xtopaydocs

Payment links

Make, change, pause and delete payment links from your server. Each is a page at xtopay.me where customers pay a set price or any amount.

Live

Payment links work through the API today, with test and live keys.

A payment link is a page at xtopay.me/<username>/<slug> where customers pay by MoMo or card: a set price, or any amount. They're the same links as in the dashboard's Payment links (see the guide). Payments through them are ordinary payments, with source.type link and the link's id.

Test links

A test key makes test links, at xtopay.me/test/<username>/<slug>. They pay through the test provider (you approve or decline the payment), don't appear in the dashboard, and email nobody. A live key makes live links, which the dashboard shows and the business is emailed about. Each key only sees its own kind. See Testing.

{
  "id": "lnk_8f3k2m9q4z7c1v5xw0bn",
  "url": "https://xtopay.me/nanaskitchen/party-pack",
  "mode": "live",
  "slug": "party-pack",
  "title": "Jollof party pack",
  "description": "Serves 10. Collect from Osu.",
  "amount_type": "fixed",
  "amount": 50,
  "min_amount": null,
  "form": {
    "email": "optional",
    "note": true,
    "note_label": "Delivery address",
    "questions": [
      {
        "id": "k3v9x2m4q8zc",
        "label": "Pick-up or delivery?",
        "type": "choice",
        "options": ["Pick-up", "Delivery"],
        "required": true
      }
    ]
  },
  "collect_email": false,
  "collect_note": true,
  "status": "active",
  "payments": 12,
  "collected": 600,
  "created_at": "2026-10-24T09:16:10Z"
}
Field
urlWhere customers pay. Share it, or turn it into a QR code
amount_typefixed (customers pay amount) or open (they type an amount, at least min_amount if set)
formWhat its page asks for besides the phone (always asked). name: required (the default), optional or skip; without one, the customer gets the name their MoMo number is registered to. email: optional, required or skip. note: a box for a note, under note_label (empty for "Note"). questions: the business's own, each text, number or choice (with options), and required or not. Their answers come with each payment as answers
collect_email, collect_noteFrom form, as links had them before it: email is required, and note is on
statusactive, or paused (not taking payments)
payments, collectedSuccessful payments through it, and what they came to (less refunds)
POST/v1/payment_links

Prop

Type

curl https://api.xtopay.co/v1/payment_links \
  -H "Authorization: Bearer sk_test_…" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Jollof party pack",
    "slug": "party-pack",
    "amount_type": "fixed",
    "amount": 50
  }'

It answers 201 with the link. An address already used by a link or page gets 409 taken.

PATCH/v1/payment_links/{id}

Send only what changes: any of the fields above, and status (active or paused) to pause or resume it. Customers who already have the link see the change straight away.

curl -X PATCH https://api.xtopay.co/v1/payment_links/lnk_8f3k2m9q4z7c1v5xw0bn \
  -H "Authorization: Bearer sk_test_…" \
  -H "Content-Type: application/json" \
  -d '{ "amount": 60, "status": "paused" }'
GET/v1/payment_links/{id}
GET/v1/payment_links

Newest first: status, page and page_size (up to 100).

DELETE/v1/payment_links/{id}
200 OK
{ "success": true, "data": { "id": "lnk_8f3k2m9q4z7c1v5xw0bn", "deleted": true } }

A deleted link stops taking payments and leaves the dashboard. Its payments stay, and its address stays reserved: anyone opening it is told it was removed, never sent to someone else's.

On this page