Add a credit to the customer's balance (a referral payout or store credit); Kentro services only

Writes one customer_credits row and its customer_payments row of type credit (method referral-credit or store-credit, the negative amount), then customer-credit.created and the legacy credit-added. Kentro services only (403 otherwise). Idempotent per customer by externalId: onDuplicate error (default) is 409 duplicate; skip answers the existing credit (200, outcome skipped) when its type, amount, currency and referred customer equal the request, else 409. An inactive customer is 422 inactive_customer; a currency other than the channel currency is 400; an orderId or referredCustomerId outside the tenant is 422 unresolved_reference. Unknown fields are refused (400).

Scope: customers:write, channel:write or admin.

Idempotency: send Idempotency-Key; a retry with the same key replays the first answer.

Rate limit: write class, 1,200 requests per minute per tenant by default (read class 6,000). Every response carries X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset; a refusal is 429 rate_limited with Retry-After.

Path Params
string
required
length between 1 and 300

The uuid, a legacy 24-hex id, or ext:: (URL-encoded).

Body Params
string
required
length between 1 and 255

The caller's identity for this credit, unique per customer (a checkout attempt's ':referral').

enum
required
required
length ≤ 24
^[0-9]{1,14}(\.[0-9]{1,8})?$

Currency units, greater than 0, at most the currency precision ("5.00").

string
required
length between 3 and 3

ISO 4217; must be the customer's sales channel currency.

string
length ≤ 1000
string
^(?:[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}|[0-9a-fA-F]{24})$

The order the credit is for (a referral payout: the referred order); must be an order of the tenant.

string
^(?:[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}|[0-9a-fA-F]{24})$

A referral payout: the customer who was referred; must be a customer of the tenant.

enum

An existing credit of the customer with this externalId: 'error' (default) is 409 duplicate; 'skip' answers it (200) when its facts match.

Headers
string
length between 7 and 50

Any string of 7 to 50 characters that identifies this request (an order number, a webhook id). A retry with the same key and the same body answers the first result with Idempotent-Replayed: true; the same key with a different body is 422 idempotency_key_reused; a concurrent request with the same key is 409 in_progress with Retry-After. Recommended on every write.

Responses

Language
Credentials
URL
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json