8 API Reference‎ > ‎Resources‎ > ‎

Voucher

Voucher represents a redemption code provided to a customer after he makes a purchase for a deal or a gift card or clips a coupon. Applicable only for digital offers such as deals, gift cards and coupons.

Common attributes:
  • id string.
  • offer_id string.
  • bundle_item_id string. Applicable only for bundle deals.
  • redemption_code string.
  • customer_name string.
  • status string. Acquired, redeemed, cancelled.
  • acquired_at time.
  • redeemed_at time.
  • cancelled_at time.
  • activation_date date.
  • expiration_date date.
Submission API specific attributes:
Distribution API specific attributes:
  • reservation_id string.
  • account_id string.
  • barcode Image.
  • print_url string.

Data Example

JSON

{
    "id": "",
    "offer_id": "",
    "redemption_code": "",
    "customer_name": "",
    "status": "",
    "acquired_at": "",
    "redeemed_at": "",
    "cancelled_at": "",
    "expiration_date": "",
    "distributor": {Distributor},
    "reservation_id": "",
    "barcode": "",
    "print_url": ""
}

XML

<voucher>
    <id></id>
    <offer_id></offer_id>
    <redemption_code></redemption_code>
    <customer_name></customer_name>
    <status></status>
    <acquired_at></acquired_at>
    <redeemed_at></redeemed_at>
    <cancelled_at></cancelled_at>
    <expiration_date></expiration_date>
    <distributor>Distributor</distributor>
        
<reservation_id></reservation_id>
    <barcode></barcode>
    <print_url></print_url>
</voucher>

Actions

Query Vouchers

GET /offers/:offer_id/vouchers

Get Voucher Details

GET /offers/:offer_id/vouchers/:id

or

GET /advertisers/:advertiser_id/vouchers/:id

or

GET /advertisers/:advertiser_id/vouchers/:redemption _code

Redeem Voucher

PUT /offers/:offer_id/vouchers/:id

or

PUT /advertisers/:advertiser_id/vouchers/:id

or

PUT /advertisers/:advertiser_id/vouchers/:redemption_code

Cancel Voucher

PUT /offers/:offer_id/vouchers/:id

Submission API examples

Redeem voucher call

Example using command-line Curl and JSON output.

curl -k -X PUT -H "Content-Type: application/json" -H "Accept: application/json" -H "X-ADILITY-API-KEY:YOUR_SUBMISSION_API_KEY " 'http://testapi.adility.com/submission/offers/OFFER_ID/vouchers/VOUCHER_ID'



Comments