Skip to main content
Version: 4.0.2

API Integration

Three APIs are available for merchants to retrieve and interact with settlement information.

Settlement Header API: The merchant can specify the settlement Id or give a date range to retrieve settlement header information.

Transaction API: A page/subset of transactions in a settlement will be returned based on the offset and limit parameters passed in.

Settlement Webhook: Real-time notifications are sent when settlement events occur, allowing merchants to take immediate action.

All Production API access is via

This is our primary environment.

You may also be given access to our Staging environment. If this is the case, the access URL will be different.

API Response Wrapper

Both settlement header and transactions API responses are returned in the settlement wrapper data structure.

FieldTypeDescription
statusobjectcode (string) - the result code of the request
response (string) - Status can be either Success, Fail, or other information

Example: {"code": "0","response": "Success" }
dataarrayThe settlement header or transactions payload

Status codes

CodeMeaning
0Success
429Rate limit exceeded
1000General exception
1001Access denied
1002Auth token missing or invalid
1010Not implemented
1020Missing required parameters
2001Database read error

Settlement Webhook

A settlement webhook will fire to your application as the status changes in a settlement. The status is defined by the settlement_status.status field.

You can choose which statuses should trigger a webhook call to your application. This can be configured in the Merchant Portal.

Webhook Payload Structure

FieldTypeDescription
idUUIDUnique ID for this webhook payload.
settlement_idUUIDUnique ID for the settlement.
settlement_dateISO 8601Time of the settlement.
settlement_status.statusstringThe status of the settlement. One of: settled, pending_settlement, settled_out_of_balance, validated
settlement_status.timestampISO 8601Time when the status was updated.
object_typestringSet to "webhook.settlement"
versionstringVersion of the webhook payload format.
eventstringType of event that triggered the webhook.

For more details on setting up and handling webhooks, see the Completion Notification documentation.

Settlement Header Details API

Request

Merchants can submit requests with parameters such as Date Range (startDate, endDate), and authentication credentials.

If startDate and endDate are specified, then the settlements with settlement date between the date range will be returned. e.g. if settlements on 3/Mar/2024, 4/Mar/2024 and 5/Mar/2024 will be returned if the value of startDate and endDate is "2024-03-03" and "2024-03-05" respectively.

POST /v1/merchant/settlement

note

Required Scopes: read:merchant, read:merchant:settlement

Parameters

Field IDDescription
settlementId
Optional
String
This is to retrieve a specific Settlement.
Format UUID/String
cid
Optional
Int
Company ID as optional for filtering.
chid
Optional
Int
Chain ID as optional for filtering.
mid
Optional
String
The Merchant ID.
Format UUID/String
startDate
Optional
String
The from_date denote the starting date for which multiple settlement data is to be included in the report.
Format YYYY-MM-DD
endDate
Optional
String
The End Date of the date range filter to determine the oldest date a settlement has been created.
Format YYYY-MM-DD
limit
Optional
Number
Number of settlements to show per query, default is 50
offset
Optional
Number
The number of records to offset by, default is 0

Sample request

{
"settlementId": "xxxx",
"cid": 1,
"chid": 2,
"mid": "xxxx",
"startDate": "2023-09-02",
"endDate": "2024-12-03",
"limit": 1,
"offset": 1
}

Response

200 - OK

Settlement header details are returned.

Status

KeyDescription
codeString
the result code of the request
responseString
Status can be either Success, Fail, or other information

Data

KeyDescription
settlementIdString
Settlement ID
paymentServiceString
The payment service used to obtain this data.
merchantIdString
DMG's merchant ID.
accountingTokenString
The accounting token of the payment service the settlement belongs to, also known as an entity ID. This is the same value delivered as service_id in charge webhooks — use it to attribute settlements to the correct entity when reconciling in your finance or ERP systems, particularly if you operate multiple legal entities or payment services under one merchant.
settlementStatusString
Status of the settlement, this can be settled, pending_settlement or settled_out_of_balance.
settlementDateString
Date and time of the settlement report was provided for this record, in ISO 8601 format.
amountGrossNumber
Gross settlement amount exclusive of tax in the smallest unit of the currency.
feesNumber
Fees associated to the settlement in the smallest unit of the currency.
taxNumber
Tax associated to the settlement in the smallest unit of the currency.
currencyCodeString
The currency code used in Settlement in ISO 4217 format.
amountPayInNumber
Amount to be paid into the settlement account in the smallest unit of the currency.
decimalPlacesNumber
decimal places used in order to bring to more common unit, e.g. 2 would equal 100 sub-units (e.g. cents, pence etc).
paymentEndToEndIdsString[]
Array of EndtoEndIDs value from the PAIN001 file provided at settlement processing.
paymentReferencesString[]
Array of PmtInfIDs value from the PAIN001 file provided at settlement processing.
totalTransactionsNumber
Total number of transactions for this settlement report.

Settlement Status Types

The settlementStatus field in the response can have the following values:

StatusDescription
settledThe settlement has been successfully processed and funds have been transferred.
pending_settlementThe settlement is in progress but not yet complete.
settled_out_of_balanceThe settlement has been processed but there is a discrepancy between the expected and actual amounts.
validatedThe settlement has been validated but not yet processed.

200 - Error

Settlement header details are returned.

Status

KeyDescription
codeString
The result code of the request
responseString
Status should be the error type.
messageString
The error message provided back from the API

Transaction Details API

Request

Merchants can submit requests with parameters such as settlementId, offset and limit (optional) to retrieve a subset of transactions in a settlement.

POST /v1/merchant/settlement/transactions

note

Required Scopes: read:merchant, read:merchant:settlement

Parameters

Field IDDescription
settlementIdString
The Unique Identifier of a Settlement. When this settlementIdpassed in the request, the transactions linked to this settlement will be returned.
limit
Optional
Number
The limit parameter controls the maximum number of items that may be returned for a single request. If no limit is specified, the system defaults to a limit of a default value. The maximum valid limit value is 100 which could vary depending on the solution capacity.
Default value is 50
offset
Optional
Number
The offset parameter controls the starting point within the collection of resource results. Note that the first item in the collection is retrieved by setting to 0.
Default value is 0

Sample request

{
"settlementId": "8f33a85b-bc5e-4ca8-ac66-caa1a6202c3b",
"limit": 10,
"offset": 1
}

Response

200 - OK

The response format includes structured settlement data and contain information including transaction details, settlement amounts, and timestamps.

Status

KeyDescription
codeString
the result code of the request
responseString
Status can be either Success, Fail, or other information

Data

Each entry in data is a transaction included in the settlement batch.

KeyDescription
chargeIdString
Charge ID in UUID format.
transactionIdString
Transaction ID in UUID format.
timestampString
ISO 8601 format
transactionTypeString
Type of transaction (e.g., "Purchase Transaction")
paymentTypeString
Type of payment method used (e.g., "Card Payment").
amountNumber
Transaction amount in the smallest unit of the currency.
feesNumber
Fees associated to the transaction in the smallest unit of the currency.
taxNumber
Tax associated to the fees in the smallest unit of the currency.
decimalPlacesString
Decimal places used to interpret monetary amounts. For example, 2 means the amount is in sub-units (e.g. cents, pence).
currencyCodeString
The currency of the transaction in ISO 4217 format.
stateString
The state of the transaction (e.g., "Approved").
orderIdString
Order ID in UUID format.
notesArray of {key, value} objects
Merchant-defined key-value pairs captured against this transaction. Used to carry merchant references (e.g. merchant_order_ref, merchant_customer_ref) for reconciliation; not used operationally by DMG.
settlementIdString
The settlement batch UUID this transaction belongs to.

200 - Error

Settlement header details are returned.

Status

KeyDescription
codeString
the result code of the request
responseString
Status should be the error type.
messageString
The error message provided back from the API