Skip to main content
POST
/
customer
/
api
/
open
/
v1
/
loyalty
/
customers
/
{customerId}
/
redeem
Redeem reward and create voucher
curl --request POST \
  --url https://api.bitbybit.studio/customer/api/open/v1/loyalty/customers/{customerId}/redeem \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "rewardOptionId": "<string>",
  "rewardName": "<string>",
  "pointsCost": 2,
  "voucherCode": "<string>",
  "voucherProvider": "<string>",
  "voucherExternalId": "<string>",
  "idempotencyKey": "<string>",
  "metadata": {}
}
'
{
  "data": {
    "wallet": {
      "id": "<string>",
      "companyId": 123,
      "customerId": "<string>",
      "availablePoints": "<string>",
      "reservedPoints": "<string>",
      "lifetimeEarnedPoints": "<string>",
      "lifetimeBurnedPoints": "<string>",
      "version": "<string>",
      "lastLedgerAt": "2023-11-07T05:31:56Z",
      "createdAt": "2023-11-07T05:31:56Z",
      "updatedAt": "2023-11-07T05:31:56Z"
    },
    "redemption": {
      "id": "<string>",
      "companyId": 123,
      "customerId": "<string>",
      "customer": {
        "id": "<string>",
        "companyId": 123,
        "name": "<string>",
        "email": "<string>",
        "phoneNumber": "<string>"
      },
      "walletId": "<string>",
      "rewardOptionId": "<string>",
      "rewardName": "<string>",
      "status": "<string>",
      "pointsReserved": "<string>",
      "pointsCommitted": "<string>",
      "voucherCode": "<string>",
      "voucherProvider": "<string>",
      "voucherExternalId": "<string>",
      "reserveExpiresAt": "2023-11-07T05:31:56Z",
      "commitAt": "2023-11-07T05:31:56Z",
      "releasedAt": "2023-11-07T05:31:56Z",
      "failureReason": "<string>",
      "idempotencyKey": "<string>",
      "metadata": {},
      "createdById": 123,
      "createdAt": "2023-11-07T05:31:56Z",
      "updatedAt": "2023-11-07T05:31:56Z"
    },
    "ledger": {
      "id": "<string>",
      "companyId": 123,
      "customerId": "<string>",
      "walletId": "<string>",
      "entryType": "<string>",
      "pointsDelta": "<string>",
      "availableAfter": "<string>",
      "reservedAfter": "<string>",
      "referenceType": "<string>",
      "referenceId": "<string>",
      "idempotencyKey": "<string>",
      "note": "<string>",
      "metadata": {},
      "occurredAt": "2023-11-07T05:31:56Z",
      "createdAt": "2023-11-07T05:31:56Z",
      "createdById": 123
    },
    "idempotencyKey": "<string>"
  }
}

Documentation Index

Fetch the complete documentation index at: https://knowledge.bitbybit.studio/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

x-api-key
string
header
required

API key for authentication. Create one in Settings > Developer.

Path Parameters

customerId
string
required

Body

application/json
rewardOptionId
string
required
rewardName
string
required
pointsCost
integer
required
Required range: x >= 1
voucherCode
string
voucherProvider
string
voucherExternalId
string
idempotencyKey
string
metadata
object

Response

200 - application/json

Success

data
object