Skip to content

Validate order

/subscription_system/validate_order

Target audience: Developers

Validate order

Introduction

Validates if a customer is allowed to make a purchase with the external subscription system. Validation can be made with customer number or customer information (E.g. first name, last name, address).

URI

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

Requirements

Identity Scope
No /external/subscription_system/r

Parameters

Field Required Type Description
customer_number No String The customer number to set on the account.
Size range: ..50
Allowed values: "/^[a-zA-Z-_0-9]+$/"
product_code No String The Payway product code of the package/campaign to validate against.
Size range: ..50
Allowed values: "/^[a-zA-Z-_0-9]+$/"
social_security_number No String Social security number of the customer.
Size range: ..100
Allowed values: "/^[0-9]{6}-[0-9]{4}$/"
first_name No String The customers first name.
Size range: ..100
last_name No String The customers last name.
Size range: ..100
contact_email No String The customers email.
Size range: ..100
street No String The customers street name.
Size range: ..100
street_number No String The customers street number.
Size range: ..100
staircase No String The customers staircase.
Size range: ..100
apartment_number No String The customers apartment number.
Size range: ..100
zip_code No String The customers zip code.
Size range: ..100
city No String The customers city.
Size range: ..100

Curl Example

curl --request GET \
  --url https://payway-api.stage.adeprimo.se/external/api/v1/subscription_system/validate_order?customer_number=1234567890 \
  --header 'accept: application/json' \
  --header 'authorization: Bearer token' \
  --header 'content-type: application/json'

Response

Field Description
customer_number The customer number.
purchase_allowed If purchase is allowed (true/false).

Example Response

HTTP 200
{
    "item": {
        "customer_number": "1234567890",
        "purchase_allowed": true
    }
}

Errors

Example error response

HTTP 400 Bad Request
{
    "code": "invalid_parameter",
    "field": "customer_number",
    "message": "Parameter must match format (/^[a-zA-Z\-_0-9]+$/)"
}

HTTP 400 Bad Request

Name Type Description
invalid_parameter Object Validation error on any of the fields in the querystring
invalid_content_type_error Object The requests Content-Type header isn't set to application/json
unknown_parameter Object One or more of the fields in the querystring was not recognized

HTTP 500 Internal Server Error

Name Type Description
internal_server_error Object Something unexpected happened server side