Customer Credits - Accounts

Create a customer credits account

Changed on

Create a new credits account for a customer. Optionally seed it with an initial balance.

post/v1/customer-credits/accounts

Request

Request body

namestring

Human-readable name for the account (bucket). Unique per customer, compared case-insensitively: Tokens and tokens are the same account. Surrounding whitespace is trimmed; the spelling you send is preserved on read. Max 100 characters.

customer_idstring required

The owner ID this account belongs to (e.g. customer ID)

unit_labelstring

Label for the unit of currency/credits

initial_balancestring

Seed the account with this many credits on creation

Example request

{
  "name": "default",
  "customer_id": "cust_abc123",
  "unit_label": "credits",
  "initial_balance": "300"
}

Response

Account created

idstring required

Account ID

store_idstring required

Store ID

customer_idstring required

Owner ID

namestring required

Account name

unit_labelstring required

Unit label

status'active' | 'frozen' | 'closed' required

Account status

created_atstring required

Creation timestamp

updated_atstring required

Last update timestamp

Example response

{
  "id": "cca_abc123",
  "customer_id": "cust_abc123",
  "name": "default",
  "unit_label": "credits"
}

Changes

    • warning

      the request property's maxLength was set to 100

    • info

      added the non-success response with the status

    • info

      api tag Customer Credits - Accounts added

    • info

      api tag Customer Credits - Accounts (Experimental) removed