POST
/
v1
/
payments
curl --request POST \
  --url https://api.hyperline.co/v1/payments \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "type": "one_time",
  "customer_id": "cus_Typ0px2W0aiEtl",
  "items": [
    {
      "id": "itm_3kXODDF42QXtnL",
      "name": "Product name",
      "amount": 24000
    }
  ],
  "products": [
    {
      "id": "itm_3kXODDF42QXtnL",
      "name": "Product name",
      "amount": 24000
    }
  ],
  "purchase_order": "<string>",
  "custom_note": "<string>",
  "charging_method": "immediately",
  "payment_method_type": "transfer",
  "payment_method_id": "pm_1ryTrMj4TTAT1N"
}'
{
  "invoice_id": "<string>",
  "checkout": {
    "id": "<string>",
    "url": "<string>"
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
Create payment payload
type
enum<string>
required

Payment type.

  • one_time: One-time payment, generating one-off invoice.
Available options:
one_time
customer_id
string
required

ID of the customer.

charging_method
enum<string>
required

Charging method.

  • immediately: Customer's payment method will be charged directly to pay the invoice.
  • checkout: Dedicated checkout page will be created for the customer to pay the invoice.
Available options:
immediately
items
object[]
deprecated

Deprecated, please use products.

products
object[]

Products composing the related invoice.

purchase_order
string

Purchase order added on the generated invoice.

custom_note
string

Custom note added on the generated invoice.

payment_method_type
enum<string>

Type of payment method to use to pay the invoice. If not specified, the payment_method_id or the default customer payment method is used.

Available options:
transfer,
external
payment_method_id
string

ID of the payment method to use to pay the invoice. Ignored if payment_method_type is specified.

Response

200 - application/json
The reference to the created invoice and optionally the checkout
invoice_id
string
required

Created invoice ID.

checkout
object

Payment checkout session.