Saltar para o conteúdo principal
POST
/
public
/
api
/
v1
/
billing
/
credit-packages
Create credit package
curl --request POST \
  --url https://api.gennia.ai/public/api/v1/billing/credit-packages \
  --header 'Content-Type: application/json' \
  --header 'X-Api-Key: <api-key>' \
  --data '
{
  "creditValueCents": 5,
  "creditsAmount": 1000,
  "extraCreditsAmount": 100,
  "name": "Starter pack",
  "renewalIntervalMonths": 1
}
'
{
  "createdAt": "2023-11-07T05:31:56Z",
  "creditValueCents": 123,
  "creditsAmount": 123,
  "extraCreditsAmount": 123,
  "name": "<string>",
  "publicId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "renewalIntervalMonths": 123,
  "updatedAt": "2023-11-07T05:31:56Z"
}

Autorizações

X-Api-Key
string
header
obrigatório

Corpo

application/json

Body for creating a new credit package.

creditValueCents
integer<int32>
obrigatório

Price per credit in the smallest currency unit (cents).

Intervalo necessário: x >= 1
Exemplo:

5

creditsAmount
integer<int32>
obrigatório

Number of credits included in the package.

Intervalo necessário: x >= 1
Exemplo:

1000

extraCreditsAmount
integer<int32>

Optional bonus credits added on top of creditsAmount.

Intervalo necessário: x >= 1
Exemplo:

100

name
string

Display name of the credit package.

Required string length: 1 - 100
Exemplo:

"Starter pack"

renewalIntervalMonths
integer<int32>

Renewal interval in months. Null means credits never renew (one-time / non-renewable package).

Exemplo:

1

Resposta

Created

createdAt
string<date-time>
creditValueCents
integer<int32>
creditsAmount
integer<int32>
extraCreditsAmount
integer<int32>
name
string
publicId
string<uuid>
renewalIntervalMonths
integer<int32>
updatedAt
string<date-time>