Create alternative transaction
Open a Migo transaction tied to a merchant client and a customer. The response includes the list of alternative payment methods available for that client and the seconds remaining until the transaction expires.
POST https://mw.migopayments.com/api/v1/integrations/transactions
See the live spec entry: POST /api/v1/integrations/transactions.
Auth recap. Every call sends
Authorization: Bearer <token>. See Authentication for how to obtain and refresh the token.
Requestβ
| Field | Type | Required | Notes |
|---|---|---|---|
amount | number | yes | Up to 4 decimal places. Validated against the merchant min/max thresholds. |
channel | string | yes | Free-form merchant tag (wa, web, pos, mobile). |
client | string | yes | Slug of the merchant client. |
userId | string | yes | External user identifier (phone, email, merchant-issued id). |
customKeys | object | no | Optional metadata propagated to processors that support it. |
cURLβ
curl -X POST https://mw.migopayments.com/api/v1/integrations/transactions \
-H 'Authorization: Bearer <token>' \
-H 'Content-Type: application/json' \
-d '{
"amount": 125.5,
"channel": "wa",
"client": "migoDeveloper",
"userId": "+50212345678",
"customKeys": { "orderId": "ABC-123" }
}'
Node.jsβ
const res = await fetch('https://mw.migopayments.com/api/v1/integrations/transactions', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.MIGO_JWT}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
amount: 125.5,
channel: 'wa',
client: 'migoDeveloper',
userId: '+50212345678',
customKeys: { orderId: 'ABC-123' },
}),
});
const { data } = await res.json();
console.log(data.uid, data.paymentMethods, data.expireAt);
Sequenceβ
Merchant βββΊ Migo βββΊ response
β β
βββββββββββββββββββββββ
uid + paymentMethods + expireAt (seconds)
Responseβ
{
"success": true,
"message": "Transaction created",
"data": {
"uid": "trx_8f3c2b1d9e7a",
"paymentMethods": ["zigi", "akisiQR", "bamPaymentButton", "quickPayQR"],
"expireAt": 900
}
}
Discovering which rails are enabled for your clientβ
There is no dedicated GET /clients/{slug}/payment-methods endpoint today. The paymentMethods array returned here is the source of truth for what the merchant frontend can render β read it from the response of every POST /api/v1/integrations/transactions call. Cache it client-side at most for the expireAt window of the transaction.
| Sandbox slug | paymentMethods returned (example / illustrative) |
|---|---|
migoDeveloper | ["zigi","akisiQR","bamPaymentButton","quickPayQR"] |
The set above is illustrative.
paymentMethodsreflects the methods enabled for your account and the methods Migo supports in your country, so it can change as your configuration changes. Always read the array from your ownPOST /api/v1/integrations/transactionsresponse rather than relying on this example.
If a rail you expect is missing, contact Migo Operations to enable it for your account.
Errorsβ
| HTTP | ownCode | Cause |
|---|---|---|
| 400 | 5000 | Missing or invalid parameters |
| 400 | 2003 | amount outside merchant min/max |
| 400 | 5004 | Merchant client configuration not found for the given client |
| 500 | 2002 | Transaction could not be persisted |
All pre-persistence validation errors (including
5000and5004) return HTTP400; only2002(persistence failure) returns HTTP500.
Next stepβ
Pick one of the returned paymentMethods and call Process payment.