credit-packs
Stable. Describes behaviour that is built and covered by tests in this repository.
GET /v1/credit-packs #
The credit packs the tenant sells
Not paged: the response is the complete list.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
active | query | boolean | true leaves out packs withdrawn from sale |
Responses
| Status | Meaning | Body |
|---|---|---|
200 | OK | CreditPackList |
Example response
{
"packs": [
{
"id": "0192f0b4-6f6e-7c3a-9a3e-6a1f2b3c4d5e",
"name": "string",
"credits": "string",
"price_minor": "string",
"currency": "string",
"active": false,
"create_time": "2026-11-03T10:15:00Z",
"validity_days": 1
}
]
}curl
curl -X GET https://YOUR-API-ADDRESS/v1/credit-packs \
-H "Authorization: Bearer $PAYRUDDER_API_KEY"POST /v1/credit-packs #
Add a credit pack
A pack is a number of credits for a price in one currency. A customer buys it through a payment link; the credits are granted when the payment is confirmed.
Request body
| Field | Type | Description |
|---|---|---|
name required | string | |
credits required | string · int64 | int64, above zero (a number is accepted too) |
price_minor required | string · int64 | int64 minor units of the currency, above zero |
currency required | string | |
validity_days | integer | The credits bought expire after this many days; 0 or absent: they never expire |
Example
{
"name": "string",
"credits": "string",
"price_minor": "string",
"currency": "string"
}Responses
| Status | Meaning | Body |
|---|---|---|
201 | Created | CreditPack |
400 | Error envelope | Error |
Example response
{
"id": "0192f0b4-6f6e-7c3a-9a3e-6a1f2b3c4d5e",
"name": "string",
"credits": "string",
"price_minor": "string",
"currency": "string",
"active": false,
"create_time": "2026-11-03T10:15:00Z",
"validity_days": 1
}curl
curl -X POST https://YOUR-API-ADDRESS/v1/credit-packs \
-H "Authorization: Bearer $PAYRUDDER_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"string","credits":"string","price_minor":"string","currency":"string"}'POST /v1/credit-packs/{id}/activate #
Put a credit pack back on sale
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id required | path | string · uuid |
Responses
| Status | Meaning | Body |
|---|---|---|
200 | OK | EmptyObject |
404 | Error envelope | Error |
Example response
{}curl
curl -X POST https://YOUR-API-ADDRESS/v1/credit-packs/<id>/activate \
-H "Authorization: Bearer $PAYRUDDER_API_KEY"POST /v1/credit-packs/{id}/deactivate #
Withdraw a credit pack from sale
Credits already sold are not touched.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id required | path | string · uuid |
Responses
| Status | Meaning | Body |
|---|---|---|
200 | OK | EmptyObject |
404 | Error envelope | Error |
Example response
{}curl
curl -X POST https://YOUR-API-ADDRESS/v1/credit-packs/<id>/deactivate \
-H "Authorization: Bearer $PAYRUDDER_API_KEY"Models
CreditPack
| Field | Type | Description |
|---|---|---|
id required | string · uuid | |
name required | string | |
credits required | string · int64 | |
price_minor required | string · int64 | |
currency required | string | |
active required | boolean | |
create_time required | string · date-time | |
validity_days required | integer | 0: the credits bought never expire |
CreditPackInput
| Field | Type | Description |
|---|---|---|
name required | string | |
credits required | string · int64 | int64, above zero (a number is accepted too) |
price_minor required | string · int64 | int64 minor units of the currency, above zero |
currency required | string | |
validity_days | integer | The credits bought expire after this many days; 0 or absent: they never expire |
CreditPackList
| Field | Type | Description |
|---|---|---|
packs required | array of CreditPack |
EmptyObject
object
Error
| Field | Type | Description |
|---|---|---|
error required | object |