Skip to main content
POST
/
v1
/
loyalties
/
members
/
{memberId}
/
balance
curl --request POST \
--url https://{cluster}.voucherify.io/v1/loyalties/members/{memberId}/balance \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-App-Id: <api-key>' \
--header 'X-App-Token: <api-key>' \
--data '{
"points": -100
}'
{
  "points": 100,
  "total": 13436,
  "balance": 13136,
  "type": "loyalty_card",
  "object": "balance",
  "related_object": {
    "type": "voucher",
    "id": "v_0aMj6Mdp0i3zuXrd9NnBKboc7746mlgF"
  }
}

Authorizations

X-App-Id
string
header
required
X-App-Token
string
header
required
Authorization
string
header
required

The access token received from the authorization server in the OAuth 2.0 flow.

Path Parameters

memberId
string
required

Unique loyalty card assigned to a particular customer.

Example:

"MmFAzfDe"

Body

application/json

Specify the point adjustment along with the expiration mechanism.

Request Body schema for POST v1/loyalties/members/{memberId}/balance and POST v1/loyalties/{campaignId}/members/{memberId}/balance.

points
integer
required

Incremental balance to be added to/subtracted from the loyalty card.

  • To add points: 100
  • To subtract points, add a minus: -100
expiration_type
enum<string>

Set the type of expiration for added points.

PROGRAM_RULES: Inherit rules from campaign. NON_EXPIRING: Points never expire. CUSTOM_DATE: Points expire on a particular date. Requires expiration_date parameter.

Available options:
PROGRAM_RULES,
CUSTOM_DATE,
NON_EXPIRING
expiration_date
string<date-time>

Set expiration date for added points, i.e. YYYY-MM-DD. This parameter is required only when expiration_type is set to CUSTOM_DATE.

reason
string

Reason for the transfer.

source_id
string

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.

Response

Returns a balance object.

Response schema for POST v1/loyalties/members/{memberId}/balance and for POST v1/loyalties/{campaignId}/members/{memberId}/balance.

points
integer
required

The incremental points removed or added to the current balance on the loyalty card.

total
integer
required

The total of points accrued over the lifetime of the loyalty card.

balance
integer
required

The balance after adding/removing points.

Required range: x >= 0
type
enum<string>
required

The type of voucher being modified.

Available options:
loyalty_card,
gift_voucher
object
enum<string>
default:balance
required

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

Available options:
balance

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

operation_type
enum<string>

The type of operation being performed.

Available options:
MANUAL,
AUTOMATIC
I