Refund Fetch by ID API


The following endpoint retrieves the details of a single refund

/refunds/:id

Path parameters

Fieldis required?Description
idmandatorystring Unique identifier of the Refund to be retrieved

Example

curl -X GET \
  https://api.durianpay.id/v1/refunds/rfn_Ct2uKVFwts5080 \
  -H 'authorization: [Base64({Your_Server_Key}:)]' \
  -H 'content-type: application/json' \

Response Code : 200

Here is an example of success response

{
  "data": {
    "id": "rfn_lCs4X0M9gB0135",
    "ref_id": null,
    "amount": "10000.00",
    "refund_type": "partial",
    "status": "approved",
    "created_at": "2021-06-29T15:43:49.998179Z",
    "updated_at": "2021-06-29T15:43:54.634024Z",
    "approved_at": "2021-06-29T15:43:54.634024Z",
    "source": "api",
    "customer_id": "cus_0lyb30V7O16812",
    "customer_name": "John Doe",
    "customer_email": "john@doe.com",
    "customer_phone": "0812778161"
  }
}

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