Link Search Menu Expand Document

Unlocking vouchers

A sample response is shown below.

{
  "result": {
    "code": 1,
    "status": "ok"
  },
  "results": {
    "voucher_key": "13918dc12e44bc183cb168fa10684d0714115ff37132d4c265f4a8ab6678a741",
    "voucher_id": 35735,
    "voucher_status": "claimed",
    "voucher_locked": false,
    "campaign_id": 136,
    "campaign_type": "signup",
    "campaign_title": "Earn €5 on signup",
    "voucher_expiry_datetime_utc": "2050-01-01 00:00:00",
    "voucher_expiry_seconds_remaining": 996899028,
    "voucher_currency_id": 2,
    "voucher_currency_symbol": "€",
    "voucher_amount_original": 5,
    "voucher_amount_redeemed": 0,
    "voucher_amount": 5,
    "voucher_text": null,
    "user_id": 1107604,
    "user_entity_card": {
      "type": "custom",
      "code": "404064"
    },
    "result_type": "unlock-voucher"
  }
}

Overview

  • Call name: unlock-voucher
  • Endpoint URL: https://api0.spaaza.com/unlock-voucher
  • Request methods: PUT or POST
  • Request Content-Type: multipart/form-data or application/x-www-form-urlencoded
  • Response Content-Type: application/json
  • Auth required: yes

Unlocks a basket voucher which has been locked.

The unlock-voucher API allows a client operating with admin or privileged authentication to unlock a locked voucher. When a voucher is unlocked, any locking associated with a particular retailer_basket_code is also removed.

Permissions and Authentication

This API call requires a valid Spaaza session. The session can be as follows:

  • Admin authentication: the performing user needs to be logged in and have write access to the entity (business or chain) to which the user is connected.
  • Privileged authentication: the use of privileged authentication is permitted for this endpoint.

HTTP Parameters

The following HTTP parameters can be passed to the API:

Parameter Description
voucher_key (string, mandatory*) The unique voucher key of the voucher. This is a string, for instance c4bc4a3115e21e228936f4223dd89b22c238847c935514e1fdcb96f3c75118ac.
voucher_id (integer, mandatory*) The unique id generated for the voucher. This is an integer, for instance 4064783. This can be used instead of voucher_key although it is recommended to use the voucher_key parameter if possible. If both are supplied the voucher_key value is used.

* At least one of the parameters voucher_key or voucher_id must be used.