Payment Link Quick Start
End-to-end walkthrough: the merchant backend creates a transaction, the customer pays in Migo's hosted webview, and the merchant receives the result via webhook.
ββ merchant backend βββ
β 1. POST β /transactions βββββββΊ
β (auth: token) β
β β βββββ 2. uid + URL
βββββββββββββββββββββββ
β 3. send URL to customer
βΌ
ββ customer βββββββββββββββββββββββββββββββββββ
β 4. opens the hosted webview at the URL β
β and pays there: enters card data, β
β chooses installments, completes 3DS β
ββββββββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
ββ merchant backend βββ
β 5. receives result β βββββ webhook (terminal status)
βββββββββββββββββββββββ
1. Create the transaction (merchant backend)β
The recommended path for a backend integration is POST /transactions with your merchant token in the Authorization header. Send the raw value Migo issued for your application β the raw token (no Bearer prefix) is the recommended form, though the authorizer tolerates and strips a leading Bearer if present. See Authentication.
curl -X POST https://sb-mw.migopayments.com/transactions \
-H 'Content-Type: application/json' \
-H 'Authorization: <your-sandbox-token>' \
-d '{
"amount": 125.50,
"userId": "+50212345678",
"channel": "wa",
"client": "your-client-slug",
"currency": "GTQ",
"externalId": "ORD-2026-0429-001",
"ads": []
}'
Response:
{
"uid": "trx_8f3c2b1d9e7a",
"reference": "CLIENT020007SB",
"URL": "https://sandbox.migopayments.com/?orderId=trx_8f3c2b1d9e7a"
}
URL is uppercaseThe hosted webview link is delivered in URL (capital U-R-L), not url. Parsers that destructure with const { url } = body will silently get undefined. See Create a Payment Link β response shape.
Send the value of URL to the customer (WhatsApp, SMS, email β any channel works).
Live spec entries:
POST /transactions(primary, bearer auth) Β·POST /transactions-hook(alternative, body-credential auth, CORS-enabled β see Create a Payment Link and the Sandbox cheat sheet for when to pick which).
2. The customer opens the hosted webviewβ
Migo serves the hosted webview at the issued URL. When the customer opens it, the webview resolves the client configuration and the enabled processors and renders the payment UI automatically β there is nothing for you to call here.
See Hosted webview for details.
3. The customer completes the payment in the webviewβ
Everything in this step happens inside Migo's hosted webview β the integrator does nothing here.
Inside the webview the customer:
- enters their card details in the payment form,
- chooses the number of installments,
- and confirms the payment.
If the processor requires 3D Secure, the webview presents the challenge to the customer and collects the response. Migo then tokenizes the card and charges the transaction internally; no integrator API call is involved.
See Hosted webview for how the checkout (including any 3D Secure challenge) behaves.
4. Receive the result (merchant backend)β
Migo notifies the merchant once the transaction reaches a terminal status (approved, denied, refunded, reversed). The Payment Link product uses the Merchant Generic Callback β an outbound POST from Migo to a URL you registered with support, carrying { uid, reference, status, amount, currency, ... }.
| Mechanism | Direction | When | Documentation |
|---|---|---|---|
| Merchant Generic Callback | Migo β your backend | Transaction reaches terminal status | Merchant Generic Callback |
| Processor β Migo callback | Processor β Migo (internal) | Processor confirms outcome | Inbound processor hooks |
The Generic Callback does not sign the body with HMAC β authenticity is delegated to the merchant via a static API key/header you register with Migo. See Merchant Generic Callback β Authenticating the request.
What next?β
- Create a Payment Link β full reference (request body, error codes, primary vs alternative endpoint)
- React quickstart β copy-paste form that calls
/transactionsand renders the link - Sandbox cheat sheet β base URLs, test cards, sample payloads ready to copy
- Merchant Generic Callback β receive the terminal status on your backend
- Hosted webview architecture β what happens inside the URL the customer opens
- Browse the live spec at
/api-reference/migo-api.