Initiate refunds via Merchant Portal

PortOne also provides refund functionality through its dashboard, allowing merchants to create and manage refunds directly within the interface. The workflow below illustrates the refund process via the PortOne dashboard.


Initiating refund via API

PortOne also provides refund APIs, allowing merchants to create and retrieve refunds directly, without needing to access the PortOne dashboard. The sequence diagram below demonstrates the refund process using the API.

Steps to generate refund via API

  • The user requests a refund from the Merchant
  • The merchant (front) sends the refund request to the Merchant (Backend).
  • The merchant (Backend) calls the PortOne Server to process the refund.
  • PortOne Server processes the refund with the PSP Server and updates the refund details.
  • PortOne Server sends a response and a webhook to the Merchant (Backend).
  • The merchant (Backend) verifies the webhook, acknowledges it, and uses the refund details

Create Refund API

POST /api/refund/:portone_order_ref

Creates a new refund against given orderId and returns all refund.

Create Refund

Request Payload

{
  "amount": 700000,
  "channel": "MOMOPAY",
  "description": "momo refund",
  "refund_type": "partial",
  "refund_reason": "customer request",
  "environment": "live"
}

Response:

{
    "amountToRefund": 100000,
    "refundDetails": [
        {
            "refund_date": "2021-07-08T23:58:05.190121+05:30",
            "refund_id": "508e2ee9a010166",
            "psp_refund_id": "2542509707",
            "amount": 200000,
            "currency": "usd",
            "refund_status": "SUCCESS",
            "refund_type": "partial",
            "refund_reason": "customer request"
        },
        {
            "refund_date": "2021-07-08T23:59:08.442882+05:30",
            "refund_id": "508e30f1d010166",
            "psp_refund_id": "2542509711",
            "amount": 700000,
            "currency": "usd",
            "refund_status": "SUCCESS",
            "refund_type": "partial",
            "refund_reason": "customer request"
        }
    ]
}

Get All Refunds API

GET /api/refund/:portone_order_ref

Get all refund transactions against an orderId, this request doesn't require any payload.

Fetch Refunds List

Response:

{
    "amountToRefund": 100000,
    "refundDetails": [
        {
            "refund_date": "2021-07-08T23:58:05.190121+05:30",
            "refund_id": "508e2ee9a010166",
            "psp_refund_id": "2542509707",
            "amount": 200000,
            "currency": "usd",
            "refund_status": "SUCCESS",
            "refund_type": "partial",
            "refund_reason": "customer request"
        },
        {
            "refund_date": "2021-07-08T23:59:08.442882+05:30",
            "refund_id": "508e30f1d010166",
            "psp_refund_id": "2542509711",
            "amount": 700000,
            "currency": "usd",
            "refund_status": "SUCCESS",
            "refund_type": "partial",
            "refund_reason": "customer request"
        }
    ]
}