• Precios
  • Blog
Iniciar sesiónAgendá una demo
Batch create customers POSTGrant customer credit POSTCreate customer POSTGet customer GETList customer credits GETList customers GETRevoke remaining customer credit POSTUpdate customer PATCH
DocumentaciónRecursosConstruir con AIAPI ReferenceWebhooks

Grant customer credit

Grant monetary credit in one currency. Credit is applied FIFO before tax to eligible recurring invoices.

POST
/customers/{id}/credits

Grant monetary credit in one currency. Credit is applied FIFO before tax to eligible recurring invoices.

Authorization

ApiKeyAuth
x-api-key<token>

In: header

Path Parameters

id*string

Header Parameters

Idempotency-Key?string

Unique key used to safely retry this write for 24 hours without applying it twice.

Length1 <= length <= 200

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/customers/string/credits" \  -H "Content-Type: application/json" \  -d '{    "amount": 1,    "currency": "usd",    "reason": "string"  }'
{  "id": "string",  "amount": -9007199254740991,  "appliedAmount": -9007199254740991,  "reversedAmount": -9007199254740991,  "revokedAmount": -9007199254740991,  "remainingAmount": -9007199254740991,  "currency": "string",  "reason": "string",  "source": "dashboard",  "expiresAt": "2019-08-24T14:15:22Z",  "createdAt": "2019-08-24T14:15:22Z",  "object": "customer_credit",  "livemode": true}
{  "error": {    "type": "string",    "code": "string",    "message": "string",    "param": "string",    "details": null,    "doc_url": "string"  }}
{  "error": {    "type": "string",    "code": "string",    "message": "string",    "param": "string",    "details": null,    "doc_url": "string"  }}
{  "error": {    "type": "string",    "code": "string",    "message": "string",    "param": "string",    "details": null,    "doc_url": "string"  }}
{  "error": {    "type": "string",    "code": "string",    "message": "string",    "param": "string",    "details": null,    "doc_url": "string"  }}
{  "error": {    "type": "string",    "code": "string",    "message": "string",    "param": "string",    "details": null,    "doc_url": "string"  }}
{  "error": {    "type": "string",    "code": "string",    "message": "string",    "param": "string",    "details": null,    "doc_url": "string"  }}
{  "error": {    "type": "string",    "code": "string",    "message": "string",    "param": "string",    "details": null,    "doc_url": "string"  }}
{  "error": {    "type": "string",    "code": "string",    "message": "string",    "param": "string",    "details": null,    "doc_url": "string"  }}

Batch create customers POST

Create up to 100 customers in a single request.

Create customer POST

Create a new customer. Idempotent when customerId is provided.

amount*integer

Amount in the currency's smallest unit.

Range0 < value <= 9007199254740991
currency*string

Value in

  • "usd"
  • "ars"
  • "brl"
  • "clp"
  • "cop"
  • "pen"
  • "uyu"
  • "pyg"
  • "bob"
  • "mxn"
  • "cad"
  • "eur"
  • "jpy"
  • "cny"
  • "krw"
  • "hkd"
  • "sgd"
  • "twd"
  • "inr"
  • "thb"
reason*string
Length1 <= length <= 500
expiresAt?|null