Skip to content

Distribution information

/subscription_system/distribution_information

Target audience: Developers

1
Release version: 4.3.5

Get distribution information

Introduction

If the subscription system integration supports it this endpoint will facilitate a way to lookup distribution information for a specific paper product, such as distribution days and distribution costs, based on package, subscription period length and zip code of the intended customer.

Info

This method is currently only supported by the Infosoft integration.

URI

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

Requirements

Identity Scope
No /external/subscription_system/r

Parameters

Field Required Type Description
product_code Yes String The package or campaign code of the Payway package.
Size range: ..50
Allowed values: "/^[a-zA-Z-_0-9]+$/"
period_id Yes String The ID of the payment period of the package.
Size range: ..24
Allowed values: "/^[a-f\d]{24}$/i"
zip_code Yes String The zip code of the intended address.
Size range: ..100

Curl Example

1
2
3
curl --request GET \
  --url 'https://payway-api.stage.adeprimo.se/external/api/v1/subscription_system/distribution_information?product_code=my_product_code&period_id=5e45513977cfebc34d66ed55&zip_code=12345' \
  --header 'Authorization: Bearer <Access Token>'

Response

Field Description
distribution_days Week days that the paper product is being distributed according to the subscription system. 1 = monday, 7 = sunday.
distribution_price Extra fee for distribution excluding VAT.
distribution_price_with_tax Extra fee for distribution including VAT.

Example Response

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
HTTP 200
{
  "item": {
    "distribution_days": [
      1,
      2,
      3,
      4,
      5,
      6,
      7
    ],
    "distribution_price": "47.17",
    "distribution_price_with_tax": "50.0002"
  }
}

Errors

Example error response

1
2
3
4
5
6
HTTP 400 Bad Request
{
    "code": "invalid_parameter",
    "field": "product_code",
    "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 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 product or period could not be found.

HTTP 500 Internal Server Error

Name Type Description
internal_server_error Object Something unexpected happened server side