Skip to content

Bought gift cards

/me/bought_vouchers

Target audience: Developers

Release version: 4.5.7

Get customer-bought gift cards

Introduction

This endpoint returns all gift cards that the given customer has bought, optionally filtered by product.

URI

Environment URI
Stage https://payway-api.stage.adeprimo.se/external/api/v1/me/bought_vouchers
Production https://backend.worldoftulo.com/external/api/v1/me/bought_vouchers

Requirements

Identity Scope
Yes /external/me/w

Parameters

Field Required Type Description
product_code Optional String The code of the product that we should filter by. If none is specified, all bought gift cards for the customer will be returned.

Curl Example

curl --request POST \
--url https://payway-api.stage.adeprimo.se/external/api/v1/me/bought_vouchers \
--header 'accept: application/json' \
--header 'authorization: Bearer token' \
--header 'content-type: application/json' \
--data '{
         "product_code": "adeprimo_digital"            
       }'

Example Response

HTTP 200
{
  "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",
  "provision_service" => "tulo",
  "voucher_details": {
    "order_id": "ORGANISATION-1",
    "purchased_by_account": "adfadjfa9d8fu9adf",
    "redeemed_by_account": null
  }
}

Errors

This API uses the common error conventions of the Payway API

See common error responses