Back to overview
Voucher
This API endpoint let you manage your vouchers. Parameters can be found on the very end of this page.
Index:
List all vouchers
Get a list of all your debtors returned in JSON
format.
GET https://app.mytourist.cloud/api/v1/vouchers
Results
{
"id": "04250025",
"code": "4863-6862",
"type": "discount",
"is_percentage": false,
"amount": "50.00",
"label": "label",
"description": "Example discount",
"expires_at": "2025-04-19T22:00:00.000000Z",
"language": "en",
"limit_date_from": "2025-03-31T22:00:00.000000Z",
"limit_date_until": "2025-04-09T22:00:00.000000Z",
"times_to_use": 3
},
{
"id": "04250026",
"code": "my-own-code",
"type": "voucher",
"is_percentage": true,
"amount": "10.00",
"label": "label",
"description": "Example voucher",
"expires_at": "2025-04-19T22:00:00.000000Z",
"language": "en",
"limit_date_from": "2025-03-31T22:00:00.000000Z",
"limit_date_until": "2025-04-09T22:00:00.000000Z",
"times_to_use": 1
}
Retrieve a single voucher
Get a single voucher returned in JSON
format.
GET https://app.mytourist.cloud/api/v1/vouchers/{VOUCHER_ID}
Results
{
"id": "04250025",
"code": "4863-6862",
"type": "discount",
"is_percentage": false,
"amount": "50.00",
"label": "label",
"description": "Example voucher",
"expires_at": "2025-04-19T22:00:00.000000Z",
"language": "en",
"limit_date_from": "2025-03-31T22:00:00.000000Z",
"limit_date_until": "2025-04-09T22:00:00.000000Z",
"times_to_use": 3
}
Create / Update a voucher
You can create or update a voucher by posting to the following URL. This endpoints will return (when success) the saved voucher (200 HTTP response). You can either post the full JSON file or single individual fields. When the field is posted we always overwrite them. When a field is not posted trough the API we won’t overwrite it and keep the existing data.
POST (Create) https://app.mytourist.cloud/api/v1/vouchers
POST (Update) https://app.mytourist.cloud/api/v1/vouchers/{VOUCHER_ID}
Available Parameters
code | optional | discount code (auto generated when blank) |
type | optional | 'discount' or 'voucher'. (Default 'discount') |
is_percentage | optional | boolean (Default 'false') |
amount | required | float |
label | optional | string |
description | optional | description |
expires_at | optional | datetime (Format yyyy-mm-dd hh:ii:ss) |
language | optional | ISO-639 2 (Only when type is 'voucher') |
limit_date_from | optional | date (Format yyyy-mm-dd) |
limit_date_until | optional | date (Format yyyy-mm-dd) |
times_to_use | optional | int |