### PHP: Get Settlement Summary using cURL Source: https://toyyibpay.com/apireference/index This code example shows how to retrieve settlement summary information using the Toyyibpay API with PHP and cURL. It requires a user secret key and a username as input, returning a summary of settlement details. ```php 'td8bfqv7', 'userName' => "Sample Username" ); $curl = curl_init(); curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_URL, 'https://toyyibpay.com/api/getSettlementSummary'); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_POSTFIELDS, $some_data); $result = curl_exec($curl); $info = curl_getinfo($curl); curl_close($curl); echo $result; ?> ``` -------------------------------- ### Get Bank Information API using PHP Source: https://toyyibpay.com/apireference/index This PHP script demonstrates how to retrieve a list of banks supported by ToyyibPay. This information is often required when creating a new user account via the API. The script makes a GET request to the /getBank endpoint and returns the bank information in JSON format. ```php ``` -------------------------------- ### Get Bank API Source: https://toyyibpay.com/apireference/index Retrieves a list of banks accepted by ToyyibPay, which is required for user creation via API. ```APIDOC ## GET /api/getBank ### Description Retrieves a list of accepted bank information for use with ToyyibPay. ### Method GET ### Endpoint https://toyyibpay.com/index.php/api/getBank ### Parameters This endpoint does not require any parameters. ### Request Example ``` ``` ### Response #### Success Response (200) - The response contains bank information in JSON format. ``` -------------------------------- ### Get Settlement Summary API Source: https://toyyibpay.com/apireference/index Retrieves all settlement summary information for a given user. Requires the user's secret key and username. ```APIDOC ## POST /api/getSettlementSummary ### Description Retrieves all settlement summary information. This endpoint requires a secret key and username for authentication. ### Method POST ### Endpoint https://toyyibpay.com/api/getSettlementSummary ### Parameters #### Request Body - **userSecretKey** (string) - Required - Secret key for Enterprise User Only. - **userName** (string) - Required - Sample Username. ### Request Example ```php 'td8bfqv7', 'userName' => "Sample Username" ); $curl = curl_init(); curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_URL, 'https://toyyibpay.com/api/getSettlementSummary'); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_POSTFIELDS, $some_data); $result = curl_exec($curl); curl_close($curl); echo $result; ?> ``` ### Response #### Success Response (200) - **userID** (string) - The user ID. - **userName** (string) - The username. - **today** (string) - The date of the settlement summary. - **Amount_Pending** (string) - The amount pending settlement. - **Amount_settle** (string) - The amount settled. - **AmountNett_Pending** (string) - The net amount pending settlement. - **AmountNett_Settle** (string) - The net amount settled. - **Different_Pending** (string) - Difference in pending amounts. - **Different_Settle** (string) - Difference in settled amounts. - **Standard_Pending** (string) - Standard pending amount. - **Standard_Settle** (string) - Standard settled amount. - **Santai_Pending** (string) - Santai pending amount. - **Santai_Settle** (string) - Santai settled amount. - **Creditcard_Pending** (string) - Credit card pending amount. - **Creditcard_settle** (string) - Credit card settled amount. - **Transaction_Pending** (string) - Number of pending transactions. - **Trnsaction_Settle** (string) - Number of settled transactions. #### Response Example ```json [ { "userID": "44", "userName": "fitweb", "today": "19-10-31", "Amount_Pending": "1.00", "Amount_settle": "5.00", "AmountNett_Pending": "1.00", "AmountNett_Settle": "0.00", "Different_Pending": "0.00", "Different_Settle": "5.00", "Standard_Pending": "0.00", "Standard_Settle": "0.00", "Santai_Pending": "1.00", "Santai_Settle": "5.00", "Creditcard_Pending": "0.00", "Creditcard_settle": "0.00", "Transaction_Pending": "6", "Trnsaction_Settle": "6" } ] ``` ``` -------------------------------- ### Get Category Details API Source: https://toyyibpay.com/apireference/index Retrieve details about a specific category using its code. ```APIDOC ## POST /api/getCategoryDetails ### Description Retrieves category information using the provided user secret key and category code. ### Method POST ### Endpoint https://toyyibpay.com/index.php/api/getCategoryDetails ### Parameters #### Request Body - **userSecretKey** (string) - Required - Your secret key for authentication. - **categoryCode** (string) - Required - The code of the category to retrieve. ### Request Example ```json { "userSecretKey": "w5x7srq7-rx5r-3t89-2ou2-k7361x2jewhn", "categoryCode": "Ajdiufd345f" } ``` ### Response #### Success Response (200) - **categoryName** (string) - The name of the category. - **categoryDescription** (string) - The description of the category. - **categoryStatus** (string) - The status of the category. #### Response Example ```json [ { "categoryName": "Makanan", "categoryDescription": "Kuih Cara", "categoryStatus": "1" } ] ``` ``` -------------------------------- ### Get ToyyibPay Category Details Source: https://toyyibpay.com/apireference/index This PHP code fetches category details from ToyyibPay. It requires a userSecretKey and a categoryCode to retrieve information about a specific category. Returns category details in JSON format. ```php 'w5x7srq7-rx5r-3t89-2ou2-k7361x2jewhn' //PROVIDE USER SECRET KEY HERE 'categoryCode' => 'Ajdiufd345f' //PROVIDE CATEGORY CODE HERE ); $curl = curl_init(); curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_URL, 'https://toyyibpay.com/index.php/api/getCategoryDetails'); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_POSTFIELDS, $some_data); $result = curl_exec($curl); $info = curl_getinfo($curl); curl_close($curl); $obj = json_decode($result); echo $result; ``` -------------------------------- ### PHP: Get User Status using cURL Source: https://toyyibpay.com/apireference/index This snippet demonstrates how to check a user's account status using the Toyyibpay API with PHP and cURL. It requires a username and an enterprise user secret key as input and returns the user's status. ```php 'johndoe', 'enterpriseUserSecretKey' => 'h9ijfq4y-hrha-jsmj-s4br-r5hll1g29ty' ); $curl = curl_init(); curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_URL, 'https://toyyibpay.com/index.php/api/getUserStatus'); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_POSTFIELDS, $some_data); $result = curl_exec($curl); $info = curl_getinfo($curl); curl_close($curl); echo $result; ?> ``` -------------------------------- ### Get Bill Transactions API Source: https://toyyibpay.com/apireference/index Retrieve the status of bill payments. You can filter by bill code and optionally by payment status. ```APIDOC ## POST /api/getBillTransactions ### Description Retrieves the status of bill payments based on the provided bill code and optional payment status. ### Method POST ### Endpoint https://toyyibpay.com/index.php/api/getBillTransactions ### Parameters #### Request Body - **billCode** (string) - Required - The unique code of the bill. - **billpaymentStatus** (string) - Optional - The payment status to filter by (1: success, 2: pending, 3: fail, 4: pending). ### Request Example ```json { "billCode": "td8bfqv7", "billpaymentStatus": "1" } ``` ### Response #### Success Response (200) - **billName** (string) - Name of the bill. - **billDescription** (string) - Description of the bill. - **billTo** (string) - Name of the bill recipient. - **billEmail** (string) - Email of the bill recipient. - **billPhone** (string) - Phone number of the bill recipient. - **billStatus** (string) - Overall status of the bill. - **billpaymentStatus** (string) - Status of the payment. - **billpaymentChannel** (string) - Payment channel used. - **billpaymentAmount** (string) - Amount of the payment. - **billpaymentInvoiceNo** (string) - Invoice number for the payment. - **billSplitPayment** (string) - Indicates if split payment was used. - **billSplitPaymentArgs** (string) - Arguments for split payment. - **billpaymentSettlement** (string) - Settlement status. - **billpaymentSettlementDate** (string) - Date and time of settlement. - **SettlementReferenceNo** (string) - Reference number for settlement. - **billPaymentDate** (string) - Date and time of payment. - **billExternalReferenceNo** (string) - External reference number for the payment. #### Response Example ```json [ { "billName": "Payment_for_order_51", "billDescription": "Payment_for_order_51", "billTo": "Ali Bin Abu", "billEmail": "alibinabu@gmail.com", "billPhone": "0123456789", "billStatus": "1", "billpaymentStatus": "1", "billpaymentChannel": "FPX", "billpaymentAmount": "10.00", "billpaymentInvoiceNo": "TP5793119399122400030321", "billSplitPayment": "1", "billSplitPaymentArgs": "[\"{\"id\":\"toyyibPaySupport\",\"amount\":\"100\"}\"]", "billpaymentSettlement": "Settlement Done", "billpaymentSettlementDate": "2021-03-03 17:15:33", "SettlementReferenceNo": "TP030321956", "billPaymentDate": "02-03-2021 16:24:25", "billExternalReferenceNo": "WP0001" } ] ``` ``` -------------------------------- ### Get User Status API Source: https://toyyibpay.com/apireference/index Allows checking the status of a user account (Inactive, New-Pending Approval, Active) by providing the user's email and enterprise user secret key. This feature is specifically for Enterprise Accounts. ```APIDOC ## POST /api/getUserStatus ### Description Checks the status of a user account. This endpoint is for Enterprise Accounts only. The status codes are: 0 - Inactive, 1 - New-Pending Approval, 2 - Active. ### Method POST ### Endpoint https://toyyibpay.com/index.php/api/getUserStatus ### Parameters #### Request Body - **username** (string) - Required - The username of the user. - **enterpriseUserSecretKey** (string) - Required - The secret key for the enterprise user. ### Request Example ```php 'johndoe', 'enterpriseUserSecretKey' => 'h9ijfq4y-hrha-jsmj-s4br-r5hll1g29ty' ); $curl = curl_init(); curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_URL, 'https://toyyibpay.com/index.php/api/getUserStatus'); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_POSTFIELDS, $some_data); $result = curl_exec($curl); curl_close($curl); echo $result; ?> ``` ### Response #### Success Response (200) - **status** (string) - The status of the user account (e.g., "1"). #### Response Example ```json [ {"status":"1"} ] ``` ``` -------------------------------- ### Create Enterprise User API using PHP Source: https://toyyibpay.com/apireference/index This PHP script shows how to create a new user for an enterprise account via the ToyyibPay API. It requires extensive user details including secret key, personal information, bank details, and package selection. The API returns a User Secret Key upon successful creation or an error if the email already exists. ```php 'abcdef-ghijk-lmnop-qrstu', 'fullname' => 'John Doe Sdn Bhd', 'username' => 'johndoe', 'email' => 'hi@johndoe.com', 'password' => '123456', 'phone' => '0134342400', 'bankAccountType' => '1', 'bank'=>1, 'accountNo'=>'162263282063', 'accountHolderName'=>'John Doe, 'registrationNo'=>'BBYUUI', 'package' => 1 ); $curl = curl_init(); curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_URL, 'https://toyyibpay.com/index.php/api/createAccount'); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_POSTFIELDS, $some_data); $result = curl_exec($curl); $info = curl_getinfo($curl); curl_close($curl); $obj = json_decode($result); echo $result; ``` -------------------------------- ### Create Bill Source: https://toyyibpay.com/apireference/index Create a bill to send to your customers. This endpoint allows you to define bill details, payment options, and customer information. ```APIDOC ## POST /create-bill ### Description Creates a bill (invoice) for a customer. You can specify fixed or dynamic amounts, payer information requirements, payment channels, and more. ### Method POST ### Endpoint /create-bill ### Parameters #### Header Parameters - **userSecretKey** (string) - Required - Your secret key for authentication. #### Request Body - **categoryCode** (string) - Required - The code for your category, obtained from the Create Category API. - **billName** (string) - Required - The name of the bill (max 30 alphanumeric characters, space and '_' only). - **billDescription** (string) - Required - The description of the bill (max 100 alphanumeric characters, space and '_' only). - **billPriceSetting** (integer) - Required - Set to 1 for a fixed amount bill, or 0 for a dynamic amount bill where the user inserts the amount. - **billPayorInfo** (integer) - Required - Set to 0 to create an open bill without requiring payer information, or 1 to require payer information. - **billAmount** (integer) - Required - The bill amount in cents (e.g., 100 = RM1). Set to 0 if `billPriceSetting` is 0. - **billReturnUrl** (string) - Required - The URL to redirect the user to upon payment completion. - **billCallbackUrl** (string) - Required - The URL to send payment transaction status updates to. - **billExternalReferenceNo** (string) - Optional - Your system's reference number for the bill. - **billTo** (string) - Optional - The name of the person to whom the bill is intended. - **billEmail** (string) - Optional - The email address of the customer. - **billPhone** (string) - Optional - The phone number of the customer. - **billSplitPayment** (integer) - Optional - Set to 1 to enable split payments (only available for FPX, not for dynamic bills). - **billSplitPaymentArgs** (JSON) - Optional - JSON array for split payment details, e.g., `[{"id":"johndoe","amount":"200"}]`. - **billPaymentChannel** (integer) - Optional - Set to 0 for FPX, 1 for Credit Card, or 2 for both. - **billContentEmail** (string) - Optional - Additional message content for the customer's email (max 1000 characters). - **billChargeToCustomer** (integer) - Optional - Set to "0" to charge FPX to the customer. Leave blank to charge the bill owner for both FPX and Credit Card. Not applicable for card payments. - **billChargeToPrepaid** (integer) - Optional - Deducts transaction charges from the prepaid account. Applicable only for FPX when charges are set to the bill owner. - **billExpiryDate** (string) - Optional - The date and time when the bill becomes inactive (e.g., "17-12-2020 17:00:00"). - **billExpiryDays** (integer) - Optional - The number of days until the bill expires (minimum 1, maximum 100). `billExpiryDate` takes precedence if both are provided. - **enableFPXB2B** (integer) - Optional - Set to "1" to enable FPX (Corporate Banking) payment channel. - **chargeFPXB2B** (integer) - Optional - Set to "0" to charge the customer for FPX (Corporate Banking), or "1" to charge the bill owner. Defaults to "1" if `enableFPXB2B` is set to "1". ### Request Example ```json { "userSecretKey": "your_secret_key", "categoryCode": "your_category_code", "billName": "Test Bill", "billDescription": "This is a test bill description", "billPriceSetting": 1, "billPayorInfo": 1, "billAmount": 1000, "billReturnUrl": "https://example.com/return", "billCallbackUrl": "https://example.com/callback" } ``` ### Response #### Success Response (200) - **billCode** (string) - The unique code generated for the bill. #### Response Example ```json { "billCode": "gcbhict9" } ``` ``` -------------------------------- ### Create User API (For Enterprise Account Only) Source: https://toyyibpay.com/apireference/index This API allows for the creation of a toyyibPay user for enterprise accounts. It returns a User Secret Key upon successful creation. ```APIDOC ## POST /api/createAccount ### Description Creates a new toyyibPay user for enterprise accounts. Returns a User Secret Key. ### Method POST ### Endpoint https://toyyibpay.com/index.php/api/createAccount ### Parameters #### Request Body - **enterpriseUserSecretKey** (string) - Required - Enterprise user secret key - **fullname** (string) - Required - User full name - **username** (string) - Required - User name (max 30 alphanumeric characters, no spaces or special characters) - **email** (string) - Required - User Email OR User Id - **password** (string) - Required - User Password - **phone** (string) - Required - User Phone - **bankAccountType** (integer) - Optional - Set 1 for Personal Saving Account, 2 for Business/Company Current Account, 3 for Society/Organisation Current Account. [default is 2] - **bank** (integer) - Required - User Bank Selection (ID) - **accountNo** (string) - Required - User Bank Account No - **accountHolderName** (string) - Required - User Account Holder Name - **registrationNo** (string) - Optional - User Company/Business/Organization Registration No - **package** (integer) - Required - User Package ID - **userStatus** (integer) - Optional - Set to 2 for active status without email confirmation. ### Request Example ```json { "enterpriseUserSecretKey": "abcdef-ghijk-lmnop-qrstu", "fullname": "John Doe Sdn Bhd", "username": "johndoe", "email": "hi@johndoe.com", "password": "123456", "phone": "0134342400", "bankAccountType": "1", "bank": 1, "accountNo": "162263282063", "accountHolderName": "John Doe", "registrationNo": "BBYUUI", "package": 1 } ``` ### Response #### Success Response (200) - **UserSecretKey** (string) - The secret key for the newly created user. #### Response Example ```json [ { "UserSecretKey": "vrbl86xf-wj1h-q0l3-95kk-4q4erulvsc0h" } ] ``` #### Error Response - Returns an error if the email already exists. ``` -------------------------------- ### Create ToyyibPay Bill Source: https://toyyibpay.com/apireference/index This PHP code snippet demonstrates how to create a new bill using the ToyyibPay API. It sends a POST request with bill details and returns a BillCode upon success. Requires userSecretKey, categoryCode, and bill details. ```php 'w5x7srq7-rx5r-3t89-2ou2-k7361x2jewhn', 'categoryCode'=>'gcbhict9', 'billName'=>'Car Rental WXX123', 'billDescription'=>'Car Rental WXX123 On Sunday', 'billPriceSetting'=>0, 'billPayorInfo'=>1, 'billAmount'=>100, 'billReturnUrl'=>'http://bizapp.my', 'billCallbackUrl'=>'http://bizapp.my/paystatus', 'billExternalReferenceNo' => 'AFR341DFI', 'billTo'=>'John Doe', 'billEmail'=>'jd@gmail.com', 'billPhone'=>'0194342411', 'billSplitPayment'=>0, 'billSplitPaymentArgs'=>'', 'billPaymentChannel'=>'0', 'billContentEmail'=>'Thank you for purchasing our product!', 'billChargeToCustomer'=>1, 'billExpiryDate'=>'17-12-2020 17:00:00', 'billExpiryDays'=>3 ); $curl = curl_init(); curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_URL, 'https://toyyibpay.com/index.php/api/createBill'); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_POSTFIELDS, $some_data); $result = curl_exec($curl); $info = curl_getinfo($curl); curl_close($curl); $obj = json_decode($result); echo $result; ``` -------------------------------- ### Create Bill API Source: https://toyyibpay.com/apireference/index This endpoint allows you to create a new bill for payment processing. It accepts various details about the bill, the payer, and return URLs. ```APIDOC ## POST /api/createBill ### Description Creates a bill for payment processing with specified details. ### Method POST ### Endpoint https://toyyibpay.com/index.php/api/createBill ### Parameters #### Request Body - **userSecretKey** (string) - Required - Your secret key for authentication. - **categoryCode** (string) - Required - The code of the category for the bill. - **billName** (string) - Required - The name of the bill. - **billDescription** (string) - Optional - A description for the bill. - **billPriceSetting** (integer) - Required - Setting for bill price (0 for fixed, 1 for variable). - **billPayorInfo** (integer) - Required - Setting for payor information (0 for optional, 1 for required). - **billAmount** (float) - Required - The amount of the bill. - **billReturnUrl** (string) - Required - The URL to redirect to after payment. - **billCallbackUrl** (string) - Required - The URL for callback notifications. - **billExternalReferenceNo** (string) - Optional - Your external reference number for the bill. - **billTo** (string) - Optional - The name of the person to bill. - **billEmail** (string) - Optional - The email address of the person to bill. - **billPhone** (string) - Optional - The phone number of the person to bill. - **billSplitPayment** (integer) - Optional - Whether to enable split payment (0 for no, 1 for yes). - **billSplitPaymentArgs** (string) - Optional - Arguments for split payment if enabled. - **billPaymentChannel** (string) - Optional - Preferred payment channel. - **billContentEmail** (string) - Optional - Content for the bill email. - **billChargeToCustomer** (integer) - Optional - Whether to charge the customer (0 for no, 1 for yes). - **billExpiryDate** (string) - Optional - Expiry date and time for the bill (e.g., '17-12-2020 17:00:00'). - **billExpiryDays** (integer) - Optional - Number of days until the bill expires. ### Request Example ```json { "userSecretKey": "w5x7srq7-rx5r-3t89-2ou2-k7361x2jewhn", "categoryCode": "gcbhict9", "billName": "Car Rental WXX123", "billDescription": "Car Rental WXX123 On Sunday", "billPriceSetting": 0, "billPayorInfo": 1, "billAmount": 100, "billReturnUrl": "http://bizapp.my", "billCallbackUrl": "http://bizapp.my/paystatus", "billExternalReferenceNo": "AFR341DFI", "billTo": "John Doe", "billEmail": "jd@gmail.com", "billPhone": "0194342411", "billSplitPayment": 0, "billSplitPaymentArgs": "", "billPaymentChannel": "0", "billContentEmail": "Thank you for purchasing our product!", "billChargeToCustomer": 1, "billExpiryDate": "17-12-2020 17:00:00", "billExpiryDays": 3 } ``` ### Response #### Success Response (200) - **BillCode** (string) - The unique code generated for the bill. #### Response Example ```json [ { "BillCode": "gcbhict9" } ] ``` ``` -------------------------------- ### Create Category with PHP Source: https://toyyibpay.com/apireference/index Demonstrates how to create a new category in toyyibPay using PHP. It requires the user's secret key and category details, sending a POST request to the toyyibpay.com API and expecting a CategoryCode in the JSON response. ```php 'toyyibPay General 2', //CATEGORY NAME 'catdescription' => 'toyyibPay General Category, For toyyibPay Transactions 2', //PROVIDE YOUR CATEGORY DESCRIPTION 'userSecretKey' => 'w5x7srq7-rx5r-3t89-2ou2-k7361x2jewhn' //PROVIDE USER SECRET KEY HERE ); $curl = curl_init(); curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_URL, 'https://toyyibpay.com/index.php/api/createCategory'); //PROVIDE API LINK HERE curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_POSTFIELDS, $some_data); $result = curl_exec($curl); $info = curl_getinfo($curl); curl_close($curl); $obj = json_decode($result); echo $result; ``` -------------------------------- ### Create Category API Source: https://toyyibpay.com/apireference/index Allows users to create a new category for grouping bills. Requires a User Secret Key and provides a Category Code upon successful creation. ```APIDOC ## POST /api/createCategory ### Description Creates a category to group bills. Requires a User Secret Key and returns a Category Code. ### Method POST ### Endpoint https://toyyibpay.com/index.php/api/createCategory ### Parameters #### Request Body - **catname** (string) - Required - The name of the category. - **catdescription** (string) - Required - A description for the category. - **userSecretKey** (string) - Required - Your unique User Secret Key. ### Request Example ```json { "catname": "toyyibPay General 2", "catdescription": "toyyibPay General Category, For toyyibPay Transactions 2", "userSecretKey": "w5x7srq7-rx5r-3t89-2ou2-k7361x2jewhn" } ``` ### Response #### Success Response (200) - **CategoryCode** (string) - The unique code generated for the category. #### Response Example ```json [ { "CategoryCode": "j0tzqhka" } ] ``` ``` -------------------------------- ### Inactive Bill API using PHP Source: https://toyyibpay.com/apireference/index This PHP script demonstrates how to call the ToyyibPay API to set a bill to an inactive status. It requires the user's secret key and the bill code as input. The API can return success if the bill is inactivated, or failure if the bill is already inactive or has pending transactions. ```php 'w5x7srq7-rx5r-3t89-2ou2-k7361x2jewhn', //PROVIDE USER SECRET KEY HERE 'billCode' => 'a7usb2' //PROVIDE BILL CODE HERE ); $curl = curl_init(); curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_URL, 'https://toyyibpay.com/index.php/api/inactiveBill'); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_POSTFIELDS, $some_data); $result = curl_exec($curl); $info = curl_getinfo($curl); curl_close($curl); $obj = json_decode($result); echo $result; ``` -------------------------------- ### Inactive Bill API Source: https://toyyibpay.com/apireference/index Use this API to set your bill to an inactive status. It requires your secret key and the bill code. ```APIDOC ## POST /api/inactiveBill ### Description Sets a bill to inactive status. ### Method POST ### Endpoint https://toyyibpay.com/index.php/api/inactiveBill ### Parameters #### Request Body - **secretKey** (string) - Required - Your toyyibPay account Secret Key - **billCode** (string) - Required - Bill Code of the bill ### Request Example ```json { "secretKey": "w5x7srq7-rx5r-3t89-2ou2-k7361x2jewhn", "billCode": "a7usb2" } ``` ### Response #### Success Response (200) - **status** (string) - Indicates the success or failure of the operation. - **result** (string) - A message describing the outcome. #### Response Example ```json { "status": "success", "result": "Bill status changed to inactive" } ``` #### Possible Error Responses - `{"status":"failed","result":"Bill has pending transaction process"}` - `{"status":"failed","result":"Bill is inactive"}` ``` -------------------------------- ### Retrieve ToyyibPay Bill Transactions Source: https://toyyibpay.com/apireference/index This PHP code retrieves the status of a ToyyibPay bill transaction. It takes a billCode and an optional billpaymentStatus as input and returns transaction details. Requires billCode and optionally billpaymentStatus. ```php 'td8bfqv7', 'billpaymentStatus' => '1' ); $curl = curl_init(); curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_URL, 'https://toyyibpay.com/index.php/api/getBillTransactions'); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_POSTFIELDS, $some_data); $result = curl_exec($curl); $info = curl_getinfo($curl); curl_close($curl); echo $result; ?> ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.