PHPackages                             appkita/xendit-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. appkita/xendit-php

ActiveLibrary[API Development](/categories/api)

appkita/xendit-php
==================

PHP clients for Xendit API

1.0.1(2y ago)063MITPHPPHP &gt;=7.3.0

Since Sep 5Pushed 2y agoCompare

[ Source](https://github.com/gunantos/xendit-php)[ Packagist](https://packagist.org/packages/appkita/xendit-php)[ Docs](https://github.com/xendit/xendit-php)[ RSS](/packages/appkita-xendit-php/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (4)Versions (2)Used By (0)

Xendit API PHP Client
=====================

[](#xendit-api-php-client)

This library is the abstraction of Xendit API for access from applications written with PHP.

- [Documentation](#documentation)
- [Installation](#installation)
- [Usage](#usage)
- [Methods' Signature and Examples](#methods-signature-and-examples)
    - [Balance](#balance)
        - [Get Balance](#get-balance)
    - [Payment Channels](#payment-channels)
        - [Get Payment Channels](#get-payment-channels)
    - [Cards](#cards)
        - [Create Charge](#create-charge)
        - [Reverse Authorization](#reverse-authorization)
        - [Capture Charge](#capture-charge)
        - [Get Charge](#get-charge)
        - [Create Refund](#create-refund)
    - [Cardless Credit](#cardless-credit)
        - [Create Cardless Credit Payment](#create-cardless-credit-payment)
        - [Calculate Payment Types](#calculate-payment-types)
    - [Customers](#customers)
        - [Create Customer](#create-customer)
        - [Get Customer by Reference ID](#get-customer-by-reference-id)
    - [Direct Debit](#direct-debit)
        - [Initialize linked account tokenization](#initialize-linked-account-tokenization)
        - [Validate OTP for Linked Account Token](#validate-otp-for-linked-account-token)
        - [Retrieve accessible accounts by linked account token](#retrieve-accessible-accounts-by-linked-account-token)
        - [Unbind linked account token](#unbind-linked-account-token)
        - [Create payment method](#create-payment-method)
        - [Get payment methods by customer ID](#get-payment-methods-by-customer-id)
        - [Create direct debit payment](#create-direct-debit-payment)
        - [Validate OTP for direct debit payment](#validate-otp-for-direct-debit-payment)
        - [Get direct debit payment by ID](#get-direct-debit-payment-by-id)
        - [Get direct debit payment by reference ID](#get-direct-debit-payment-by-reference-id)
    - [Payouts New (Disbursement)](#payouts-new)
        - [Create Payouts](#create-payouts-new)
        - [Get Payouts By ID / Reference](#retrieve-by-id)
        - [Cancel Payouts](#cancel-payouts)
        - [Get Payouts Channels](#get-payments-channels)
    - [IDR Disbursements for Indonesia](#idr-disbursements-for-indonesia)
        - [Create an IDR Disbursement](#create-an-idr-disbursement)
        - [Create an IDR Batch Disbursement](#create-an-idr-batch-disbursement)
        - [Get an IDR Disbursement by ID](#get-an-idr-disbursement-by-id)
        - [Get an IDR Disbursement by External ID](#get-an-idr-disbursement-by-external-id)
        - [Get an IDR Disbursement Available Banks](#get-an-idr-disbursement-available-banks)
    - [PHP Disbursements for Philippines](#php-disbursements-for-philippines)
        - [Create a PHP Disbursement](#create-a-php-disbursement)
        - [Get a PHP Disbursement by ID](#get-a-php-disbursement-by-id)
        - [Get a PHP Disbursement by Reference ID](#get-a-php-disbursement-by-reference-id)
    - [Disbursement Channels](#disbursement-channels)
        - [Get Disbursement Channels](#get-disbursement-channels)
        - [Get Disbursement Channels By Channel Category](#get-disbursement-channels-by-channel-category)
        - [Get Disbursement Channels By Channel Code](#get-disbursement-channels-by-channel-code)
    - [E-Wallets](#e-wallets)
        - [Create E-Wallet Charge](#create-e-wallet-charge)
        - [Get E-Wallet Charge Status](#get-e-wallet-charge-status)
        - [Void E-Wallet Charge](#void-e-wallet-charge)
        - [Refund E-Wallet Charge](#refund-e-wallet-charge)
        - [Get Refund By ID](#get-refund-by-id)
        - [List Refunds](#list-refunds)
    - [Invoice](#invoice)
        - [Create Invoice](#create-invoice)
        - [Get Invoice](#get-invoice)
        - [Get All Invoice](#get-all-invoice)
        - [Expire Invoice](#expire-invoice)
    - [Paylater](#paylater)
        - [Initiate PayLater Plans](#initiate-paylater-plans)
        - [Create PayLater Charges](#create-paylater-charges)
        - [Get PayLater Charge by ID](#get-paylater-charge-by-id)
        - [Refund PayLater Charge](#refund-paylater-charge)
        - [Get PayLater Refund by ID](#get-paylater-refund-by-id)
        - [List PayLater Refunds](#list-paylater-refunds)
    - [Payout Links](#payout-links)
        - [Create a Payout Link](#create-payout-links)
        - [Get a Payout Link](#get-payout-links)
        - [Void a Payout Link](#void-payout-links)
    - [QR Code](#qr-code)
        - [Create a QR Code](#create-a-qr-code)
        - [Get QR Code](#get-qr-code)
    - [Recurring](#recurring-payments)
        - [Create a Recurring Payment](#create-a-recurring-payment)
        - [Get a Recurring Payment](#get-a-recurring-payment)
        - [Edit a Recurring Payment](#edit-recurring-payment)
        - [Pause a Recurring Payment](#pause-recurring-payment)
        - [Stop a Recurring Payment](#stop-recurring-payment)
        - [Resume a Recurring Payment](#resume-recurring-payment)
    - [Retail Outlets](#retail-outlets)
        - [Create Fixed Payment Code](#create-fixed-payment-code)
        - [Update Fixed Payment Code](#update-fixed-payment-code)
        - [Get Fixed Payment Code](#get-fixed-payment-code)
    - [Virtual Accounts](#virtual-accounts)
        - [Create Fixed Virtual Account](#create-fixed-virtual-account)
        - [Get Virtual Account Bank](#get-virtual-account-bank)
        - [Get Fixed Virtual Account](#get-fixed-virtual-account)
        - [Update Fixed Virtual Account](#update-fixed-virtual-account)
        - [Get Fixed Virtual Account Payment](#get-fixed-virtual-account-payment)
    - [xenPlatform](#xenplatform)
        - [Create Account](#create-account)
        - [Get Account](#get-account)
        - [Update Account](#update-account)
        - [Create Transfers](#create-transfers)
        - [Create Fee Rule](#create-fee-rule)
        - [Set Callback URLs](#set-callback-urls)
    - [Transaction](#transaction)
        - [List of transactions](#list-of-transactions)
        - [Detail of transaction](#detail-of-transaction)
    - [Report](#report)
        - [Generate Report](#generate-report)
        - [Detail of Report](#detail-of-report)
- [Exceptions](#exceptions)
    - [InvalidArgumentException](#invalidargumentexception)
    - [ApiException](#apiexception)
- [Contributing](#contributing)
    - [Test](#tests)
        - [Running test suite](#running-test-suite)
        - [Running examples](#running-examples)

---

Documentation
-------------

[](#documentation)

For the API documentation, check [Xendit API Reference](https://xendit.github.io/apireference).

Installation
------------

[](#installation)

Install xendit-php-clients with composer by following command:

```
composer require xendit/xendit-php
```

or add it manually in your `composer.json` file.

### Update from v1.4.0 to v2.0.0

[](#update-from-v140-to-v200)

To update xendit-php-clients with composer, use the following command:

```
composer update xendit/xendit-php
```

To migrate, see [MIGRATE.md](MIGRATE.md) for more information.

Usage
-----

[](#usage)

Configure package with your account's secret key obtained from [Xendit Dashboard](https://dashboard.xendit.co/settings/developers#api-keys).

```
Xendit::setApiKey('secretKey');
```

See [example codes](./examples) for more details.

### Use Custom HTTP Client

[](#use-custom-http-client)

A custom HTTP Client that implements [HttpClientInterface](./src/HttpClientInterface.php) can be injected like so

```
Xendit::setHttpClient($client);
```

Checkout [custom http client example](./examples/CustomHttpClient.php) for implementation reference.

Methods' Signature and Examples
-------------------------------

[](#methods-signature-and-examples)

### Balance

[](#balance)

#### Get Balance

[](#get-balance)

```
$params = array(
    'for-user-id' => '' //The sub-account user-id that you want to make this transaction for (Optional).
);
\Xendit\Balance::getBalance(string $account_type, array $params);
```

Usage example:

```
$getBalance = \Xendit\Balance::getBalance('CASH');
var_dump($getBalance);
```

### Payment Channels

[](#payment-channels)

#### Get Payment Channels

[](#get-payment-channels)

GetPaymentChannels is in `maintenance mode`. Existing behavior on the endpoint will continue to work as before, but newer channels will be missing from the returned result.

```
\Xendit\PaymentChannels::list();
```

Usage example:

```
$getPaymentChannels = \Xendit\PaymentChannels::list();
var_dump($getPaymentChannels);
```

### Cards

[](#cards)

#### Create Charge

[](#create-charge)

```
\Xendit\Cards::create(array $params);
```

Usage example:

```
$params = [
    'token_id' => '5e2e8231d97c174c58bcf644',
    'external_id' => 'card_' . time(),
    'authentication_id' => '5e2e8658bae82e4d54d764c0',
    'amount' => 100000,
    'card_cvn' => '123',
    'capture' => false
];

$createCharge = \Xendit\Cards::create($params);
var_dump($createCharge);
```

#### Reverse Authorization

[](#reverse-authorization)

```
\Xendit\Cards::reverseAuthorization(string $id, array $params);
```

Usage example:

```
$id = 'charge-id';
$params = ['external_id' => 'ext-id'];

$reverseAuth = \Xendit\Cards::reverseAuthorization(
    $id,
    $params
);
var_dump($reverseAuth);
```

#### Capture Charge

[](#capture-charge)

```
\Xendit\Cards::capture(string $id, array $params);
```

Usage example:

```
$id = 'charge-id';
$params = ['amount' => 100000];

$captureCharge = \Xendit\Cards::capture($id, $params);
var_dump($captureCharge);
```

#### Get Charge

[](#get-charge)

```
\Xendit\Cards::retrieve(string $id);
```

Usage example:

```
$id = 'charge-id';

$getCharge = \Xendit\Cards::retrieve($id);
var_dump($getCharge);
```

#### Create Refund

[](#create-refund)

```
\Xendit\Cards::createRefund(string $id, array $params);
```

Usage examples

Without idempotency key:

```
$params = [
    'external_id' => 'ext-id',
    'amount' => 20000
];

$refund = \Xendit\Cards::createRefund($id, $params);
var_dump($refund);
```

With idempotency key:

```
$params = [
    'external_id' => 'ext-id',
    'amount' => 20000,
    'X-IDEMPOTENCY-KEY' => 'unique-id'
];

$refund = \Xendit\Cards::createRefund($id, $params);
var_dump($refund);
```

#### Create Promotion

[](#create-promotion)

```
\Xendit\Promotion::create(array $params);
```

usage examples:

```
$params = [
    'reference_id' => 'reference_123',
    'description' => 'test promotion',
    'currency' => 'IDR',
    'start_time' => '2021-01-01T00:00:00.000Z',
    'end_time' => '2021-01-02T00:00:00.000Z',
    'promo_code' => 'testpromo',
    'discount_amount' => 5000
];

$createPromotion = \Xendit\Promotion::create($params);
var_dump($createPromotion);
```

### Cardless Credit

[](#cardless-credit)

#### Create Cardless Credit Payment

[](#create-cardless-credit-payment)

```
\Xendit\CardlessCredit::create(array $params);
```

Usage example:

```
$params = [
    'cardless_credit_type' => 'KREDIVO',
    'external_id' => 'test-cardless-credit-02',
    'amount' => 800000,
    'payment_type' => '3_months',
    'items' => [
        [
            'id' => '123123',
            'name' => 'Phone Case',
            'price' => 200000,
            'type' => 'Smartphone',
            'url' => 'http=>//example.com/phone/phone_case',
            'quantity' => 2
        ],
        [
            'id' => '234567',
            'name' => 'Bluetooth Headset',
            'price' => 400000,
            'type' => 'Audio',
            'url' => 'http=>//example.com/phone/bluetooth_headset',
            'quantity' => 1
        ]
    ],
    'customer_details' => [
        'first_name' => 'customer first name',
        'last_name' => 'customer last name',
        'email' => 'customer@yourwebsite.com',
        'phone' => '081513114262'
    ],
    'shipping_address' => [
        'first_name' => 'first name',
        'last_name' => 'last name',
        'address' => 'Jalan Teknologi No. 12',
        'city' => 'Jakarta',
        'postal_code' => '12345',
        'phone' => '081513114262',
        'country_code' => 'IDN'
    ],
    'redirect_url' => 'https://example.com',
    'callback_url' => 'http://example.com/callback-cardless-credit'
];

$createPayment = \Xendit\CardlessCredit::create($params);
var_dump($createPayment);
```

#### Calculate Payment Types

[](#calculate-payment-types)

```
\Xendit\CardlessCredit::calculatePaymentTypes(array $params);
```

Usage example:

```
$params = [
    'cardless_credit_type' => 'KREDIVO',
    'amount' => 2000000,
    'items' => [
        [
            'id' => '123123',
            'name' => 'Phone Case',
            'price' => 1000000,
            'type' => 'Smartphone',
            'url' => 'http://example.com/phone/phone_case',
            'quantity' => 2
        ]
    ]
];

$calculatePaymentTypes = \Xendit\CardlessCredit::calculatePaymentTypes($params);
var_dump($calculatePaymentTypes);
```

### Customers

[](#customers)

#### Create Customer

[](#create-customer)

```
\Xendit\Customers::createCustomer(array $params);
```

Usage example:

```
$customerParams = [
    'reference_id' => '' . time(),
    'given_names' => 'customer 1',
    'email' => 'customer@website.com',
    'mobile_number' => '+6281212345678',
    'description' => 'dummy customer',
    'middle_name' => 'middle',
    'surname' => 'surname',
    'addresses' => [
        [
            'country' => 'ID',
            'street_line1' => 'Jl. 123',
            'street_line2' => 'Jl. 456',
            'city' => 'Jakarta Selatan',
            'province' => 'DKI Jakarta',
            'state' => '-',
            'postal_code' => '12345'
        ]
    ],
    'metadata' => [
        'meta' => 'data'
    ]
];

$createCustomer = \Xendit\Customers::createCustomer($customerParams);
var_dump($createCustomer);
```

#### Get Customer by Reference ID

[](#get-customer-by-reference-id)

```
\Xendit\Customers::getCustomerByReferenceID(string $reference_id);
```

Usage example:

```
$reference_id = 'ref_id';
$getCustomer = \Xendit\Customers::getCustomerByReferenceID($reference_id);
var_dump($getCustomer);
```

### Direct Debit

[](#direct-debit)

#### Initialize linked account tokenization

[](#initialize-linked-account-tokenization)

```
\Xendit\DirectDebit::initializeLinkedAccountTokenization(array $params);
```

Usage example:

```
$params = [
    'customer_id' => '4b7b6050-0830-440a-903b-37d527dbbaa9',
    'channel_code' => 'DC_BRI',
    'properties' => [
        'account_mobile_number' => '+62818555988',
        'card_last_four' => '8888',
        'card_expiry' => '06/24',
        'account_email' => 'test.email@xendit.co'
    ],
    'metadata' => [
        'meta' => 'data'
    ]
];

$initializeTokenization = \Xendit\DirectDebit::initializeLinkedAccountTokenization($params);
var_dump($initializeTokenization);
```

#### Validate OTP for Linked Account Token

[](#validate-otp-for-linked-account-token)

```
\Xendit\DirectDebit::validateOTPForLinkedAccount(string $linked_account_token_id, array $params);
```

Usage example:

```
$params = [
    'otp_code' => '333000'
];

$validateOTPForLinkedAccount = \Xendit\DirectDebit::validateOTPForLinkedAccount(
    'lat-a08fba1b-100c-445b-b788-aaeaf8215e8f',
    $params
);
var_dump($validateOTPForLinkedAccount);
```

#### Retrieve accessible accounts by linked account token

[](#retrieve-accessible-accounts-by-linked-account-token)

```
\Xendit\DirectDebit::retrieveAccessibleLinkedAccounts(string $linked_account_token_id);
```

Usage example:

```
$retrieveAccessibleLinkedAccounts = \Xendit\DirectDebit::retrieveAccessibleLinkedAccounts(
    'lat-a08fba1b-100c-445b-b788-aaeaf8215e8f'
);
var_dump($retrieveAccessibleLinkedAccounts);
```

#### Unbind linked account token

[](#unbind-linked-account-token)

```
\Xendit\DirectDebit::unbindLinkedAccountToken(string $linked_account_token_id);
```

Usage example:

```
$unbindLinkedAccountToken = \Xendit\DirectDebit::unbindLinkedAccountToken(
    'lat-a08fba1b-100c-445b-b788-aaeaf8215e8f'
);
var_dump($unbindLinkedAccountToken);
```

#### Create payment method

[](#create-payment-method)

```
\Xendit\DirectDebit::createPaymentMethod(array $params);
```

Usage example:

```
$params = [
    'customer_id' => '4b7b6050-0830-440a-903b-37d527dbbaa9',
    'type' => 'DEBIT_CARD',
    'properties' => [
        'id' => 'la-052d3e2d-bc4d-4c98-8072-8d232a552299'
    ],
    'metadata' => [
        'meta' => 'data'
    ]
];

$createPaymentMethod = \Xendit\DirectDebit::createPaymentMethod($params);
var_dump($createPaymentMethod);
```

#### Get payment methods by customer ID

[](#get-payment-methods-by-customer-id)

```
\Xendit\DirectDebit::getPaymentMethodsByCustomerID(string $customer_id);
```

Usage example:

```
$getPaymentMethods = \Xendit\DirectDebit::getPaymentMethodsByCustomerID('4b7b6050-0830-440a-903b-37d527dbbaa9');
var_dump($getPaymentMethods);
```

#### Create direct debit payment

[](#create-direct-debit-payment)

```
\Xendit\DirectDebit::createDirectDebitPayment(array $params);
```

Usage example:

```
$params = [
    'reference_id' => 'test-direct-debit-ref',
    'payment_method_id' => 'pm-ebb1c863-c7b5-4f20-b116-b3071b1d3aef',
    'currency' => 'IDR',
    'amount' => 15000,
    'callback_url' => 'http://webhook.site/',
    'enable_otp' => true,
    'description' => 'test description',
    'basket' => [
        [
            'reference_id' => 'basket-product-ref-id',
            'name' => 'product name',
            'category' => 'mechanics',
            'market' => 'ID',
            'price' => 50000,
            'quantity' => 5,
            'type' => 'product type',
            'sub_category' => 'product sub category',
            'description' => 'product description',
            'url' => 'https://product.url'
        ]
    ],
    'device' => [
        'id' => 'device_id',
        'ip_address' => '0.0.0.0',
        'ad_id' => 'ad-id',
        'imei' => '123a456b789c'
    ],
    'success_redirect_url' => 'https://success-redirect.url',
    'failure_redirect_url' => 'https://failure-redirect.url',
    'metadata' => [
        'meta' => 'data'
    ],
    'Idempotency-key' => '' . time()
];

$createDirectDebitPayment = \Xendit\DirectDebit::createDirectDebitPayment(
    $params
);
var_dump($createDirectDebitPayment);
```

#### Validate OTP for direct debit payment

[](#validate-otp-for-direct-debit-payment)

```
\Xendit\DirectDebit::validateOTPForDirectDebitPayment(
    string $direct_debit_payment_id,
    array $params
);
```

Usage example:

```
$params = [
    'otp_code' => '222000'
];

$validateOTPForDirectDebitPayment = \Xendit\DirectDebit::validateOTPForDirectDebitPayment(
    'ddpy-7e61b0a7-92f9-4762-a994-c2936306f44c',
    $params
);
var_dump($validateOTPForDirectDebitPayment);
```

#### Get direct debit payment by ID

[](#get-direct-debit-payment-by-id)

```
\Xendit\DirectDebit::getDirectDebitPaymentByID(
    string $direct_debit_payment_id
);
```

Usage example:

```
$getDirectDebitPaymentByID = \Xendit\DirectDebit::getDirectDebitPaymentByID(
    'ddpy-7e61b0a7-92f9-4762-a994-c2936306f44c'
);
var_dump($getDirectDebitPaymentByID);
```

#### Get direct debit payment by reference ID

[](#get-direct-debit-payment-by-reference-id)

```
\Xendit\DirectDebit::getDirectDebitPaymentByReferenceID(
    string $reference_id
);
```

Usage example:

```
$getDirectDebitPaymentByReferenceID = \Xendit\DirectDebit::getDirectDebitPaymentByReferenceID(
    'test-direct-debit-ref'
);
var_dump($getDirectDebitPaymentByReferenceID);
```

### Payouts New

[](#payouts-new)

```
\Xendit\PayoutsNew::create(array $params);
```

#### Create Payouts New

[](#create-payouts-new)

Usage example

```
\Xendit\PayoutsNew::create([
    'reference_id'         => 'ref-823723232',
    'channel_code'         => 'ID_BRI',
    'channel_properties'   => [
        'account_number'      => '0000000000',
        'account_holder_name' => 'Yanuar'
    ],
    'amount'               => 1000,
    'description'          => 'Sample Successful Create IDR Payout',
    'currency'             => 'IDR',
    'receipt_notification' => [
        'email_to'  => ['someone@example.com'],
        'email_cc'  => ['someone1@example.com'],
        'email_bcc' => ['someone2@example.com'],
    ],
    'metadata'             => [
        'lotto_outlet' => 24
    ]
])
```

#### Retrieve By ID

[](#retrieve-by-id)

```
## Using ID
\Xendit\PayoutsNew::retrieve(string $id);

## Using Reference ID
\Xendit\PayoutsNew::retrieveReference(string $referenceID)
```

#### Cancel Payouts

[](#cancel-payouts)

```
\Xendit\PayoutsNew::cancel(string $id);
```

#### Get Payouts Channel

[](#get-payouts-channel)

```
\Xendit\PayoutsNew::getPayoutsChannels()
```

### IDR Disbursements for Indonesia

[](#idr-disbursements-for-indonesia)

#### Create an IDR Disbursement

[](#create-an-idr-disbursement)

```
\Xendit\Disbursements::create(array $params);
```

Usage examples

Without idempotency key:

```
$params = [
    'external_id' => 'disb-12345678',
    'amount' => 15000,
    'bank_code' => 'BCA',
    'account_holder_name' => 'Joe',
    'account_number' => '1234567890',
    'description' => 'Disbursement from Example'
];

$createDisbursements = \Xendit\Disbursements::create($params);
var_dump($createDisbursements);
```

With idempotency key:

```
$params = [
    'external_id' => 'disb-12345678',
    'amount' => 15000,
    'bank_code' => 'BCA',
    'account_holder_name' => 'Joe',
    'account_number' => '1234567890',
    'description' => 'Disbursement from Example',
    'X-IDEMPOTENCY-KEY' => 'unique-id'
];

$createDisbursements = \Xendit\Disbursements::create($params);
var_dump($createDisbursements);
```

#### Create an IDR Batch Disbursement

[](#create-an-idr-batch-disbursement)

```
\Xendit\Disbursements::createBatch(array $params);
```

Usage example:

```
$batch_params = [
    'reference' => 'disb_batch-12345678',
    'disbursements' => [
        [
            'amount' => 20000,
            'bank_code' => 'BCA',
            'bank_account_name' => 'Fadlan',
            'bank_account_number' => '1234567890',
            'description' => 'Batch Disbursement',
            'external_id' => 'disbursement-1'
        ],
        [
            'amount' => 30000,
            'bank_code' => 'MANDIRI',
            'bank_account_name' => 'Lutfi',
            'bank_account_number' => '1234567891',
            'description' => 'Batch Disbursement with email notifications',
            'external_id' => 'disbursement-2',
            'email_to' => ['test+to@xendit.co'],
            'email_cc' => ['test+cc@xendit.co'],
            'email_bcc' => ['test+bcc1@xendit.co', 'test+bcc2@xendit.co']
        ]
    ]
];

$createBatchDisbursements = \Xendit\Disbursements::createBatch($batch_params);
var_dump($createBatchDisbursements);
```

#### Get an IDR Disbursement by ID

[](#get-an-idr-disbursement-by-id)

```
\Xendit\Disbursements::retrieve(string $id, array $params);
```

Usage example:

```
$id = 'disbursements-id';
$retrieveParams = [
	'for-user-id' => 'test-reference-user-id'
]
$getDisbursements = \Xendit\Disbursements::retrieve($id, $retrieveParams);
var_dump($getDisbursements);
```

#### Get an IDR Disbursement by External ID

[](#get-an-idr-disbursement-by-external-id)

```
\Xendit\Disbursements::retrieveExternal(string $external_id);
```

Usage example:

```
$external_id = 'disbursements-ext-id';
$getDisbursementsByExt = \Xendit\Disbursements::retrieveExternal($external_id);
var_dump($getDisbursementsByExt);
```

#### Get an IDR Disbursement Available Banks

[](#get-an-idr-disbursement-available-banks)

```
\Xendit\Disbursements::getAvailableBanks();
```

Usage example:

```
$getDisbursementsBanks = \Xendit\Disbursements::getAvailableBanks();
var_dump($getDisbursementsBanks);
```

### PHP Disbursements for Philippines

[](#php-disbursements-for-philippines)

#### Create a PHP Disbursement

[](#create-a-php-disbursement)

```
\Xendit\DisbursementsPHP::createPHPDisbursement(array $params);
```

Usage examples

Without optional fields:

```
$params = [
    'reference_id' => 'reference_id',
    'currency' => 'PHP',
    'amount' => 15000,
    'channel_code' => 'PH_BDO',
    'account_name' => 'Test',
    'account_number' => '1234567890',
    'description' => 'PHP Disbursement from Example',
    'xendit-idempotency-key' =>  'unique-id'
];

$createDisbursements = \Xendit\DisbursementsPHP::createPHPDisbursement($params);
var_dump($createDisbursements);
```

With beneficiary optional field:

```
$params = [
    'reference_id' => 'reference_id',
    'currency' => 'PHP',
    'amount' => 15000,
    'channel_code' => 'PH_BDO',
    'account_name' => 'Test',
    'account_number' => '1234567890',
    'description' => 'PHP Disbursement from Example',
    'xendit-idempotency-key' =>  'unique-id',
    'beneficiary' => [
        'type' => 'INDIVIDUAL',
        'given_names' => 'Test Name',
        'middle_name' => 'middle_name',
        'surname' => 'surname',
        'business_name' => 'business_name',
        'street_line1' => 'street_line1',
        'street_line2' => 'street_line2',
        'city' => 'city',
        'province' => 'province',
        'state' => 'state',
        'country' => 'country',
        'zip_code' => '12345',
        'mobile_number' => '9876543210',
        'phone_number' => '987654321',
        'email' => 'email@test.com'
    ]
];

$createDisbursementsWithbeneficiary = \Xendit\DisbursementsPHP::createPHPDisbursement($params);
var_dump($createDisbursementsWithbeneficiary);
```

With receipt\_notification optional field:

```
$params = [
    'reference_id' => 'reference_id',
    'currency' => 'PHP',
    'amount' => 15000,
    'channel_code' => 'PH_BDO',
    'account_name' => 'Test',
    'account_number' => '1234567890',
    'description' => 'PHP Disbursement from Example',
    'xendit-idempotency-key' =>  'unique-id',
    'beneficiary' => [
        'type' => 'INDIVIDUAL',
        'given_names' => 'Test Name',
        'middle_name' => 'middle_name',
        'surname' => 'surname',
        'business_name' => 'business_name',
        'street_line1' => 'street_line1',
        'street_line2' => 'street_line2',
        'city' => 'city',
        'province' => 'province',
        'state' => 'state',
        'country' => 'country',
        'zip_code' => '12345',
        'mobile_number' => '9876543210',
        'phone_number' => '987654321',
        'email' => 'email@test.com'
    ],
    'receipt_notification' => [
        'email_to' => ['test@test.com'],
        'email_cc' => [],
        'email_bcc' => []
    ]
];

$createDisbursementsWithReceipt = \Xendit\DisbursementsPHP::createPHPDisbursement($params);
var_dump($createDisbursementsWithReceipt);
```

#### Get a PHP Disbursement by ID

[](#get-a-php-disbursement-by-id)

```
\Xendit\DisbursementsPHP::getPHPDisbursementByID(string $id, array $params);
```

Usage example:

```
$id = 'php-disbursements-id';
$retrieveParams = [
	'for-user-id' => 'test-reference-user-id'
]
$getDisbursements = \Xendit\DisbursementsPHP::getPHPDisbursementByID($id, $retrieveParams);
var_dump($getDisbursements);
```

#### Get a PHP Disbursement by Reference ID

[](#get-a-php-disbursement-by-reference-id)

```
\Xendit\DisbursementsPHP::getPHPDisbursementsByReferenceID(string $reference_id);
```

Usage example:

```
$reference_id = 'reference_id';
$getDisbursementsByRef = \Xendit\DisbursementsPHP::getPHPDisbursementsByReferenceID($reference_id);
var_dump($getDisbursementsByRef);
```

### Disbursement Channels

[](#disbursement-channels)

#### Get Disbursement Channels

[](#get-disbursement-channels)

```
\Xendit\DisbursementChannels::getDisbursementChannels();
```

Usage examples

```
$disbursementChannels = \Xendit\DisbursementChannels::getDisbursementChannels();
var_dump($disbursementChannels);
```

#### Get Disbursement Channels By Channel Category

[](#get-disbursement-channels-by-channel-category)

```
\Xendit\DisbursementChannels::getDisbursementChannelsByChannelCategory(string $channelCategory);
```

Usage examples

```
$channelCategory = 'Test';
$getdisbursementChannelsByCategory = \Xendit\DisbursementChannels::getDisbursementChannelsByChannelCategory($channelCategory);
var_dump($getdisbursementChannelsByCategory);
```

#### Get Disbursement Channels By Channel Code

[](#get-disbursement-channels-by-channel-code)

```
\Xendit\DisbursementChannels::getDisbursementChannelsByChannelCode(string $channelCode);
```

Usage examples

```
$channelCode = 'Test';
$getdisbursementChannelsByCode = \Xendit\DisbursementChannels::getDisbursementChannelsByChannelCode($channelCode);
var_dump($getdisbursementChannelsByCode);
```

### E-Wallets

[](#e-wallets)

#### Create E-Wallet Charge

[](#create-e-wallet-charge)

```
\Xendit\EWallets::createEWalletCharge(array $params);
```

For more information about the params, please check [Xendit API Reference - E-Wallets](https://developers.xendit.co/api-reference/#create-ewallet-charge).

Usage example:

```
$ewalletChargeParams = [
    'reference_id' => 'test-reference-id',
    'currency' => 'IDR',
    'amount' => 50000,
    'checkout_method' => 'ONE_TIME_PAYMENT',
    'channel_code' => 'ID_SHOPEEPAY',
    'channel_properties' => [
        'success_redirect_url' => 'https://yourwebsite.com/order/123',
    ],
    'metadata' => [
        'meta' => 'data'
    ]
];

$createEWalletCharge = \Xendit\EWallets::createEWalletCharge($ewalletChargeParams);
var_dump($createEWalletCharge);
```

#### Get E-Wallet Charge Status

[](#get-e-wallet-charge-status)

```
\Xendit\EWallets::getEWalletChargeStatus(string $charge_id, array $params);
```

Usage example:

```
$charge_id = 'ewc_f3925450-5c54-4777-98c1-fcf22b0d1e1c';
$eWalletStatusParam = [
	'for-user-id' => 'test-reference-user-id'
]
$getEWalletChargeStatus = \Xendit\EWallets::getEWalletChargeStatus($charge_id, $eWalletStatusParam);
var_dump($getEWalletChargeStatus);
```

#### Void E-Wallet Charge

[](#void-e-wallet-charge)

```
\Xendit\EWallets::voidEwalletCharge(string $charge_id,array $params);
```

Usage example:

```
$charge_id = 'ewc_f3925450-5c54-4777-98c1-fcf22b0d1e1c';
$voidEwalletChargeParam = [
    'for-user-id' => 'test-reference-user-id' // OPTIONAL
]
$voidEwalletCharge = \Xendit\EWallets::voidEwalletCharge($charge_id, $voidEwalletChargeParam);
var_dump($voidEwalletCharge);
```

#### Refund E-Wallet Charge

[](#refund-e-wallet-charge)

```
\Xendit\EWallets::refundEwalletCharge(string $charge_id,array $params);
```

Usage example:

```
$charge_id = 'ewc_f3925450-5c54-4777-98c1-fcf22b0d1e1c';
$refundEwalletChargeParam = [
    'for-user-id' => 'test-reference-user-id' // OPTIONAL
]
$refundEwalletCharge = \Xendit\EWallets::refundEwalletCharge($charge_id, $refundEwalletChargeParam);
var_dump($refundEwalletCharge);
```

#### Get Refund By ID

[](#get-refund-by-id)

```
\Xendit\EWallets::getRefund(string $charge_id,string $refund_id, array $params);
```

Usage example:

```
$charge_id = 'ewc_f3925450-5c54-4777-98c1-fcf22b0d1e1c';
$refund_id = 'ewr_532as23lew2321id';
$getRefundEwalletChargeParam = [
    'for-user-id' => 'test-reference-user-id' // OPTIONAL
]
$getRefundEwalletCharge = \Xendit\EWallets::getRefund($charge_id, $refund_id, $getRefundEwalletChargeParam);
var_dump($getRefundEwalletCharge);
```

#### List Refunds

[](#list-refunds)

```
\Xendit\EWallets::listRefund(string $charge_id, array $params);
```

Usage example:

```
$charge_id = 'ewc_f3925450-5c54-4777-98c1-fcf22b0d1e1c';
$listRefundEwalletChargeParam = [
    'for-user-id' => 'test-reference-user-id' // OPTIONAL
]
$listRefundEwalletCharge = \Xendit\EWallets::listRefund($charge_id, $getRefundEwalletChargeParam);
var_dump($listRefundEwalletCharge);
```

### Invoice

[](#invoice)

#### Create Invoice

[](#create-invoice)

```
\Xendit\Invoice::create(array $params);
```

Usage example:

```
$params = ['external_id' => 'demo_147580196270',
    'payer_email' => 'sample_email@xendit.co',
    'description' => 'Trip to Bali',
    'amount' => 32000,
    'for-user-id' => '5c2323c67d6d305ac433ba20'
];

$createInvoice = \Xendit\Invoice::create($params);
var_dump($createInvoice);
```

#### Get Invoice

[](#get-invoice)

```
\Xendit\Invoice::retrieve(string $id, array $params);
```

Usage example:

```
$id = 'invoice-id';
$retrieveParam = [
	'for-user-id' => 'test-reference-user-id' // OPTIONAL
];
$getInvoice = \Xendit\Invoice::retrieve($id, $retrieveParam);
var_dump($getInvoice);
```

#### Get All Invoice

[](#get-all-invoice)

```
\Xendit\Invoice::retrieveAll(array $params);
```

Usage example:

```
$retrieveAllParam = [
	'for-user-id' => 'test-reference-user-id' // OPTIONAL
];
$getAllInvoice = \Xendit\Invoice::retrieveAll($retrieveAllParam);
var_dump(($getAllInvoice));
```

#### Expire Invoice

[](#expire-invoice)

```
\Xendit\Invoice::expireInvoice(string $id, array $params);
```

Usage example:

```
$id = 'invoice-id';
$params = [
	'for-user-id' => 'test-reference-user-id' // OPTIONAL
];
$expireInvoice = \Xendit\Invoice::expireInvoice($id, $params);
var_dump($expireInvoice);
```

### Paylater

[](#paylater)

#### Initiate PayLater Plans

[](#initiate-paylater-plans)

```
\Xendit\PayLater::initiatePayLaterPlans(array $params);
```

Usage example:

```
$params = [
    'customer_id' => '',
    'channel_code' => 'ID_KREDIVO',
    'currency' => 'IDR',
    'amount' => 6000000,
    'order_items' => [
        [
            'type' => 'PHYSICAL_PRODUCT',
            'reference_id' => '1533',
            'name' => 'Mobile Phone',
            'net_unit_amount' => 6000000,
            'quantity' => 1,
            'url' => '',
            'category' => 'Smartphone'
        ]
    ]
];

$payLaterPlan = \Xendit\PayLater::initiatePayLaterPlans($params);
var_dump($payLaterPlan);
```

#### Create Paylater Charges

[](#create-paylater-charges)

```
\Xendit\PayLater::createPayLaterCharge(array $params);
```

Usage example:

```
$params = [
    'plan_id' => $payLaterPlan['id'],
    'reference_id' => 'order_id_' . time(),
    'checkout_method' => 'ONE_TIME_PAYMENT',
    'success_redirect_url' => '',
    'failure_redirect_url' => '',
];
$payLaterCharge = \Xendit\PayLater::createPayLaterCharge($params);
var_dump($payLaterCharge);
```

#### Get PayLater Charge by ID

[](#get-paylater-charge-by-id)

```
\Xendit\PayLater::getPayLaterChargeStatus($id, array $params);
```

Usage example:

```
$params = []; // Optional (You can put for-user-id if needed)
$id = '';
$payLaterCharge = \Xendit\PayLater::getPayLaterChargeStatus($id, $params);
var_dump($payLaterCharge);
```

#### Refund Paylater Charge

[](#refund-paylater-charge)

```
\Xendit\PayLater::createPayLaterRefund($id, array $params);
```

Usage example:

```
$params = []; // Optional (You can put for-user-id if needed)
$id = '';
$payLaterCharge = \Xendit\PayLater::createPayLaterRefund($id, $params);
var_dump($payLaterCharge);
```

#### Create Paylater Refund

[](#create-paylater-refund)

```
\Xendit\PayLater::createPayLaterRefund($id, array $params);
```

Usage example:

```
$params = []; // Optional (You can put for-user-id if needed)
$id = '';
$payLaterChargeRefundCreate = \Xendit\PayLater::createPayLaterRefund($id, $params);
var_dump($payLaterChargeRefundCreate);
```

#### Get PayLater Refund by ID

[](#get-paylater-refund-by-id)

```
\Xendit\PayLater::getPayLaterRefund($charge_id, $refund_id, array $params);
```

Usage example:

```
$params = []; // Optional (You can put for-user-id if needed)
$charge_id = '';
$refund_id = '';
$payLaterChargeRefund = \Xendit\PayLater::getPayLaterRefund($charge_id, $refund_id, $params);
var_dump($payLaterChargeRefund);
```

#### List PayLater Refunds

[](#list-paylater-refunds)

```
\Xendit\PayLater::listPayLaterRefund($charge_id, array $params);
```

Usage example:

```
$params = []; // Optional (You can put for-user-id if needed)
$charge_id = '';
$payLaterChargeRefundList = \Xendit\PayLater::listPayLaterRefund($charge_id, $params);
var_dump($payLaterChargeRefundList);
```

#### Void Payout

[](#void-payout)

```
\Xendit\Payouts::void(string $id);
```

Usage example:

```
$id = 'payout-id';

$voidPayout = \Xendit\Payouts::void($id);
var_dump($voidPayout);
```

### Payout Links

[](#payout-links)

#### Create Payout Links

[](#create-payout-links)

```
\Xendit\Payouts::create(array $params);
```

Usage example:

```
$params = [
    'external_id' => 'payouts-123456789',
    'amount' => 50000
];

$createPayout = \Xendit\Payouts::create($params);
var_dump($createPayout);
```

#### Get Payout Links

[](#get-payout-links)

```
\Xendit\Payouts::retrieve(string $id, array $params);
```

Usage example:

```
$id = 'payout-id';
$params = [
	'for-user-id' => 'test-reference-user-id' // OPTIONAL
]
$getPayout = \Xendit\Payouts::retrieve($id, $params);
var_dump($getPayout);
```

#### Void Payout Links

[](#void-payout-links)

```
\Xendit\Payouts::void(string $id);
```

Usage example:

```
$id = 'payout-id';

$voidPayout = \Xendit\Payouts::void($id);
var_dump($voidPayout);
```

### QR Code

[](#qr-code)

#### Create a QR Code

[](#create-a-qr-code)

```
\Xendit\QRCode::create(array $params);
```

Usage example:

```
$params = [
    'external_id' => 'demo_123456',
    'type' => 'STATIC',
    'callback_url' => 'https://webhook.site',
    'amount' => 10000,
];

$qr_code = \Xendit\QRCode::create($params);
var_dump($qr_code)
```

#### Get QR Code

[](#get-qr-code)

```
\Xendit\QRCode::get(string $external_id);
```

Usage example:

```
$qr_code = \Xendit\QRCode::get('external_123');
var_dump($qr_code);
```

### Recurring Payments

[](#recurring-payments)

#### Create a Recurring Payment

[](#create-a-recurring-payment)

```
\Xendit\Recurring::create(array $params);
```

Usage example:

```
$params = [
    'external_id' => 'demo_147580196270',
    'payer_email' => 'sample_email@xendit.co',
    'description' => 'Trip to Bali',
    'amount' => 32000,
    'interval' => 'MONTH',
    'interval_count' => 1
];

$createRecurring = \Xendit\Recurring::create($params);
var_dump($createRecurring);
```

#### Get a Recurring Payment

[](#get-a-recurring-payment)

```
\Xendit\Recurring::retrieve(string $id, array $params);
```

Usage example:

```
$id = 'recurring-payment-id';
$params = [
	'for-user-id' => 'test-reference-user-id' // OPTIONAL
]
$getRecurring = \Xendit\Recurring::retrieve($id, $params);
var_dump($getRecurring);
```

#### Edit Recurring Payment

[](#edit-recurring-payment)

```
\Xendit\Recurring::update(string $id, array $params);
```

Usage example:

```
$id = 'recurring-payment-id';
$params = ['amount' => 10000];

$editRecurring = \Xendit\Recurring::update($id, $params);
var_dump($editRecurring);
```

#### Stop Recurring Payment

[](#stop-recurring-payment)

```
\Xendit\Recurring::stop(string $id);
```

Usage example:

```
$id = 'recurring-payment-id';

$stopRecurring = \Xendit\Recurring::stop($id);
var_dump($stopRecurring);
```

#### Pause Recurring Payment

[](#pause-recurring-payment)

```
\Xendit\Recurring::pause(string $id);
```

Usage example:

```
$id = 'recurring-payment-id';

$pauseRecurring = \Xendit\Recurring::pause($id);
var_dump($pauseRecurring);
```

#### Resume Recurring Payment

[](#resume-recurring-payment)

```
\Xendit\Recurring::resume(string $id);
```

Usage example:

```
$id = 'recurring-payment-id';

$resumeRecurring = \Xendit\Recurring::resume($id);
var_dump($resumeRecurring);
```

### Retail Outlets

[](#retail-outlets)

#### Create Fixed Payment Code

[](#create-fixed-payment-code)

```
\Xendit\Retail::create(array $params);
```

Usage example:

```
$params = [
    'external_id' => 'TEST-123456789',
    'retail_outlet_name' => 'ALFAMART',
    'name' => 'JOHN DOE',
    'expected_amount' => 25000
];

$createFPC = \Xendit\Retail::create($params);
var_dump($createFPC);
```

#### Update Fixed Payment Code

[](#update-fixed-payment-code)

```
\Xendit\Retail::update(string $id, array $params);
```

Usage example:

```
$id = 'FPC-id';
$updateParams = ['expected_amount' => 20000];

$updateFPC = \Xendit\Retail::update($id, $updateParams);
var_dump($updateFPC);
```

#### Get Fixed Payment Code

[](#get-fixed-payment-code)

```
\Xendit\Retail::retrieve(string $id);
```

Usage example:

```
$id = 'FPC-id';
$getFPC = \Xendit\Retail::retrieve($id);
var_dump($getFPC);
```

### Virtual Accounts

[](#virtual-accounts)

#### Create Fixed Virtual Account

[](#create-fixed-virtual-account)

```
\Xendit\VirtualAccounts::create(array $params);
```

Usage example:

```
$params = ["external_id" => "VA_fixed-12341234",
   "bank_code" => "MANDIRI",
   "name" => "Steve Wozniak"
];

$createVA = \Xendit\VirtualAccounts::create($params);
var_dump($createVA);
```

#### Get Virtual Account Bank

[](#get-virtual-account-bank)

```
\Xendit\VirtualAccounts::getVABanks();
```

Usage example:

```
$getVABanks = \Xendit\VirtualAccounts::getVABanks();
var_dump($getVABanks);
```

#### Get Fixed Virtual Account

[](#get-fixed-virtual-account)

```
\Xendit\VirtualAccounts::retrieve(string $id, array $params);
```

Usage example:

```
$id = 'VA-id';
$params = [
	'for-user-id' => 'test-reference-user-id' //OPTIONAL
]
$getVA = \Xendit\VirtualAccounts::retrieve($id, $params);
var_dump($getVA);
```

#### Update Fixed Virtual Account

[](#update-fixed-virtual-account)

```
\Xendit\VirtualAccounts::update(string $id, array $params);
```

Usage example:

```
$id = 'VA-id';
$updateParams = ["suggested_amount" => 1000];

$updateVA = \Xendit\VirtualAccounts::update($id, $updateParams);
var_dump($updateVA);
```

#### Get Fixed Virtual Account Payment

[](#get-fixed-virtual-account-payment)

```
\Xendit\VirtualAccounts::getFVAPayment(string $paymentID);
```

Usage example:

```
$paymentID = 'payment-ID';
$getFVAPayment = \Xendit\VirtualAccounts::getFVAPayment($paymentID);
var_dump($getFVAPayment);
```

### xenPlatform

[](#xenplatform)

#### Create Account

[](#create-account)

```
\Xendit\Platform::createAccount(array $params);
```

Usage example:

```
$params = [
    'email' => 'customer@website.com',
    'type' => 'OWNED',
    'public_profile' => ['business_name' => 'customer company']
];

$createAccount = \Xendit\Platform::createAccount(array $params);
var_dump($createAccount);
```

#### Get Account

[](#get-account)

```
\Xendit\Platform::getAccount(string $account_id);
```

Usage example:

```
$getAccount = \Xendit\Platform::getAccount($accountId);
var_dump($getAccount);
```

#### Update Account

[](#update-account)

```
$updateAccount = \Xendit\Platform::updateAccount(string $account_id, array $params);
```

Usage example:

```
$updateParams = [
    'email' => 'customer@website.com',
    'public_profile' => ['business_name' => 'customer company updated']
];
$updateAccount = \Xendit\Platform::updateAccount($accountId, $updateParams);
var_dump($updateAccount);
```

#### Create Transfers

[](#create-transfers)

```
$createTransfer = \Xendit\Platform::createTransfer(array $transferParams);
```

Usage example:

```
$transferParams = [
    'reference' => ''.time(),
    'amount' => 50000,
    'source_user_id' => '54afeb170a2b18519b1b8768',
    'destination_user_id' => '5cafeb170a2b1851246b8768',
];
$createTransfer = \Xendit\Platform::createTransfer($transferParams);
var_dump($createTransfer);
```

#### Create Fee Rule

[](#create-fee-rule)

```
$createFeeRule = \Xendit\Platform::createFeeRule(array $feeRuleParams);
```

Usage example:

```
$feeRuleParams = [
    'name' => 'standard_platform_fee',
    'description' => 'Fee charged to insurance agents based in Java',
    'unit' => 'flat',
    'amount' => 6500,
    'currency' => 'IDR'
];
$createFeeRule = \Xendit\Platform::createFeeRule($feeRuleParams);
var_dump($createFeeRule);
```

#### Set Callback URLs

[](#set-callback-urls)

```
$setCallbackUrl = \Xendit\Platform::setCallbackUrl(string $callbackType, array $callbackUrlParams);
```

Usage example:

```
$callbackUrlParams = [
    'url' => 'https://webhook.site/c9c9140b-96b8-434c-9c59-7440eeae4d7f'
];
$callbackType = 'invoice';
$setCallbackUrl = \Xendit\Platform::setCallbackUrl($callbackType, $callbackUrlParams);
var_dump($setCallbackUrl);
```

### Transaction

[](#transaction)

#### List of Transactions

[](#list-of-transactions)

```
\Xendit\Transaction::list(array $params);
```

Usage example:

```
$params = [
    'types' => 'DISBURSEMENT'
    'for-user-id' => 'Your User Id', //Optional
    'query-param'=> 'true' //This is to enable parameters as query strings
];

$transactions = \Xendit\Transaction::list(array $params);
var_dump($transactions);
```

#### Detail of Transaction

[](#detail-of-transaction)

```
\Xendit\Transaction::detail(string $transaction_id);
```

Usage example:

```
$detailTransaction = \Xendit\Transaction::detail(string $transaction_id);
var_dump($detailTransaction);
```

### Report

[](#report)

#### Generate Report

[](#generate-report)

```
\Xendit\Report::generate(array $params);
```

Usage example:

```
$params = [
    'type' => 'TRANSACTIONS'
];
$generate = \Xendit\Report::generate($params);
var_dump($generate);
```

#### Detail of Report

[](#detail-of-report)

```
\Xendit\Report::detail(string $report_id);
```

Usage example:

```
$detailReport = \Xendit\Report::detail('report_5c1b34a2-6ceb-4c24-aba9-c836bac82b28');
var_dump($detailReport);
```

Exceptions
----------

[](#exceptions)

### InvalidArgumentException

[](#invalidargumentexception)

`InvalidArgumentException` will be thrown if the argument provided by user is not sufficient to create the request.

For example, there are required arguments such as `external_id`, `payer_email`, `description`, and `amount` to create an invoice. If user lacks one or more arguments when attempting to create one, `InvalidArgumentException` will be thrown.

`InvalidArgumentException` is derived from PHP's `InvalidArgumentException`. For more information about this Exception methods and properties, please check [PHP Documentation](https://www.php.net/manual/en/class.invalidargumentexception.php).

### ApiException

[](#apiexception)

`ApiException` wraps up Xendit API error. This exception will be thrown if there are errors from Xendit API side, e.g. get fixed virtual account with invalid `id`.

To get exception message:

```
try {
    $getInvoice = \Xendit\Invoice::retrieve('123');
} catch (\Xendit\Exceptions\ApiException $e) {
    var_dump($e->getMessage());
}
```

To get exception HTTP error code:

```
try {
    $getInvoice = \Xendit\Invoice::retrieve('123');
} catch (\Xendit\Exceptions\ApiException $e) {
    var_dump($e->getCode());
}
```

To get exception Xendit API error code:

```
try {
    $getInvoice = \Xendit\Invoice::retrieve('123');
} catch (\Xendit\Exceptions\ApiException $e) {
    var_dump($e->getErrorCode());
}
```

Contributing
------------

[](#contributing)

For any requests, bugs, or comments, please open an [issue](https://github.com/xendit/xendit-php-clients/issues) or [submit a pull request](https://github.com/xendit/xendit-php-clients/pulls).

### Installing Packages

[](#installing-packages)

Before you start to code, run this command to install all of the required packages. Make sure you have `composer` installed in your computer

```
composer install
```

### Tests

[](#tests)

#### Running test suite:

[](#running-test-suite)

```
vendor\bin\phpunit tests
```

#### Running examples:

[](#running-examples)

```
php examples\InvoiceExample.php
```

There is a pre-commit hook to run phpcs and phpcbf. Please make sure they passed before making commits/pushes.

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

 Bus Factor4

4 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

976d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/260e9af2937309dfdeb236c6e129e26f924d1f7261a05b5496b6c40fbace8f8a?d=identicon)[Gunanto](/maintainers/Gunanto)

---

Top Contributors

[![ellennugroho](https://avatars.githubusercontent.com/u/33599891?v=4)](https://github.com/ellennugroho "ellennugroho (92 commits)")[![stanleynguyen](https://avatars.githubusercontent.com/u/12974927?v=4)](https://github.com/stanleynguyen "stanleynguyen (32 commits)")[![albertlieyingadrian](https://avatars.githubusercontent.com/u/12984659?v=4)](https://github.com/albertlieyingadrian "albertlieyingadrian (32 commits)")[![kevindavee](https://avatars.githubusercontent.com/u/28204154?v=4)](https://github.com/kevindavee "kevindavee (29 commits)")[![xen-HendryZheng](https://avatars.githubusercontent.com/u/90175540?v=4)](https://github.com/xen-HendryZheng "xen-HendryZheng (22 commits)")[![glendaesutanto](https://avatars.githubusercontent.com/u/60346343?v=4)](https://github.com/glendaesutanto "glendaesutanto (14 commits)")[![0505gonzalez](https://avatars.githubusercontent.com/u/719669?v=4)](https://github.com/0505gonzalez "0505gonzalez (12 commits)")[![69dev69dev](https://avatars.githubusercontent.com/u/7419157?v=4)](https://github.com/69dev69dev "69dev69dev (9 commits)")[![HendryZheng](https://avatars.githubusercontent.com/u/2715449?v=4)](https://github.com/HendryZheng "HendryZheng (7 commits)")[![afik](https://avatars.githubusercontent.com/u/7345441?v=4)](https://github.com/afik "afik (7 commits)")[![boxbag](https://avatars.githubusercontent.com/u/719745?v=4)](https://github.com/boxbag "boxbag (6 commits)")[![edwinyoyada](https://avatars.githubusercontent.com/u/5466522?v=4)](https://github.com/edwinyoyada "edwinyoyada (6 commits)")[![michaellimair](https://avatars.githubusercontent.com/u/43024848?v=4)](https://github.com/michaellimair "michaellimair (5 commits)")[![abhijeetjuneja](https://avatars.githubusercontent.com/u/17945868?v=4)](https://github.com/abhijeetjuneja "abhijeetjuneja (5 commits)")[![nazieb](https://avatars.githubusercontent.com/u/463775?v=4)](https://github.com/nazieb "nazieb (5 commits)")[![hglohika](https://avatars.githubusercontent.com/u/94830525?v=4)](https://github.com/hglohika "hglohika (4 commits)")[![muthmainnah234](https://avatars.githubusercontent.com/u/27885666?v=4)](https://github.com/muthmainnah234 "muthmainnah234 (4 commits)")[![xtianatilano](https://avatars.githubusercontent.com/u/19198931?v=4)](https://github.com/xtianatilano "xtianatilano (3 commits)")[![gunantos](https://avatars.githubusercontent.com/u/32815894?v=4)](https://github.com/gunantos "gunantos (3 commits)")[![asokawotulo](https://avatars.githubusercontent.com/u/32058490?v=4)](https://github.com/asokawotulo "asokawotulo (3 commits)")

---

Tags

xendit

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/appkita-xendit-php/health.svg)

```
[![Health](https://phpackages.com/badges/appkita-xendit-php/health.svg)](https://phpackages.com/packages/appkita-xendit-php)
```

###  Alternatives

[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[convertkit/convertkitapi

Kit PHP SDK for the Kit API

2167.1k1](/packages/convertkit-convertkitapi)[mapado/rest-client-sdk

Rest Client SDK for hydra API

1125.9k2](/packages/mapado-rest-client-sdk)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
