Generate settlement for merchant + period
Generates a new settlement for a merchant over a single-currency period. Aggregates payment, refund, chargeback, and fee data. To create an adjustment settlement that revises a previously finalized settlement, supply linkedSettlementId, adjustmentDirection, adjustmentAmount, and adjustmentReason.
Authorization
bearer In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
curl -X POST "https://api.miracle.com/v1/settlements" \ -H "Content-Type: application/json" \ -d '{ "merchantId": "c3073b9d-edd0-49f2-a28d-b7ded8ff9a8b", "currency": "string", "periodFrom": "string", "periodTo": "string" }'{
"data": {
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"tenantId": "f97df110-f4de-492e-8849-4a6af68026b0",
"livemode": true,
"merchantId": "c3073b9d-edd0-49f2-a28d-b7ded8ff9a8b",
"currency": "string",
"period": {
"from": "string",
"to": "string"
},
"grossVolume": {
"currency": "string",
"valueMinor": 0
},
"refundVolume": {
"currency": "string",
"valueMinor": 0
},
"chargebackVolume": {
"currency": "string",
"valueMinor": 0
},
"merchantFee": {
"currency": "string",
"valueMinor": 0
},
"feeBreakdown": {
"providerFee": {
"currency": "string",
"valueMinor": 0
},
"platformFee": {
"currency": "string",
"valueMinor": 0
},
"tenantFee": {
"currency": "string",
"valueMinor": 0
},
"partnerCommission": {
"currency": "string",
"valueMinor": 0
}
},
"rollingReserveHeld": {
"currency": "string",
"valueMinor": 0
},
"rollingReserveReleased": {
"currency": "string",
"valueMinor": 0
},
"recurrentFees": {
"currency": "string",
"valueMinor": 0
},
"adjustment": {
"currency": "string",
"valueMinor": 0
},
"adjustmentDirection": "credit",
"adjustmentReason": "string",
"netToMerchant": {
"currency": "string",
"valueMinor": 0
},
"status": "draft",
"generationMode": "automatic",
"linkedSettlementId": "a5b4ae99-b2c7-4597-bf95-7fafa4c7a116",
"createdAt": "string",
"updatedAt": "string",
"finalizedAt": "string",
"deletedAt": "string"
}
}List refunds for payment
Returns all refunds for the specified payment, most recent first. Uses cursor-based pagination — pass `cursor` from a previous response to fetch the next page. Default page size is 20, maximum 100. Returns an empty list if the payment has no refunds.
Finalize draft settlement
Finalizes the settlement, marking all linked financial statements as paid. This is an irreversible action. Once finalized, the settlement document and its fee breakdown become the official financial record for the period.