Skip to main content
Migo Docs

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​

FieldTypeRequiredNotes
amountnumberyesUp to 4 decimal places. Validated against the merchant min/max thresholds.
channelstringyesFree-form merchant tag (wa, web, pos, mobile).
clientstringyesSlug of the merchant client.
userIdstringyesExternal user identifier (phone, email, merchant-issued id).
customKeysobjectnoOptional 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 slugpaymentMethods returned (example / illustrative)
migoDeveloper["zigi","akisiQR","bamPaymentButton","quickPayQR"]

The set above is illustrative. paymentMethods reflects 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 own POST /api/v1/integrations/transactions response rather than relying on this example.

If a rail you expect is missing, contact Migo Operations to enable it for your account.

Errors​

HTTPownCodeCause
4005000Missing or invalid parameters
4002003amount outside merchant min/max
4005004Merchant client configuration not found for the given client
5002002Transaction could not be persisted

All pre-persistence validation errors (including 5000 and 5004) return HTTP 400; only 2002 (persistence failure) returns HTTP 500.

Next step​

Pick one of the returned paymentMethods and call Process payment.