Skip to content

Get

/cancellation_reasons

Target audience: Developers

Introduction

This endpoint returns one or several cancellation reasons.

URI

Environment URI
Stage https://payway-api.stage.adeprimo.se/external/api/v1/cancellation_reasons
Production https://backend.worldoftulo.com/external/api/v1/cancellation_reasons

Required scope

1
/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

1
2
3
4
curl --request GET \
  --url https://payway-api.stage.adeprimo.se/external/api/v1/cancellation_reasons?id=5c18ea52a25b4d988d252f40 \
  --header 'accept: application/json' \
  --header 'authorization: Bearer token' \

Response

One cancellation reason response

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
HTTP 200
{
    "item": {
        "id": "5c18ea52a25b4d988d252f40",
        "name": "Cancellation_Reason_1",
        "code": "Code_1",
        "integration_code": "Integration_Code_1",
        "visible_to_end_customer": true,
        "internal": false
    }
}

Multiple cancellation reasons response

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
HTTP 200
{
    "items": [
        {
            "id": "5c18ea52a25b4d988d252f40",
            "name": "Cancellation_Reason_1",
            "code": "Code_1",
            "integration_code": "Integration_Code_1",
            "visible_to_end_customer": false,
            "internal": true
        },
        {
            "id": "5c18ea52a25b4d988d252f40",
            "name": "Cancellation_Reason_2",
            "code": "Code_2",
            "integration_code": "Integration_Code_2",
            "visible_to_end_customer": true,
            "internal": false
        }
    ]
}

Errors

Example error response

1
2
3
4
5
6
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