Skip to content

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/v1/vouchers/redeem
Production https://backend.worldoftulo.com/external/api/v1/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 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.
first_name
Required String First name of the recipient
last_name
Required String Last name of the recipient
care_of
Optional String Care of address of the recipient
street
Required String Street of the recipient
zip_code
Required String Zip code of the recipient
city
Required String City of the recipient
country_code
Required String Country code of the recipient
company_name
Optional String Company name, if applicable
company_reference
Optional String Company reference, if applicable
company_department
Optional String Company department, if applicable

Curl Example

curl --request POST \
  --url https://payway-api.stage.adeprimo.se/external/api/v1/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

See common error responses