/payment_periods

/products/payment_periods

Target audience: Developers

1
Release version: 4.1.7

Introduction

This endpoint returns the payment periods for the provided package/campaign.
Read more on package payment periods and campaign payment periods.

URI

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

Requirements

Identity Scope
No /external/product/r

Parameters

Name Description Required
product_id The id of the package/campaign. If not set then product_code must be set
product_code The product code of the package/campaign If not set then product_id must be set

Curl Example

Get by product_id

1
2
3
4
curl --request GET \
  --url https://payway-api.stage.adeprimo.se/external/api/v1/products/payment_periods?id=52a781d6400e06897c00000f \
  --header 'accept: application/json' \
  --header 'authorization: Bearer token' \

Get by product_code

1
2
3
4
curl --request GET \
  --url https://payway-api.stage.adeprimo.se/external/api/v1/products/payment_periods?product_code=adeprimo_digital \
  --header 'accept: application/json' \
  --header 'authorization: Bearer token' \

Response

Successful response

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
HTTP 200
{
  "items": [
      {
        "id": "5e4bbd0e09c04c1f6498c57f",
        "payment_method": "adyen",
        "type": "recurring",
        "enabled": true,
        "iteration_type": "month",
        "iteration_length": 1,
        "price": 210,
        "details": {
          "name": "Credit Card",
          "type": "scheme"
        }
      },
      {
        "id": "5e4bbd0e09c04c1f6498c57f",
        "payment_method": "creditcard",
        "type": "recurring",
        "enabled": true,
        "iteration_type": "month",
        "iteration_length": 1,
        "price": 210
      }
  ]
}

Errors

Example error response

1
2
3
4
5
6
HTTP 400 Bad Request
{
    "code": "invalid_parameter",
    "field": "product_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
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 500 Internal Server Error

Name Type Description
internal_server_error Object Something unexpected happened server side