Orders Fetch API


The following endpoint retrieves the details of all Orders created

/orders

Query Parameters

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

Fieldis required?Description
fromoptionalinteger Timestamp (in Unix format) from when the Orders should be fetched
tooptionalinteger Timestamp (in Unix format) up till when Orders are to be fetched
skipoptionalinteger The number of orders to be skipped. The default value is 0. This can be used for pagination, in combination with count
limitoptionalinteger Number of orders to be fetched. Default value is 25. This can be used for pagination, in combination with the skip parameter

Example

curl -u [Base64({Your_Server_Key}:)] \
-X GET https://api.durianpay.id/v1/orders?limit=50&skip=10 \
-H "content-type: application/json"'

Response Code : 200

Here is an example of success response

{
  orders: [{
    "id": "ord_A31sd3AwAgItmmXdp",
    "amount": "20000",
    "payment_option": "full_payment",
    "currency": "IDR",
    "status": "started",
    "order_ref_id": "order2314",
    "created_at": 1582628071,
    "metadata": []
  }, {
    "id": "ord_B14sdfwAdmmSDF24a",
    "amount": "10000",
    "payment_option": "full_payment",
    "currency": "IDR",
    "status": "started",
    "order_ref_id": "order1144",
    "created_at": 1578228010,
    "metadata": []
  }],
  total: 2
}

Error Response Code : 400

Here is an example error response for invalid request

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

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 orders",
    "error_code": "DPAY_INTERNAL_ERROR"
}