merce.STACK
merce.STACK
Skip to content
PricingDevelopersSecurityAbout
Log inRequest access
{}Developers
GuidesAPI referenceChangelogGet API keys →
  • Get started

    • Quickstart
    • Keys & authentication
  • Storefront

    • Products & catalog
    • Carts
    • Checkout & payment
    • Customer accounts
    • Digital products
    • Without a build step
  • Server API

    • Server API
    • Customers
    • Payment links & transactions
    • Balance & payouts
    • Classes & students
    • Node SDK
  • Events & errors

    • Webhooks
    • Errors
  • Reference

    • API reference
    • Changelog

Server API

Payment links & transactions

Ask to be paid with a link, then see whether it was.

A payment link is a hosted page for one-time payments. Mercestack creates a Bachs checkout session and redirects the payer to Bachs; payment details stay on the hosted checkout, never in your app. Available payment methods depend on the settlement currency and the Bachs corridors enabled for the platform account. When the payment is confirmed, the link's status becomes paid and payment_link.paid fires.

  1. 01

    Create a link

    Use the server API or attach a link to an invoice, order or class fee.

  2. 02

    Send the payer to checkout

    The hosted payment page is served by Bachs. Keep your Mercestack reference for the return trip.

  3. 03

    Wait for confirmation

    Use the signed Mercestack webhook or read the transaction back; a browser redirect alone is not proof of payment.

FULFILMENT

Payment status is authoritative

Verify the transaction or process payment.transaction.succeeded before granting access or shipping an order.

REFUNDS

Refunds depend on the rail

Bachs processes eligible refunds asynchronously. NGN bank-transfer collections do not support provider refunds; check the transaction's provider and status before offering one.

StatusMeans
activeNot paid yet — or, for a reusable link, still taking payments
paidPaid. A single-use link takes no further payments
inactiveSwitched off
expiredPast its expiresAt

Create a payment link

POST/v1/payment-links
Secret keypayments:write

Needs a fixed amount or an invoiceId. The currency is your workspace's.

Body

titlestringrequired
Shown to the payer.
amountstring
Major units: "25000.00".
descriptionstring
Shown under the title.
customerIduuid
Link it to a customer.
invoiceIduuid
Collect an invoice; stays open until it's settled.
expiresAtISO 8601
Stops accepting payment after this.
reusableboolean
Take any number of payments.
curl -X POST https://api.mercestack.com/v1/payment-links \
  -H "Authorization: Bearer sk_test_…" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{"title":"Deposit — order 1042","amount":"25000"}'
Response
{
  "id": "4c0a…",
  "title": "Deposit — order 1042",
  "amount": "25000.00",
  "amountMinor": "2500000",
  "currency": "NGN",
  "status": "active",
  "paid": false,
  "paidAt": null,
  "reusable": false,
  "url": "https://mercestack.com/pay/vJZKPXDrY8Ko65V8",
  "customerId": null,
  "invoiceId": null,
  "expiresAt": null,
  "createdAt": "2026-09-27T10:00:00.000Z"
}

List payment links

GET/v1/payment-links
Secret keypayments:read

Filter by status to find what's still unpaid.

Query parameters

limitinteger
How many to return, 1–100. Defaults to 25.
cursorstring
nextCursor from the previous page.
statusstring
active, paid, inactive, expired.
curl https://api.mercestack.com/v1/payment-links?status=paid \
  -H "Authorization: Bearer sk_test_…"
Response
{ "object": "list", "data": [ { "id": "4c0a…", "status": "paid", "paid": true, … } ], "hasMore": false, "nextCursor": null }

Get a payment link

GET/v1/payment-links/:id
Secret keypayments:read

Check paid before you ship.

curl https://api.mercestack.com/v1/payment-links/LINK_ID \
  -H "Authorization: Bearer sk_test_…"
Response
{ "id": "4c0a…", "status": "paid", "paid": true, "paidAt": "2026-09-27T11:20:00.000Z", … }

Deactivate a payment link

POST/v1/payment-links/:id/deactivate
Secret keypayments:write

Stops it taking payments. A paid link stays paid.

curl -X POST https://api.mercestack.com/v1/payment-links/LINK_ID/deactivate \
  -H "Authorization: Bearer sk_test_…"
Response
{ "id": "4c0a…", "status": "inactive", … }

List transactions

GET/v1/transactions
Secret keypayments:read

Every payment attempt: store orders, payment links, invoices and class fees.

Query parameters

limitinteger
How many to return, 1–100. Defaults to 25.
cursorstring
nextCursor from the previous page.
statusstring
success, failed, refunded…
emailstring
The payer's email.
paymentLinkIduuid
Payments to one link.
curl https://api.mercestack.com/v1/transactions?status=success \
  -H "Authorization: Bearer sk_test_…"
Response
{
  "object": "list",
  "data": [
    {
      "id": "a91c…",
      "reference": "ms_8Kq2…",
      "status": "success",
      "amount": "25000.00",
      "amountMinor": "2500000",
      "fees": "375.00",
      "currency": "NGN",
      "channel": "card",
      "customerEmail": "[email protected]",
      "paymentLinkId": "4c0a…",
      "invoiceId": null,
      "orderId": null,
      "paidAt": "2026-09-27T11:20:00.000Z",
      "createdAt": "2026-09-27T11:19:02.000Z"
    }
  ],
  "hasMore": false,
  "nextCursor": null
}

Get a transaction

GET/v1/transactions/:id
Secret keypayments:read

By id, or by the payment reference printed on the customer's receipt.

curl https://api.mercestack.com/v1/transactions/ms_8Kq2 \
  -H "Authorization: Bearer sk_test_…"
Response
{ "id": "a91c…", "reference": "ms_8Kq2…", "status": "success", … }
← PreviousCustomersNext →Balance & payouts

On this page

  • POSTCreate a payment link
  • GETList payment links
  • GETGet a payment link
  • POSTDeactivate a payment link
  • GETList transactions
  • GETGet a transaction
Request accessTalk to usPricing

Mercestack is the business operating system — your team, customers, store, classes and payouts in one place.

Request access

Platform

  • Overview
  • Organization & work
  • Customers, support & messaging
  • Payments, store & classes
  • Flow, AI & Marverse
  • Analytics, growth & files

Developers

  • Quickstart
  • Server API
  • Customer accounts
  • Payment links
  • Webhooks
  • Changelog

Company

  • About
  • Pricing
  • Security
  • Contact
  • Report a vulnerability

Legal

  • Privacy
  • Terms
  • Cookie policy
  • GDPR
  • Privacy contact

© 2026 Mercestack. All rights reserved.

Mercestack StructureOS

mercestack