Skip to main content
POST
/
v1
/
customers
/
{id}
/
credits
/
{productId}
/
usage
Create credits usage
curl --request POST \
  --url https://api.hyperline.co/v1/customers/{id}/credits/{productId}/usage \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "usage_retained": 41,
  "event_id": "<string>"
}'
{
  "id": "cdt_BPZ19obsBS2qyo",
  "product_id": "itm_3kXODDF42QXtnL",
  "price": {
    "id": "pri_0Jv8EbMDOGsHcn",
    "amount": 20000,
    "pack_size": 120
  },
  "customer_id": "cus_Typ0px2W0aiEtl",
  "payment_method_id": "pm_1xMpj5bwRqN7LM",
  "invoice_id": "inv_1eTaiytfA0i2Va",
  "event_id": null,
  "expires_at": null,
  "type": "topup",
  "source": "api",
  "amount_excluding_tax": 123,
  "credit_count": 32,
  "balance_after": 2000,
  "created_at": "2024-10-13T07:00:01.860Z",
  "updated_at": "2024-10-13T07:00:01.860Z"
}

Authorizations

Authorization
string
header
required

Path Parameters

id
string
required
productId
string
required

Body

application/json
usage_retained
number
required
Required range: x > 0
Example:
event_id
string

Response

201 - application/json
id
string
required
Example:
product_id
string | null
required
Example:
price
object | null
required
Example:
customer_id
string
required
Example:
payment_method_id
string | null
required
Example:
invoice_id
string | null
required
Example:
event_id
string | null
required
Example:
expires_at
string<date> | null
required
Example:
type
enum<string>
required
Available options:
topup,
usage,
expiration
Example:
source
enum<string>
required
Available options:
app,
portal,
api,
system
Example:
amount_excluding_tax
number | null
required
credit_count
number
required
Example:
balance_after
number
required
Example:
created_at
string<date-time>
required
Example:
updated_at
string<date-time>
required
Example: