Skip to content

Get

/cancellation_reasons

Target audience: Developers

Get cancellation reasons

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

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_reasons?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
    }
}

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
        },
        {
            "index": 0,
            "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

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