openapi: 3.2.0 info: title: Consumer connectivity Purchases API description: '#### Copyright © Aeris Communications, Inc.' version: 2.0.1 x-api-id: 7d04b81f-0545-4c01-9d81-244fda13b6c8 x-audience: external-public servers: - url: https://iot-api.aeris.com/iot/api/consumer-connectivity description: API server security: - Oauth2_auth: [] tags: - name: Purchases paths: /purchases/{company-id}/{subscription-id-type}/{subscription-id}/{purchase-id}: get: tags: - Purchases summary: Get a purchase of a subscription description: Returns a purchase of a subscription. operationId: getPurchase parameters: - name: company-id in: path description: Company ID of the subscription. required: true schema: type: string - name: subscription-id-type in: path description: Subscription ID type required: true schema: $ref: '#/components/schemas/SubscriptionIdTypeEnum' - name: subscription-id in: path description: Subscription ID required: true schema: type: string - name: purchase-id in: path description: Purchase ID required: true schema: type: string format: uuid responses: 200: description: Purchase allOf: - $ref: '#/components/responses/RateLimitedResponse' content: application/vnd.dcp-v1+json: schema: $ref: '#/components/schemas/PurchaseModel' 401: $ref: '#/components/responses/Unauthorized' 404: description: Company, subscription or purchase not found content: application/vnd.dcp-v1+json: schema: $ref: '#/components/schemas/ErrorResponse' 429: $ref: '#/components/responses/Response_429' 500: $ref: '#/components/responses/InternalError' security: - Oauth2_auth: - cc.read /purchases/{company-id}/{subscription-id-type}/{subscription-id}/free: post: tags: - Purchases summary: Purchase a free product description: Purchases a free product. operationId: purchaseFree parameters: - name: company-id in: path description: Company ID of the subscription. required: true schema: type: string - name: subscription-id-type in: path description: Subscription ID type required: true schema: $ref: '#/components/schemas/SubscriptionIdTypeEnum' - name: subscription-id in: path description: Subscription ID required: true schema: type: string requestBody: content: application/json: schema: $ref: '#/components/schemas/FreePurchaseRequestModel' application/vnd.dcp-v1+json: schema: $ref: '#/components/schemas/FreePurchaseRequestModel' responses: 200: description: Purchase allOf: - $ref: '#/components/responses/RateLimitedResponse' content: application/vnd.dcp-v1+json: schema: $ref: '#/components/schemas/PurchaseModel' 400: description: Invalid purchase request content: application/vnd.dcp-v1+json: schema: $ref: '#/components/schemas/ErrorResponse' 401: $ref: '#/components/responses/Unauthorized' 404: description: Company, subscription or product not found content: application/vnd.dcp-v1+json: schema: $ref: '#/components/schemas/ErrorResponse' 429: $ref: '#/components/responses/Response_429' 500: $ref: '#/components/responses/InternalError' security: - Oauth2_auth: - cc.write /purchases/{company-id}/{subscription-id-type}/{subscription-id}/refund: put: tags: - Purchases summary: Refund a purchase of a subscription description: Refunds a purchase of a subscription. operationId: refundPurchase parameters: - name: company-id in: path description: Company ID of the subscription. required: true schema: type: string - name: subscription-id-type in: path description: Subscription ID type required: true schema: $ref: '#/components/schemas/SubscriptionIdTypeEnum' - name: subscription-id in: path description: Subscription ID required: true schema: type: string requestBody: content: application/json: schema: $ref: '#/components/schemas/RefundPurchaseRequestModel' application/vnd.dcp-v1+json: schema: $ref: '#/components/schemas/RefundPurchaseRequestModel' responses: 200: description: Purchase allOf: - $ref: '#/components/responses/RateLimitedResponse' content: application/vnd.dcp-v1+json: schema: $ref: '#/components/schemas/PurchaseModel' 400: description: Purchase already refunded or purchase state is not refundable content: application/vnd.dcp-v1+json: schema: $ref: '#/components/schemas/ErrorResponse' 401: $ref: '#/components/responses/Unauthorized' 404: description: Company, subscription or purchase not found content: application/vnd.dcp-v1+json: schema: $ref: '#/components/schemas/ErrorResponse' 429: $ref: '#/components/responses/Response_429' 500: $ref: '#/components/responses/InternalError' security: - Oauth2_auth: - cc.write /purchases/buckets/{company-id}/{subscription-id-type}/{subscription-id}/{purchase-id}: delete: tags: - Purchases summary: Delete a bucket of a subscription description: Deletes a bucket of a subscription by purchase ID. operationId: deleteBucket parameters: - name: company-id in: path description: Company ID of the subscription. required: true schema: type: string - name: subscription-id-type in: path description: Subscription ID type required: true schema: $ref: '#/components/schemas/SubscriptionIdTypeEnum' - name: subscription-id in: path description: Subscription ID required: true schema: type: string - name: purchase-id in: path description: Purchase ID required: true schema: type: string format: uuid responses: 200: description: Bucket data allOf: - $ref: '#/components/responses/RateLimitedResponse' content: application/vnd.dcp-v1+json: schema: $ref: '#/components/schemas/BucketDataModel' 400: description: Invalid subscription content: application/vnd.dcp-v1+json: schema: $ref: '#/components/schemas/ErrorResponse' 401: $ref: '#/components/responses/Unauthorized' 404: description: Company, subscription or purchase not found content: application/vnd.dcp-v1+json: schema: $ref: '#/components/schemas/ErrorResponse' 429: $ref: '#/components/responses/Response_429' 500: $ref: '#/components/responses/InternalError' security: - Oauth2_auth: - cc.write /purchases/{company-id}/{subscription-id-type}/{subscription-id}: get: tags: - Purchases summary: List purchases of a subscription description: Lists purchases of a subscription. operationId: getPurchasesBySubscription parameters: - name: company-id in: path description: Company ID of the subscription. required: true schema: type: string - name: subscription-id-type in: path description: Subscription ID type required: true schema: $ref: '#/components/schemas/SubscriptionIdTypeEnum' - name: subscription-id in: path description: Subscription ID required: true schema: type: string - name: product_id in: query description: Product ID schema: type: string default: '' - name: initial_purchase_id in: query description: Initial purchase ID schema: type: string format: uuid - name: page in: query description: Page number or offset schema: $ref: '#/components/schemas/Page' - name: per_page in: query description: Items per page schema: $ref: '#/components/schemas/PerPage' responses: 200: description: Purchase list allOf: - $ref: '#/components/responses/RateLimitedResponse' content: application/vnd.dcp-v1+json: schema: $ref: '#/components/schemas/PurchaseList' 401: $ref: '#/components/responses/Unauthorized' 404: description: Company or subscription not found content: application/vnd.dcp-v1+json: schema: $ref: '#/components/schemas/ErrorResponse' 429: $ref: '#/components/responses/Response_429' 500: $ref: '#/components/responses/InternalError' security: - Oauth2_auth: - cc.read post: tags: - Purchases summary: Purchase a product description: Purchases a product. operationId: purchase parameters: - name: company-id in: path description: Company ID of the subscription. required: true schema: type: string - name: subscription-id-type in: path description: Subscription ID type required: true schema: $ref: '#/components/schemas/SubscriptionIdTypeEnum' - name: subscription-id in: path description: Subscription ID required: true schema: type: string requestBody: content: application/json: schema: $ref: '#/components/schemas/PurchaseRequestModel' application/vnd.dcp-v1+json: schema: $ref: '#/components/schemas/PurchaseRequestModel' responses: 200: description: Purchase allOf: - $ref: '#/components/responses/RateLimitedResponse' content: application/vnd.dcp-v1+json: schema: $ref: '#/components/schemas/PurchaseModel' 400: description: Invalid purchase request content: application/vnd.dcp-v1+json: schema: $ref: '#/components/schemas/ErrorResponse' 401: $ref: '#/components/responses/Unauthorized' 404: description: Company, subscription or product not found content: application/vnd.dcp-v1+json: schema: $ref: '#/components/schemas/ErrorResponse' 429: $ref: '#/components/responses/Response_429' 500: $ref: '#/components/responses/InternalError' security: - Oauth2_auth: - cc.read components: headers: Content-Type: description: Handle Content-Type schema: type: string X-RateLimit-Remaining-Second: description: The number of requests remaining in a second. schema: type: integer format: int32 X-RateLimit-Limit-Second: description: The maximum number of requests allowed in a second. schema: type: integer format: int32 X-RateLimit-Remaining-Minute: description: The number of requests remaining in a minute. schema: type: integer format: int32 X-RateLimit-Limit-Minute: description: The maximum number of requests allowed in a minute. schema: type: integer format: int32 responses: Unauthorized: description: Unauthorized content: application/vnd.dcp-v1+json: schema: $ref: '#/components/schemas/ErrorResponse' Response_429: description: Too Many Requests allOf: - $ref: '#/components/responses/RateLimitedResponse' content: application/vnd.dcp-v1+json: schema: $ref: '#/components/schemas/ErrorResponse' RateLimitedResponse: headers: X-RateLimit-Limit-Second: $ref: '#/components/headers/X-RateLimit-Limit-Second' X-RateLimit-Limit-Minute: $ref: '#/components/headers/X-RateLimit-Limit-Minute' X-RateLimit-Remaining-Second: $ref: '#/components/headers/X-RateLimit-Remaining-Second' X-RateLimit-Remaining-Minute: $ref: '#/components/headers/X-RateLimit-Remaining-Minute' Content-Type: $ref: '#/components/headers/Content-Type' InternalError: description: Internal error content: application/vnd.dcp-v1+json: schema: $ref: '#/components/schemas/ErrorResponse' schemas: RecurrenceStateModel: type: object properties: state: type: string enum: - ACTIVE - PAUSED - FINAL_RENEW_COMPLETED - CANCELED timestamp: type: string format: date-time description: Recurrence state PurchaseList: type: object properties: page: type: integer format: int32 pages: type: integer format: int32 total: type: integer format: int64 count_limit_reached: type: boolean purchases: type: array items: $ref: '#/components/schemas/PurchaseModel' description: Purchase list BucketEventModel: type: object properties: type: $ref: '#/components/schemas/BucketEventTypeEnum' timestamp: type: string format: date-time description: Bucket event ErrorResponse: type: object properties: code: type: integer format: int32 http_status: type: integer format: int32 default: 500 message: type: string description: Error response PriceModel: type: object properties: price: type: number format: double currency_code: type: string vat: type: number format: float validity_period: $ref: '#/components/schemas/TimePeriodModel' description: Price BucketDataModel: type: object properties: company_id: type: string imsi: type: string msisdn: type: string product_id: type: string purchase_id: type: string format: uuid instance_id: type: string bucket_type: type: string instance_type: type: string volume: type: integer format: int64 balance: type: integer format: int64 end_date: type: string format: date-time created: type: string format: date-time description: Bucket data DeletedBucketModel: type: object properties: balance: type: integer format: int64 timestamp: type: string format: date-time description: Deleted bucket RefundPurchaseRequestModel: type: object properties: purchase_id: type: string format: uuid description: Refund purchase request PurchaseStateEnum: type: string description: Purchase state enum: - CREATED - CHARGED - COMPLETED - RENEW_COMPLETED - REFUNDED - CHARGE_FAILED - REFUND_FAILED BucketEventTypeEnum: type: string description: Bucket event type enum: - LOW_BUCKET_VOLUME - EMPTY_BUCKET_VOLUME - BUCKET_EXPIRED - BUCKET_RENEW_COMPLETED ProductDescriptionModel: type: object properties: language: type: string name: type: string description: type: string description: Product description PerPage: type: integer format: int32 default: 20 description: Items per page PurchaseModel: type: object properties: company_id: type: string imsi: type: string msisdn: type: string purchase_id: type: string format: uuid created: type: string format: date-time updated: type: string format: date-time initial_purchase_id: type: string format: uuid product_id: type: string product_description: $ref: '#/components/schemas/ProductDescriptionModel' instance_id: type: string bucket_type: type: string instance_type: type: string volume: type: integer format: int64 bucket_end_date: type: string format: date-time recurrence_interval: $ref: '#/components/schemas/TimePeriodModel' recurrence_end_date: type: string format: date-time recurrence_state: $ref: '#/components/schemas/RecurrenceStateModel' renew_completed_count: type: integer format: int32 free_purchases: type: integer format: int32 state: $ref: '#/components/schemas/PurchaseStateEnum' type: $ref: '#/components/schemas/PurchaseTypeEnum' price: $ref: '#/components/schemas/PriceModel' deleted_bucket: $ref: '#/components/schemas/DeletedBucketModel' bucket_events: type: array items: $ref: '#/components/schemas/BucketEventModel' error: $ref: '#/components/schemas/ErrorResponse' description: Purchase Page: type: integer format: int32 description: Page number or offset PurchaseRequestModel: type: object properties: product_id: type: string description: Purchase request PurchaseTypeEnum: type: string description: Purchase type enum: - ONETIME - INITIAL_RECURRING - RENEW_RECURRING SubscriptionIdTypeEnum: type: string description: Subscription ID type enum: - IMSI - MSISDN TimePeriodModel: type: object properties: unit: type: string enum: - NONE - DAYS - WEEKS - MONTHS - YEARS value: type: integer format: int64 description: Time period FreePurchaseRequestModel: type: object properties: product_id: type: string free_purchases: type: integer format: int32 description: Free purchase request securitySchemes: Oauth2_auth: flows: password: tokenUrl: https://iot-api.aeris.com/iot/api/auth/token scopes: cc.read: Access right needed to read from Consumer Connectivity service. cc.write: Access right needed to write to Consumer Connectivity service. type: oauth2