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>",
"expires_at": "<string>"
}'
{
"invoice_id": "<string>",
"new_credit_balance": 123
}
Purchase a number of credits. This action will generate an invoice and charge the customer. Can take a few seconds to complete.
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>",
"expires_at": "<string>"
}'
{
"invoice_id": "<string>",
"new_credit_balance": 123
}
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Credit purchase payload
The body is of type object
.
Invoice ID and balance after purchase
The response is of type object
.
Was this page helpful?