Redeem
/vouchers/redeem
Target audience: Developers
Redeem voucher¶
Introduction¶
This endpoint lets you redeem a voucher.
Events triggered¶
See Payway events for more information on the events triggered.
Event | Description |
---|---|
voucher_redeemed | When a bought voucher is redeemed. |
voucher_user_product_created | When a user product is created. |
URI¶
Environment | URI |
---|---|
Stage | https://payway-api.stage.adeprimo.se/external/api/v2/vouchers/redeem |
Production | https://backend.worldoftulo.com/external/api/v2/vouchers/redeem |
Requirements¶
Identity | Scope |
---|---|
No | /external/voucher/w |
Parameters¶
Field | Required | Type | Description |
---|---|---|---|
voucher_code | Required | String | The code of the voucher we should search for. Size: 10 |
account_id | Required | String | The id of the account to redeem the voucher for. Size range: ..24 Allowed values: "/^[a-f\d]{24}$/i" |
delivery_address | Optional/Required | Address Object | The delivery address that should be set on the voucher. Only applicable if the voucher has been bought. Read more here. Required if the voucher product is a paper product. |
Curl Example¶
curl --request POST \
--url https://payway-api.stage.adeprimo.se/external/api/v2/vouchers/redeem \
--header 'accept: application/json' \
--header 'authorization: Bearer token' \
--header 'content-type: application/json' \
--data '{
"voucher_code": "123123",
"account_id": "585a4768edce2c5e6f000001"
}'
Response¶
Field | Description |
---|---|
id | The id of the updated account. |
Example Response: Successfully redeemed voucher¶
HTTP 200
{
"id": "585a4768edce2c5e6f000001"
}
Errors¶
This API uses the common error conventions of the Payway API