credits

Stable. Describes behaviour that is built and covered by tests in this repository.

API reference

GET /v1/credits/settings #

The low-balance threshold of the credits.low event

Responses

StatusMeaningBody
200OKCreditSettings
Example response
{
  "low_threshold": "string"
}
curl
curl -X GET https://YOUR-API-ADDRESS/v1/credits/settings \
  -H "Authorization: Bearer $PAYRUDDER_API_KEY"

PUT /v1/credits/settings #

Set the low-balance threshold

A consume that takes a customer's balance from at least low_threshold credits to fewer announces credits.low once (the webhook event). 0, the default, turns it off.

Request body

FieldTypeDescription
low_thresholdstring · int64int64 credits; 0 turns credits.low off
Example
{}

Responses

StatusMeaningBody
200OKCreditSettings
400Error envelopeError
Example response
{
  "low_threshold": "string"
}
curl
curl -X PUT https://YOUR-API-ADDRESS/v1/credits/settings \
  -H "Authorization: Bearer $PAYRUDDER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'

Models

CreditSettings

FieldTypeDescription
low_threshold requiredstring · int64int64 credits; 0 turns credits.low off

CreditSettingsInput

FieldTypeDescription
low_thresholdstring · int64int64 credits; 0 turns credits.low off

Error

FieldTypeDescription
error requiredobject