Skip to content

Order validation

/order_validation

Validate order

Target audience: Developers

Release version: 4.4.0

Introduction

This endpoint returns a true/false value whether the user can purchase a package, and if not, a reason and code explaining why.

URI

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

Requirements

Identity Scope
No /external/order_validation/r

Parameters

Name Description
account_id The id of the account that should be checked
package_code The code of the package that the user should be checked against

Curl Example

Check user eligibility

curl --request GET \
  --url https://payway-api.stage.adeprimo.se/external/api/v2/order_validation?account_id=abc123&product_code=adeprimo_test_package \
  --header 'accept: application/json' \
  --header 'authorization: Bearer token' \

Response

Example response if user can purchase package

HTTP 200
{
  "item": {
    "purchase_allowed": true,
    "reason": null,
    "message": null,
    "fallback_package_code": null
  }
}

Example response if user cannot purchase package

HTTP 200
{
  "item": {
      "purchase_allowed": false,
      "reason": "too_young",
      "message": "User is too young to purchase this package",
      "fallback_package_code": null
  }
}

Errors

This API uses the common error conventions of the Payway API

See common error responses