Skip to main content
In the Bango Platform, entitlements describe a user’s ability to access a service provided by a merchant. In some circumstances you might want to temporarily withdraw a user’s access to that service. To do this, where supported by the merchant and service, you suspend the entitlement by making a PATCH request to the Bango Resale API with entitlementBenefits set to SUSPENDED. (To restore access later, resume the entitlement.) As part of the API request, you supply:
  • The entitlement ID
  • The entitlement benefits enum
  • Optionally, custom data
The API response is a structure that contains:
  • A response code, indicating the result of the request. Use this code to determine what to do next.
  • For HTTP 200 responses, the entitlement record. The record includes any additional custom data as part of the entitlement’s extensionData property. The record status is SUSPENDED, and the dateSuspended property marks the date and time of the suspension request.
  • For HTTP 202 responses, the entitlement record. The record includes any additional custom data as part of the entitlement’s extensionData property. The record status is ACTIVE. HTTP 202 responses indicates that the merchant has accepted your request and has queued it for processing within their system. You should expect to receive a notification from Bango when the merchant has completed the processing of the queued request.

Sequence diagrams

The Bango Platform suspends the service for the user.
Image
The Bango Platform can’t suspend the service for the user, and returns the reason in the response to the API request.
Image

Skeleton code

Here’s some sample code in a C/Java-like language: adapt this code to your needs. Use the same API endpoint prefix with test credentials and with production credentials. Some functions referenced in the skeleton code are not defined. You need to implement these where possible.

FAQ

You must set the entitlementId. Include any other parameters you want to update: any parameter not included in the request is not changed.In the request body, you should set the entitlementBenefits parameter. You can also include any other parameters, with any names and values you like.See Bango Resale / For resellers / Reseller API reference / Reseller API reference overview for detailed information on all request parameters.
All responses contain a responseCode string that indicates the result of the request. Use this code to determine how to react.On success, responseCode is OK and other properties describe the entitlement. In particular, the status property is SUSPENDED and the dateSuspended property contains a timestamp marking the time of the suspension request. Here’s an example response:
On accepted, responseCode is ACCEPTED and other properties describe the entitlement. In particular, the status property is ACTIVE. Here’s an example response:
See Bango Resale / For resellers / Reseller API reference / Reseller API reference overview for detailed information on all responses.