Merchant guide

Routing-only

You keep your own payment gateway accounts and execute collections yourself. SwcPay only decides which gateway and MID to use for each transaction.

Website swcindia.online · Dashboard dashboard.swcindia.online · API https://api-collections.swcindia.online

What you get

ServiceWhat it does
Intelligent routingPicks a live MID + gateway from the MIDs SwcPay configured for you.
DistributionSplits volume using share % (must total 100%).
Health & circuitsAvoids gateways that are failing, over TPS, or below the SR floor.
Daily limitsCalendar day Asia/Kolkata.
Abuse filtersSame-user MID repeats, same-amount cooldown, anti-concentration.
FailoverRe-decide with excludedGateways if your PSP call never left.
Outcome learningReport SUCCESS / FAILED / TIMEOUT after you collect.
No KYCRouting-only skips KYC. SwcPay still activates the account.

SwcPay does not charge the customer, host checkout, talk to the PSP for you, send payment webhooks, refund, or settle funds.

What you cannot call

Routing-only keys cannot hit /api/v1/payments, UPI, or refunds. Those return HTTP 403. Use /api/v1/routing/** only.

Go live

  1. SwcPay onboards you as Routing-only and activates the account.
  2. Ops attaches your MIDs (internal id, gateway-provided MID, daily limit, share %).
  3. Sign in at dashboard.swcindia.online → API keys. The secret is shown once.
  4. Call decide from your server. Never put the API key in a browser app.

Live OpenAPI: https://api-collections.swcindia.online/v3/api-docs/routing-only

Authenticate

Header
X-Api-Key: {keyId}:{secret}
Content-Type: application/json

1. Decide a route

POST /api/v1/routing/decide (aliases: /payin/decide, /payout/decide)

Request
{
  "transactionRef": "ORD-10021",
  "amount": 150.00,
  "currency": "INR",
  "idempotencyKey": "ORD-10021",
  "paymentMethod": "UPI_INTENT",
  "ipAddress": "203.0.113.42",
  "customerRef": "cust_88a1",
  "customer": { "vpa": "user@okhdfcbank" }
}

Always send ipAddress and a stable customerRef so same-user rules can run.

HTTP 200 ROUTED

Use selectedGateway + gatewayProvidedMid to start the payment on your stack. Persist decisionId.

HTTP 422 REJECTED

rejectionReasonWhat to do
NO_ELIGIBLE_GATEWAYFail the order or retry later. Do not guess a gateway.
DUPLICATE_USER_MID_REQUESTAsk the customer to wait, or fail.
REPEATED_AMOUNT_GATEWAYWait or change amount context.

Rejected decides are not counted toward distribution or daily limits.

HTTP 503

Hot store down. Fail closed. Do not pick a fallback gateway yourself.

2. Execute the payment yourself

Map the gateway to your existing PSP integration. If initiation never reached the PSP, call decide again with that code in excludedGateways. Do not double-charge.

3. Report the outcome

POST /api/v1/routing/decisions/{decisionId}/outcome

Request
{ "status": "SUCCESS", "pspErrorCode": null }

status must be SUCCESS, FAILED, TIMEOUT, or PENDING. First report wins.

4. Look up a decision

GET
GET /api/v1/routing/decisions/{decisionId}
GET /api/v1/routing/decisions?transactionRef=ORD-10021

Copy-paste

curl
BASE=https://api-collections.swcindia.online/api/v1
KEY='swcpay_yourKeyId:yourSecret'

curl -sS -X POST "$BASE/routing/decide" \
  -H "X-Api-Key: $KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "transactionRef": "ORD-10021",
    "amount": 150.00,
    "currency": "INR",
    "idempotencyKey": "ORD-10021",
    "paymentMethod": "UPI_INTENT",
    "ipAddress": "203.0.113.42",
    "customerRef": "cust_88a1"
  }'

Checklist