| Permalink: |
Invoice creation
URL¶
POST https://w3s.webmoney.com/json/V1/CreateInvoice.ashx
Headers¶
Authorization: Bearer {JWT}— required JWT token (issued at https://security.webmoney.com/trustlisttokens.aspx)- Content-Type: application/json; charset=utf-8
Request body (JSON)¶
{
"reqn": 1730486400000,
"orderid": 1730486400000,
"customerwmid": "111122223333",
"amount": 0.02,
"desc": "Test invoice",
"address": "",
"period": 0,
"expiration": 0,
"onlyauth": 1,
"lmishopid": 123456
}
Field description¶
| *. Field | *. Type | Description |
|---|---|---|
| reqn | long | Request number (recommended: Unix time in ms) |
| orderid | long | Invoice ID in the merchant system |
| customerwmid | string | Payer’s WMID |
| amount | decimal | Amount (> 0) |
| desc | string | Payment description (must not be empty) |
| address | string | Address/comment (optional) |
| period | int | Protection period, days (>= 0) |
| expiration | int | Invoice expiration, days (>= 0) |
| lmishopid | long | Merchant ID (optional; if > 0 — passed explicitly) |
Notes:
- The merchant’s purse is taken from JWT and is not passed in the request body.
Example of a successful response¶
{
"reqn": 1730486400000,
"retval": 0,
"retdesc": "Ok",
"invoice": {
"id": 987654321,
"ts": 987654321,
"orderid": 1730486400000,
"customerwmid": "111122223333",
"storepurse": "Z123456789012",
"amount": 0.02,
"desc": "Test invoice",
"address": "",
"period": 0,
"expiration": 0,
"state": 0,
"datecrt": "2025-10-02T12:34:56.789Z",
"dateupd": "2025-10-02T12:34:56.789Z"
}
}
Notes on response:
datecrt/dateupd— ISO 8601, UTC.
Error examples¶
401 Unauthorized:
{
"reqn": 1730486400000,
"retval": 401,
"retdesc": "Authorization error: <description>"
}
400 Bad Request:
{
"reqn": 1730486400000,
"retval": -3,
"retdesc": "Request processing error: <description>"
}
Possible return codes¶
| *. Code | *. Description |
| 0 | Ok |
| 401 | Authorization error |
| 405 | Method not allowed (only POST) |
| -3 | Request processing error |
| ... | Other codes are described in Interface X1 |