Shopeepay

DOKU has partnered with various e-money providers and one of them is ShopeePay to provide E-Money Payment. Learn more about how DOKU can help you integrate with ShopeePay here.

ShopeePay only compatible for Mobile Integration

ShopeePay integration is app-to-app redirection meaning that it will only available for mobile users


Integration steps

Here is the overview of how to integrate with ShopeePay:

  1. Setup Return URL

  2. Create order

  3. Redirect to ShopeePay payment page to complete the payment

  4. Acknowledge payment result

ShopeePay Sequence Diagram


1. Setup Return URL

Based on the flow, the customers will redirected back to your site after completing the payment on ShopeePay application. Therefore, please setup the return URL:

  1. Go to Configuration > E-Money

  2. Click Configure button on ShopeePay channel

  3. Input the Payment Return URL

  4. Click Save button

2. Create order

To create an order, you will need to hit this API through your Backend:

API Request

Here is the sample of request header to create an order:

Client-Id: MCH-0001-10791114622547
Request-Id: 24bb5232-3fe6-47a5-b0b0-d0fc3c6b5fdb
Request-Timestamp: 2020-08-11T08:45:42Z
Signature: HMACSHA256=vl9DBTX5KhEiXmnpOD0TSm8PYQknuHPdyHSTSc3W6Ps=

Request Header Explanation

Here is a sample of request body to create an order:

{
    "order": {
        "invoice_number": "INV-20210124-0001",
        "amount": 150000,
        "callback_url": "https://merchant.com/return-url",
        "expired_time": 300
    }
}

Request Body Explanation

API Response

After hitting the above API request, DOKU will give the response.

Client-Id: MCH-0001-10791114622547
Request-Id: 24bb5232-3fe6-47a5-b0b0-d0fc3c6b5fdb
Response-Timestamp: 2021-07-09T02:05:14Z
Signature: HMACSHA256=9UPUFzOqJc47aJzD9ESOTcWg6TMsg3mqSP+DnUO8ENE=

Response Header Explanation

Here is the sample of response body:

{
    "order": {
        "invoice_number": "INV-20210124-0001",
        "amount": 150000
    },
    "shopeepay_configuration": {
        "merchant_ext_id": "846609710695590",
        "store_ext_id": "99012984"
    },
    "shopeepay_payment": {
        "redirect_url_app" : "merchant://main?apprl=%2Frn%2FTRANSFER_PAGE%3Fnavigate_url%3Dhttps%253A%252F%252Fwallet.airpay.co.id%252Fwallet%252Fpay%253Ftoken%253D{paymentToken}",
        "redirect_url_http": "https://wallet.airpay.co.id/universal-link/wallet/pay?de ep_and_deferred=1&token=5a10f3bc-f555-4c92-8339-10421c09264a",
        "status": "SUCCESS"
    }
}

Response Body Explanation

2. Redirect to ShopeePay payment page to complete the payment

  1. ShopeePay will display the order details in the Shopee App

  2. Customer will check the payment amount and input ShopeePay PIN / Biometrics to complete the payment

  3. ShopeePay returns the transaction result and the user is redirected to payment successful page. From the payment success page in ShopeePay, user can jump back to the Merchant's app using the ​return_url​ to view their order status.

3. Acknowledge payment result

DOKU will send HTTP Notification to your defined Notification URL. Learn how to handle the notification from DOKU:


Additional features

We provide various addtional features to suited your needs. Learn more here.

Online Refund

To request a refund, you will need to hit this API through your backend:

API Request

Here is the sample of request header to generate payment URL:

Client-Id: MCH-0001-10791114622547
Request-Id: 6cc9f8b1-d83d-4c24-b853-a3223f43a744
Request-Timestamp: 2020-08-12T09:45:42Z
Signature: HMACSHA256=9UPUFzOqJc47aJzD9ESOTcWg6TMsg3mqSP+DnUO8ENE=

Request Header Explanation

Here is the sample request body to request a refund:

{
    "order": {
        "invoice_number": "MINV20201231468"
    },
    "shopeepay_payment": {
        "identifier": [
            {
                "name": "PAYMENT_REFERENCE_ID",
                "value": "REF-12345678"
            }
            {
                "name": "TRANSACTION_SN",
                "value": "000000012345678"
            }
        ]
    }
}

Request Body Explanation

API Response

After hitting the above API request, DOKU will give the response.

Here is the sample response header:

Client-Id: MCH-0001-10791114622547
Request-Id: 6cc9f8b1-d83d-4c24-b853-a3223f43a744
Response-Timestamp: 2020-08-11T08:45:42Z
Signature: HMACSHA256=1jap2tpgvWt83tG4J7IhEwUrwmMt71OaIk0oL0e6sPM=

Response Header Explanation

Here is the sample of response body :

{
    "service": {
        "id": "EMONEY”
    },
    "acquirer": {
        "id": "SHOPEE_PAY”
    },
    "channel": {
        "id": "EMONEY_SHOPEE_PAY”
    },
    “order”: {
        "invoice_number":"MINV20201231468",
        "amount":150000
    },
    "transaction": {
        "status": "REFUNDED”,
        "date": "2020-08-11T08:45:42Z",
        "original_request_id": "asdak1238912381"
    },
    "refund”: {
        "status": "SUCCESS",
        "date": "2020-08-11T08:45:42Z",
        "original_request_id": "asdak1238912381"
    },
    "additional_info": {
    },
    "shopeepay_configuration": {
        "merchant_ext_id": "846609710695590,
        "store_ext_id”: "99012984”
    },
    "shopeepay_payment": {
        "identifier": [
            {
                "name": "PAYMENT_REFERENCE_ID”,
                "value": "REF-12345678
            },{
                "name": "TRANSACTION_SN”,
                "value": "000000012345678
            },{
                "name": "USER_ID_HASH”,
                "value": "dhfas0yd0ayf0sadf7nys0af0san7
            },
        ],
        "transaction_status”: "3”,
        “transaction_message”: “Transaction successful”
    },
    "shopeepay_refund”: {
        "identifier": [
            {
                "name": "PAYMENT_REFERENCE_ID”,
                "value": "REF-12345678”
            },{
                "name": "TRANSACTION_SN”,
                "value": "000000012345678”
            },{
                "name": "USER_ID_HASH”,
                "value": "dhfas0yd0ayf0sadf7nys0af0san7”
            },
        ],
        "transaction_status”: "3”,
        “transaction_message”: “Transaction successful”
    }
}

Response Body Explanation

Split Settlement

If you are a platform or a marketplace, you can use this feature to settle the funds to your sellers or partners programmatically, save many operational efforts.

Last updated