Skip to navigation

Create a credit auto top-up

Draft scaffold — not implemented or available in the API.

Creates a rule that buys quantity of a one-time price when the customer’s balance in creditCurrency drops below threshold. Each purchase is added to the customer’s active order by amendment and invoiced, at most limits.maxPerMonth times per UTC month (default 1). Fails if the order belongs to another customer, the price is not one-time or does not grant creditCurrency, or the customer already has an enabled rule for that unit.

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
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.
orderstringRequired1-255 characters
A Paid ID, external ID or resource key, as supported by the referenced resource.
pricestringRequired1-255 characters
A Paid ID, external ID or resource key, as supported by the referenced resource.
quantityintegerRequired
Quantity purchased on each trigger.
thresholdobjectRequired

A downward available-balance crossing threshold.

collectionenumOptionalDefaults to sendInvoice

How the top-up invoice is collected.

Allowed values:
enabledbooleanOptionalDefaults to true

Whether the rule can trigger; true resumes it.

limitsobjectOptional
Monthly purchase limits.
metadatamap from strings to stringsOptional

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

paymentMethodstring or nullOptional1-255 characters
A Paid ID, external ID or resource key, as supported by the referenced resource.

Response

201
idstring
The CreditAutoTopUp ID.
objectenum

The type of object. Always creditAutoTopUp.

Allowed values:
createdAtdatetime
When the object was created.
archivedAtdatetime or null
When this resource was archived, or null.
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.
lastAmendmentstring or null1-255 characters
A Paid ID, external ID or resource key, as supported by the referenced resource.
lastTriggeredAtdatetime or null
Last purchase trigger.
limitsobject
Monthly purchase limits.
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.

orderstring1-255 characters
A Paid ID, external ID or resource key, as supported by the referenced resource.
pausedReasonstring or null
Why the rule is paused.
paymentMethodstring or null1-255 characters
A Paid ID, external ID or resource key, as supported by the referenced resource.
pricestring1-255 characters
A Paid ID, external ID or resource key, as supported by the referenced resource.
quantityinteger
Quantity purchased on each trigger.
statusenum
Rule lifecycle status.
Allowed values:
thresholdobject

A downward available-balance crossing threshold.

collectionenumOptionalDefaults to sendInvoice

How the top-up invoice is collected.

Allowed values:
enabledbooleanOptionalDefaults to true

Whether the rule can trigger; true resumes it.

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