Test Guideline

Description

Testing and development with Xendit eWallets does not require an activated account. Once you register for a free Xendit account, you can begin simulating eWallet payments via API immediately.

Testing eWallet Payments

  1. To do eWallet testing with Xendit, first create a secret API key for development mode. Make sure to assign permission for Money-In as WRITE
  2. Set up your preferrred callback URL in the Callbacks section of the Settings tab
  3. Follow and refer to our API Reference for details on request requirements

Testing One-Time Payment Flow

Step 1: Create an eWallet Charge

Send a ‘POST’ request to Create Payment Request API using your development API key.

INFO

To simulate and test errors/failures scenarios, please use the corresponding values for the amount parameter as specified in the Testing Scenarios for eWallet Endpoints page.

POST https://api.xendit.co/payment_requests
{
    "reference_id": "order_id_001",
    "amount": 25000,
    "currency": "IDR",
    "country": "ID",
    "payment_method": {
        "type": "EWALLET",
        "ewallet": {
            "channel_code": "DANA",
            "channel_properties": {
                "success_return_url": "https://your-redirect-website.com/success"
            }
        },
        "reusability": "ONE_TIME_USE"
    }
}

If successful, you will receive a 201 response with the status parameter having the value of REQUIRES_ACTION.

{
    "id": "ewc_cc45c431-8d58-41c7-ab0d-21d697e347az",
    "country": "ID",
    "amount": 25000,
    "currency": "IDR",
    "business_id": "603f1c4172bbe840979fd4az",
    "reference_id": "order_id_001",
    "payment_method": {
        "id": "pm-7c3110af-4cd0-4ae4-be0f-a0280ea080az",
        "type": "EWALLET",
        "reference_id": "742850a2-87ee-4842-b535-88e8718117az",
        "description": null,
        "created": "2023-07-27T07:42:52.253213104Z",
        "updated": "2023-07-27T07:42:52.253213104Z",
        "card": null,
        "ewallet": {
            "channel_code": "DANA",
            "channel_properties": {
                "success_return_url": "https://your-redirect-website.com/success"
            },
            "account": {
                "name": null,
                "account_details": null,
                "balance": null,
                "point_balance": null
            }
        },
        "direct_debit": null,
        "direct_bank_transfer": null,
        "over_the_counter": null,
        "virtual_account": null,
        "qr_code": null,
        "metadata": null,
        "billing_information": {
            "city": null,
            "country": "",
            "postal_code": null,
            "province_state": null,
            "street_line1": null,
            "street_line2": null
        },
        "reusability": "ONE_TIME_USE",
        "status": "ACTIVE"
    },
    "description": null,
    "metadata": null,
    "customer_id": null,
    "capture_method": "AUTOMATIC",
    "initiator": null,
    "card_verification_results": null,
    "created": "2023-07-27T07:42:52.330859604Z",
    "updated": "2023-07-27T07:42:52.330859604Z",
    "status": "REQUIRES_ACTION",
    "actions": [
        {
            "action": "AUTH",
            "url": "https://ewallet-mock-connector.xendit.co/v1/ewallet_connector/checkouts?token=cj11vv1a1nqarqdao5d0",
            "url_type": "WEB",
            "method": "GET",
            "qr_code": null
        },
        {
            "action": "AUTH",
            "url": "https://ewallet-mock-connector.xendit.co/v1/ewallet_connector/checkouts?token=cj11vv1a1nqarqdao5d0",
            "url_type": "MOBILE",
            "method": "GET",
            "qr_code": null
        }
    ],
    "failure_code": null,
    "channel_properties": null,
    "shipping_information": null,
    "items": null
}

Step 2: Simulate an eWallet Payment

Open the URL returned under the actions object from the above response (e.g. https://ewallet-mock-connector.xendit.co/v1/ewallet_connector/checkouts?token=12345) and proceed to simulate a payment. Note that in production, for ID_OVO and ID_JENIUSPAY, no link will be returned under the actions object. Instead, the end user will receive a push notification on their registered mobile phone

If successful, you will be redirected to the success_redirect_url and receive a successful payment callback

{
  "created": "2023-07-27T07:46:12.199Z",
  "business_id": "603f1c4172bbe840979fd4az",
  "event": "payment.succeeded",
  "api_version": null,
  "data": {
    "amount": 25000,
    "channel_properties": null,
    "country": "ID",
    "created": "2023-07-27T07:42:52.368144Z",
    "currency": "IDR",
    "customer_id": null,
    "description": null,
    "failure_code": null,
    "id": "ewc_cc45c431-8d58-41c7-ab0d-21d697e347az",
    "items": null,
    "metadata": null,
    "payment_detail": null,
    "payment_method": {
      "billing_information": {
        "city": null,
        "country": "",
        "postal_code": null,
        "province_state": null,
        "street_line1": null,
        "street_line2": null
      },
      "card": null,
      "created": "2023-07-27T07:42:52.253213Z",
      "description": null,
      "direct_bank_transfer": null,
      "direct_debit": null,
      "ewallet": {
        "account": {
          "account_details": null,
          "balance": null,
          "name": null,
          "point_balance": null
        },
        "channel_code": "DANA",
        "channel_properties": {
          "success_return_url": "https://your-redirect-website.com/success"
        }
      },
      "id": "pm-7c3110af-4cd0-4ae4-be0f-a0280ea080az",
      "metadata": null,
      "over_the_counter": null,
      "qr_code": null,
      "reference_id": "742850a2-87ee-4842-b535-88e8718117az",
      "reusability": "ONE_TIME_USE",
      "status": "EXPIRED",
      "type": "EWALLET",
      "updated": "2023-07-27T07:42:52.253213Z",
      "virtual_account": null
    },
    "payment_request_id": "pr-b95c6766-b82e-4c16-8539-13899b0b53az",
    "reference_id": "order_id_001",
    "status": "SUCCEEDED",
    "updated": "2023-07-27T07:46:11.891855Z"
  }
}

Testing Tokenized Payment Flow

Step 1: Create a Customer Object

Send a ‘POST’ request to Create Customer Object API using your development API key

POST https://api.xendit.co/customers 
{
    "reference_id": "customer-id-123",
    "mobile_number": "+6208774494404",
    "given_names": "John Doe"
}

If successful, you will receive the customer_id in the response

{
    "id": "b7c308fe-2836-41c8-98ae-0d23ed4d8450",
    "reference_id": "customer-id-123",
    "given_names": "John Doe",
    "email": null,
    "mobile_number": "+628774494404",
    "description": null,
    "middle_name": null,
    "surname": null,
    "phone_number": null,
    "nationality": null,
    "date_of_birth": null,
    "metadata": null,
    "employment": null,
    "addresses": null,
    "source_of_wealth": null
}

Step 2: Create an eWallet Payment Method

Send a ‘POST’ request to Create Payment Method API using the customer_id from above

POST https://api.xendit.co/v2/payment_methods 
{
    "type": "EWALLET",
    "reusability": "MULTIPLE_USE",
    "ewallet": {
        "channel_code": "OVO",
        "channel_properties": {
            "mobile_number": "+628774494404",
            "success_return_url": "https://your-redirect-website.com/success",
            "failure_return_url": "https://your-redirect-website.com/failure"
        }
    },
    "customer_id": "b7c308fe-2836-41c8-98ae-0d23ed4d8450"
}

If successful, you will receive a REQUIRES_ACTION response

{
    "id": "pm-123123123-f4d9-421c-9f0b-ab3b2b6bbc39",
    "type": "EWALLET",
    "reusability": "MULTIPLE_USE",
    "customer_id": "b7c308fe-2836-41c8-98ae-0d23ed4d8450",
    "business_id": "5f27a14a9bf05c73123123123",
    "status": "REQUIRES_ACTION",
    "country": "ID",
    "actions": [
        {
            "action": "AUTH",
            "url_type": "WEB",
            "url": "https://link-web-staging.xendit.co/oauth/lat-b32caa2d-a36b-4e50-a1da/confirm",
            "method": "GET"
        }
    ],
    "created": "2022-01-29T09:12:33.001Z",
    "updated": "2022-01-29T09:12:33.001Z",
    "metadata": null,
    "ewallet": {
        "channel_code": "OVO",
        "channel_properties": {
            "success_return_url": "https://your-redirect-website.com/success",
            "failure_return_url": "https://your-redirect-website.com/failure"
        },
        "account": {
            "account_details": null,
            "name": null,
            "balance": null,
            "point_balance": null
        }
    },
    "direct_debit": null,
    "card": null,
    "over_the_counter": null,
    "virtual_account": null,
    "qr_code": null
}

Step 3: Simulate an eWallet Account Linking

Open the URL returned under the actions object from the above response (e.g. https://link-web-staging.xendit.co/oauth/lat-b32caa2d-a36b-4e50-a1da/confirm) and proceed to simulate an account linking

If successful, you will be redirected to the success_return_url and receive a successful account linking callback

{
    "id": "pm-123123123-f4d9-421c-9f0b-ab3b2b6bbc39",
    "event": "payment_method.activated",
    "business_id": "5f27a14a9bf05c73123123123",
    "created": "2022-01-29T09:13:33.001Z",
    "data": {
        "id": "pm-123123123-f4d9-421c-9f0b-ab3b2b6bbc39",
        "type": "EWALLET",
        "country": "ID",
        "reference_id": "ovo_linking_001",
        "customer_id": "b7c308fe-2836-41c8-98ae-0d23ed4d8450",
        "business_id": "5f27a14a9bf05c73123123123",
        "reusability": "MULTIPLE_USE",
        "status": "ACTIVE",
        "actions": [],
        "created": "2022-01-29T09:12:33.001Z",
        "updated": "2022-01-29T09:12:33.001Z",
        "metadata": null,
        "ewallet": {
            "channel_code": "OVO",
            "channel_properties": {
                "success_return_url": "https://your-redirect-website.com/success",
                "failure_return_url": "https://your-redirect-website.com/failure"
            },
            "account": {
                "name": "John Doe",
                "account_details": "+62123456XXXX",
                "balance": null,
                "point_balance": null
            }
        },
        "direct_debit": null,
        "card": null,
        "over_the_counter": null,
        "virtual_account": null,
        "qr_code": null,
        "direct_bank_transfer": null
    }
}

Step 4: Create an eWallet Charge

Send a ‘POST’ request to Create Payment Request API using the payment_method_id from above.

For eWallets with redirection as the default tokenization flow, if you want to test the auto debit flow where the eWallet PIN is skipped, use the specific value of 13579 for the amount parameter. Not applicable for eWallets with auto debit as the default tokenization flow

Indonesia

ValueOVODANAShopeePay(ID)LinkAja
Default Tokenization FlowRedirectionRedirectionRedirectionRedirection

Philippines

ValuePayMayaGrabPayShopeePay(PH)
Default Tokenization FlowAuto DebitAuto DebitAuto Debit
POST https://api.xendit.co/payment_requests
{
    "reference_id": "order_id_001",
    "amount": 25000,
    "payment_method_id": "pm-123123123-f4d9-421c-9f0b-ab3b2b6bbc39",
    "currency": "IDR",
    "country": "ID",
    "reusability": "MULTIPLE_USE"
}

If successful, you will receive a 201 response with the status parameter having the value of REQUIRES_ACTION.

{
    "id": "ewc_d9adeee7-02e5-4257-8bbc-55d2424c02az",
    "country": "ID",
    "amount": 25000,
    "currency": "IDR",
    "business_id": "5f27a14a9bf05c73123123123",
    "reference_id": "order_id_001",
    "payment_method": {
        "id": "pm-123123123-f4d9-421c-9f0b-ab3b2b6bbc39",
        "type": "EWALLET",
        "reference_id": "ovo_linking_001",
        "description": null,
        "created": "2022-07-27T08:03:11.783613Z",
        "updated": "2022-07-27T08:06:30.311456Z",
        "card": null,
        "ewallet": {
            "channel_code": "OVO",
            "channel_properties": {
                "failure_return_url": "https://your-redirect-website.com/failure",
                "success_return_url": "https://your-redirect-website.com/success"
            },
            "account": {
                "name": "John Doe",
                "account_details": "+62123456XXXX",
                "balance": 1000000,
                "point_balance": 1000000
            }
        },
        "direct_debit": null,
        "direct_bank_transfer": null,
        "over_the_counter": null,
        "virtual_account": null,
        "qr_code": null,
        "metadata": null,
        "reusability": "MULTIPLE_USE",
        "status": "ACTIVE"
    },
    "description": null,
    "metadata": null,
    "customer_id": "b7c308fe-2836-41c8-98ae-0d23ed4d8450",
    "capture_method": "AUTOMATIC",
    "initiator": null,
    "card_verification_results": null,
    "created": "2022-07-27T08:13:05.086532261Z",
    "updated": "2022-07-27T08:13:05.086532261Z",
    "status": "REQUIRES_ACTION",
    "actions": [
        {
            "action": "AUTH",
            "url": "https://ewallet-mock-connector.xendit.co/v1/ewallet_connector/checkouts?token=cj12e49a1nqarqdao6a0",
            "url_type": "WEB",
            "method": "GET",
            "qr_code": null
        },
        {
            "action": "AUTH",
            "url": "https://ewallet-mock-connector.xendit.co/v1/ewallet_connector/checkouts?token=cj12e49a1nqarqdao6a0",
            "url_type": "MOBILE",
            "method": "GET",
            "qr_code": null
        }
    ],
    "failure_code": null,
    "channel_properties": null,
    "shipping_information": null,
    "items": null
}

Step 5: Simulate an eWallet Payment (Only Applicable for Non-Auto Debit Flow)

Redirecting the end user to authorize a subsequent payment after the initial account linking is only applicable for eWallets with redirection as the default tokenization flow. For eWallets with auto debit as the default tokenization flow, a payment callback is sent without the need to redirect the end user to a payment simulation URL.

Indonesia

ValueOVODANAShopeePay (ID)LinkAja
Default Tokenization FlowRedirectionRedirectionRedirectionRedirection

Philippines

ValuePayMayaGrabPayShopeePay (PH)
Default Tokenization FlowAuto DebitAuto DebitAuto Debit

Open the URL returned under the actions object from the above response (e.g. https://ewallet-mock-connector.xendit.co/v1/ewallet_connector/checkouts?token=12345) and proceed to simulate a payment.

If successful, you will be redirected to the success_redirect_url and receive a successful payment callback

{
  "created": "2022-07-27T08:14:52.412Z",
  "business_id": "5f27a14a9bf05c73123123123",
  "event": "payment.succeeded",
  "api_version": null,
  "data": {
    "amount": 25000,
    "channel_properties": null,
    "country": "ID",
    "created": "2022-07-27T08:13:05.535683Z",
    "currency": "IDR",
    "customer_id": "b7c308fe-2836-41c8-98ae-0d23ed4d8450",
    "description": null,
    "failure_code": null,
    "id": "ewc_d9adeee7-02e5-4257-8bbc-55d2424c02az",
    "items": null,
    "metadata": null,
    "payment_detail": null,
    "payment_method": {
      "card": null,
      "created": "2022-07-27T08:03:11.783613Z",
      "description": null,
      "direct_bank_transfer": null,
      "direct_debit": null,
      "ewallet": {
        "account": {
          "account_details": "+62123456XXXX",
          "balance": 1000000,
          "name": "John Doe",
          "point_balance": 1000000
        },
        "channel_code": "OVO",
        "channel_properties": {
          "failure_return_url": "https://your-redirect-website.com/failure",
          "success_return_url": "https://your-redirect-website.com/success"
        }
      },
      "id": "pm-123123123-f4d9-421c-9f0b-ab3b2b6bbc39",
      "metadata": null,
      "over_the_counter": null,
      "qr_code": null,
      "reference_id": "ovo_linking_001",
      "reusability": "MULTIPLE_USE",
      "status": "ACTIVE",
      "type": "EWALLET",
      "updated": "2022-07-27T08:06:30.311456Z",
      "virtual_account": null
    },
    "payment_request_id": "pr-6d2842b3-49ba-45d0-be14-119500e055az",
    "reference_id": "order_id_001",
    "status": "SUCCEEDED",
    "updated": "2022-07-27T08:14:52.049791Z"
  }
}

Last Updated on 2023-08-04