Skip to navigation

Create a credit grant

Draft scaffold — not implemented or available in the API.

Grants credits in a credit currency to a customer’s balance by hand, for example a goodwill top-up. Requires an Idempotency-Key. startsAt defaults to now and can be in the future; expiresAt of null means the credits never expire. The credit currency must not be archived. Grants from bundles are created by orders, not by this call.

Authentication

AuthorizationBearer
API Key authentication using Bearer token

Headers

Paid-BetaenumRequired

This endpoint is in the credits=v1 beta. Send this header to use it.

Allowed values:

Request

Body
amountstringRequiredformat: "[1-9]"
A positive exact credit amount, up to 15 fractional places.
creditCurrencystringRequired1-255 characters
A Paid ID, external ID or resource key, as supported by the referenced resource.
customerstringRequired1-255 characters
A Paid ID, external ID or resource key, as supported by the referenced resource.
expiresAtdatetime or nullOptional

Expiry; null means no expiry.

metadatamap from strings to stringsOptional

String key-value pairs of your own, up to 500 characters per value. Always updatable.

reasonstring or nullOptional
Why credits are granted.
refillobjectOptional
CreditRefill.
rolloverobjectOptional
CreditRollover.
scopeobjectOptional
Scope or null.
startsAtdatetimeOptional
When credits become available.

Response

201
idstring
The CreditGrant ID.
objectenum

The type of object. Always creditGrant.

Allowed values:
createdAtdatetime
When the object was created.
amountstring or nullformat: "^\d+(\.\d{1,15})?$"

An exact non-negative credit amount, up to 15 fractional places.

availablestringformat: "^\d+(\.\d{1,15})?$"

An exact non-negative credit amount, up to 15 fractional places.

creditCurrencystring1-255 characters
A Paid ID, external ID or resource key, as supported by the referenced resource.
customerstring1-255 characters
A Paid ID, external ID or resource key, as supported by the referenced resource.
expiresAtdatetime or null
When the grant expires.
livemodeboolean

true for an object on a live account, false on a test account.

metadatamap from strings to strings

String key-value pairs of your own, up to 500 characters per value. Always updatable.

nextRefillAtdatetime or null
Next refill boundary.
reasonstring or null
Why credits were granted.
refillobject
CreditRefill.
refilledAtdatetime or null
Start of the current refill window.
rolloverobject
CreditRollover.
rolloverEndsAtdatetime or null
When rolled credits expire.
scopeobject
Scope or null.
seatstring or null1-255 characters
A Paid ID, external ID or resource key, as supported by the referenced resource.
sourceobject
The origin of a grant.
startsAtdatetime
When the grant starts.
statusenum
Grant lifecycle status.
Allowed values:
usedstringformat: "^\d+(\.\d{1,15})?$"

An exact non-negative credit amount, up to 15 fractional places.

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
409
Conflict Error
429
Too Many Requests Error
500
Internal Server Error
501
Not Implemented Error