younifyd
Menu

Update Voucher Balance

Adjust Voucher Balance

POST/v1/vouchers/{code}/balance

Use it in a workflow

  1. Add a step and choose the Voucherify connector.
  2. Pick the Update Voucher Balance action (under Vouchers).
  3. Fill in the fields below, then reference the result from later steps as {{updateVoucherBalance.response.data}}.

Request

Path parameters

codestringrequired

A **code** that identifies the voucher or a unique voucher ID assigned by Voucherify, i.e. `v_TzD19aeNiqGc9LWciMWknyEZT8IW7u4u`.

Request body

Enter the body as JSON in the step's Body field.

amountinteger

The incremental amount to be added to or removed from the current balance on the gift card or loyalty card. The value is multiplied by 100 to represent 2 decimal places. For example `10000 cents` for `$100.00`. To remove balance, simply add a minus sign before the value, i.e. to remove $20, use -2000.

source_idstring

The merchant's transaction ID if it is different from the Voucherify transaction ID. It is really useful in case of an integration between multiple systems. It can be a transaction ID from a CRM system, database or 3rd-party service.

reasonstring

Reason why the transaction occurred.

json
{
  "amount": 0,
  "source_id": "string",
  "reason": "string"
}

Response

Returns 200 with an object. Read it in later steps with {{updateVoucherBalance.response.data.<field>}}.

amountinteger

The incremental amount added (positive integer) or subtracted (negative integer) to the current balance on the gift card or loyalty card. The value is multiplied by 100 to represent 2 decimal places. For example `10000 cents` for `$100.00`.

totalinteger

Total income incurred over the lifespan of the gift card or loyalty card.

balanceinteger

The balance after adding or subtracting a specified amount. The value is multiplied by 100 to represent 2 decimal places. For example `10000 cents` for `$100.00`.

typestring

The type of voucher being modified.

One ofgift_voucherloyalty_card

operation_typestring

The type of the operation being performed.

One ofMANUAL

objectstring

The type of the object represented by JSON. Default is `balance`.

One ofbalanceDefault "balance"

related_objectobject

Defines the resource that is being modified with the values that are returned in the balance object.

typestring

The object being modified, i.e. `voucher`.

One ofvoucherDefault "voucher"

idstring

Identifies the voucher that is being modified, this is the ID that was assigned by the Voucherify API.

json
{
  "amount": 0,
  "total": 0,
  "balance": 0,
  "type": "gift_voucher",
  "operation_type": "MANUAL",
  "object": "balance",
  "related_object": {
    "type": "voucher",
    "id": "v_abCdEfghI1JKLMNPqRS2Tu3vWXyza4bc"
  }
}

Need more? See the Voucherify guide for connection setup and behaviour shared by every action.