Get
/vouchers
Target audience: Developers
Get voucher(s)¶
Introduction¶
This endpoint lets you fetch a specific voucher, alternatively all vouchers on a specified package.
URI¶
Environment | URI |
---|---|
Stage | https://payway-api.stage.adeprimo.se/external/api/v1/vouchers |
Production | https://backend.worldoftulo.com/external/api/v1/vouchers |
Requirements¶
Identity | Scope |
---|---|
No | /external/voucher/w |
Parameters¶
Field | Required | Type | Description |
---|---|---|---|
voucher_code | Optional | String | The voucher code of the voucher that should be fetched |
package_code | Optional | String | The package_code to fetch all vouchers for |
id | Optional | String | ID of the voucher Size range: ..24 Allowed values: "/^[a-f\d]{24}$/i" |
Curl Example¶
curl --request GET \
--url https://payway-api.stage.adeprimo.se/external/api/v1/vouchers?package_code=adeprimo_digital \
--header 'accept: application/json' \
--header 'authorization: Bearer token' \
Example Response¶
HTTP 200
{
"item": {
"id": "adfa09dfadf09ajkdf09adf",
"created_at": "2022-01-01T00:00:00",
"expires_at": "2022-02-01T00:00:00",
"redeemed": false,
"redeemed_at": null,
"days_of_access": 30,
"voucher_code": "AB12345678",
"package_code": "adeprimo_digital",
"deactivated": false,
"voucher_details": {
"id": "adf0jadf908adf09adfadf",
"order_id": "ORGANISATION-1",
"purchased_by": "adfadjfa9d8fu9adf",
"redeemed_by": null,
"user_product_id": null,
"period_id": "adfadf8jad98fad9a8"
}
}
}
Errors¶
This API uses the common error conventions of the Payway API