Get
/cancellation_reason
Target audience: Developers
Get cancellation reason¶
Introduction¶
This endpoint returns one or several cancellation reasons.
The print_subscriptions_only field indicates whether a cancellation reason should only be
used for print subscriptions. This version returns every cancellation reason regardless of that
flag. To filter reasons for a specific subscription, use v2, which
accepts a subscription_id and hides print_subscriptions_only reasons for non-print subscriptions.
URI¶
| Environment | URI |
|---|---|
| Stage | https://payway-api.stage.adeprimo.se/external/api/v1/cancellation_reason |
| Production | https://backend.worldoftulo.com/external/api/v1/cancellation_reason |
Requirements¶
| Identity | Scope |
|---|---|
| No | /external/cancellation_reason/r |
Parameters¶
| Name | Type | Description |
|---|---|---|
| id | String | The id of the cancellation reason to get.. Size range: ..24 Allowed values: "/^[a-f\d]{24}$/i" |
| include_internal | Boolean | If true, internal cancellation reasons will be included |
| visible_to_end_customer | 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/v1/cancellation_reason?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¶
Example error response¶
HTTP 400 Bad Request
{
"code": "invalid_parameter",
"field": "id",
"message": "Parameter must match format (/^[a-f\d]{24}$/)"
}
HTTP 400 Bad Request¶
| Name | Type | Description |
|---|---|---|
| invalid_parameter | Object | Validation error on any of the fields |
| unknown_parameter | Object | One or more of the input fields was not recognized |
HTTP 404 Not Found¶
| Name | Type | Description |
|---|---|---|
| not_found | Object | The cancellation reason could not be found |
HTTP 500 Internal Server Error¶
| Name | Type | Description |
|---|---|---|
| internal_server_error | Object | Something unexpected happened server side |