Client Credits
Client credits are prepaid sessions or credits that clients use to book appointments and classes, the same as Add credits on a client's profile in the app. Each call works on one grant: the credits given to one client in one go.
A grant is one of two types:
| Type | What the client gets | What a booking uses |
|---|---|---|
session_pack | A number of sessions per service (and variant), for example 10 yoga classes | 1 session of the booked service |
credit_balance | One balance of credits for all services or selected ones, or unlimited | The service's credits per booking |
How it works:
- Counts are what is left.
countsets the remaining sessions or credits, not an amount to add. To top up, read the grant and send the new total. - Your own id. Send
externalId(for example the order number in your shop) andPOST /v1/creditswith the sameexternalIdupdates that grant instead of creating a new one, so retries never give credits twice. - Bookings use credits automatically. Booking with appointments or classes uses a matching active grant and returns a
creditobject. A cancelled booking gives the credit back. - Status:
active,expired(pastexpiryDate),completed(nothing left) ordisabled(paused). - Plan: giving credits needs the Sales add-on. Reading, changing, pausing and deleting existing grants always work.
The {id} in a path is the record id returned by the API (for example 5tw9zcQkbu), not the client number shown in the app.
api.whautomate.comList credits
/v1/creditsLists client credit grants, newest first. status is active, expired, completed or disabled.
x-api-keystringrequiredlocationIdstringclientIdstringexternalIdstringstatusstringactive, expired, completed, disabled.pageintegerlimitintegeridstringexternalIdstringcodestringclientobjectlocationsobject[]Locations where the credits can be used
expiryDatestringstatusstring (enum)active, expired, completed, disabled.disabledbooleantypestring (enum)session_pack, credit_balance.sessionsobject[]Session pack lines; empty for a credit balance
creditBalanceobjectThe credit balance; null for a session pack
notesstringcreatedAtstringupdatedAtstringcreatedbooleancurl -X GET "https://api.whautomate.com/v1/credits?clientId=FLT22gHGml&limit=2" \
-H "x-api-key: YOUR_API_KEY"
[
{
"id": "taNZ9FxeQL",
"externalId": "shop-order-1043",
"code": "7fa050e1",
"client": {
"id": "FLT22gHGml",
"name": "Priya Nair"
},
"locations": [
{
"id": "Le6dWjQF9K",
"title": "Serene Wellness Studio"
}
],
"expiryDate": "2027-01-27",
"status": "active",
"disabled": false,
"type": "credit_balance",
"sessions": [],
"creditBalance": {
"remaining": 10,
"unlimited": false,
"appliesTo": "selected",
"serviceIds": [
"9g0PbP1Hau",
"BICnvnGBgO"
]
},
"notes": "10 class credits for yoga or Pilates.",
"createdAt": "2026-10-29T12:40:19.351Z",
"updatedAt": "2026-10-29T12:40:19.360Z"
},
{
"id": "lxOL3532D3",
"externalId": "shop-order-1042",
"code": "a3cf3a55",
"client": {
"id": "FLT22gHGml",
"name": "Priya Nair"
},
"locations": [
{
"id": "Le6dWjQF9K",
"title": "Serene Wellness Studio"
}
],
"expiryDate": "2027-01-27",
"status": "active",
"disabled": false,
"type": "session_pack",
"sessions": [
{
"serviceId": "THF7D9KbDa",
"serviceName": "Deep Tissue Massage",
"variantId": null,
"variantName": null,
"total": 6,
"remaining": 6
}
],
"creditBalance": null,
"notes": "Upgraded to 6 massages.",
"createdAt": "2026-10-29T12:40:19.211Z",
"updatedAt": "2026-10-29T12:40:19.511Z"
}
]
Get a credit grant
/v1/credits/{creditId}Gets a credit grant.
x-api-keystringrequiredcreditIdstringrequiredidstringexternalIdstringcodestringclientobjectlocationsobject[]Locations where the credits can be used
expiryDatestringstatusstring (enum)active, expired, completed, disabled.disabledbooleantypestring (enum)session_pack, credit_balance.sessionsobject[]Session pack lines; empty for a credit balance
creditBalanceobjectThe credit balance; null for a session pack
notesstringcreatedAtstringupdatedAtstringcreatedbooleancurl -X GET "https://api.whautomate.com/v1/credits/lxOL3532D3" \
-H "x-api-key: YOUR_API_KEY"
{
"id": "lxOL3532D3",
"externalId": "shop-order-1042",
"code": "a3cf3a55",
"client": {
"id": "FLT22gHGml",
"name": "Priya Nair"
},
"locations": [
{
"id": "Le6dWjQF9K",
"title": "Serene Wellness Studio"
}
],
"expiryDate": "2027-01-27",
"status": "active",
"disabled": false,
"type": "session_pack",
"sessions": [
{
"serviceId": "THF7D9KbDa",
"serviceName": "Deep Tissue Massage",
"variantId": null,
"variantName": null,
"total": 6,
"remaining": 6
}
],
"creditBalance": null,
"notes": "Upgraded to 6 massages.",
"createdAt": "2026-10-29T12:40:19.211Z",
"updatedAt": "2026-10-29T12:40:19.511Z"
}
Give credits to a client
/v1/creditsAdds credits to a client (as Add credits in the client profile), or updates the grant with the same externalId. Response includes created. Creating needs the Sales module.
Send either sessions (session pack) or creditBalance (credit balance), not both. The examples show one of each, and a second call with the same externalId that updates the grant.
x-api-keystringrequiredexternalIdstringclientIdstringlocationIdsstring[]expiryDatestringnotesstringsessionsobject[]Session pack: sessions per service, 1 used per booking. Replaces the lines: a line with the same service and variant keeps its used count. Not with creditBalance.
creditBalanceobjectA credit balance usable across services (each booking uses the service's creditsPerBooking). Not with sessions.
idstringexternalIdstringcodestringclientobjectlocationsobject[]Locations where the credits can be used
expiryDatestringstatusstring (enum)active, expired, completed, disabled.disabledbooleantypestring (enum)session_pack, credit_balance.sessionsobject[]Session pack lines; empty for a credit balance
creditBalanceobjectThe credit balance; null for a session pack
notesstringcreatedAtstringupdatedAtstringcreatedbooleanErrors
| Status | Error | Meaning |
|---|---|---|
| 400 | Invalid parameters | Neither or both of sessions and creditBalance, a count below 0, or a service that is not bookable. |
| 403 | This feature is not included in your plan. | Creating a grant needs the Sales add-on. |
| 404 | Client not found | The client is not in your account. |
curl -X POST "https://api.whautomate.com/v1/credits" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"externalId": "shop-order-1042",
"clientId": "FLT22gHGml",
"expiryDate": "2027-01-27",
"notes": "Bought 5 massages in the online shop.",
"sessions": [
{
"serviceId": "THF7D9KbDa",
"count": 5
}
]
}'
{
"created": true,
"id": "lxOL3532D3",
"externalId": "shop-order-1042",
"code": "a3cf3a55",
"client": {
"id": "FLT22gHGml",
"name": "Priya Nair"
},
"locations": [
{
"id": "Le6dWjQF9K",
"title": "Serene Wellness Studio"
}
],
"expiryDate": "2027-01-27",
"status": "active",
"disabled": false,
"type": "session_pack",
"sessions": [
{
"serviceId": "THF7D9KbDa",
"serviceName": "Deep Tissue Massage",
"variantId": null,
"variantName": null,
"total": 5,
"remaining": 5
}
],
"creditBalance": null,
"notes": "Bought 5 massages in the online shop.",
"createdAt": "2026-10-29T12:40:19.211Z",
"updatedAt": "2026-10-29T12:40:19.246Z"
}
curl -X POST "https://api.whautomate.com/v1/credits" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"externalId": "shop-order-1043",
"clientId": "FLT22gHGml",
"expiryDate": "2027-01-27",
"notes": "10 class credits for yoga or Pilates.",
"creditBalance": {
"count": 10,
"serviceIds": [
"9g0PbP1Hau",
"BICnvnGBgO"
]
}
}'
{
"created": true,
"id": "taNZ9FxeQL",
"externalId": "shop-order-1043",
"code": "7fa050e1",
"client": {
"id": "FLT22gHGml",
"name": "Priya Nair"
},
"locations": [
{
"id": "Le6dWjQF9K",
"title": "Serene Wellness Studio"
}
],
"expiryDate": "2027-01-27",
"status": "active",
"disabled": false,
"type": "credit_balance",
"sessions": [],
"creditBalance": {
"remaining": 10,
"unlimited": false,
"appliesTo": "selected",
"serviceIds": [
"9g0PbP1Hau",
"BICnvnGBgO"
]
},
"notes": "10 class credits for yoga or Pilates.",
"createdAt": "2026-10-29T12:40:19.351Z",
"updatedAt": "2026-10-29T12:40:19.360Z"
}
curl -X POST "https://api.whautomate.com/v1/credits" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"externalId": "shop-order-1042",
"clientId": "FLT22gHGml",
"notes": "Upgraded to 6 massages.",
"sessions": [
{
"serviceId": "THF7D9KbDa",
"count": 6
}
]
}'
{
"created": false,
"id": "lxOL3532D3",
"externalId": "shop-order-1042",
"code": "a3cf3a55",
"client": {
"id": "FLT22gHGml",
"name": "Priya Nair"
},
"locations": [
{
"id": "Le6dWjQF9K",
"title": "Serene Wellness Studio"
}
],
"expiryDate": "2027-01-27",
"status": "active",
"disabled": false,
"type": "session_pack",
"sessions": [
{
"serviceId": "THF7D9KbDa",
"serviceName": "Deep Tissue Massage",
"variantId": null,
"variantName": null,
"total": 6,
"remaining": 6
}
],
"creditBalance": null,
"notes": "Upgraded to 6 massages.",
"createdAt": "2026-10-29T12:40:19.211Z",
"updatedAt": "2026-10-29T12:40:19.511Z"
}
{
"error": "Send either sessions (session pack) or creditBalance (credit balance), not both."
}
Update a credit grant
/v1/credits/{creditId}Updates a grant. Only the fields you send change. Sent sessions replace the lines, but a line for the same service and variant keeps the sessions already used. Switching a session pack to creditBalance drops its session lines. A grant cannot move to another client.
x-api-keystringrequiredcreditIdstringrequiredexternalIdstringclientIdstringlocationIdsstring[]expiryDatestringnotesstringsessionsobject[]Session pack: sessions per service, 1 used per booking. Replaces the lines: a line with the same service and variant keeps its used count. Not with creditBalance.
creditBalanceobjectA credit balance usable across services (each booking uses the service's creditsPerBooking). Not with sessions.
idstringexternalIdstringcodestringclientobjectlocationsobject[]Locations where the credits can be used
expiryDatestringstatusstring (enum)active, expired, completed, disabled.disabledbooleantypestring (enum)session_pack, credit_balance.sessionsobject[]Session pack lines; empty for a credit balance
creditBalanceobjectThe credit balance; null for a session pack
notesstringcreatedAtstringupdatedAtstringcreatedbooleancurl -X PUT "https://api.whautomate.com/v1/credits/lxOL3532D3" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"expiryDate": "2027-02-26",
"notes": "Expiry extended as a goodwill gesture."
}'
{
"created": false,
"id": "lxOL3532D3",
"externalId": "shop-order-1042",
"code": "a3cf3a55",
"client": {
"id": "FLT22gHGml",
"name": "Priya Nair"
},
"locations": [
{
"id": "Le6dWjQF9K",
"title": "Serene Wellness Studio"
}
],
"expiryDate": "2027-02-26",
"status": "active",
"disabled": false,
"type": "session_pack",
"sessions": [
{
"serviceId": "THF7D9KbDa",
"serviceName": "Deep Tissue Massage",
"variantId": null,
"variantName": null,
"total": 6,
"remaining": 6
}
],
"creditBalance": null,
"notes": "Expiry extended as a goodwill gesture.",
"createdAt": "2026-10-29T12:40:19.211Z",
"updatedAt": "2026-10-29T12:40:19.814Z"
}
Pause a credit grant
/v1/credits/{creditId}/disablePauses a grant (e.g. while unpaid): booking skips it, a cancelled booking still gets its credit back. No request body.
x-api-keystringrequiredcreditIdstringrequiredidstringexternalIdstringcodestringclientobjectlocationsobject[]Locations where the credits can be used
expiryDatestringstatusstring (enum)active, expired, completed, disabled.disabledbooleantypestring (enum)session_pack, credit_balance.sessionsobject[]Session pack lines; empty for a credit balance
creditBalanceobjectThe credit balance; null for a session pack
notesstringcreatedAtstringupdatedAtstringcreatedbooleancurl -X POST "https://api.whautomate.com/v1/credits/lxOL3532D3/disable" \
-H "x-api-key: YOUR_API_KEY"
{
"id": "lxOL3532D3",
"externalId": "shop-order-1042",
"code": "a3cf3a55",
"client": {
"id": "FLT22gHGml",
"name": "Priya Nair"
},
"locations": [
{
"id": "Le6dWjQF9K",
"title": "Serene Wellness Studio"
}
],
"expiryDate": "2027-02-26",
"status": "disabled",
"disabled": true,
"type": "session_pack",
"sessions": [
{
"serviceId": "THF7D9KbDa",
"serviceName": "Deep Tissue Massage",
"variantId": null,
"variantName": null,
"total": 6,
"remaining": 6
}
],
"creditBalance": null,
"notes": "Expiry extended as a goodwill gesture.",
"createdAt": "2026-10-29T12:40:19.211Z",
"updatedAt": "2026-10-29T12:40:19.898Z"
}
Resume a credit grant
/v1/credits/{creditId}/enableTurns a paused grant back on for booking (status refreshed). No request body.
x-api-keystringrequiredcreditIdstringrequiredidstringexternalIdstringcodestringclientobjectlocationsobject[]Locations where the credits can be used
expiryDatestringstatusstring (enum)active, expired, completed, disabled.disabledbooleantypestring (enum)session_pack, credit_balance.sessionsobject[]Session pack lines; empty for a credit balance
creditBalanceobjectThe credit balance; null for a session pack
notesstringcreatedAtstringupdatedAtstringcreatedbooleancurl -X POST "https://api.whautomate.com/v1/credits/lxOL3532D3/enable" \
-H "x-api-key: YOUR_API_KEY"
{
"id": "lxOL3532D3",
"externalId": "shop-order-1042",
"code": "a3cf3a55",
"client": {
"id": "FLT22gHGml",
"name": "Priya Nair"
},
"locations": [
{
"id": "Le6dWjQF9K",
"title": "Serene Wellness Studio"
}
],
"expiryDate": "2027-02-26",
"status": "active",
"disabled": false,
"type": "session_pack",
"sessions": [
{
"serviceId": "THF7D9KbDa",
"serviceName": "Deep Tissue Massage",
"variantId": null,
"variantName": null,
"total": 6,
"remaining": 6
}
],
"creditBalance": null,
"notes": "Expiry extended as a goodwill gesture.",
"createdAt": "2026-10-29T12:40:19.211Z",
"updatedAt": "2026-10-29T12:40:20.020Z"
}
Delete a credit grant
/v1/credits/{creditId}Deletes a credit grant (soft delete, as the app does).
x-api-keystringrequiredcreditIdstringrequiredidstringremovedbooleancurl -X DELETE "https://api.whautomate.com/v1/credits/taNZ9FxeQL" \
-H "x-api-key: YOUR_API_KEY"
{
"id": "taNZ9FxeQL",
"removed": true
}