---
title: "Create payment"
method: POST
path: "/v1/payments"
tags: ["Payments"]
---

# Create payment

`POST /v1/payments`

Initiate a new payment (limited to one-time): generate an invoice and charge it directly or with a checkout session

## Request body

- union
  - object
    - `type` 'one_time', required — Payment type. - `one_time`: One-time payment, generating one-off invoice.
    - `customer_id` string, required — ID of the customer.
    - `items` object[] — Deprecated field, please use `products`.
      - `id` string, required — Product ID.
      - `name` string — Product name. Allow to override the value from the catalog.
      - `amount` number — Product amount. Allow to override the value from the catalog. Monetary amount in currency's smallest unit.
    - `products` object[] — Products composing the related invoice.
      - `id` string, required — Product ID.
      - `name` string — Product name. Allow to override the value from the catalog.
      - `amount` number — Product amount. Allow to override the value from the catalog. Monetary amount in currency's smallest unit.
    - `purchase_order` string — Purchase order added on the generated invoice.
    - `custom_note` string — Custom note added on the generated invoice.
    - `charging_method` 'immediately', 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.
    - `payment_method_type` 'transfer' | 'external' — 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.
    - `payment_method_id` string — ID of the payment method to use to pay the invoice. Ignored if payment_method_type is specified.
  - object
    - `type` 'one_time', required — Payment type. - `one_time`: One-time payment, generating one-off invoice.
    - `customer_id` string, required — ID of the customer.
    - `items` object[] — Deprecated field, please use `products`.
      - `id` string, required — Product ID.
      - `name` string — Product name. Allow to override the value from the catalog.
      - `amount` number — Product amount. Allow to override the value from the catalog. Monetary amount in currency's smallest unit.
    - `products` object[] — Products composing the related invoice.
      - `id` string, required — Product ID.
      - `name` string — Product name. Allow to override the value from the catalog.
      - `amount` number — Product amount. Allow to override the value from the catalog. Monetary amount in currency's smallest unit.
    - `purchase_order` string — Purchase order added on the generated invoice.
    - `custom_note` string — Custom note added on the generated invoice.
    - `charging_method` 'checkout', 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_payment_methods` string[], required
    - `checkout_session` object — Only applies to `checkout` charging method.
      - `send_to` object — Details to send email to the payer receiving the checkout.
        - `email` string, email, required
        - `customMessage` string
      - `redirect_url` string, uri — URL to which Hyperline redirects the user after the completion of the checkout.

## Response `200`

The reference to the created invoice and optionally the checkout

- object
  - `invoice_id` string, required — Created invoice ID.
  - `checkout` object — Payment checkout session.
    - `id` string, required — Checkout session ID.
    - `url` string, required — URL of the hosted Hyperline checkout page. Only defined if the status is `opened`.

---

[API](https://skmtc.dev/hyperline/apis/hyperline-api.md) · [All operations](https://skmtc.dev/hyperline/apis/hyperline-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/hyperline/hyperline-api/revisions/19fa5f22e39b/schema)
