Skip to content

Subscription number

/subscription_system/subscription_number

Target audience: Developers

Update subscription number

Introduction

Updates the subscription number for the supplied user product. This endpoint should only be used by a subscription system integration. The subscription number should be set on a user product after processing the new_subscription event sent by Payway.

URI

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

Requirements

Identity Scope
No /external/subscription_system/w

Parameters

Field Required Type Description
account_id Required String The id of the account owning the user product.
Size range: ..24
Allowed values: "/^[a-f\d]{24}$/i"
user_product_id Required String The id of the user product to update.
Size range: ..24
Allowed values: "/^[a-f\d]{24}$/i"
subscription_number Required String The subscription number to set on the user product.
Size range: ..50
Allowed values: "/^[a-zA-Z-_0-9]+$/"

Curl Example

curl --request PUT \
  --url https://payway-api.stage.adeprimo.se/external/api/v1/subscription_system/subscription_number \
  --header 'accept: application/json' \
  --header 'authorization: Bearer token' \
  --header 'content-type: application/json' \
  --data '{
            "account_id": "56e1741a6fc9365306000002",
            "user_product_id": "56e1741a6fc9365306000034",
            "subscription_number": "1234567890"
          }'

Response

Field Description
id The id of the user product updated.

Example Response

HTTP 200 Updated
{
    "id": "50f3ac249f6aef294d000007"
}

Errors

Example error response

HTTP 400 Bad Request
{
    "code": "invalid_parameter",
    "field": "account_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 in the posted json
json_parser_error Object The request body could not be parsed as valid json
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 posted json was not recognized

HTTP 404 Not Found

Name Type Description
not_found Object The account or product could not be found

HTTP 500 Internal Server Error

Name Type Description
internal_server_error Object Something unexpected happened server side