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": "2024-12-20T16:04:11Z"
}
'{
"invoice_id": "<string>",
"new_credit_balance": 123
}Purchase a number of credits. This action will generate an invoice and charge the customer.
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": "2024-12-20T16:04:11Z"
}
'{
"invoice_id": "<string>",
"new_credit_balance": 123
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Credit purchase payload
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.
32
Custom amount for the added credits. Either amount_excluding_tax or price_id must be defined. Expressed in currency's smallest unit.
Price ID used to add credits. The price must be of type bundle. Either amount_excluding_tax or price_id must be defined.
Was this page helpful?