Bango uses cookies to give you the best website experience. By using this website you agree to let Bango use cookies. More info
OK
Bango Developer
  1. Bango Resale
  2. End of Life
  3. Entitlement reactivation API

Entitlement reactivation API

(EOL 1st June 2019) - Details of the API for reactivating service access where possible

This page describes the method used to reactivate an entitlement using the Bango Resale API. Some merchants may not support entitlement reactivation.

Every API request must comply with the requirements in Bango Platform / Connectivity and security. All request body parameters and responses are encoded as UTF-8 JSON objects.

Reactivate an entitlement

POST https://resale.api.bango.net/v1/entitlement/reactivate/{entitlementId}
Path parameters
entitlementId string

The ID of the entitlement you want to reactivate. You can only reactivate entitlements you created.

Header parameters
Authorization string

Your Bango Resale API credentials encoded for HTTP Basic Authentication. See Bango Platform / Connectivity and security / Basic authentication.

X-RequestIdentifier string

A unique identifier for the request. If present, this ID is used for Bango Platform idempotency.

Query parametersNone
Body parametersNone
Sample requests
Reactivate an entitlement
POST https://resale.api.bango.net/v1/entitlement/reactivate/a25100b8-4e0c-4e37-b921-cac9cb1e930f HTTP/1.1

Reactivate an entitlement. There's no request body.

Response body
responseCode string

Result of the request. Possible values: OK, CLIENT_ACTION_REQUIRED, BAD_REQUEST, UNAUTHORIZED, NOT_AVAILABLE, NOT_FOUND, ALREADY_EXISTS, TOO_MANY_REQUESTS, INTERNAL_ERROR, SERVICE_UNAVAILABLE. See sample responses for more information.

responseMessage string

A short human-readable message describing responseCode. Not for use by code.

parameters object2xx

For HTTP status 202, contains the property action describing what your code must do, and other parameters that depend on the action. See sample responses.

entitlementId string2xx

The unique, persistent ID of the entitlement.

status string2xx

The current status of the entitlement: in this case, ACTIVE or PENDING. See sample responses.

dateCreated ISO 8601 string2xx

ISO 8601 timestamp for the entitlement creation time.

dateActivated ISO 8601 string or null2xx

ISO 8601 timestamp for the entitlement's last activation time. null if the entitlement has never been active.

dateEnded ISO 8601 string or null2xx

ISO 8601 timestamp for when the entitlement was last canceled or revoked. null if never.

dateSuspended ISO 8601 string or null2xx

ISO 8601 timestamp of the last request to suspend the entitlement. null otherwise.

dateResumed ISO 8601 string or null2xx

ISO 8601 timestamp of the last request to resume the entitlement. null otherwise.

dateLastUpdated ISO 8601 string2xx

ISO 8601 timestamp for the last time the entitlement was modified.

customerIdentifier string2xx

Your unique user identifier for the customer accessing the service.

merchantAccountKey string2xx

The identifier for the merchant supplying the service.

productKey string2xx

The identifier for the merchant service.

offerKey string2xx

Any offer identifier recorded for the entitlement.

activationCode string2xx

The merchant's activation code, if applicable.

entitlementDisplayName string2xx

The user-visible string describing the entitlement.

dateExpiry ISO 8601 string or null2xx

ISO 8601 timestamp of the moment the user's entitlement to the service ends.

extensionData string2xx

The collection of arbitrary string keys and values you've associated with the entitlement.

Sample responses
200OKEntitlement reactivated successfully
{
    "responseCode": "OK",
    "responseMessage": "Success",
    "parameters": {},
    "entitlementId": "a25100b8-4e0c-4e37-b921-cac9cb1e930f",
    "status": "ACTIVE",
    "dateCreated": "2017-08-31T14:15:03Z",
    "dateActivated": "2017-09-16T10:12:67Z",
    "dateEnded": "2017-09-15T09:44:02Z",
    "dateSuspended": null,
    "dateResumed": null,
    "dateLastUpdated": "2017-09-16T10:12:97Z",
    "customerIdentifier": "my-user-123456789",
    "merchantAccountKey": "BANGO_ENTERTAINMENT",
    "productKey": "MUSIC_30D",
    "activationCode": "",
    "entitlementDisplayName": "30 days of Bango Music",
    "offerKey": null,
    "dateExpiry": "2017-09-30T23:59:59.999Z",
    "notificationUrl": "https://example.com/entitlement/notification",
    "extensionData": {
        "price": "9.99",
        "currencyIso3": "GBP",
        "channelType": "WEB_PROMOTION",
        "channelSource": "https://bango.com/promo",
        "campaignKey": "SUMMER_PROMO",
        "referrer": "SEARCH_ENGINE",
        "cancelReasonCode": "NOT_RENEWED",
        "cancelReasonDescription": "The user has not renewed their subscription",
        "renewalDiscount": "10%"
    }
}

The Bango Platform successfully reactivated a canceled entitlement. The cancellation data remains in the extensionData object.

202CLIENT_ACTION_REQUIRED: NAVIGATE_TO_URLEntitlement reactivated successfully, now pending activation
{
    "responseCode": "CLIENT_ACTION_REQUIRED",
    "responseMessage": "An action is required in the client",
    "parameters": {
        "action": "NAVIGATE_TO_URL",
        "url": "https://example.com/?entitlementId=a25100b8-4e0c-4e37-b921-cac9cb1e930f"
    },
    "entitlementId": "a25100b8-4e0c-4e37-b921-cac9cb1e930f",
    "status": "PENDING",
    "dateCreated": "2017-08-31T14:15:03Z",
    "dateActivated": "2017-09-16T10:12:67Z",
    "dateEnded": "2017-09-15T09:44:02Z",
    "dateSuspended": null,
    "dateResumed": null,
    "dateLastUpdated": "2017-09-16T10:12:97Z",
    "customerIdentifier": "my-user-123456789",
    "merchantAccountKey": "BANGO_ENTERTAINMENT",
    "productKey": "MUSIC_60D",
    "activationCode": "",
    "entitlementDisplayName": "60 days of Bango Music",
    "offerKey": null,
    "dateExpiry": "2017-09-30T23:59:59.999Z",
    "extensionData": {
        "price": "9.99",
        "currencyIso3": "GBP",
        "channelType": "WEB_PROMOTION",
        "channelSource": "https://bango.com/promo",
        "campaignKey": "SUMMER_PROMO",
        "referrer": "SEARCH_ENGINE"
    }
}

The merchant requires the user to complete a process before reactivation, so the Bango Platform returned response code CLIENT_ACTION_REQUIRED with parameters.action value NAVIGATE_TO_URL, and set the entitlement status to PENDING. Your code should ensure the user visits parameters.url, perhaps by programmatically opening that URL on their device.

Entitlements with status PENDING may change status to REVOKED if the user does not complete the merchant process quickly enough. When the user completes the process, the status may change to ACTIVE. The Bango Platform POSTs these status changes to the entitlement's notificationUrl.

400BAD_REQUESTInvalid API request
{
    "responseCode": "BAD_REQUEST",
    "responseMessage": "Invalid request."
}

The Bango Platform was unable to process the request. This indicates an implementation problem in your code.

401UNAUTHORIZEDIP address or access credentials are invalid
{
    "responseCode": "UNAUTHORIZED",
    "responseMessage": "Invalid access credentials."
}

The Bango Platform didn't process the request as the supplied credentials were invalid, or the request was not from an authorized IP address. This indicates an implementation problem in your code or a configuration issue. See Bango Platform / Connectivity and security / Basic authentication and Bango Platform / Connectivity and security / IP whitelisting.

403NOT_AVAILABLEUnable to reactivate entitlement for the service
{
    "responseCode": "NOT_AVAILABLE",
    "responseMessage": "No active entitlement routes found."
}

The Bango Platform didn't reactivate the entitlement as the service described in the request is either not enabled for you to use, or has been temporarily disabled due to service issues. Contact Bango Support for more information.

404NOT_FOUNDEntitlement not found
{
    "responseCode": "NOT_FOUND",
    "responseMessage": "Entitlement not found."
}

The Bango Platform didn't find an entitlement record with the specified ID.

404ALREADY_EXISTSEntitlement already active
{
    "responseCode": "ALREADY_EXISTS",
    "responseMessage": "Entitlement is already active."
}

The Bango Platform didn't reactivate the entitlement as it's already active.

429TOO_MANY_REQUESTSRequest limit reached
{
    "responseCode": "TOO_MANY_REQUESTS",
    "responseMessage": "Request limit reached. Please try again later"
}

The Bango Platform didn't process the request as you've sent too many requests recently. Try again later.

500INTERNAL_ERRORUnexpected server issue
{
    "responseCode": "INTERNAL_ERROR",
    "responseMessage": "The server encountered an unexpected condition."
}

The Bango Platform couldn't respond to the request. Try again later.

503SERVICE_UNAVAILABLEBango Platform undergoing maintenance
{
    "responseCode": "SERVICE_UNAVAILABLE",
    "responseMessage": "The server is undergoing maintenance."
}

The Bango Platform is undergoing maintenance and is not currently available. Try again later.

Copyright © 2000–2023 Bango.net Limited