### Get Payment Intent Status with cURL Source: https://api.webimpian.support/bayarcash/payment/payment-intent-id Use this cURL command to make a GET request to retrieve the status of a specific payment intent. Ensure you replace `` with your actual token. ```bash curl -X GET https://api.console.bayar.cash/v3/payment-intents/trx_z88ymJ \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer ' ``` -------------------------------- ### GET /merchant-registrations/{id} Source: https://api.webimpian.support/bayarcash/enterprise-partner/merchant-status Retrieves the registration status and details for a specific merchant. ```APIDOC ## GET /merchant-registrations/{id} ### Description Check the registration status of a merchant. Registration statuses include Incomplete, Pending Approval, Approved, and Rejected. ### Method GET ### Endpoint console.bayar.cash/api/v2/merchant-registrations/{id} or api.console.bayar.cash/v3/merchant-registrations/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the merchant registration. ### Response #### Success Response (200) - **id** (string) - Merchant ID - **name** (string) - Merchant name - **email** (string) - Merchant email - **registration_status** (string) - Current status (Incomplete, Pending Approval, Approved, Rejected) - **user_profiles** (object) - Organization and contact details - **active_package_subscription** (object) - Subscription package details - **portal** (object) - Portal and API configuration #### Response Example { "id": "mr_3qjZwq", "name": "Mohd Ali Bin Seman", "email": "namasyarikat@gmail.com", "registration_status": "Incomplete", "user_profiles": { "organisation_name": "Nama Syarikat Sdn. Bhd.", "organisation_registration_number": "123456789-H", "contact_mobile_number": "60169165576" }, "active_package_subscription": { "package": { "name": "DuitNow T+ Package", "code": "T+" } }, "portal": { "api_key": "3888499948593892894" } } ``` -------------------------------- ### Activate e-Mandate JSON Response Source: https://api.webimpian.support/bayarcash/direct-debit/activate-e-mandate Example of the JSON response returned after successfully activating a Direct Debit mandate. ```json { "id": "md_MGWpzp", "updated_at": "2024-07-21T15:07:09.000000Z", "mandate_reference_number": "E-20230408F00230289", "order_number": "1-680-631-498-908819", "application_reason": "Enrollment for 1-680-631-498-908819", "frequency_mode": "MT", "frequency_mode_label": "Monthly", "effective_date": "2023-04-05", "expiry_date": null, "currency": "MYR", "amount": 10, "payer_name": "MOHD ALI", "payer_id": "800810065921", "payer_id_type": "1", "payer_bank_account_number": "1602119463111", "payer_email": "m.ali@gmail.com", "payer_telephone_number": "0199991122", "status": 3, "status_description": "Active", "return_url": "http://website.net/donations/mandates/callback", "metadata": null, "portal": "Portal A", "merchant": { "name": "Merchant A", "email": "ska@gmail.com" } } ``` -------------------------------- ### Retrieve Payout JSON Response Source: https://api.webimpian.support/bayarcash/enterprise-partner/merchant-payout-id Example of the JSON structure returned when querying a specific payout ID. ```json { "id": "pay_qK7gOq", "created_at": "2025-01-14 10:57:33", "merchant": { "id": "usr_Zz29gG", "name": "ABC Sdn. Bhd.", "email": "admin@abc.com" }, "status": "Processing", "reference_number": "P1736823453599915", "split_payout": "-", "bank_transaction_reference_number": null, "amount": "1.50" } ``` -------------------------------- ### e-Mandate Enrollment Response Structure Source: https://api.webimpian.support/bayarcash/direct-debit/e-mandate-enrollment This is an example of a JSON structured response received after successfully initializing an e-Mandate enrollment request. ```json { "payer_name": "Mohd Ali", "payer_id_type": 1, "payer_id": "910109021234", "payer_email": "mohd.ali@gmail.com", "payer_telephone_number": "60196019001", "order_number": "DD001", "amount": 30, "application_type": "Enrollment", "application_reason": "Enrollment of DD001", "frequency_mode": "MT", "effective_date": "2024-06-15", "expiry_date": "2024-08-15", "url": "https://console.bayar.cash/payment-intent/pi_pGwZaY" } ``` -------------------------------- ### Portal List JSON Response Structure Source: https://api.webimpian.support/bayarcash/portal/list Example of the JSON response returned by the portals API, including data, pagination links, and merchant metadata. ```json { "data": [ { "id": 931, "created_at": "2024-10-19 12:47:07", "portal_key": "8baf5e234dd88c2d1375d5f386d78d8f", "portal_name": "Payment Link", "url": "https://bcl.my/", "transaction_notification_email": "hai@bayarcash.com", "custom_payment_button_text": null, "payment_channels": [ { "id": 1, "code": "FPX", "name": "FPX" }, { "id": 3, "code": "FpxDirectDebit", "name": "Direct Debit" }, { "id": 4, "code": "FpxLineOfCredit", "name": "FPX Line of Credit" } ] } ], "links": { "first": "https://api.console.bayar.cash/v3/portals?page=1", "last": "https://api.console.bayar.cash/v3/portals?page=1", "prev": null, "next": null }, "meta": { "current_page": 1, "from": 1, "last_page": 1, "links": [ { "url": null, "label": "pagination.previous", "active": false }, { "url": "https://api.console.bayar.cash/v3/portals?page=1", "label": "1", "active": true }, { "url": null, "label": "pagination.next", "active": false } ], "path": "https://api.console.bayar.cash/v3/portals", "per_page": 15, "to": 2, "total": 2, "merchant": { "name": "Bayarcash Sdn. Bhd.", "email": "hai@bayarcash.com", "created_at": "2024-10-19 12:45:42" } } } ``` -------------------------------- ### GET /duitnow/dobw/banks Source: https://api.webimpian.support/bayarcash/bank-list/duitnow-online-banking-wallets Retrieves a list of available bank codes and names for DuitNow Online Banking/Wallets. ```APIDOC ## GET /duitnow/dobw/banks ### Description Returns a list of bank codes for DuitNow Online Banking/Wallets (DOBW). This list is used to populate `payer_bank_code` and `payer_bank_name` in payment requests. ### Method GET ### Endpoint - v2: console.bayar.cash/api/v2/duitnow/dobw/banks - v3: api.console.bayar.cash/v3/duitnow/dobw/banks ### Response #### Success Response (200) - **bank_name** (string) - Name of the bank - **bank_code** (string) - Unique code for the bank - **bank_availability** (boolean) - Indicates if the bank is currently available #### Response Example [ { "bank_name": "Affin Bank", "bank_code": "PHBMMYKL", "bank_availability": true }, { "bank_name": "Agro Bank", "bank_code": "AGRO01", "bank_availability": true } ] ``` -------------------------------- ### Merchant Registration Status JSON Response Source: https://api.webimpian.support/bayarcash/enterprise-partner/merchant-status Example of the JSON structure returned when querying merchant registration status. ```json { "id": "mr_3qjZwq", "name": "Mohd Ali Bin Seman", "email": "namasyarikat@gmail.com", "referral_id": null, "registration_status": "Incomplete", "login_token": "$778374mifnminvrunvrvmrmri997uIO", "user_profiles": { "organisation_name": "Nama Syarikat Sdn. Bhd.", "organisation_registration_number": "123456789-H", "contact_first_name": null, "contact_last_name": null, "contact_mobile_number": "60169165576", "contact_email": "namasyarikat@gmail.com", "organisation_bank_id": 1, "organisation_bank_name": "Affin Bank Berhad", "organisation_bank_account_number": "221233898832", "organisation_bank_account_holder": "Nama Syarikat Sdn. Bhd." }, "active_package_subscription": { "reference_number": "112234434TE", "package": { "name": "DuitNow T+ Package", "code": "T+" }, "start_date": "2024-11-13", "expiry_date": "2025-11-13", "minimum_balance": "RM50.00", "payouts_schedule": "Payout next working day T+1 starting 01.00 AM" }, "portal": { "name": "Default", "api_key": "3888499948593892894", "merchant_transaction_notification_email": "financesyarikat@gmail.com", "url": "https://bcl.my", "payment_gateways": [ { "name": "FPX", "code": "FPX" } ] } } ``` -------------------------------- ### GET /v3/payment-intents/{payment_intent_id} Source: https://api.webimpian.support/bayarcash/payment/payment-intent-id Retrieve the status and details of a specific payment intent. ```APIDOC ## GET /v3/payment-intents/{payment_intent_id} ### Description At any given time, you can request a payment intent ID to check on the payment status. It will return the payment intent object. ### Method GET ### Endpoint `/v3/payment-intents/{payment_intent_id}` ### Parameters #### Path Parameters - **payment_intent_id** (string) - Required - The unique identifier of the payment intent. ### Request Example ```curl curl -X GET https://api.console.bayar.cash/v3/payment-intents/trx_z88ymJ \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer ' ``` ### Response #### Success Response (200) - **type** (string) - The type of the object, e.g., "payment_intent". - **id** (string) - The unique identifier of the payment intent. - **status** (string) - The current status of the payment intent (e.g., "paid"). - **last_attempt** (string) - Timestamp of the last payment attempt. - **paid_at** (string) - Timestamp when the payment was successfully paid. - **order_number** (string) - The associated order number. - **amount** (string) - The payment amount. - **currency** (string) - The currency of the payment (e.g., "MYR"). - **payer_name** (string) - The name of the payer. - **payer_email** (string) - The email address of the payer. - **payer_telephone_number** (string) - The telephone number of the payer. - **attempts** (array) - A list of payment attempt objects. - **transaction_id** (string) - The ID of the transaction. - **created_at** (string) - Timestamp when the attempt was created. - **payer_name** (string) - The name of the payer for this attempt. - **payer_email** (string) - The email address of the payer for this attempt. - **payer_telephone_number** (string) - The telephone number of the payer for this attempt. - **order_number** (string) - The order number for this attempt. - **currency** (string) - The currency for this attempt. - **amount** (string) - The amount for this attempt. - **exchange_reference_number** (string) - Reference number for the exchange. - **exchange_transaction_id** (string) - Transaction ID for the exchange. - **payer_bank_name** (string) - The name of the payer's bank. - **status** (integer) - The status code of the attempt. - **status_description** (string) - A description of the attempt status. - **payment_gateway** (object) - Information about the payment gateway used. - **id** (integer) - The ID of the payment gateway. - **name** (string) - The name of the payment gateway. - **code** (string) - The code of the payment gateway. #### Response Example ```json { "type": "payment_intent", "id": "pi_PGPP2G", "status": "paid", "last_attempt": "2024-12-30 12:07:57", "paid_at": "2024-12-30 12:07:57", "order_number": "ORD001", "amount": "10.50", "currency": "MYR", "payer_name": "Mohd Ali", "payer_email": "mohd.ali@gmail.com", "payer_telephone_number": "+60169166656", "attempts": [ { "transaction_id": "trx_YdoXvn", "created_at": "2024-12-30 12:07:57", "payer_name": "Mohd Ali", "payer_email": "mohd.ali@gmail.com", "payer_telephone_number": "+60169166656", "order_number": "ORD001", "currency": "MYR", "amount": "10.50", "exchange_reference_number": "1-735-272-902-315691", "exchange_transaction_id": "2412271215020084", "payer_bank_name": "SBI Bank A", "status": 3, "status_description": "Approved", "payment_gateway": { "id": 1, "name": "FPX", "code": "FPX" } }, { "transaction_id": "trx_GWlpvW", "created_at": "2024-12-27 12:15:02", "payer_name": "Mohd Ali", "payer_email": "mohd.ali@gmail.com", "payer_telephone_number": "+60169166656", "order_number": "ORD001", "currency": "MYR", "amount": "10.50", "exchange_reference_number": "1-735-272-902-315691", "exchange_transaction_id": "2412271215020084", "payer_bank_name": "SBI Bank A", "status": 2, "status_description": "Unsuccessful", "payment_gateway": { "id": 1, "name": "FPX", "code": "FPX" } } ] } ``` ``` -------------------------------- ### GET /v3/transactions Source: https://api.webimpian.support/bayarcash/transaction/all-transactions Retrieves a list of transactions based on provided query parameters. ```APIDOC ## GET /v3/transactions ### Description Retrieve transaction objects to check on the current status of payments. ### Method GET ### Endpoint https://api.console.bayar.cash/v3/transactions ### Parameters #### Query Parameters - **order_number** (string) - Optional - The unique order number for the transaction. - **status** (integer) - Optional - The status code of the transaction. - **payment_channel** (string) - Optional - The payment channel code. - **exchange_reference_number** (string) - Optional - The reference number from the exchange. - **payer_email** (string) - Optional - The email address of the payer. ### Request Example curl -X GET https://api.console.bayar.cash/v3/transactions?order_number=24354620275 \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer ' ### Response #### Success Response (200) - **data** (array) - List of transaction objects. - **links** (object) - Pagination links. - **meta** (object) - Metadata regarding the current page and total records. #### Response Example { "data": [ { "id": "trx_q6LJdl", "updated_at": "2023-05-26 13:35:01", "order_number": "24354620275", "status": 3, "status_description": "Approved" } ], "meta": { "current_page": 1, "total": 6 } } ``` -------------------------------- ### GET /payouts/{payout_id} Source: https://api.webimpian.support/bayarcash/enterprise-partner/merchant-payout-id Retrieves the settlement summary for a specific merchant payout. ```APIDOC ## GET /payouts/{payout_id} ### Description Retrieves the settlement summary for a specific payout. This endpoint is available in v2 and v3. ### Method GET ### Endpoint - v2: console.bayar.cash/api/v2/payouts/{payout_id} - v3: api.console.bayar.cash/v3/payouts/{payout_id} ### Parameters #### Path Parameters - **payout_id** (string) - Required - The unique identifier of the payout. ### Response #### Success Response (200) - **id** (string) - The payout ID. - **created_at** (string) - Timestamp of creation. - **merchant** (object) - Merchant details including id, name, and email. - **status** (string) - Current status of the payout. - **reference_number** (string) - Internal reference number. - **split_payout** (string) - Split payout information. - **bank_transaction_reference_number** (string|null) - Bank transaction reference. - **amount** (string) - The payout amount. #### Response Example { "id": "pay_qK7gOq", "created_at": "2025-01-14 10:57:33", "merchant": { "id": "usr_Zz29gG", "name": "ABC Sdn. Bhd.", "email": "admin@abc.com" }, "status": "Processing", "reference_number": "P1736823453599915", "split_payout": "-", "bank_transaction_reference_number": null, "amount": "1.50" } ``` -------------------------------- ### Retrieve Mandate Transaction Details Source: https://api.webimpian.support/bayarcash/direct-debit/mandate-transaction-id Example JSON response structure returned when querying a mandate transaction by ID. ```json { "id": "trx_GPk868", "updated_at": "2024-06-27 17:57:01", "datetime": "2024-06-27 17:56:42", "order_number": "DDD-24060323", "payer_name": "Mohd Ali", "payer_email": "mohd.ali@gmail.com", "payer_telephone_number": "60197019001", "currency": "MYR", "amount": 10, "exchange_reference_number": "1-719-482-202-565809", "exchange_transaction_id": "2406271756420574", "payer_bank_name": "SBI Bank A", "status": 3, "status_description": "Approved", "return_url": "https://website.net/transactions/mandates/callback", "metadata": null, "payout": { "ref_no": null }, "payment_gateway": { "name": "Direct Debit", "code": "FpxDirectDebit" }, "portal": "Portal ABC", "merchant": { "name": "Web Impian Sdn. Bhd.", "email": "webimpian.merchant@gmail.com" }, "mandate": { "id": "md_nq5oAG", "updated_at": "2024-06-27T09:57:27.000000Z", "mandate_reference_number": "E-20241719482236", "order_number": "DDD-24060323", "application_reason": "Enrollment of DDD-24060323", "frequency_mode": "MT", "frequency_mode_label": "Monthly", "effective_date": "2024-06-30", "expiry_date": "2025-06-30", "currency": "MYR", "amount": 200, "payer_name": "Mohd Ali", "payer_id": "910909122211", "payer_id_type": "1", "payer_bank_account_number": "033112228108", "payer_email": "mohd.ali@gmail.com", "payer_telephone_number": "60197019001", "status": 4, "status_description": "Terminated", "return_url": "https://website.net/transactions/mandates/callback", "metadata": null, "portal": "Portal ABC", "merchant": { "name": "Web Impian Sdn. Bhd.", "email": "webimpian.merchant@gmail.com" } } } ``` -------------------------------- ### GET /v3/portals Source: https://api.webimpian.support/bayarcash/portal/list Retrieves a list of portals associated with your Bayarcash account. This endpoint is versioned as v3. ```APIDOC ## GET /v3/portals ### Description Retrieves a list of portal in Bayarcash. ### Method GET ### Endpoint `https://api.console.bayar.cash/v3/portals` ### Request Example ```bash curl -X GET https://api.console.bayar.cash/v3/portals \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer ' ``` ### Response #### Success Response (200) - **data** (array) - A list of portal objects. - **links** (object) - Pagination links. - **meta** (object) - Metadata about the response, including pagination details. #### Response Example ```json { "data": [ { "id": 931, "created_at": "2024-10-19 12:47:07", "portal_key": "8baf5e234dd88c2d1375d5f386d78d8f", "portal_name": "Payment Link", "url": "https://bcl.my/", "transaction_notification_email": "hai@bayarcash.com", "custom_payment_button_text": null, "payment_channels": [ { "id": 1, "code": "FPX", "name": "FPX" }, { "id": 3, "code": "FpxDirectDebit", "name": "Direct Debit" }, { "id": 4, "code": "FpxLineOfCredit", "name": "FPX Line of Credit" } ] } ], "links": { "first": "https://api.console.bayar.cash/v3/portals?page=1", "last": "https://api.console.bayar.cash/v3/portals?page=1", "prev": null, "next": null }, "meta": { "current_page": 1, "from": 1, "last_page": 1, "links": [ { "url": null, "label": "pagination.previous", "active": false }, { "url": "https://api.console.bayar.cash/v3/portals?page=1", "label": "1", "active": true }, { "url": null, "label": "pagination.next", "active": false } ], "path": "https://api.console.bayar.cash/v3/portals", "per_page": 15, "to": 2, "total": 2, "merchant": { "name": "Bayarcash Sdn. Bhd.", "email": "hai@bayarcash.com", "created_at": "2024-10-19 12:45:42" } } } ``` ``` -------------------------------- ### Retrieve Portal List via cURL Source: https://api.webimpian.support/bayarcash/portal/list Use this cURL command to perform a GET request to the v3 portals endpoint. Requires a valid Personal Access Token in the Authorization header. ```markup curl -X GET https://api.console.bayar.cash/v3/portals \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer ' ``` -------------------------------- ### Retrieve Mandate Details JSON Response Source: https://api.webimpian.support/bayarcash/direct-debit/mandate-id Example of the JSON object returned when successfully querying a mandate by its ID. ```json { "id": "md_MGWpzp", "updated_at": "2024-07-21T15:07:09.000000Z", "mandate_reference_number": "E-20230408F00230289", "order_number": "1-680-631-498-908819", "application_reason": "Enrollment for 1-680-631-498-908819", "frequency_mode": "MT", "frequency_mode_label": "Monthly", "effective_date": "2023-04-05", "expiry_date": null, "currency": "MYR", "amount": 10, "payer_name": "Mohd Ali", "payer_id": "910810065921", "payer_id_type": "1", "payer_bank_account_number": "1602219363111", "payer_email": "mohd.ali@gmail.com", "payer_telephone_number": "60199971822", "status": 3, "status_description": "Active", "return_url": "http://website.net/transaction/mandates/callback", "metadata": null, "portal": "Portal ABC", "merchant": { "name": "Web Impian Sdn. Bhd.", "email": "webimpian.merchant@gmail.com" } } ``` -------------------------------- ### Retrieve Merchant Payouts JSON Response Source: https://api.webimpian.support/bayarcash/enterprise-partner/all-merchant-payouts Example of the structured JSON response returned when querying the payouts endpoint. ```json { "data": [ { "id": "pay_YZ6jNY", "created_at": "2024-11-01 14:20:06", "status": "Processing", "package_subscription_id": 399, "payment_channel": "FPX", "reference_number": "P11229399384849", "split_payout": "Parent", "bank_transaction": null, "amount": "97.00" } ], "links": { "first": "https://api.console.bayar.cash/v3/payouts?page=1", "last": "https://api.console.bayar.cash/v3/payouts?page=2", "prev": null, "next": "https://api.console.bayar.cash/v3/payouts?page=2" }, "meta": { "current_page": 1, "from": 1, "last_page": 2, "links": [ { "url": null, "label": "« Previous", "active": false }, { "url": "https://api.console.bayar.cash/v3/payouts?page=1", "label": "1", "active": true }, { "url": "https://api.console.bayar.cash/v3/payouts?page=2", "label": "2", "active": false }, { "url": "https://api.console.bayar.cash/v3/payouts?page=2", "label": "Next »", "active": false } ], "path": "https://api.console.bayar.cash/v3/payouts", "per_page": 15, "to": 15, "total": 27 } } ``` -------------------------------- ### Payment Intent JSON Response Structure Source: https://api.webimpian.support/bayarcash/payment/payment-intent-id This is an example of the JSON response you will receive when querying a payment intent. It includes details about the payment status, amounts, payer information, and transaction attempts. ```json { "type": "payment_intent", "id": "pi_PGPP2G", "status": "paid", "last_attempt": "2024-12-30 12:07:57", "paid_at": "2024-12-30 12:07:57", "order_number": "ORD001", "amount": "10.50", "currency": "MYR", "payer_name": "Mohd Ali", "payer_email": "mohd.ali@gmail.com", "payer_telephone_number": "+60169166656", "attempts": [ { "transaction_id": "trx_YdoXvn", "created_at": "2024-12-30 12:07:57", "payer_name": "Mohd Ali", "payer_email": "mohd.ali@gmail.com", "payer_telephone_number": "+60169166656", "order_number": "ORD001", "currency": "MYR", "amount": "10.50", "exchange_reference_number": "1-735-272-902-315691", "exchange_transaction_id": "2412271215020084", "payer_bank_name": "SBI Bank A", "status": 3, "status_description": "Approved", "payment_gateway": { "id": 1, "name": "FPX", "code": "FPX" } }, { "transaction_id": "trx_GWlpvW", "created_at": "2024-12-27 12:15:02", "payer_name": "Mohd Ali", "payer_email": "mohd.ali@gmail.com", "payer_telephone_number": "+60169166656", "order_number": "ORD001", "currency": "MYR", "amount": "10.50", "exchange_reference_number": "1-735-272-902-315691", "exchange_transaction_id": "2412271215020084", "payer_bank_name": "SBI Bank A", "status": 2, "status_description": "Unsuccessful", "payment_gateway": { "id": 1, "name": "FPX", "code": "FPX" } } ] } ``` -------------------------------- ### Register Merchant with cURL Source: https://api.webimpian.support/bayarcash/enterprise-partner/merchant-registration Use this cURL command to register a new merchant. Ensure you replace placeholders like `` and `` with your actual credentials. The `--data-raw` section must contain valid JSON with all required fields. ```bash curl -X POST https://api.console.bayar.cash/v3/merchant-registrations \ --header 'Content-Type: application/json' \ --header 'X-API-Key: ' \ --header 'Authorization: Bearer ' \ --data-raw '{ "organisation_name": string, "organisation_registration_number": string, "organisation_bank_id": integer, // Please refer Payout Bank List "organisation_bank_account_holder": string, "organisation_bank_account_number": string, "login_name": string, "login_email": string, "login_mobile_number": integer, "password": string, "password_confirmation": string }' ``` -------------------------------- ### POST {return_url} (Authorization) Source: https://api.webimpian.support/bayarcash/direct-debit/callback Handles authorization callbacks for enrollment, maintenance, and termination events. ```APIDOC ## POST {return_url} ### Description Receives authorization status updates for enrollment, maintenance, and termination. ### Method POST ### Endpoint {return_url} ### Request Body - **record_type** (string) - Required - Value: "authorization" - **transaction_id** (string) - Required - **mandate_id** (string) - Required - **exchange_reference_number** (string) - Required - **exchange_transaction_id** (string) - Required - **order_number** (number) - Required - **currency** (string) - Required - **amount** (string) - Required - **payer_name** (string) - Required - **payer_email** (string) - Required - **payer_bank_name** (string) - Required - **status** (string) - Required - **status_description** (string) - Required - **datetime** (string) - Required - **checksum** (string) - Required ### Response #### Success Response (200) - Returns 200 status code to acknowledge receipt. ``` -------------------------------- ### POST {return_url} (Bank Approval) Source: https://api.webimpian.support/bayarcash/direct-debit/callback Handles bank approval callbacks for enrollment, maintenance, and termination events. ```APIDOC ## POST {return_url} ### Description Receives bank approval status updates for enrollment, maintenance, and termination. ### Method POST ### Endpoint {return_url} ### Request Body - **record_type** (string) - Required - Value: "bank_approval" - **approval_date** (string) - Required - **approval_status** (string) - Required - **mandate_id** (string) - Required - **mandate_reference_number** (string) - Required - **order_number** (string) - Required - **payer_bank_code_hashed** (string) - Required - **payer_bank_code** (string) - Required - **payer_bank_account_no** (string) - Required - **application_type** (number) - Required - **checksum** (string) - Required ### Response #### Success Response (200) - Returns 200 status code to acknowledge receipt. ``` -------------------------------- ### Initialize e-Mandate Enrollment Request Source: https://api.webimpian.support/bayarcash/direct-debit/e-mandate-enrollment Use this cURL command to send a POST request to the Bayarcash API to initialize an e-Mandate enrollment. Ensure your account is enabled for Direct Debit and include your Personal Access Token for authorization. ```bash curl -X POST https://api.console.bayar.cash/v3/mandates \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer ' \ --data-raw '{ "portal_key": string, "order_number": DD001, "amount": 100, "payer_id_type": 1, "payer_id": "123456121234", "payer_name": "Mohd Ali", "payer_email": "mohd.ali@gmail.com", "payer_telephone_number": "60191122000", "frequency_mode": "MT", "application_reason": "Enrollment for DD001", "effective_date": "2024-08-01", "expiry_date": "2025-07-01", "metadata": string, "return_url": "https://website.net/callback", "success_url": "https://website.net/success", "failed_url": "https://website.net/failed", "checksum": string }' ``` -------------------------------- ### POST /v3/portals Source: https://api.webimpian.support/bayarcash/portal/create Creates a new portal using the v3 API. ```APIDOC ## POST /v3/portals ### Description Creates a new portal via the v3 API. ### Method POST ### Endpoint `/v3/portals` ### Request Example ```json { "example": "POST request with cURL" } ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message. #### Response Example ```json { "example": "Portal created successfully." } ``` ``` -------------------------------- ### Initialize Payment Intent with cURL Source: https://api.webimpian.support/bayarcash/payment/payment-intent Use this cURL command to send a POST request to the v3 payment-intents endpoint. Ensure the Authorization header includes a valid Personal Access Token. ```markup curl -X POST https://api.console.bayar.cash/v3/payment-intents \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer ' \ --data-raw '{ "payment_channel": 5, "portal_key": string, "order_number": string, "amount": 100, "payer_name": string, "payer_email": string, "payer_telephone_number": integer, "payer_bank_code": string, "payer_bank_name": string, "metadata": string, "return_url": string, "platform_id": string, "checksum": string }' ``` -------------------------------- ### POST {return_url} (Transaction) Source: https://api.webimpian.support/bayarcash/direct-debit/callback Handles transaction callbacks specifically for enrollment events. ```APIDOC ## POST {return_url} ### Description Receives transaction status updates applicable to enrollment. ### Method POST ### Endpoint {return_url} ### Request Body - **record_type** (string) - Required - Value: "transaction" - **batch_number** (string) - Required - **mandate_id** (string) - Required - **mandate_reference_number** (string) - Required - **transaction_id** (string) - Required - **datetime** (string) - Required - **reference_number** (string) - Required - **amount** (number) - Required - **status** (string) - Required - **status_description** (string) - Required - **cycle** (number) - Required - **checksum** (string) - Required ### Response #### Success Response (200) - Returns 200 status code to acknowledge receipt. ``` -------------------------------- ### POST /v2/payment-intents and POST /v3/payment-intents Source: https://api.webimpian.support/bayarcash/payment/payment-intent Initialize a payment intent request to Bayarcash. Ensure your account is enabled for the selected payment channel. By default, only the FPX channel is activated. ```APIDOC ## POST /v2/payment-intents and POST /v3/payment-intents ### Description Initialize a payment intent request to Bayarcash. Make sure your account is enabled for the selected payment channel. By default only FPX channel is activated. ### Method POST ### Endpoint - `console.bayar.cash/api/v2/payment-intents` - `api.console.bayar.cash/v3/payment-intents` ### Parameters #### Request Body - **payment_channel** (integer) - Required - Refer payment channel page - **portal_key** (string) - Required - Portal key retrieve from Bayarcash console - **order_number** (string) - Required - - **amount** (integer) - Required - - **payer_name** (string) - Required - - **payer_email** (string) - Required - - **payer_telephone_number** (integer) - Optional - Currently we only accept Malaysia number - **payer_bank_code** (string) - Optional - - **payer_bank_name** (string) - Optional - - **metadata** (string) - Optional - Currently only support order items from WooCommerce plugin - **return_url** (string) - Optional - Server to browser redirect callback (use GET) - **callback_url** (string) - Optional - Server to server redirect callback (use POST) - only available on v3 - **platform_id** (string) - Optional - - **checksum** (string) - Optional - ### Request Example ```json { "payment_channel": 5, "portal_key": "string", "order_number": "string", "amount": 100, "payer_name": "string", "payer_email": "string", "payer_telephone_number": integer, "payer_bank_code": "string", "payer_bank_name": "string", "metadata": "string", "return_url": "string", "platform_id": "string", "checksum": "string" } ``` ### Response #### Success Response (200) - **type** (string) - only available on v3 - **id** (string) - only available on v3 - **payer_name** (string) - - **payer_email** (string) - - **payer_telephone_number** (string) - - **order_number** (string) - - **amount** (string) - - **url** (string) - #### Response Example ```json { "type": "payment_intent", "id": "pi_MGWpzp", "payer_name": "Mohd Ali", "payer_email": "mohd.ali@gmail.com", "payer_telephone_number": "60193000123", "order_number": "1351", "amount": "21.10", "url": "https://console.bayar.cash/payment-intent/pi_MGWpzp" } ``` ``` -------------------------------- ### GET /transactions/{transaction_id} Source: https://api.webimpian.support/bayarcash/transaction/transaction-id Retrieves the full transaction object for a given transaction ID to check its current status. ```APIDOC ## GET /transactions/{transaction_id} ### Description Retrieve the current status and details of a specific transaction. ### Method GET ### Endpoint console.bayar.cash/api/v2/transactions/{transaction_id} or api.console.bayar.cash/v3/transactions/{transaction_id} ### Parameters #### Path Parameters - **transaction_id** (string) - Required - The unique identifier of the transaction. ### Request Example curl -X GET https://api.console.bayar.cash/v3/transactions/trx_z88ymJ \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer ' ### Response #### Success Response (200) - **id** (string) - Transaction ID - **updated_at** (string) - Last update timestamp - **datetime** (string) - Transaction creation timestamp - **order_number** (string) - Order reference number - **payer_name** (string) - Name of the payer - **payer_email** (string) - Email of the payer - **payer_telephone_number** (string) - Phone number of the payer - **currency** (string) - Currency code - **amount** (number) - Transaction amount - **exchange_reference_number** (string) - Exchange reference - **exchange_transaction_id** (string) - Exchange transaction ID - **payer_bank_name** (string) - Bank name - **status** (integer) - Status code - **status_description** (string) - Human-readable status - **return_url** (string) - Callback URL - **metadata** (null) - Metadata object - **payout** (object) - Payout details - **payment_gateway** (object) - Payment gateway info - **portal** (string) - Portal name - **merchant** (object) - Merchant details #### Response Example { "id": "trx_q6LJdl", "updated_at": "2023-05-26 13:35:01", "datetime": "2023-05-26 13:29:06", "order_number": "24354620275", "payer_name": "Mohd Ali", "payer_email": "mohd.ali@gmail.com", "payer_telephone_number": "60111157245", "currency": "MYR", "amount": 50, "exchange_reference_number": "1-685-0718-946-53336", "exchange_transaction_id": "23052613290110936", "payer_bank_name": "Bank Islam", "status": 3, "status_description": "Approved", "return_url": "https://website.net/api/return_url", "metadata": null, "payout": { "reference_number": "P1685011113148329" }, "payment_gateway": { "name": "FPX", "code": "FPX" }, "portal": "Portal ABC", "merchant": { "name": "Web Impian Sdn. Bhd.", "email": "webimpian.merchant@gmail.com" } } ```