Get payment periods
/products/payment_periods
Target audience: Developers
Get payment periods
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
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
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
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
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 |