logo
English
English
API ReferenceSign In

Testing

Last updated 09/28/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 Retail Outlet payment code 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 Retail Outlet events referenced on this page.

You can see your prefix in Settings > Payment Methods > Retail Outlets > Alfamart > Click Test

Test: Create Fixed Payment Code

Send a ‘POST’ request to https://api.xendit.co/fixed_payment_codeusing your secret API key

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

Example Request

curl https://api.xendit.co/fixed_payment_code -X POST \ -u xnd_development_O46JfOtygef9kMNsK+ZPGT+ZZ9b3ooF4w3Dn+R1k+2fT/7GlCAN3jg==: \ -d external_id=demo_fixed_payment_code_123 \ -d retail_outlet_name=ALFAMART \ -d name='Rika Sutanto' \ -d expected_amount=10000

Example response

Test: Simulate Fixed Payment Code Payment

Send a POST request to https://api.xendit.co/fixed_payment_code/simulate_payment using your secret API key.

Example Request

curl https://api.xendit.co/fixed_payment_code/simulate_payment -X POST \ <br> -u xnd_development_O46JfOtygef9kMNsK+ZPGT+ZZ9b3ooF4w3Dn+R1k+2fT/7GlCAN3jg==: \<br> -d external_id=demo_fixed_payment_code_123 \<br> -d retail_outlet_name=ALFAMART \<br> -d payment_code='TEST123456' \<br> -d transfer_amount=10000

Example Response

{    "status": "COMPLETED",    "message": "Payment for the Fixed Payment Code was successfully simulated" }

Note: You must first create the fixed payment code before executing this step.  Be sure to use the same payment code that you created to simulate payment.

Test: Update Fixed Payment Code

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

Note: you can get the ‘id’ from the response sent in the create fixed payment code response.

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

Test: Get Fixed Payment Code

Sometimes you need to know the detail for your fixed payment code. You can use this endpoint by sending a GET request to https://api.xendit.co/fixed_payment_code/{fixed_payment_code_id

Example request

curl https://api.xendit.co/fixed_payment_code/{fixed_payment_code_id} -X GET \ -u xnd_development_O46JfOtygef9kMNsK+ZPGT+ZZ9b3ooF4w3Dn+R1k+2fT/7GlCAN3jg==:

You can get your ‘id’ from the callback sent by Xendit.

Example response

{ "owner_id": "5b614aa8e79f9214007244d4", "external_id": "123", "retail_outlet_name": "ALFAMART", "prefix": "TEST", "name": "Joe Contini", "payment_code": "TEST123456", "type": "USER", "expected_amount": 20000, "is_single_use": true, "expiration_date": "2049-07-31T17:00:00.000Z", "id": "5b61881e6cc2770f00117f73" }
Was this page helpful?
Yes No