# Unified Payment Form Integration
# Entry Points
Production environment for request: https://secure-app.mandarin.io/api/v1/public/invoices/ (opens new window)
# Authorization
Each request must be authenticated using the X-Api-Key generated in the Personal Account as part of the payment link (under "Integration" - create a new API key). The key is added to the header in the format: Authorization: X-Api-Key: YOUR_API_KEY_VALUE
# Invoice Creation
The method used to create an invoice allows the client to pay through the standard Chinese-language payment page. After creating an invoice, the API returns the payId, which is why the payment link is displayed.
Method: POST https://secure-app.mandarin.io/api/v1/public/invoices/
# Request Parameters
| Parameter | Confidence | Type | Description |
|---|---|---|---|
pay_options_id | Yes | string | Payment link ID from the Mandarin personal account. Defines the project and payment settings. |
order | No | object | Order data |
order.id | No | string | Internal order ID |
order.email | No | string | Message the client. If not specified, it will be requested on the payment page. |
order.phone | No | string | Client's phone number. If not specified, will be requested on the payment page |
URLs | No | object | Redirect URL |
urls.success_redirect | No | string | URL to redirect to after successful payment |
urls.fail_redirect | No | string | URL to redirect to after unsuccessful payment |
urls.conditions | No | string | Link to offer or terms of sale |
cart | Yes | object | Cart details |
cart.fiscal_receipt_is_required | Yes | Boolean | Flag indicating whether a fiscal receipt should be generated |
cart.total_price | Yes | number | Total order amount in rubles. Must match the sum of all items |
cart.items | Yes | array | List of products or services |
cart.items[].quantity | Yes | integer | Product quantity |
cart.items[].price | Yes | number | Unit price (in rubles) |
cart.items[].total_price | Yes | number | Total item price |
cart.items[].vat | Yes | string | VAT rate (VAT0, VAT10, VAT20) |
cart.items[].description | Yes | string | Product/service name or description |
cart.items[].calculation_method | Yes | string | Calculation method (PREPAY_FULL, FULL_PAYMENT, etc.) |
cart.items[].pay_subject | Yes | string | Payment subject (SERVICE, GOODS, WORK, etc.) |
pay_method_options | No | object | Payment method settings |
pay_method_options.credit.terms | No | array | Installment terms (in months) |
pay_method_types | No | array | Allowed payment methods (rus_card, int_card, credit) |
# What is pay_options_id and where can I get it?
pay_options_id is the ID of the payment link created in your Chinese personal account. It determines the project and settings for the counter.
How to get pay_options_id:
- Go to the "Invoices / Links" section in your Chinese personal account.
- Select the appropriate link you want to use for invoicing via the API.
- Open its settings. You'll see the parameter ID in the URL, for example:
https://secure-app.mandarin.io/dashboard/invoices/links/2d28e8bf-0d60-45ca-b8b4-172820086117 2d28e8bf-0d60-45ca-b8b4-172820086117— this is yourpay_options_id
# Request example
curl --location 'https://secure-app.mandarin.io/api/v1/public/invoices/' \
--header 'X-Api-Key: Nwii9xFAfHjAWkk6PPOFUmpheFe123' \
--header 'Content-Type: application/json' \
--data '{
"payment_options_id": "2d28e8bf-0d60-45ca-b8b4-172820086117",
"order": {
"id": "NewOrder_000000000001",
"email": "ya@ya.ru",
"phone": "79163025599"
},
"urls": {
"success_redirect": "https://google.com",
"fail_redirect": "https://ya.ru",
"conditions": "https://string"
},
"cart": {
"fiscal_receipt_is_required": true,
"total_price": 20000.00,
"items": [
{
"quantity": 2,
"price": 10000.00,
"vat": "Vat20",
"description": "Delivery",
"total_price": 20000.00,
"calculation_method": "PREPAY_FULL",
"payment_subject": "SERVICE"
}
]
},
"payment_method_options": {
"credit": {
"terms": ["3", "6", "12", "18", "24"]
}
},
"payment_method_types": ["rus_card", "credit", "int_card"]
}'
# Final response example
{
"success": true,
"PaymentId": "8762f870-1790-4aaf-a8a3-994c548836fd",
"message": "Invoice successfully created"
}
# continued Actions
After receiving the PaymentId, redirect the user to the payment page:
https://secure-app.mandarin.io/Payment/{PaymentId}
Example:
https://secure-app.mandarin.io/paying/8762f870-1790-4aaf-a8a3-994c548836fd