Create invoice
XML: CreateInvoice · JSON: POST /invoices
Creates an invoice for a subscriber. The customer type determines the payment method: MobilePhoneCustomer (mobile carrier billing) or BankCardCustomer (card / SBP) — see the flow sections.
| Field | Type | Req. | Description |
|---|---|---|---|
ProjectID | int | Yes | Project ID |
ClientIP | string(39) | No | Subscriber IP |
MSISDN | string(20) | Yes* | Phone number (for mobile carrier billing) |
Email | string(1000) | No | User e-mail |
MerchantOrderID | string(38) | Yes | Order ID in the Merchant’s system |
CustomerPrice. | money | No | Amount including fee |
CustomerPrice. | string(3) | No | Currency (RUB by default) |
CustomerPrice. | bool | No | Amount includes VAT |
CreateIfNotExists | bool | No | Create the contract automatically (usually false) |
MerchantContractID | string(64) | No | Contract ID in the Merchant’s system |
AppName | string(256) | No | Application name |
ProductName | string(256) | No | Product name |
ExpectedBillingResult | enum | No | Sandbox: Success / Failed / SuccessSequencePayment / FailedSequencePayment |
Response
| Field | Type | Description |
|---|---|---|
InvoiceID | guid | Unique invoice ID — store it! |
MerchantOrderID | string(38) | Order ID |
InvoiceStatus | enum | Created / Billing / Processed / Cancelled / Refund |
PaymentStatus | enum | PAID / NOT_PAID / PARTLY_PAID |
AuthorizationType | enum | SMS_PIN / BY_CONTRACT / SKIP / AUTH_PAGE — see the reference |
IsAuthorized | bool | Whether authorization passed |
BillingChannel | enum | CPA / MT / MC / BankRtp etc. — see the reference |
ContractID | guid | Contract ID (if applicable) |
JSON API v3
Response (JSON)
// 201 Created — full request examples are in the flow sections
{
"success": true,
"data": {
"invoice_id": "1624505c-0031-00cf-7d54-4cf1ce08cb30",
"status": "Created",
"payment_status": "NOT_PAID",
"authorization": { "type": "BY_CONTRACT", "is_authorized": true },
"price": { "amount": "99.00", "currency": "RUB", "vat_included": true },
"merchant_order_id": "ORDER-001",
"billing_channel": "CPA"
}
}