logo
English
English
API ReferenceSign In

Testing

Last updated 09/19/2019

Description

For information on how to test invoice payments, please see the Invoices testing page

Once you register for a free Xendit account, you can begin simulating Virtual Accounts payments via API immediately.

Setup

First, make sure you have downloaded Xendit’s Postman collections. For more information, please see our Integrations page. The integration page contains json collections for all of the VA events referenced on this page.

Your Xendit dashboard is already configured with a test VA range in development mode. To see your test account range, go to settings > configuration > fixed virtual accounts.

Under this same area in settings, be sure to set your payment, create, and update callback URLs to send these events to your endpoint.

Test: Create Fixed VA

Send a ‘POST’ request to https://api.xendit.co/callback_virtual_accounts using your secret API key. Enter the required and optional fields, as referenced in the API reference docs.

Example Request

{ "external_id": "demo_virtual_account_1475459775872", "bank_code": "BNI", "name": "Rika Sutanto" }

Example response

{ </code> <code> "owner_id":"57b4e5181473eeb61c11f9b9",</code> <code> "external_id":"demo_virtual_account_</code>1475459775872<code>",</code> <code> "bank_code":"BNI",</code> <code> "merchant_code":"8808",</code> <code> "name":"Rika Sutanto",</code> <code> "account_number":"8808999939380502",</code> <code> "is_closed": false, </code> <code> "id":"57f6fbf26b9f064272622aa6",</code> <code> "is_single_use": true,</code> <code> "status": "PENDING" </code> <code>}

Test: Simulate Fixed VA Payment

Send a ‘POST’ request to
https://api.xendit.co/callback_virtual_accounts/{external_id=}/simulate_payment using your secret API key.

Note: Add the relevant `external_id` for the virtual account payment you wish to simulate in the endpoint URL.

If you created multiple virtual accounts using the same external_id, payment simulation by external_id will pay the earliest created virtual account that uses that external_id

Enter the required and optional fields, as referenced in the API reference docs.

Test: Update Fixed VA 

Send a PATCH request to https://api.xendit.co/callback_virtual_accounts/{fixed_virtual_account_id} using your secret API key

Enter the required and optional fields, as referenced in the API reference docs.

Test: Verify callback virtual account

To verify if the callback you received is coming from us, send a GET request to https://api.xendit.co/callback_virtual_account_payments/payment_id={payment_id} using your secret API key

Example request

You can get your payment_id from the callback sent by Xendit.

Example response

{ "id": "598d91b1191029596846047f", "payment_id": "1502450097080", "callback_virtual_account_id": "598d5f71bf64853820c49a18", "external_id": "demo-1502437214715", "merchant_code": "77517", "account_number": "1000016980", "bank_code": "BNI", "amount": 5000, "transaction_timestamp": "2017-08-11T11:14:57.080Z", "created": "2017-08-11 11:15:30.548Z", "updated": "2017-08-11 11:15:31.891Z", "owner_id": "58cd618ba0464eb64acdb246" }
Was this page helpful?
Yes No