You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can use the APIs below to interface with Xendit's TransactionApi.
To start using the API, you need to configure the secret key and initiate the client instance.
<?phprequire_once(__DIR__ . '/vendor/autoload.php');
useXendit\Configuration;
useXendit\BalanceAndTransaction\TransactionApi;
Configuration::setXenditKey("YOUR_API_KEY_HERE");
$apiInstance = newTransactionApi();
$id = "'id_example'"; // string$for_user_id = "5dbf20d7c8eb0c0896f811b6"; // string | The sub-account user-id that you want to make this transaction for. This header is only used if you have access to xenPlatform. See xenPlatform for more informationtry {
$result = $apiInstance->getTransactionByID($id, $for_user_id);
print_r($result);
} catch (\Xendit\XenditSdkException$e) {
echo'Exception when calling TransactionApi->getTransactionByID: ', $e->getMessage(), PHP_EOL;
echo'Full Error: ', json_encode($e->getFullError()), PHP_EOL;
}
<?phprequire_once(__DIR__ . '/vendor/autoload.php');
useXendit\Configuration;
useXendit\BalanceAndTransaction\TransactionApi;
Configuration::setXenditKey("YOUR_API_KEY_HERE");
$apiInstance = newTransactionApi();
$for_user_id = "5dbf20d7c8eb0c0896f811b6"; // string | The sub-account user-id that you want to make this transaction for. This header is only used if you have access to xenPlatform. See xenPlatform for more information$types = ["DISBURSEMENT","PAYMENT"]; // \BalanceAndTransaction\TransactionTypes[] | Transaction types that will be included in the result. Default is to include all transaction types$statuses = ["SUCCESS","PENDING"]; // \BalanceAndTransaction\TransactionStatuses[] | Status of the transaction. Default is to include all status.$channel_categories = ["BANK","INVOICE"]; // \BalanceAndTransaction\ChannelsCategories[] | Payment channels in which the transaction is carried out. Default is to include all channels.$reference_id = "ref23232"; // string | To filter the result for transactions with matching reference given (case sensitive)$product_id = "d290f1ee-6c54-4b01-90e6-d701748f0701"; // string | To filter the result for transactions with matching product_id (a.k.a payment_id) given (case sensitive)$account_identifier = "123123123"; // string | Account identifier of transaction. The format will be different from each channel. For example, on `BANK` channel it will be account number and on `CARD` it will be masked card number.$amount = 100; // float | Specific transaction amount to search for$currency = new \Xendit\BalanceAndTransaction\Currency(); // Currency$created = array('key' => new \Xendit\BalanceAndTransaction\DateRangeFilter()); // DateRangeFilter | Filter time of transaction by created date. If not specified will list all dates.$updated = array('key' => new \Xendit\BalanceAndTransaction\DateRangeFilter()); // DateRangeFilter | Filter time of transaction by updated date. If not specified will list all dates.$limit = 10; // float | number of items in the result per page. Another name for \"results_per_page\"$after_id = "'after_id_example'"; // string$before_id = "'before_id_example'"; // stringtry {
$result = $apiInstance->getAllTransactions($for_user_id, $types, $statuses, $channel_categories, $reference_id, $product_id, $account_identifier, $amount, $currency, $created, $updated, $limit, $after_id, $before_id);
print_r($result);
} catch (\Xendit\XenditSdkException$e) {
echo'Exception when calling TransactionApi->getAllTransactions: ', $e->getMessage(), PHP_EOL;
echo'Full Error: ', json_encode($e->getFullError()), PHP_EOL;
}