POST
/
v1
/
customers
/
{id}
/
credits
/
{productId}
/
purchase
curl --request POST \
  --url https://api.hyperline.co/v1/customers/{id}/credits/{productId}/purchase \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "credit_count": 32,
  "amount_excluding_tax": 123,
  "price_id": "<string>"
}'
{
  "invoice_id": "<string>",
  "new_credit_balance": 123
}

Authorizations

Authorization
string
headerrequired

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

id
string
required
productId
string
required

Body

application/json
credit_count
number
required

Value indicating a number of credits to add. If price_id is defined, this value must correspond to a full credit pack for the price.

amount_excluding_tax
number

Total custom monetary amount in the currency's smallest unit for the added credits. Either amount_excluding_tax or price_id must be defined.

price_id
string | null

Price ID used to add credits. The price must be of type bundle. Either amount_excluding_tax or price_id must be defined.

Response

201 - application/json
invoice_id
string
required
new_credit_balance
number
required