{"openapi":"3.1.0","info":{"title":"Cancel consumer offer","version":"1.0.0"},"paths":{"/consumer-offers/{consumer_offer_id}/cancelation":{"post":{"tags":["Consumer Offers"],"summary":"Cancel Consumer Offer","description":"Cancel a consumer offer and all underlying entitlements.","operationId":"Cancel_consumer_offer_consumer_offers__consumer_offer_id__cancelation_post","parameters":[{"name":"consumer_offer_id","in":"path","required":true,"schema":{"type":"string","title":"Consumer Offer Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConsumerOfferCancelation"},"examples":{"End of term cancelation":{"value":{"cancelationType":"END_OF_TERM","reasonCode":"SUBSCRIPTION_CANCELED","reasonDescription":"Customer has cancelled the subscription"}},"Immediate cancelation":{"value":{"cancelationType":"IMMEDIATE","reasonCode":"ACCOUNT_TERMINATED","reasonDescription":"Customer has closed their account with the reseller"}}}}}},"responses":{"202":{"description":"Accepted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConsumerOfferSummaryForCancel"},"example":{"consumerOfferId":"338d31e1-a289-40dd-beff-ab41c1fc5f51","offerId":"7560fca0-d8a9-4124-a172-924debec874e","consumer":{"consumerIdentifier":"RFBNZ2MU3Y35OA5GNNNGETK6JTEVRYVB"},"status":"FULLY_ACTIVE","subStatus":"PENDING_CANCELS","timeline":{"plannedCancelationTs":"2025-12-21T00:00:00Z"}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestResponse"}}}},"401":{"description":"Invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedResponse"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundResponse"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConflictResponse"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalErrorResponse"}}}}}}}},"components":{"schemas":{"ActionSchedule":{"type":"string","enum":["END_OF_TERM","IMMEDIATE"],"title":"ActionSchedule","description":"Scheduling type for an action."},"BadRequestResponse":{"properties":{"responseCode":{"type":"string","const":"BAD_REQUEST","title":"Response Code","description":"Error code"},"responseMessage":{"type":"string","title":"Response Message","description":"Description of the error","examples":["Invalid request"]},"metadata":{"$ref":"#/components/schemas/ErrorMetadata","title":"Metadata","description":"Error metadata"}},"type":"object","required":["responseCode"],"title":"BadRequestResponse","description":"Bad request."},"CancelationReasonCode":{"type":"string","enum":["NOT_RENEWED","CHANGED_SERVICE","SUBSCRIPTION_CANCELED","ADDON_CANCELED","EXPIRED","ACCOUNT_TERMINATED","SUSPEND_TERMINATED","ERROR","FRAUD","IMMEDIATE_CANCELATION","CUSTOMER_CANCELED","OTHER"],"title":"CancelationReasonCode","description":"Reason code for the cancelation."},"ConflictResponse":{"properties":{"responseCode":{"type":"string","const":"CONFLICT","title":"Response Code","description":"Error code"},"responseMessage":{"type":"string","title":"Response Message","description":"Description of the error","examples":["Conflict"]},"metadata":{"$ref":"#/components/schemas/ErrorMetadata","title":"Metadata","description":"Error metadata"}},"type":"object","required":["responseCode"],"title":"ConflictResponse","description":"Conflict."},"ConsumerOfferCancelation":{"properties":{"cancelationType":{"$ref":"#/components/schemas/ActionSchedule","title":"Cancelation Type","description":"Cancelation type\n\n* `END_OF_TERM`: consumer retains access to the service until the end of the current term\n* `IMMEDIATE`: consumer immediately loses access to the service\n","default":"IMMEDIATE","examples":["IMMEDIATE"]},"reasonCode":{"$ref":"#/components/schemas/CancelationReasonCode","title":"Cancelation Reason","description":"Cancelation reason\n\n* `NOT_RENEWED`: Customer has not renewed their entitlement\n* `CHANGED_SERVICE`: Customer has changed content provider/service\n* `SUBSCRIPTION_CANCELED`: Customer has canceled the subscription\n* `ADDON_CANCELED`: Customer has canceled the add-on\n* `EXPIRED`: Scheduled cancelation by Bango (based on dateExpiry set during entitlement creation by the reseller)\n* `OTHER`: Canceled for any other reason\n* `ACCOUNT_TERMINATED`: Consumer has closed their account with the reseller\n* `SUSPEND_TERMINATED`: Suspended entitlement has been canceled based on suspension terms\n* `ERROR`: Consumer offer/subscription created by mistake\n* `FRAUD`: Fraud detected or suspected\n* `IMMEDIATE_CANCELATION`: Cancelation for fraud or suspected fraud reasons\n","examples":["SUBSCRIPTION_CANCELED"]},"reasonDescription":{"type":"string","title":"Cancelation Reason Description","description":"Human readable description of the reason for canceling","examples":["Requested by consumer"]}},"type":"object","title":"ConsumerOfferCancelation","description":"Consumer offer cancelation action."},"ConsumerOfferCancelationTimeline":{"properties":{"plannedCancelationTs":{"type":"string","format":"date-time","title":"Planned Cancelation Timestamp","description":"Scheduled date and time for cancel","examples":["2025-12-21T00:00:00Z"]}},"type":"object","required":["plannedCancelationTs"],"title":"ConsumerOfferCancelationTimeline","description":"Consumer Offer timeline."},"ConsumerOfferSummaryForCancel":{"properties":{"consumerOfferId":{"type":"string","title":"Consumer Offer ID","description":"A globally unique and immutable identifier of the Consumer Offer","examples":["338d31e1-a289-40dd-beff-ab41c1fc5f51"]},"offerId":{"type":"string","title":"Offer ID","description":"A globally unique and immutable identifier of the offer the consumer has subcribed to.","examples":["7560fca0-d8a9-4124-a172-924debec874e"]},"consumer":{"anyOf":[{"$ref":"#/components/schemas/ConsumerWithBillingIdentifier"},{"$ref":"#/components/schemas/ConsumerWithPhoneNumber"}],"title":"Consumer","description":"Consumer data."},"status":{"type":"string","title":"Consumer Offer status","description":"Status of the consumer offer\n\n* FAILED: creation of the consumer offer failed\n* CREATED: consumer offer is created\n* ENDING: consumer offer is not going to be renewed at end of term\n* ENDED: consumer offer has ended\n","examples":["CREATED"]},"subStatus":{"type":"string","title":"Consumer Offer sub-status","description":"Status of the consumer offer\n\n* FAILED: creation of the consumer offer failed\n* CREATED: consumer offer is created\n* ENDING: consumer offer is not going to be renewed at end of term\n* ENDED: consumer offer has ended\n","examples":["CREATED"]},"timeline":{"$ref":"#/components/schemas/ConsumerOfferCancelationTimeline","title":"Consumer Offer Timeline","description":"Timeline of events related to the consumer offer."}},"type":"object","required":["consumerOfferId","offerId","consumer","status","subStatus","timeline"],"title":"ConsumerOfferSummaryForCancel","description":"Consumer offer summary (cancelation response)."},"ConsumerWithBillingIdentifier":{"properties":{"consumerIdentifier":{"type":"string","title":"Consumer Identifier","description":"Consumer identifier","examples":["6X3D5MHHVSRGKDRLCHIC3Q2W2AQE55BK"]},"billingIdentifier":{"type":"string","title":"Billing Identifier","description":"Billing identifier","examples":["RDZN22AAVYAHVDN3N2OB2A7ADA3FVQWG"]}},"type":"object","required":["consumerIdentifier"],"title":"ConsumerWithBillingIdentifier","description":"Consumer with billing identifier."},"ConsumerWithPhoneNumber":{"properties":{"consumerIdentifier":{"type":"string","title":"Consumer Identifier","description":"Consumer identifier","examples":["6X3D5MHHVSRGKDRLCHIC3Q2W2AQE55BK"]},"phoneNumber":{"type":"string","title":"Phone Number","description":"Phone number","examples":["+1234567890"]}},"type":"object","required":["consumerIdentifier"],"title":"ConsumerWithPhoneNumber","description":"Consumer with phone number."},"ErrorMetadata":{"properties":{"originator":{"$ref":"#/components/schemas/ErrorOriginator","title":"Originator","description":"The originator of the error (either Bango or the content provider)","examples":["BANGO"]}},"type":"object","title":"ErrorMetadata","description":"Error metadata."},"ErrorOriginator":{"type":"string","enum":["BANGO","CONTENT_PROVIDER"],"title":"ErrorOriginator","description":"Originator of the error."},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"InternalErrorResponse":{"properties":{"responseCode":{"type":"string","const":"INTERNAL_ERROR","title":"Response Code","description":"Error code"},"responseMessage":{"type":"string","title":"Response Message","description":"Description of the error","examples":["Internal error"]},"metadata":{"$ref":"#/components/schemas/ErrorMetadata","title":"Metadata","description":"Error metadata"}},"type":"object","required":["responseCode"],"title":"InternalErrorResponse","description":"Internal Server Error."},"NotFoundResponse":{"properties":{"responseCode":{"type":"string","const":"NOT_FOUND","title":"Response Code","description":"Error code"},"responseMessage":{"type":"string","title":"Response Message","description":"Description of the error","examples":["Not found"]},"metadata":{"$ref":"#/components/schemas/ErrorMetadata","title":"Metadata","description":"Error metadata"}},"type":"object","required":["responseCode"],"title":"NotFoundResponse","description":"Not Found."},"UnauthorizedResponse":{"properties":{"responseCode":{"type":"string","const":"UNAUTHORIZED","title":"Response Code","description":"Error code"},"responseMessage":{"type":"string","title":"Response Message","description":"Description of the error","examples":["Invalid credentials"]},"metadata":{"$ref":"#/components/schemas/ErrorMetadata","title":"Metadata","description":"Error metadata"}},"type":"object","required":["responseCode"],"title":"UnauthorizedResponse","description":"Unauthorized."},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}