Skip to main content

Invoices & Payment Links

The Morph Payments API exposes two endpoints for collecting a payment:

  • Create Payment Link — a shareable checkout URL for a fixed amount.
  • Create Invoice — a payment link plus payer details, a due date, and optional line items.

All requests must be authenticated with your API Key. The gateway resolves your merchant identity from the API Key, so you do not send merchant_id in the body or query — it is ignored if present.

Base URL

https://pay-openapi.morph.network/pro/merchant/payin/v1

Endpoint paths in this page are relative to that base URL.

Response envelope

Every response is wrapped in a common envelope:

{
"error_code": 0,
"msg": "success",
"data": {},
"trace": "..."
}
note

Business success or failure is determined by error_code (error_code == 0 means success), not by the HTTP status code alone. See the Error Codes reference for the full list.

Validation rules

Before a payment resource is created, the request is validated. If any check fails, the corresponding error code is returned and nothing is created:

  1. Receiving token & chain(receiving_network, receiving_token_symbol, receiving_token_address) must match a supported, active entry in the Supported Tokens & Networks list. An unsupported chain returns 90111; a token that does not match the chain returns 90120.
  2. Receiving walletreceiving_address must be a receiving wallet you have configured at https://account.morph.network/ under your merchant account, and it must be bound to receiving_network. An address that is not yours returns 90112; a wallet not bound to that chain returns 90111.
  3. Allowlistsupport_networks and support_tokens are required. Each support_tokens[] entry must also match the supported list. The allowlist must include the primary receiving token, and support_networks must equal the deduplicated set of support_tokens[].network.
POST /payment-links

Request fields

FieldTypeRequiredDescription
amountstringYesPayment amount.
receiving_networkstringYesPrimary receiving chain.
receiving_token_symbolstringYesPrimary receiving token symbol.
receiving_token_addressstringYesPrimary receiving token contract address.
receiving_addressstringYesReceiving address — must be a wallet configured at account.morph.network and bound to the chain.
descriptionstringNoDescription.
support_networksstring[]YesAllowlisted chains for the payment.
support_tokensobject[]YesAllowlisted tokens (network / address / symbol).

Request example

{
"amount": "100.00",
"receiving_network": "morph",
"receiving_token_symbol": "USDT",
"receiving_token_address": "0xe7cd86e13ac4309349f30b3435a9d337750fc82d",
"receiving_address": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e",
"description": "July subscription",
"support_networks": ["morph"],
"support_tokens": [
{
"network": "morph",
"address": "0xe7cd86e13ac4309349f30b3435a9d337750fc82d",
"symbol": "USDT"
}
]
}

Success response

{
"error_code": 0,
"msg": "success",
"data": {
"payin_id": "plink_01HXXX",
"payment_link_url": "https://pay.example.com/paylink/eyJ...",
"status": "ACTIVE"
},
"trace": "..."
}

Create Invoice

POST /invoices

An invoice takes every Payment Link field plus the invoice-specific fields payer, due_date, and items.

Request fields

FieldTypeRequiredDescription
amountstringYesPayment amount.
receiving_networkstringYesPrimary receiving chain.
receiving_token_symbolstringYesPrimary receiving token symbol.
receiving_token_addressstringYesPrimary receiving token contract address.
receiving_addressstringYesReceiving address — must be a wallet configured at account.morph.network and bound to the chain.
descriptionstringNoDescription.
support_networksstring[]YesAllowlisted chains for the payment.
support_tokensobject[]YesAllowlisted tokens (network / address / symbol).
payerobjectYesPayer information.
payer.namestringYesPayer name.
payer.emailstringNoValid email address.
due_dateint64YesInvoice due time (Unix millisecond timestamp).
itemsobject[]NoInvoice line items.
items[].namestringYesItem name.
items[].quantityint64YesQuantity, > 0.
items[].unit_pricestringYesUnit price.
note

Only name, quantity, and unit_price are read from each items[] entry; any other fields are discarded.

Request example

{
"amount": "299.00",
"receiving_network": "morph",
"receiving_token_symbol": "USDT",
"receiving_token_address": "0xe7cd86e13ac4309349f30b3435a9d337750fc82d",
"receiving_address": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e",
"description": "Annual plan",
"payer": {
"name": "Jane Doe",
"email": "[email protected]"
},
"due_date": 1782777600000,
"items": [
{
"name": "Annual plan",
"quantity": 1,
"unit_price": "299.00"
}
],
"support_networks": ["morph"],
"support_tokens": [
{
"network": "morph",
"address": "0xe7cd86e13ac4309349f30b3435a9d337750fc82d",
"symbol": "USDT"
}
]
}

Success response

{
"error_code": 0,
"msg": "success",
"data": {
"invoice_id": "INV-2026-0042",
"checkout_url": "https://pay.example.com/checkout/eyJ...",
"status": "Pending",
"due_date": 1782777600000
},
"trace": "..."
}