Mark as Settled (Sandbox)
Batch captured payments — plus optional refunds and chargebacks — into one settlement and fire PAYMENT_SETTLED, without waiting for real money movement.
Overview
Settlement is the one part of the payment lifecycle you cannot trigger yourself: it happens when money actually moves, on the bank’s schedule. That makes settlement webhook handlers and reconciliation logic awkward to test. This endpoint settles payments on demand. It applies a simulated fee schedule, creates a real settlement record, and firesPAYMENT_SETTLED exactly as production would.
How the amounts are calculated
Per payment, against the order amount:settlement_amount= Σ payment net − Σ refund amounts − Σ chargeback amountssettlement_charges= Σ platform feessettlement_gst= Σ GST
Worked example — ₹1,000 payment, ₹100 refund, ₹50 chargeback
Worked example — ₹1,000 payment, ₹100 refund, ₹50 chargeback
Side effects
Each payment in the batch getssettlement_status = SETTLED and its per-payment breakdown populated — fee, tax, net, forex rate, settlement currency — in the same shape a real settlement produces.
What each payment must satisfy
A payment is rejected unless it is:- Yours — belonging to your merchant account or one of your sub-merchants
- On the Simulator gateway
CAPTURED- Not already settled — a payment belongs to exactly one settlement
Reading validation errors
Unresolvable UIDs come back grouped by category, with the first failure in each. Empty categories return[].
Testing your settlement handler
Capture a payment
CAPTURED.Settle it
POST /pg/settlements/mark-settled/ with that payment’s UID.Receive the webhook
PAYMENT_SETTLED carrying the new settlement.Reconcile
GET /pg/settlements/{settlement_id}/ and check your records agree.settlement_amount equals the payment net minus both.
Gotchas
Amounts are strings in rupees, not integer paise
Amounts are strings in rupees, not integer paise
"941.00", not 94100. Parse as decimal — never as a float, for money.A payment can be settled only once
A payment can be settled only once
is already settled. Create a fresh payment for each settlement test.settlement_charges and settlement_gst cover payments only
settlement_charges and settlement_gst cover payments only
settlement_amount.It is a POST, despite reading like a bulk update
It is a POST, despite reading like a bulk update
POST.Related
Set Refund Status
PAYMENT_SETTLED
Authorizations
Client Application ID - Your unique application identifier used to authenticate API requests. You can find your Client ID in the Developer Settings section of the merchant dashboard.
Client Secret Key - Your secret key used alongside the Client ID for secure authentication. Keep this confidential and never expose it in client-side code. Available in the Developer Settings section of the merchant dashboard.
Merchant Identifier - The unique ID for the merchant account. This is required for PSP (Payment Service Provider) merchants who manage multiple merchant accounts. You can find merchant IDs in the Merchant Management section of the dashboard.
API Version - Specifies which version of the API to use (e.g., '1.X.X', '2.X.X', or '3.X.X'). This header allows you to control which API version your integration uses. Default version information is available in the Developer Settings.
Body
Payments to settle. Each must be CAPTURED, on the Simulator gateway, yours, and not already settled.
1Refunds to fold into the same settlement. Each debits the total at its full amount and carries no fee of its own.
Chargebacks to fold in. Same treatment as refunds.