AnyAmount Invoices
AnyAmount invoices allow the client to decide how much to pay. These are useful for donations, tips, or custom payments.
Key Differences from Regular Invoices
- Items do not require a
pricefield WrongandRefundedstatuses are not applicable (no expected amount is defined, so underpayment and refunding are impossible)- Best practice is to use only one item/service/purpose per AnyAmount invoice
Create New AnyAmount Invoice
This endpoint creates a new AnyAmount invoice under merchant's account.
POST /api/invoices/v1/unlimited
Headers
| Header | Value |
|---|---|
Content-Type | application/json |
Authorization | Bearer YOUR_PUBLIC_TOKEN |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
items | array | Yes | Item or service provided by invoice. Can contain multiple items, but best practice for AnyAmount is one item/service/purpose |
items[].name | string | Yes | Any desirable item name. Items don't require price for AnyAmount invoices as their concept is to let the client decide the amount |
isMerchantPaysFee | boolean | No | false — client pays total + fees, merchant receives full amount. true — client pays total only, merchant receives total minus fees |
paymentCurrency | string | No | Crypto asset the merchant wants to receive. If not provided or null, the client chooses |
redirectURL | string | No | URL to redirect after invoice reaches "Done" status. If null or absent, the default from Settings/Payment is used |
cURL
curl --location 'https://my.paidlys.com/api/invoices/v1/unlimited' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_PUBLIC_TOKEN' \
--data '<body>'
Body:
{
"items": [
{
"name": "Product 1"
}
],
"isMerchantPaysFee": null,
"paymentCurrency": null,
"redirectURL": "https://google.com"
}
Response
View response body
{
"id": "invoice_id",
"status": "created",
"createdAt": "YYYY-MM-DDTHH:MM:SS.000Z",
"type": "unlimited",
"company": {
"name": "%company_name",
"logoUrl": "%logo_url%",
"assets": [
{ "asset": "btc", "isAllowed": false },
{ "asset": "eth", "isAllowed": false },
{ "asset": "usdt", "isAllowed": false },
{ "asset": "sol", "isAllowed": false },
{ "asset": "ton", "isAllowed": false },
{ "asset": "usdc", "isAllowed": false },
{ "asset": "bnb", "isAllowed": false },
{ "asset": "ltc", "isAllowed": false },
{ "asset": "near", "isAllowed": false },
{ "asset": "trx", "isAllowed": false },
{ "asset": "bch", "isAllowed": false }
]
},
"invoiceContent": {
"invoiceCurrency": "eur",
"items": [
{ "name": "Product 1" }
],
"paymentCurrency": "usdc",
"isMerchantPaysFee": false,
"redirectURL": "%url_for_DONE_statused_invoices_redirection%"
}
}
Response Fields
| Field | Description |
|---|---|
id | Invoice identifier. Open on frontend: https://pay.paidlys.com/%invoice_id% |
status | Current invoice state: created, pending, processing, done, failed, expired. Note: wrong and refunded are not applicable for AnyAmount invoices |
createdAt | Invoice creation date and time |
type | Invoice type: regular, unlimited, or business |
company | Merchant's company information: name, logoUrl, assets (list of accepted assets with isAllowed flag) |
invoiceContent | Primary invoice info: items list, invoiceCurrency, paymentCurrency, isMerchantPaysFee |
redirectURL | URL for redirect after "Done" status. null means no redirect |
Fill AnyAmount Invoice with Client Info
This endpoint fills an AnyAmount invoice with client's info — email address and payment asset (if not pre-defined by merchant during creation).
POST /api/invoices/v1/unlimited/%invoice_id%/proceed
Headers
| Header | Value |
|---|---|
Content-Type | application/json |
Authorization is not required as the invoice is provided to a non-registered client.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
clientEmail | string | Yes | Client's email. Should meet standard email format |
paymentCurrency | string | Yes | Asset name + network the client wants to pay with. Values: btc, eth, trc20usdt, usdterc20, sol, ton, usdc, bnb, ltc, trx, bch. Ignored if previously provided during creation |
paymentAmount | number | Yes | Amount entered by the client as a reference of amount to be received in invoiceCurrency. Required for frontend correct work, can have any desirable value for API-only processing |
invoiceCurrency | string | No | Invoice currency for payment amount reference to be calculated. Required for frontend correct work, can be ignored for API-only processing |
cURL
curl --location 'https://my.paidlys.com/api/invoices/v1/unlimited/%invoice_id%/proceed' \
--header 'Content-Type: application/json' \
--data '<body>'
Body:
{
"paymentCurrency": "usdc",
"clientEmail": "client@example.com",
"paymentAmount": 100,
"invoiceCurrency": "eur"
}
Response
View response body
{
"id": "%invoice_id%",
"status": "%invoice_status%",
"createdAt": "YYYY-MM-DDTHH:MM:SS.000Z",
"type": "unlimited",
"company": {
"name": "%company_name%",
"logoUrl": "%logo_url%",
"assets": [
{ "asset": "btc", "isAllowed": true },
{ "asset": "eth", "isAllowed": false },
{ "asset": "usdt", "isAllowed": true },
{ "asset": "sol", "isAllowed": false },
{ "asset": "ton", "isAllowed": false },
{ "asset": "usdc", "isAllowed": false },
{ "asset": "bnb", "isAllowed": false },
{ "asset": "ltc", "isAllowed": false },
{ "asset": "near", "isAllowed": false },
{ "asset": "trx", "isAllowed": false },
{ "asset": "bch", "isAllowed": false }
]
},
"invoiceContent": {
"items": [
{ "name": "Product 1" }
],
"paymentCurrency": "trc20usdt",
"isMerchantPaysFee": false,
"paymentAmount": "100"
},
"redirectURL": "%url_for_DONE_statused_invoices_redirection%",
"clientEmail": "client_mail@service.domain",
"address": {
"id": "%payment_address_id%",
"address": "%payment_address%",
"tag": null,
"asset": "trc20usdt",
"qrCodeURL": "string link to address QR-code generated",
"qrCodeBase64": "string link to address QR-code generated in Base64"
},
"paymentDetails": {
"rate": "1.16843920",
"invoiceFee": "12.728032"
},
"expiredAt": "YYYY-MM-DDTHH:MM:SS.000Z"
}
Additional Response Fields
Fields available after the invoice is filled (not available for "Created" status):
| Field | Description |
|---|---|
clientEmail | Client's email |
address | Payment address: id, address, tag (null if not TON), asset, qrCodeURL, qrCodeBase64 |
paymentDetails.rate | invoiceCurrency → paymentCurrency exchange rate |
paymentDetails.invoiceFee | Fees in paymentCurrency |
expiredAt | Invoice expiration time. 30 min for all assets, 120 min for BTC |
Get AnyAmount Invoice Info
Use the same endpoint as Regular Invoices:
GET /api/invoices/v1/regular/%invoice_id%
See Regular Invoices — Get Invoice Info for details.