Skip to main content
Migo Docs

Costa Rica — integration recipes

The rail wired on the alternative-payments /payments endpoint for Costa Rica is QuickPay QR.

Setup (do this once)

All recipes assume the variables below. Set them in your shell before running any curl. The host (sb-mw.migopayments.com) and the path (/api/v1/integrations/...) are the public sandbox reachable by external integrators. The Alternative Payments routes accept the long-lived 64-char merchant token as a Bearer token — see Authentication → Header format by endpoint.

export MIGO_BASE="https://sb-mw.migopayments.com"
export MIGO_CLIENT="<your-client-slug>"
export MIGO_TOKEN="<your-64-char-merchant-token>" # 64 hex chars
export MIGO_USER_ID="+50600000000"

export UID=$(
curl -s -X POST "$MIGO_BASE/api/v1/integrations/transactions" \
-H "Authorization: Bearer $MIGO_TOKEN" \
-H "Content-Type: application/json" \
-d "{
\"amount\": 250000,
\"channel\": \"web\",
\"client\": \"$MIGO_CLIENT\",
\"userId\": \"$MIGO_USER_ID\",
\"customKeys\": { \"orderId\": \"recipe-test\" }
}" | jq -r '.data.uid'
)

Inspect the returned paymentMethods to confirm which rails your client has enabled (resolved at runtime from clientConfig.processors).


QuickPay QR (quickPayQR)

Country: Costa Rica (also GT, SV, HN) · Type: Interbank QR aggregator · Pre-call payment-intents: No · Response payload: json.

curl -X POST "$MIGO_BASE/api/v1/integrations/transactions/$UID/payments" \
-H "Authorization: Bearer $MIGO_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "processor": "quickPayQR", "data": {} }'

Response — the type and data come straight from the processor's paymentRequest:

{
"success": true,
"message": "Success",
"data": {
"transaction_id": "…",
"type": "<paymentRequest.type>",
"data": "<paymentRequest.data>",
"cancelAt": null
}
}

quickPayQR supports revert via POST $MIGO_BASE/revert with body {"transactionUid":"$UID","processor":"quickPayQR"} (JWT-Bearer scheme, separate from this merchant-token surface).

Done checklist

  • QR payload rendered from data.data.
  • Webhook arrives after scan.

Common errors across rails

The alternative-payments middleware raises 4-digit own-codes (not the ALI Gateway 7xxx catalog):

HTTPown-codeWhen
4005000Missing/invalid params (amount, channel, client, userId, customKeys, or processor)
400processor not allowed for this client
4005004Client config not found
4002002Transaction create failed
4002003Amount outside the allowed range

Final checklist

  • Merchant token sent as Authorization: Bearer $MIGO_TOKEN; transaction created.
  • Each available rail above tested in sandbox.