POST
/
v1
/
customers
/
{id}
/
credits
/
{productId}
/
topup
curl --request POST \
  --url https://api.hyperline.co/v1/customers/{id}/credits/{productId}/topup \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "credit_count": 32
}'
{
  "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": "<string>",
  "type": "topup",
  "source": "api",
  "amount_excluding_tax": 123,
  "credit_count": 32,
  "balance_after": 2000,
  "created_at": "2023-10-13T07:00:01.860Z",
  "updated_at": "2023-10-13T07:00:01.860Z"
}

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.

Response

201 - application/json
id
string
required

Credit transaction ID.

product_id
string | null
required

ID of the product related to the transaction.

price
object | null
required

Price details related to the transaction.

customer_id
string
required

ID of the customer related to the transaction.

payment_method_id
string | null
required

ID of the payment method related to the transaction.

invoice_id
string | null
required

ID of the invoice related to the transaction.

event_id
string | null
required

ID of the event related to the credit consumption.

type
enum<string>
required

Type of credit transaction.

Available options:
topup,
usage
source
enum<string>
required

Type of credit transaction.

Available options:
app,
portal,
api
amount_excluding_tax
number
required

Monetary amount in currency's smallest unit.

credit_count
number
required

Value of credits related to the transaction.

balance_after
number
required

Credit balance after the transaction.

created_at
string
required

Credit transaction creation date.

updated_at
string
required

Credit transaction last edition date.