API Reference
DOKU DocsChangelogDOKU Github
  • Getting Started with DOKU API
    • User Registration
    • Idempotency Request
    • Notification
      • Setup Notification URL
      • HTTP Notification Sample for SNAP
      • HTTP Notification Sample - Non SNAP
      • Best Practice
      • Retry Notification
      • Override Notification URL
    • Signature Component
      • Non-SNAP
        • Signature Component from Request Header
        • Signature Componen from Response Header
        • Signature from API Get Method
        • Sample Code
      • SNAP
        • Symmetric Signature
        • Asymmetric Signature
    • Response Code
      • HTTP Status and Case Code
    • Check Status API
      • Non-SNAP
      • SNAP
    • Retrieve Payment Credential
  • Accept Payment
    • DOKU Checkout
      • Integration Guide
        • Backend Integration
        • Frontend Integration
        • Simulate payment and Notification
      • Supported Payment Methods
      • Status Order
      • Additional Feature
        • Tokenization
        • Promo on DOKU Checkout Page
        • Track Campaign Source on Google Analytics
      • Checkout Settings
    • Direct API
      • Non-SNAP
        • Cards
          • Payment Page Integration Guide
          • Host-To-Host Integration Guide
          • Mastercard Automatic Billing Updater (ABU) Integration Guide
            • Backend Integration
        • e-Wallet
          • Overview
          • DOKU e-Wallet
          • OVO Push Payment
          • ShopeePay
          • LinkAja
        • Paylater
          • Akulaku
          • Kredivo
          • Indodana
        • Digital Banking
          • Jenius Pay
        • Convenience Store
          • Alfa Group
          • Indomaret
      • SNAP
        • Integration Guide
          • Get Token API
            • B2B
            • B2B2C
          • Virtual Account
            • CIMB Virtual Account
            • BSI Virtual Account
            • BCA Virtual Account
            • BNC Virtual Account
            • BNI Virtual Account
            • Mandiri Virtual Account
            • BRI Virtual Account
            • BTN Virtual Account
            • Permata Virtual Account
            • Danamon Virtual Account
            • BSS Virtual Account
          • E-Wallet
            • DOKU Wallet
            • DANA
            • OVO
            • ShopeePay
          • Direct Debit
            • Allo Bank Direct Debit
            • BRI Direct Debit
            • CIMB Direct Debit
            • Mandiri Direct Debit
          • Kartu Kredit Indonesia Cepat Secure(KKI CPTS)
            • Host to Host Integration
          • QRIS
    • Finance and Settlement
      • Split Settlement
      • Custom Settlement Report
      • Hold and Release Settlement
      • Bulk Registration Bank
    • Test on DOKU Demo Site
    • DOKU Payment Simulator
  • Developer Kit
    • Postman Collection
    • Libraries and SDK
  • Wallet As A Service
    • Sub Account
  • Partnership
    • Partner API
      • Check Requirements API
      • Generate Token API
      • Upload File API
      • Business Registration API
      • Create Business Lite API
      • Get Business Data API
  • Payout
    • Kirim DOKU
  • FLEXIBILL
    • Account Billing
      • Batch Upload
    • DOKU Biller
      • Response Code
      • Samples
  • PAYCHAT API
    • Send WhatsApp Message
  • Archive
    • Non-SNAP
      • Tokenization V1
      • e-Wallet
        • OVO Recurring
        • OVO Open API
    • SNAP
      • Virtual Account
        • BCA v1.0
        • BRI v1.0
        • BNI v1.0
        • BNC v1.0
        • Mandiri v1.0
        • BTN v1.0
        • Permata v1.0
        • Danamon Virtual Account
      • e-Wallet
        • OVO Open API
        • DANA
        • ShopeePay
      • Direct Debit
        • CIMB Direct Debit
        • BRI Direct Debit
        • Allobank
Powered by GitBook

DOKU API

  • Legacy Documentation
On this page
  • Integration steps
  • Additional features

Was this helpful?

  1. Accept Payment
  2. Direct API
  3. Non-SNAP
  4. e-Wallet

ShopeePay

PreviousOVO Push PaymentNextLinkAja

Last updated 5 months ago

Was this helpful?

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

Type
Value

HTTP Method

POST

API endpoint (Sandbox)

https://api-sandbox.doku.com/shopeepay-emoney/v2/order

API endpoint (Production)

https://api.doku.com/shopeepay-emoney/v2/order

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

Parameter
Description

Client-Id

Client ID retrieved from DOKU Back Office

Request-Id

Unique random string (max 128 characters) generated from merchant side to protect duplicate request

Request-Timestamp

Timestamp request on UTC time in ISO8601 UTC+0 format. It means to proceed transaction on UTC+7 (WIB), merchant need to subtract time with 7. Ex: to proceed transaction on September 22th 2020 at 08:51:00 WIB, the timestamp should be 2020-09-22T01:51:00Z

Signature

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
    },
    "additional_info": {
        "override_notification_url": "https://another.example.com/payments/notifications"
    }
}

Request Body Explanation

Parameter
Type
Mandatory
Description

order.invoice_number

string

Mandatory

Generated by merchant to identify the order and must unique per request Allowed chars: alphabetic, numeric, special chars Max length: 64

order.amount

number

Mandatory

In IDR currency and without decimal Allowed chars: numeric Max length: 12

order.callback_url

string

Mandatory

Merchant URL that will redirected to after the order completed

order.expired_time

number

Optional

Order expired time. Input value in seconds.

  • If the value is set to be > max value, the request will not be successful

  • If the value is still set to be > max value, DOKU will rewrite the value to be max value

  • If this parameter is not filled, the default value will be applied

1. Max Value: 86400 2. Recommended Value: 180 to 300 3. Default Value: 300

additional_info.override_notification_url

string

Optional

API Response

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

Type
Value

HTTP Status

200

Result

SUCCESS

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

Parameter
Description

Client-Id

Same as the request

Request-Id

Same as the request

Response-Timestamp

Timestamp Response on UTC with format ISO8601 UTC+0 from DOKU

Signature

Signature generated by DOKU based on the response body

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"
    },
    "additional_info": {
        "override_notification_url": "https://another.example.com/payments/notifications"
    }
}

Response Body Explanation

Parameter
Type
Mandatory
Description

order.invoice_number

string

Mandatory

Same as the request

order.amount

number

Mandatory

Same as the request

shopeepay_configuration.merchant_ext_id

string

Optional

Merchant identifier by ShopeePay Max length: 15 Allowed chars: alphabetic, numeric

shopeepay_configuration.store_ex_id

string

Optional

Store identifier by ShopeePay Max length: 8 Allowed chars: alphabetic, numeric

shopeepay_payment.redirect_url_http

string

Conditional

Universal link to ShopeePay payment page

shopeepay_payment.status

string

Mandatory

Status of the create order request Possible value: SUCCESS, FAILED. If FAILED, initiate new order

additional_info.override_notification_url

string

Optional

Same as the request

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

Type
Value

HTTP Method

POST

API endpoint (Sandbox)

https://api-sandbox.doku.com/shopeepay-emoney/v2/refund

API endpoint (Production)

https://api.doku.com/shopeepay-emoney/v2/refund

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

Parameter
Description

Client-Id

Client ID retrieved from DOKU Back Office

Request-Id

Unique random string (max 128 characters) generated from merchant side to protect duplicate request

Request-Timestamp

Timestamp request on UTC time in ISO8601 UTC+0 format. It means to proceed transaction on UTC+7 (WIB), merchant need to subtract time with 7. Ex: to proceed transaction on September 22th 2020 at 08:51:00 WIB, the timestamp should be 2020-09-22T01:51:00Z

Signature

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

Parameter
Type
Mandatory
Description

order.invoice_number

string

Mandatory

Invoice number of the transaction that being refunded

shopeepay_payment.identifier

Array

Mandatory

Get from payment notification response

API Response

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

Type
Value

HTTP Status

200

Result

SUCCESS

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

Parameter
Description

Client-Id

Same as the request

Request-Id

Same as the request

Response-Timestamp

Timestamp Response on UTC with format ISO8601 UTC+0 from DOKU

Signature

Signature generated by DOKU based on the response body

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

Parameter
Type
Mandatory
Description

service.id

string

Mandatory

Same as the request

acquirer_id

string

Mandatory

Same as the request

channel.id

number

Mandatory

Same as the request

order.invoice_number

string

Mandatory

Merchant invoice number, must unique per request per merchant

order.amount

number

Mandatory

Amount per request per merchant

transaction.status

string

Mandatory

Transaction status Possible value: REFUNDED, SUCCESS, FAILED

transaction.date

string

Mandatory

Time Stamp request on UTC time in ISO8601 format

transaction.original_request_id

string

Mandatory

Request Id from create order request

refund.status

string

Mandatory

Refund status Possible value: SUCCESS, FAILED

refund.date

string

Mandatory

Time Stamp request on UTC time in ISO8601 format

refund.original_request_id

string

Mandatory

Request Id from create order request

additional_info

string

Mandatory

Additional info

shopeepay_configuration.merchant_ext_id

string

Mandatory

Merchant identifier

shopeepay_configuration.store_ext_id

string

Mandatory

Merchant identifier

shopeepay_payment.identifier

string

Mandatory

Transaction data identifier

shopeepay_payment.transaction_status

string

Mandatory

Transaction data status

shopeepay_payment.transaction_message

string

Mandatory

Transaction message description

shopeepay_refund.identifier

string

Mandatory

Refund data identifier

shopeepay_refund.transaction_status

string

Mandatory

Refund data status

shopeepay_refund.transaction_message

string

Mandatory

Refund message description

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.

Login to

Security parameter that needs to be generated on merchant Backend and placed to the header request to ensure that the request is coming from valid merchant. Please refer to to generate the signature

This parameter is intended to override the configured Notification URL with another URL. Click for more information.

Security parameter that needs to be generated on merchant Backend and placed to the header request to ensure that the request is coming from valid merchant. Please refer to to generate the signature

DOKU Back Office
Handling DOKU HTTP Notification
Settlement
this section
here
this section