Settlements Fetch API


The following endpoint retrieves the list of all Settlements for a particular merchant

/settlements

Query parameters

Following are the parameters to be sent in the request body:

Fieldis required?Description
fromoptionalDate Date in YYYY-MM-DD format from when the settlements should be fetched
tooptionalDate Date in YYYY-MM-DD format up till when settlements are to be fetched
skipoptionalinteger The number of settlements to be skipped. The default value is 0. This can be used for pagination, in combination with count
limitoptionalinteger Number of settlements to be fetched. Default value is 10, Max value is 100. This can be used for pagination, in combination with the skip parameter

Example

curl --location --request GET 'https://api.durianpay.id/v1/settlements?limit=1&skip=1&from=2020-07-13&to=2021-07-13' \
--header 'Authorization: <SECRET KEY>'

Response Code : 200

Here is an example of success response

{
  "total_count": 1,
  "settlement_detail": [
    {
      "id": "set_WDizQUoyWy1234",
      "settlement_amount": "20000.00",
      "status": "settled",
      "fee": "200.00",
      "promo_amount": "",
      "total_transcation_amount": "20200.00",
      "created_at": "2021-05-17T08:30:56.73529Z",
      "settled_at": "2021-05-17T08:32:00.628182Z",
      "currency": "IDR"
    }
  ]
}

Error Response Code : 400

Here is an example error response for invalid request

{
    "error": "invalid skip and limit parameter",
    "error_code": "DPAY_INVALID_REQUEST"
}

Error Response Code : 401

Here is an example error response for unauthorized access

{
    "error": "invalid Authorization header in request",
    "error_code": "DPAY_UNAUTHORIZED_ACCESS"
}

Error Response Code : 500

Here is an example error response for internal server error

{
    "error": "error getting settlement",
    "error_code": "DPAY_INTERNAL_ERROR"
}