Get
/cancellation_reason
Target audience: Developers
Get cancellation reason¶
Introduction¶
This endpoint returns one or several cancellation reasons for a given subscription.
Compared to v1, this version requires a subscription_id and uses it to
filter the returned reasons based on the print_subscriptions_only flag:
- If the subscription is a print subscription, all cancellation reasons are returned.
- If the subscription is not a print subscription, cancellation reasons flagged as
print_subscriptions_onlyare excluded.
The print_subscriptions_only field is still returned on each cancellation reason so integrators can
see which reasons are print-specific.
URI¶
| Environment | URI |
|---|---|
| Stage | https://payway-api.stage.adeprimo.se/external/api/v2/cancellation_reason |
| Production | https://backend.worldoftulo.com/external/api/v2/cancellation_reason |
Requirements¶
| Identity | Scope |
|---|---|
| No | /external/cancellation_reason/r |
Parameters¶
| Name | Required | Type | Description |
|---|---|---|---|
| subscription_id | Yes | String | The id of the subscription the reasons are requested for. Determines whether print_subscriptions_only reasons are included. Size range: ..24 Allowed values: "/^[a-f\d]{24}$/i" |
| id | No | String | The id of the cancellation reason to get. Size range: ..24 Allowed values: "/^[a-f\d]{24}$/i" |
| include_internal | No | Boolean | If true, internal cancellation reasons will be included |
| visible_to_end_customer | No | Boolean | If true, cancellation reasons visible to the end customer will be included |
Curl Example¶
curl --request GET \
--url https://payway-api.stage.adeprimo.se/external/api/v2/cancellation_reason?subscription_id=5c18ea52a25b4d988d252f40 \
--header 'accept: application/json' \
--header 'authorization: Bearer token' \
Response¶
One cancellation reason response¶
HTTP 200
{
"item": {
"index": 0,
"id": "5c18ea52a25b4d988d252f40",
"name": "Cancellation_Reason_1",
"code": "Code_1",
"integration_code": "Integration_Code_1",
"visible_to_end_customer": true,
"internal": false,
"print_subscriptions_only": false
}
}
Multiple cancellation reasons response¶
HTTP 200
{
"items": [
{
"index": 0,
"id": "5c18ea52a25b4d988d252f40",
"name": "Cancellation_Reason_1",
"code": "Code_1",
"integration_code": "Integration_Code_1",
"visible_to_end_customer": false,
"internal": true,
"print_subscriptions_only": false
},
{
"index": 0,
"id": "5c18ea52a25b4d988d252f40",
"name": "Cancellation_Reason_2",
"code": "Code_2",
"integration_code": "Integration_Code_2",
"visible_to_end_customer": true,
"internal": false,
"print_subscriptions_only": true
}
]
}
Errors¶
This API uses the common error conventions of the Payway API