---
title: "POST /payment/invoice"
method: POST
path: "/payment/invoice"
tags: ["Invoice"]
---

# POST /payment/invoice

`POST /payment/invoice`

## Headers

- `merchant_api_key` string, required
- `Content-Type` string, required

## Request body

- object
  - `amount` number, required — The amount for the payment. If the currency field is not filled, the amount should be specified in dollars. If the `currency` field is filled, the amount should correspond to the specified currency.
  - `currency` string — Specify the currency symbol if you want the invoice amount calculated with a specific currency. You can also generate invoices in fiat currencies.
  - `lifetime` integer — Set the expiration time for the payment link in minutes.
  - `fee_paid_by_payer` number — Specify whether the payer will cover the invoice commission. 1 indicates that the payer will pay the fee, while 0 indicates that the merchant will pay the fee.
  - `under_paid_coverage` number — Specify the acceptable inaccuracy in payment. Determines the maximum acceptable difference between the requested and paid amount.
  - `to_currency` string — The currency symbol of the cryptocurrency you want to convert to. You can only convert paid crypto currencies to USDT.
  - `auto_withdrawal` boolean — 1 indicates that the received currency will be sent to the address specified in your Address List on the Settings page and 0 indicates that the amount will be credited to your OxaPay balance.
  - `mixed_payment` boolean — Specify whether the payer can cover the remaining amount with another currency if they pay less than the invoice amount. 1 allows the user to pay the remainder with a different coin, while 0 doesn't allow it.
  - `callback_url` string — The URL where payment information will be sent. Use this to receive notifications about the payment status.
  - `return_url` string — The URL where the payer will be redirected after a successful payment.
  - `email` string — Provide the payer's email address for reporting purposes.
  - `order_id` string — Specify a unique order ID for reference in your system.
  - `thanks_message` string — A thanks message that brief note displayed to the payer after a successful payment.
  - `description` string — Provide order details or any additional information that will be shown in different reports.
  - `sandbox` boolean — The sandbox field is a boolean that specifies whether the API request should operate in sandbox mode (test environment). Set it to true for testing and false for live transactions.

## Response `200`

Successful operation

- object
  - `data` object
    - `track_id` string — Unique identifier for the payment session in the OxaPay gateway. It is used to track the payment status, query details, and generate reports.
    - `payment_url` string — The URL of the payment page linked to the track ID. This link is shared with the payer to complete the payment process.
    - `expired_at` integer — The expiration timestamp (UNIX epoch) of the payment link. After this time, the link becomes invalid.
    - `date` integer — The creation timestamp (UNIX epoch) of the payment session.
  - `message` string — A message containing additional information about the result of the request.
  - `error` object, nullable — An object that provides details about any errors that occurred.
    - `type` string — Type of the error
    - `key` string — Key related to the error
    - `message` string — Error message
  - `status` integer — The status of the request response. Typically provided as a numeric code (e.g., 200 for success or other codes for errors).
  - `version` string — The version of the API being used.

## Other responses

- `400` — Bad request

---

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