Skip to content

PHP Client

What is PHP Client

PHP Client is a client or library that created on top of PHP so it will be easier for your technical team integrating with us to accept payment with our supported payment channel.

Currently Xendit supports: + Bank Transfer through Virtual Account + Credit cards + Xendit Invoice, that supports: + Bank Transfer through Virtua Account + Credit Cards + Alfamart + E-wallet

With integrating with us, you are helping us in bringing better digital infrastructure on Indonesia

What to Prepare Before Integrating with Xendit

Here are steps that you need to do in Integrating with Xendit: + Register or sign in on Xendit + Get your API Key from your Xendit Dashboard

Requirement with Integrating with Us

Here the minimum environment that you need to have to run Xendit PHP client + PHP 5.4

How to Integrate

Please follow these steps to integrate with Xendit through PHP client:

  • Clone our PHP Client source from: here

  • Include XenditPHPClient.php in your code, especially where you want to create a payment or disburse activity

  • Create XenditPHPClient object with secret API key as the parameter

[Example] - How to Create Xendit Invoice

These are steps that you need to do in order to create XenInvoice from PHP Client:

  • Require XenditPHPClient.php file in your code, especially where you want to create a payment or disburse activity

alt text

  • Here data that you need to provide:
    • Amount in integer (IDR 11,000 at minimum)
    • Reference ID in strings
    • User email in string
    • Invoice description in string
  • Put your secret key in an array like shown below alt text

  • Create XenditPHPClient object with array that you created alt text

  • Call createInvoice function with the a variable to contain the returns of the function alt text

  • Response on create invoice is shown in detail in here