Before you start
- A Xenarch account and a wallet linked to it. Sign in with that wallet.
- The receiving wallet (
to) must be the account’s owner wallet or a full co-owner wallet. A wallet you link later can receive money 24 hours after you link it. - The wallet that signs the link must be the wallet you are signed in with. With a merchant API key, it is the account’s owner wallet.
The params tree
A link is described by aparams object. Each field is a tagged value of the form {"state": "lit", "value": ...}. Five fields are required:
Common optional fields:
The full, versioned field list is public:
The schema response includes
"max_amount_usd": "1.00". It is a display hint for clients. The create endpoint does not reject larger fixed amounts.Create with the CLI
Thexenarch CLI (npm xenarch 1.4.0) builds the params tree, validates it, signs it with your wallet and creates the link.
to, currency and network from your wallet and defaults):
--confirm, a non-interactive run prints the terms it would sign and exits without creating anything. Other commands: xenarch links list, links get <id>, links revoke <id>, links events <id>, links webhook set <id> --url <https-url>.
Create with the TypeScript SDK
createXenarch({ sessionToken, privateKey }), where sessionToken is the xen_session value and privateKey is the signing wallet’s key. create validates first and throws PayLinkValidationError when fields are missing. create and revoke require { confirm: true } unless you build the client with requireConfirm: false.
Create with the Python SDK
MerchantClient(session_token, private_key=..., api_base="https://api.xenarch.dev") takes explicit credentials instead. The Python merchant client needs Python 3.12 or later.
Create with the REST API
POST /v1/links takes the params tree plus a signature from your wallet. See Create link for the request body and the EIP-712 message to sign. Authenticate with your dashboard session or a merchant API key:
xenarch keys create. A key can call the pay link, payment and subscriber endpoints. It cannot link wallets or mint more keys.
What you get back
Digital delivery
To hand over a file after payment, pass a top-leveldownload_url in the create request (not inside params). It stays hidden until the payment is confirmed and then appears on the receipt. It must be an https URL on an allowed host, such as Google Drive, Dropbox, GitHub, Gumroad, WeTransfer, MEGA, Cloudflare R2, Amazon S3, Bunny CDN or cdn.xenarch.dev.
Manage links
GET /v1/linkslists your links. See List links.GET /v1/links/{link_id}returns one link. See Get link.DELETE /v1/links/{link_id}revokes a link. Payers can no longer pay it. Revoking is permanent.