API documentation
Integrations
Analytics
Billable events
Companies
Coupons > Promotion codes
Custom properties
Customers
Customers > Credits
Customers > Payment methods
Integrations
Invoices
Invoices > Transactions
Invoicing entities
Organisations
Payments
Price configurations
Products
Quotes
Subscriptions
- GETGet subscriptions
- GETGet subscription
- GETGet subscription phases
- GETGet subscription phase
- POSTCreate subscription update
- POSTCreate subscription updates
- POSTCreate subscription
- PUTUpdate subscription
- POSTActivate subscription
- POSTCancel subscription
- POSTPause subscription
- POSTReactivate subscription
- POSTRefresh seat products
- POSTRefresh subscriptions
- POSTReinstate subscription
- POSTTransition subscription to next phase
Third-party apps
Wallets
Customers > Credits
Purchase credits
Purchase a number of credits. This action will generate an invoice and charge the customer. Can take a few seconds to complete.
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": 24000,
"price_id": "<string>"
}'
{
"invoice_id": "<string>",
"new_credit_balance": 123
}
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Body
application/json
Credit purchase payload
The body is of type object
.
Response
201 - application/json
Invoice ID and balance after purchase
The response is of type object
.
Was this page helpful?
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": 24000,
"price_id": "<string>"
}'
{
"invoice_id": "<string>",
"new_credit_balance": 123
}
Assistant
Responses are generated using AI and may contain mistakes.