JFIFxxC      C  " }!1AQa"q2#BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz w!1AQaq"2B #3Rbr# PayoutApi You can use the APIs below to interface with Xendit's `PayoutApi`. To start using the API, you need to configure the secret key and initiate the client instance. ```php 'DISB-001', 'currency' => 'PHP', 'channel_code' => 'PH_BDO', 'channel_properties' => [ 'account_holder_name' => 'John Doe', 'account_number' => '000000' ], 'amount' => 90000, 'description' => 'Test Bank Payout', 'type' => 'DIRECT_DISBURSEMENT' ]); // \Xendit\Payout\CreatePayoutRequest try { $result = $apiInstance->createPayout($idempotency_key, $for_user_id, $create_payout_request); print_r($result); } catch (\Xendit\XenditSdkException $e) { echo 'Exception when calling PayoutApi->createPayout: ', $e->getMessage(), PHP_EOL; echo 'Full Error: ', json_encode($e->getFullError()), PHP_EOL; } ``` ## `getPayoutById()` Function ```php getPayoutById($id, $for_user_id): \Payout\GetPayouts200ResponseDataInner ``` API to fetch the current status, or details of the payout | Name | Value | |--------------------|:-------------:| | Function Name | `getPayoutById` | | Request Parameters | [GetPayoutByIdRequestParams](#request-parameters--GetPayoutByIdRequestParams) | | Return Type | [**\Xendit\Payout\GetPayouts200ResponseDataInner**](Payout/GetPayouts200ResponseDataInner.md) | ### Request Parameters - GetPayoutByIdRequestParams |Name | Type | Required |Default | |-------------|:-------------:|:-------------:|-------------| | **id** | **string** | ☑️ | | | **for_user_id** | **string** | | | ### Usage Example ```php getPayoutById($id, $for_user_id); print_r($result); } catch (\Xendit\XenditSdkException $e) { echo 'Exception when calling PayoutApi->getPayoutById: ', $e->getMessage(), PHP_EOL; echo 'Full Error: ', json_encode($e->getFullError()), PHP_EOL; } ``` ## `getPayoutChannels()` Function ```php getPayoutChannels($currency, $channel_category, $channel_code, $for_user_id): \Payout\Channel[] ``` API providing the current list of banks and e-wallets we support for payouts for both regions | Name | Value | |--------------------|:-------------:| | Function Name | `getPayoutChannels` | | Request Parameters | [GetPayoutChannelsRequestParams](#request-parameters--GetPayoutChannelsRequestParams) | | Return Type | [**\Xendit\Payout\Channel[]**](Payout/Channel.md) | ### Request Parameters - GetPayoutChannelsRequestParams |Name | Type | Required |Default | |-------------|:-------------:|:-------------:|-------------| | **currency** | **string** | | | | **channel_category** | [**ChannelCategory**](Payout/ChannelCategory.md) | | | | **channel_code** | **string** | | | | **for_user_id** | **string** | | | ### Usage Example ```php getPayoutChannels($currency, $channel_category, $channel_code, $for_user_id); print_r($result); } catch (\Xendit\XenditSdkException $e) { echo 'Exception when calling PayoutApi->getPayoutChannels: ', $e->getMessage(), PHP_EOL; echo 'Full Error: ', json_encode($e->getFullError()), PHP_EOL; } ``` ## `getPayouts()` Function ```php getPayouts($reference_id, $limit, $after_id, $before_id, $for_user_id): \Payout\GetPayouts200Response ``` API to retrieve all matching payouts with reference ID | Name | Value | |--------------------|:-------------:| | Function Name | `getPayouts` | | Request Parameters | [GetPayoutsRequestParams](#request-parameters--GetPayoutsRequestParams) | | Return Type | [**\Xendit\Payout\GetPayouts200Response**](Payout/GetPayouts200Response.md) | ### Request Parameters - GetPayoutsRequestParams |Name | Type | Required |Default | |-------------|:-------------:|:-------------:|-------------| | **reference_id** | **string** | ☑️ | | | **limit** | **float** | | | | **after_id** | **string** | | | | **before_id** | **string** | | | | **for_user_id** | **string** | | | ### Usage Example ```php getPayouts($reference_id, $limit, $after_id, $before_id, $for_user_id); print_r($result); } catch (\Xendit\XenditSdkException $e) { echo 'Exception when calling PayoutApi->getPayouts: ', $e->getMessage(), PHP_EOL; echo 'Full Error: ', json_encode($e->getFullError()), PHP_EOL; } ``` ## `cancelPayout()` Function ```php cancelPayout($id, $for_user_id): \Payout\GetPayouts200ResponseDataInner ``` API to cancel requested payouts that have not yet been sent to partner banks and e-wallets. Cancellation is possible if the payout has not been sent out via our partner and when payout status is ACCEPTED. | Name | Value | |--------------------|:-------------:| | Function Name | `cancelPayout` | | Request Parameters | [CancelPayoutRequestParams](#request-parameters--CancelPayoutRequestParams) | | Return Type | [**\Xendit\Payout\GetPayouts200ResponseDataInner**](Payout/GetPayouts200ResponseDataInner.md) | ### Request Parameters - CancelPayoutRequestParams |Name | Type | Required |Default | |-------------|:-------------:|:-------------:|-------------| | **id** | **string** | ☑️ | | | **for_user_id** | **string** | | | ### Usage Example ```php cancelPayout($id, $for_user_id); print_r($result); } catch (\Xendit\XenditSdkException $e) { echo 'Exception when calling PayoutApi->cancelPayout: ', $e->getMessage(), PHP_EOL; echo 'Full Error: ', json_encode($e->getFullError()), PHP_EOL; } ``` [[Back to README]](../README.md)