# BCL API > BCL is a Malaysian platform for payment forms, events, bookings and payment links. This is the reference for the BCL API v1: payment links, forms, event forms, customers, participants, coupons, protected content, automations and transactions. - Interactive reference: https://api-reference.bcl.my/ - OpenAPI document: https://api-reference.bcl.my/openapi/v1.yaml (also https://api-reference.bcl.my/openapi/v1.json) - Base URL (Production. Use this address for all new integrations.): https://api.bcl.my/v1 - Base URL (Legacy. The old address. Use it only for the integrations that use it now.): https://bcl.my/api - Authentication: a bearer token (`Authorization: Bearer `). - Help centre for merchants: https://docs.bcl.my/ (its own index: https://docs.bcl.my/llms.txt) ## Introduction BCL (Bayarcash Commerce Layer) is a no-code platform to sell online. Bayarcash is the payment gateway that collects the money. Use this API to connect your website, app or system to your BCL account. With the API, you can: - Create payment links for one-off payments. Set the amount and the payer details. - Get the status of a payment, and read your transactions and customers. - Manage your payment forms, event forms, participants, coupons, protected content and automations. ## Payment methods The payer can pay with these methods: - Online banking (FPX) - Credit cards and debit cards - E-wallets and pay-later, for example Boost and SPayLater The methods that you can use are the methods that your Bayarcash portal offers. ## Authentication Each request must have an API token. Send the token as a bearer token in the `Authorization` header: ``` Authorization: Bearer bcl_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Accept: application/json User-Agent: MyShop/1.0 ``` To create a token, go to **Platform Setup → Integrations** in BCL. On the **API tokens** card, click **Manage**. Then click **Create new API token**. Only an Admin can create a token. Each Admin can have a maximum of 10 tokens. Give the token only the permissions that your app must have: - **API Read**: read forms, transactions, customers, coupons and other data. - **API Write**: create payment links and change data. A token with only **API Write** cannot read data. Usually, select **API Read** also. After you create a token, you cannot change its permissions. For the full steps, see [Create an API token](https://docs.bcl.my/api-tokens/). > [!IMPORTANT] > Send a `User-Agent` header that gives the name of your app. BCL refuses requests that have the default user agent of a script tool, such as `curl` or `python-requests`. > [!CAUTION] > A token gives access to the same data as the Admin who created it. Do not put a token in website code that visitors can see, in a public Git repository, or in a screenshot. If a token becomes known to other persons, delete it immediately. ## Errors Each error response has a `message`. These status codes are the same for all the endpoints: | Code | Meaning | |---|---| | `401` | The token is missing, not correct, or expired. | | `404` | The item is not in your account. | | `422` | A field is not correct. The `errors` object gives the problem for each field. | | `500` | BCL did not complete the request. | If the token does not have the necessary permission, the message is, for example, `Token does not have the 'api:write' ability`. Create a new token with the correct permissions. ## BCL and Bayarcash BCL keeps the record of each sale. Bayarcash collects the payment and pays the money to your bank account. For questions on registration, payouts and payment channels, speak to Bayarcash. For more information, see [BCL and Bayarcash](https://docs.bcl.my/bcl-and-bayarcash/). ## Payments ## Payment links A payment link is a link to a payment page for one customer, with a set amount. Use it when you sell through WhatsApp, Facebook or other chats, and a full payment form is not necessary. A payment link stays valid for a maximum of 3 months. When the customer pays, the payment shows in [Transactions](#tag/transactions). See [Create a payment link](https://docs.bcl.my/payment-link/). ### Create a payment link `POST /payment-link` Create a payment link for one payer. The response gives the `payment_link`. Send this link to the payer. You can set the payment channel in two ways: - Send `payment_channel` to set one channel. - Set `let_user_choose_payment` to `true`. The payer can then select the channel on the payment page. > [!NOTE] > A payment link stays valid for a maximum of 3 months. The token must have the **API Write** permission. Request body (JSON): - `order_number` (string or null, optional): Optional. Your order reference. If you do not send it, BCL makes one. Use a maximum of 64 letters, digits and the characters `.` `_` `-` `/`. The value must not start with `LINK-`. - `amount` (number, required): The amount to pay, in MYR. - `payer_name` (string, required): The name of the payer. - `payer_email` (string, required): The email address of the payer. - `payer_telephone_number` (string, required): The phone number of the payer, in international format. The number can include the country code. - `portal_key` (string, required): The key of the Bayarcash portal that receives the payment. Get it from your portals in the Bayarcash Console (console.bayar.cash/portals). See [Choose a Bayarcash portal key](https://docs.bcl.my/bayarcash-portal-key/). - `payment_channel` (integer or null, optional, one of: 1, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 21, 23, ): Optional. The payment channel. Send the number of the channel: - `1`: FPX Online Banking - `4`: FPX Line of Credit - `5`: DuitNow Online Banking - `6`: DuitNow QR - `7`: SPayLater - `8`: Boost PayFlex - `9`: QRIS Online Banking - `10`: QRIS e-Wallet - `11`: NETS Singapore - `12`: Credit Card - `13`: Alipay - `14`: WeChat Pay - `15`: PromptPay Thailand - `16`: Touch 'n Go eWallet - `17`: Boost Wallet - `18`: GrabPay - `19`: Grab PayLater - `21`: ShopeePay - `23`: FPX B2B - `let_user_choose_payment` (boolean or null, optional): Optional. Set to `true` to let the payer select the payment method on the payment page. BCL then sets `payment_channel` to `null`. - `remarks` (string or null, optional): Optional. A note for the order. Responses: - 200: Success. - 201: Created. - 401: Unauthenticated. The token is missing, not correct, or expired. - 422: Validation error. One or more fields are not correct. ### Get the status of a payment link `GET /transaction/{orderNumber}` Get the transaction of a payment link by its order number. The response gives the transaction, the `short_link` and the `payment_status`. To get all the details of a transaction, use [Get a transaction](#tag/transactions/GET/transactions/{orderNumber}). Parameters: - `orderNumber` (path, string, required): The order number of the payment link. The response of Create a payment link gives it as `order_number`. Responses: - 200: Success. - 401: Unauthenticated. The token is missing, not correct, or expired. - 404: Not found. No item with this ID or order number is in your account. - 500: Server error. BCL did not complete the request. ## Transactions A transaction is one payment through your forms, payment links or QR codes. Get the transactions, the details of one transaction, and the totals for a date range. The status of a transaction is `pending`, `success`, `completed`, `cancelled` or `failed`. See [Find a transaction](https://docs.bcl.my/transactions/). ### List transactions `GET /transactions` Get your transactions, one page at a time. You can filter, search and sort the list. Parameters: - `page` (query, integer, optional): The page number. The first page is 1. - `per_page` (query, integer, optional): The number of items on each page. - `search` (query, string, optional): Find transactions by order number, payer name, email, phone or Bayarcash transaction ID. - `status` (query, string, optional, one of: pending, failed, success, cancelled, completed, all): Show only the transactions with this status. Use `all` for all statuses. - `payment_channel` (query, integer, optional, one of: 1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 21, 23): Show only the transactions with this payment channel. Send the number of the channel: - `1`: FPX Online Banking - `3`: FPX Direct Debit - `4`: FPX Line of Credit - `5`: DuitNow Online Banking - `6`: DuitNow QR - `7`: SPayLater - `8`: Boost PayFlex - `9`: QRIS Online Banking - `10`: QRIS e-Wallet - `11`: NETS Singapore - `12`: Credit Card - `13`: Alipay - `14`: WeChat Pay - `15`: PromptPay Thailand - `16`: Touch 'n Go eWallet - `17`: Boost Wallet - `18`: GrabPay - `19`: Grab PayLater - `21`: ShopeePay - `23`: FPX B2B - `form_type` (query, string, optional, one of: payment_form, event_form, booking_form, all): Show only the transactions from this type of form. Use `all` for all types. - `date_from` (query, string, optional): Show the transactions from this date. The list includes this date. Format `YYYY-MM-DD`. - `date_to` (query, string, optional): Show the transactions until this date. The list includes this date. Format `YYYY-MM-DD`. - `min_amount` (query, number, optional): Show only the transactions with an amount of this value or more, in MYR. - `max_amount` (query, number, optional): Show only the transactions with an amount of this value or less, in MYR. - `sort_by` (query, string, optional, one of: created_at, amount, status, order_number): The field that BCL uses to sort the list. - `sort_order` (query, string, optional, one of: asc, desc): The sort direction: `asc` (from low to high) or `desc` (from high to low). Responses: - 200: Success. - 401: Unauthenticated. The token is missing, not correct, or expired. - 422: Validation error. One or more fields are not correct. - 500: Server error. BCL did not complete the request. ### Get transaction statistics `GET /transactions/stats` Get the statistics of the paid transactions in a date range. The response gives the revenue, in groups by status, payment channel and form type. If you do not send dates, the range is the last 30 days. Parameters: - `date_from` (query, string, optional): The first date of the range. The range includes this date. The default is 30 days before today. Format `YYYY-MM-DD`. - `date_to` (query, string, optional): The last date of the range. The range includes this date. The default is today. Format `YYYY-MM-DD`. Responses: - 200: Success. - 401: Unauthenticated. The token is missing, not correct, or expired. - 422: Validation error. One or more fields are not correct. - 500: Server error. BCL did not complete the request. ### Get a transaction `GET /transactions/{orderNumber}` Get one transaction by its order number. The response gives: - the payer details - the payment status - the amounts - the items - the form of the transaction Parameters: - `orderNumber` (path, string, required): The order number of the transaction. Responses: - 200: Success. - 401: Unauthenticated. The token is missing, not correct, or expired. - 404: Not found. No item with this ID or order number is in your account. - 500: Server error. BCL did not complete the request. ## Forms and events ## Payment forms A payment form is a page where your customers fill in their details and pay you. Get your payment forms, and change their status, slug, title, content, stock, prices and other configuration. See [Create your first payment form](https://docs.bcl.my/create-payment-form/). ### List payment forms `GET /forms` Get the payment forms that you can manage, one page at a time. Parameters: - `page` (query, integer, optional): The page number. The first page is 1. - `per_page` (query, integer, optional): The number of items on each page. - `search` (query, string, optional): The text to find. - `status` (query, string, optional, one of: active, inactive, all): Show only `active` items, only `inactive` items, or `all` items. - `sort_by` (query, string, optional, one of: title, created_at, updated_at, slug): The field that BCL uses to sort the list. - `sort_order` (query, string, optional, one of: asc, desc): The sort direction: `asc` (from low to high) or `desc` (from high to low). Responses: - 200: Success. - 401: Unauthenticated. The token is missing, not correct, or expired. - 422: Validation error. One or more fields are not correct. - 500: Server error. BCL did not complete the request. ### Get a payment form `GET /forms/{id}` Get the full configuration of one payment form. The response includes the products, the variations and the other configuration. Parameters: - `id` (path, integer, required): The ID of the payment form. Responses: - 200: Success. - 401: Unauthenticated. The token is missing, not correct, or expired. - 404: Not found. No item with this ID or order number is in your account. - 500: Server error. BCL did not complete the request. ### Duplicate a payment form `POST /forms/duplicate` Make a copy of a payment form. The copy is a new draft that you can change. Send the ID of the form to copy in `form_id`. Send a `title` and a `slug` for the new form. Request body (JSON): - `form_id` (integer, required): The ID of the payment form to copy. - `title` (string, required): The title of the new form. - `slug` (string, required): The slug of the new form. Use only letters, digits, `-` and `_`. Responses: - 201: Created. - 401: Unauthenticated. The token is missing, not correct, or expired. - 404: Not found. No item with this ID or order number is in your account. - 422: Validation error. One or more fields are not correct. - 500: Server error. BCL did not complete the request. ### Change the status of a payment form `PATCH /forms/{id}/status` Make the payment form available or not available to customers. Set `is_active` to `true` or `false`. Parameters: - `id` (path, integer, required): The ID of the payment form. Request body (JSON): - `is_active` (boolean, required): `true` makes the form available to customers. `false` makes it not available. Responses: - 200: Success. - 401: Unauthenticated. The token is missing, not correct, or expired. - 404: Not found. No item with this ID or order number is in your account. - 422: Validation error. One or more fields are not correct. - 500: Server error. BCL did not complete the request. ### Show a payment form on the homepage `PATCH /forms/{id}/homepage` Set if the payment form shows on your BCL homepage. Set `show_on_homepage` to `true` or `false`. Parameters: - `id` (path, integer, required): The ID of the payment form. Request body (JSON): - `show_on_homepage` (boolean, required): `true` shows the form on your BCL homepage. `false` removes it from the homepage. Responses: - 200: Success. - 401: Unauthenticated. The token is missing, not correct, or expired. - 404: Not found. No item with this ID or order number is in your account. - 422: Validation error. One or more fields are not correct. - 500: Server error. BCL did not complete the request. ### Change the slug of a payment form `PATCH /forms/{id}/slug` Change the public slug of the payment form. The slug is part of the public address of the form. The response gives the new link in `form_url`. Parameters: - `id` (path, integer, required): The ID of the payment form. Request body (JSON): - `slug` (string, required): The new slug. It is part of the public address of the form. Responses: - 200: Success. - 401: Unauthenticated. The token is missing, not correct, or expired. - 404: Not found. No item with this ID or order number is in your account. - 422: Validation error. One or more fields are not correct. - 500: Server error. BCL did not complete the request. ### Change the title of a payment form `PATCH /forms/{id}/title` Change the title of the payment form. The other configuration of the form does not change. Parameters: - `id` (path, integer, required): The ID of the payment form. Request body (JSON): - `title` (string, required): The new title. Responses: - 200: Success. - 401: Unauthenticated. The token is missing, not correct, or expired. - 404: Not found. No item with this ID or order number is in your account. - 422: Validation error. One or more fields are not correct. - 500: Server error. BCL did not complete the request. ### Change the content of a payment form `PATCH /forms/{id}/content` Save the HTML body of a custom payment form. Send the HTML in `content_editor`. Parameters: - `id` (path, integer, required): The ID of the payment form. Request body (JSON): - `content_editor` (string, required): The HTML body of the form. Responses: - 200: Success. - 401: Unauthenticated. The token is missing, not correct, or expired. - 404: Not found. No item with this ID or order number is in your account. - 422: Validation error. One or more fields are not correct. - 500: Server error. BCL did not complete the request. ### Change the stock of a payment form `PATCH /forms/{id}/stock` Change the stock of the products or variations of the payment form. Send one item for each product or variation. Parameters: - `id` (path, integer, required): The ID of the payment form. Request body (JSON): - `items` (array of object, required): One item for each product or variation. `id` is the ID of the product or variation. `stock` is the new number in stock. Responses: - 200: Success. - 401: Unauthenticated. The token is missing, not correct, or expired. - 404: Not found. No item with this ID or order number is in your account. - 422: Validation error. One or more fields are not correct. - 500: Server error. BCL did not complete the request. ### Change the prices of a payment form `PATCH /forms/{id}/prices` Change the prices of the products or variations of the payment form. Send one item for each product or variation. For `sale_price`: - If you do not send `sale_price`, the sale price does not change. - If you send `null` or `0`, BCL removes the sale price. Parameters: - `id` (path, integer, required): The ID of the payment form. Request body (JSON): - `items` (array of object, required): One item for each product or variation. `id` is the ID of the product or variation. Send the new `price`, and the `sale_price` if necessary. Responses: - 200: Success. - 401: Unauthenticated. The token is missing, not correct, or expired. - 404: Not found. No item with this ID or order number is in your account. - 422: Validation error. One or more fields are not correct. - 500: Server error. BCL did not complete the request. ### Change the affiliate options of a payment form `PATCH /forms/{id}/affiliate` Change the affiliate programme options of the payment form. > [!NOTE] > You can change these options only when affiliates are on for your full account. If they are off, the API sends a `403` response. Parameters: - `id` (path, integer, required): The ID of the payment form. Request body (JSON): - `enable_affiliate` (boolean, optional): Set to `true` to use the affiliate programme on this form. - `show_affiliate_info` (boolean, optional): Set to `true` to show customers the affiliate who referred them. - `override_commission_settings` (boolean, optional): Set to `true` to use a different commission rate on this form. Responses: - 200: Success. - 401: Unauthenticated. The token is missing, not correct, or expired. - 403: Forbidden. Affiliates are off for your full account. - 404: Not found. No item with this ID or order number is in your account. - 422: Validation error. One or more fields are not correct. - 500: Server error. BCL did not complete the request. ### Change the redirect URLs of a payment form `PATCH /forms/{id}/redirect-urls` Set the pages where BCL sends the customer after the payment. Set one URL for a successful payment and one URL for a failed payment. Parameters: - `id` (path, integer, required): The ID of the payment form. Request body (JSON): - `success_url` (string or null, optional): The page for a successful payment. The URL can contain these variables: - `{order_number}`: the order number of the transaction - `{amount}`: the payment amount - `{status}`: the payment status (success or failed) - `{email}`: the email of the customer - `{customer_name}`: the name of the customer - `{customer_phone}`: the phone number of the customer - `{payment_date}`: the date and time of the payment - `{form_title}`: the title of the form - `{reference_id}`: the reference ID - `{payment_method}`: the payment method - `{currency}`: the currency (MYR) - `{items}`: the item details (name, quantity, price) - `{shipping}`: the shipping details (method, cost) - `{address}`: the address of the customer - `failed_url` (string or null, optional): The page for a failed payment. The URL can contain the same variables as `success_url`. Responses: - 200: Success. - 401: Unauthenticated. The token is missing, not correct, or expired. - 404: Not found. No item with this ID or order number is in your account. - 422: Validation error. One or more fields are not correct. - 500: Server error. BCL did not complete the request. ### Change the webhook of a payment form `PATCH /forms/{id}/webhook` Start or stop the webhook of the payment form. Then select the events that BCL sends to your URL. For the fields that BCL sends, see [Payment form webhook payload](https://docs.bcl.my/webhook-payment-form/). Parameters: - `id` (path, integer, required): The ID of the payment form. Request body (JSON): - `enabled` (boolean, required): Set to `true` to start the webhook. Set to `false` to stop it. - `url` (string or null, optional): The URL that receives the webhook. - `events` (array or null, optional): The events that BCL sends to the URL. Responses: - 200: Success. - 401: Unauthenticated. The token is missing, not correct, or expired. - 404: Not found. No item with this ID or order number is in your account. - 422: Validation error. One or more fields are not correct. - 500: Server error. BCL did not complete the request. ### Change the Facebook pixel of a payment form `PATCH /forms/{id}/facebook-pixel` Change the Facebook pixel of the payment form. You can: - start or stop the pixel - set the pixel ID - set the server-side options (Conversions API) Parameters: - `id` (path, integer, required): The ID of the payment form. Request body (JSON): - `enable_facebook_pixel` (boolean, required): Set to `true` to start the Facebook pixel. Set to `false` to stop it. - `facebook_pixel_id` (string or null, optional): The ID of your Facebook pixel. - `enable_facebook_api` (boolean or null, optional): Set to `true` to also send the events from the server (Conversions API). - `facebook_api_token` (string or null, optional): The access token for the Conversions API. Responses: - 200: Success. - 401: Unauthenticated. The token is missing, not correct, or expired. - 404: Not found. No item with this ID or order number is in your account. - 422: Validation error. One or more fields are not correct. - 500: Server error. BCL did not complete the request. ### Change the TikTok pixel of a payment form `PATCH /forms/{id}/tiktok-pixel` Change the TikTok pixel of the payment form. You can: - start or stop the pixel - set the pixel ID - set the Events API options Parameters: - `id` (path, integer, required): The ID of the payment form. Request body (JSON): - `enable_tiktok_pixel` (boolean, required): Set to `true` to start the TikTok pixel. Set to `false` to stop it. - `tiktok_pixel_id` (string or null, optional): The ID of your TikTok pixel. - `enable_tiktok_api` (boolean or null, optional): Set to `true` to also send the events from the server (Events API). - `tiktok_api_token` (string or null, optional): The access token for the Events API. Responses: - 200: Success. - 401: Unauthenticated. The token is missing, not correct, or expired. - 404: Not found. No item with this ID or order number is in your account. - 422: Validation error. One or more fields are not correct. - 500: Server error. BCL did not complete the request. ### Change the coupon rules of a payment form `PATCH /forms/{id}/coupon` Set if the payment form accepts coupons. Then set the IDs of the coupons that the form accepts. To create a coupon, see [Coupons](#tag/coupons). Parameters: - `id` (path, integer, required): The ID of the payment form. Request body (JSON): - `enable_coupons` (boolean, required): Set to `true` to let the form accept coupons. - `allowed_coupons` (array or null, optional): The IDs of the coupons that the form accepts. Responses: - 200: Success. - 401: Unauthenticated. The token is missing, not correct, or expired. - 404: Not found. No item with this ID or order number is in your account. - 422: Validation error. One or more fields are not correct. - 500: Server error. BCL did not complete the request. ## Event forms An event form is the page where customers buy tickets for your event. It holds the name, date, venue and payment details of the event, and its ticket types. To use event forms, you must have the Event Management add-on. See [Create an event form](https://docs.bcl.my/create-event-form/). ### List event forms `GET /event-forms` Get the event forms that you can manage, one page at a time. Parameters: - `page` (query, integer, optional): The page number. The first page is 1. - `per_page` (query, integer, optional): The number of items on each page. - `search` (query, string, optional): The text to find. - `status` (query, string, optional, one of: active, inactive, all): Show only `active` items, only `inactive` items, or `all` items. - `sort_by` (query, string, optional, one of: created_at, updated_at, starts_at, ends_at, venue_name, slug): The field that BCL uses to sort the list. - `sort_order` (query, string, optional, one of: asc, desc): The sort direction: `asc` (from low to high) or `desc` (from high to low). Responses: - 200: Success. - 401: Unauthenticated. The token is missing, not correct, or expired. - 422: Validation error. One or more fields are not correct. - 500: Server error. BCL did not complete the request. ### Get an event form `GET /event-forms/{id}` Get the full configuration of one event form. The response includes the tickets, the affiliate options and the other configuration. Parameters: - `id` (path, integer, required): The ID of the event form. Responses: - 200: Success. - 401: Unauthenticated. The token is missing, not correct, or expired. - 404: Not found. No item with this ID or order number is in your account. - 500: Server error. BCL did not complete the request. ### Change the slug of an event form `PATCH /event-forms/{id}/slug` Change the public URL slug of the event form. The response gives the new link in `form_url`. Parameters: - `id` (path, integer, required): The ID of the event form. Request body (JSON): - `slug` (string, required): The new slug. Use only lowercase letters, digits and `-`. Responses: - 200: Success. - 401: Unauthenticated. The token is missing, not correct, or expired. - 404: Not found. No item with this ID or order number is in your account. - 422: Validation error. One or more fields are not correct. - 500: Server error. BCL did not complete the request. ### Change the name of an event form `PATCH /event-forms/{id}/venue-name` Change the name of the event form. The name is in the field `venue_name`. The other configuration of the form does not change. Parameters: - `id` (path, integer, required): The ID of the event form. Request body (JSON): - `venue_name` (string, required): The new name of the event. Responses: - 200: Success. - 401: Unauthenticated. The token is missing, not correct, or expired. - 404: Not found. No item with this ID or order number is in your account. - 422: Validation error. One or more fields are not correct. - 500: Server error. BCL did not complete the request. ### Change the content of an event form `PATCH /event-forms/{id}/content` Save the description or the custom HTML content of the event form. `use_html_content` sets the content mode: - `false`: the event page shows `description`. - `true`: the event page shows `html_content`. Parameters: - `id` (path, integer, required): The ID of the event form. Request body (JSON): - `use_html_content` (boolean, optional): The content mode. `true` uses `html_content`. `false` uses `description`. - `html_content` (string or null, optional): The custom HTML content of the event page. - `description` (string or null, optional): The description of the event. Responses: - 200: Success. - 401: Unauthenticated. The token is missing, not correct, or expired. - 404: Not found. No item with this ID or order number is in your account. - 422: Validation error. One or more fields are not correct. - 500: Server error. BCL did not complete the request. ### Change the status of an event form `PATCH /event-forms/{id}/status` Make the event form available or not available to customers. Set `is_active` to `true` or `false`. Parameters: - `id` (path, integer, required): The ID of the event form. Request body (JSON): - `is_active` (boolean, required): `true` makes the form available to customers. `false` makes it not available. Responses: - 200: Success. - 401: Unauthenticated. The token is missing, not correct, or expired. - 404: Not found. No item with this ID or order number is in your account. - 422: Validation error. One or more fields are not correct. - 500: Server error. BCL did not complete the request. ### Show an event form on the homepage `PATCH /event-forms/{id}/homepage` Set if the event form shows in the showcase on your BCL homepage. Set `show_on_homepage` to `true` or `false`. Parameters: - `id` (path, integer, required): The ID of the event form. Request body (JSON): - `show_on_homepage` (boolean, required): `true` shows the form on your BCL homepage. `false` removes it from the homepage. Responses: - 200: Success. - 401: Unauthenticated. The token is missing, not correct, or expired. - 404: Not found. No item with this ID or order number is in your account. - 422: Validation error. One or more fields are not correct. - 500: Server error. BCL did not complete the request. ### Change the ticket stock of an event form `PATCH /event-forms/{id}/tickets` Change the number of tickets in stock for one or more ticket types in one request. Send one item for each ticket type. Parameters: - `id` (path, integer, required): The ID of the event form. Request body (JSON): - `tickets` (array of object, required): One item for each ticket type. `id` is the ID of the ticket type. `stock` is the new number of tickets in stock. Responses: - 200: Success. - 401: Unauthenticated. The token is missing, not correct, or expired. - 404: Not found. No item with this ID or order number is in your account. - 422: Validation error. One or more fields are not correct. - 500: Server error. BCL did not complete the request. ### Change the ticket prices of an event form `PATCH /event-forms/{id}/ticket-prices` Change the price and the sale price of one or more ticket types in one request. Send one item for each ticket type. For `sale_price`: - If you do not send `sale_price`, the sale price does not change. - If you send `null` or `0`, BCL removes the sale price. Parameters: - `id` (path, integer, required): The ID of the event form. Request body (JSON): - `tickets` (array of object, required): One item for each ticket type. `id` is the ID of the ticket type. Send the new `price`, and the `sale_price` if necessary. Responses: - 200: Success. - 401: Unauthenticated. The token is missing, not correct, or expired. - 404: Not found. No item with this ID or order number is in your account. - 422: Validation error. One or more fields are not correct. - 500: Server error. BCL did not complete the request. ### Change the affiliate options of an event form `PATCH /event-forms/{id}/affiliate` Change the affiliate programme options of this event. > [!NOTE] > You can change these options only when affiliates are on for your full account. If they are off, the API sends a `403` response. Parameters: - `id` (path, integer, required): The ID of the event form. Request body (JSON): - `enable_affiliate` (boolean, optional): Set to `true` to use the affiliate programme on this form. - `show_affiliate_info` (boolean, optional): Set to `true` to show customers the affiliate who referred them. - `override_commission_settings` (boolean, optional): Set to `true` to use a different commission rate on this form. Responses: - 200: Success. - 401: Unauthenticated. The token is missing, not correct, or expired. - 403: Forbidden. Affiliates are off for your full account. - 404: Not found. No item with this ID or order number is in your account. - 422: Validation error. One or more fields are not correct. - 500: Server error. BCL did not complete the request. ### Change the redirect URLs of an event form `PATCH /event-forms/{id}/redirect-urls` Set the pages where BCL sends the customer after the checkout of the event form. Set one URL for a successful payment and one URL for a failed payment. Parameters: - `id` (path, integer, required): The ID of the event form. Request body (JSON): - `success_url` (string or null, optional): The page for a successful payment. The URL can contain these variables: - `{order_number}`: the order number of the transaction - `{amount}`: the payment amount - `{status}`: the payment status (success or failed) - `{email}`: the email of the customer - `{customer_name}`: the name of the customer - `{customer_phone}`: the phone number of the customer - `{payment_date}`: the date and time of the payment - `{form_title}`: the title of the form - `{reference_id}`: the reference ID - `{payment_method}`: the payment method - `{currency}`: the currency (MYR) - `{items}`: the item details (name, quantity, price) - `{shipping}`: the shipping details (method, cost) - `{address}`: the address of the customer - `failed_url` (string or null, optional): The page for a failed payment. The URL can contain the same variables as `success_url`. Responses: - 200: Success. - 401: Unauthenticated. The token is missing, not correct, or expired. - 404: Not found. No item with this ID or order number is in your account. - 422: Validation error. One or more fields are not correct. - 500: Server error. BCL did not complete the request. ### Change the webhook of an event form `PATCH /event-forms/{id}/webhook` Start or stop the webhook of the event form. Then select the events that BCL sends to your URL. Parameters: - `id` (path, integer, required): The ID of the event form. Request body (JSON): - `enabled` (boolean, required): Set to `true` to start the webhook. Set to `false` to stop it. - `url` (string or null, optional): The URL that receives the webhook. - `events` (array or null, optional): The events that BCL sends to the URL. Responses: - 200: Success. - 401: Unauthenticated. The token is missing, not correct, or expired. - 404: Not found. No item with this ID or order number is in your account. - 422: Validation error. One or more fields are not correct. - 500: Server error. BCL did not complete the request. ### Change the Facebook pixel of an event form `PATCH /event-forms/{id}/facebook-pixel` Change the Facebook pixel of the event form. You can: - start or stop the pixel - set the pixel ID - set the Conversions API options Parameters: - `id` (path, integer, required): The ID of the event form. Request body (JSON): - `enable` (boolean, required): Set to `true` to start the Facebook pixel. Set to `false` to stop it. - `pixel_id` (string or null, optional): The ID of your Facebook pixel. - `enable_api` (boolean or null, optional): Set to `true` to also send the events from the server (Conversions API). - `api_token` (string or null, optional): The access token for the Conversions API. - `test_code` (string or null, optional): The test event code for the Conversions API. - `trigger_on_pending` (boolean or null, optional): Set to `true` to send the purchase event for a `pending` order, for example a COD or manual bank transfer order. If `false`, the platform gets the event after you confirm the payment of the order. Responses: - 200: Success. - 401: Unauthenticated. The token is missing, not correct, or expired. - 404: Not found. No item with this ID or order number is in your account. - 422: Validation error. One or more fields are not correct. - 500: Server error. BCL did not complete the request. ### Change the TikTok pixel of an event form `PATCH /event-forms/{id}/tiktok-pixel` Change the TikTok pixel of the event form. You can: - start or stop the pixel - set the pixel ID - set the Events API options Parameters: - `id` (path, integer, required): The ID of the event form. Request body (JSON): - `enable` (boolean, required): Set to `true` to start the TikTok pixel. Set to `false` to stop it. - `pixel_id` (string or null, optional): The ID of your TikTok pixel. - `enable_api` (boolean or null, optional): Set to `true` to also send the events from the server (Events API). - `api_token` (string or null, optional): The access token for the Events API. - `test_code` (string or null, optional): The test event code for the Events API. - `trigger_on_pending` (boolean or null, optional): Set to `true` to send the purchase event for a `pending` order, for example a COD or manual bank transfer order. If `false`, the platform gets the event after you confirm the payment of the order. Responses: - 200: Success. - 401: Unauthenticated. The token is missing, not correct, or expired. - 404: Not found. No item with this ID or order number is in your account. - 422: Validation error. One or more fields are not correct. - 500: Server error. BCL did not complete the request. ### Change the coupon rules of an event form `PATCH /event-forms/{id}/coupon` Set if the event form accepts coupons. Then set the IDs of the coupons that the form accepts. To create a coupon, see [Coupons](#tag/coupons). Parameters: - `id` (path, integer, required): The ID of the event form. Request body (JSON): - `enable_coupons` (boolean, required): Set to `true` to let the form accept coupons. - `allowed_coupons` (array or null, optional): The IDs of the coupons that the form accepts. Responses: - 200: Success. - 401: Unauthenticated. The token is missing, not correct, or expired. - 404: Not found. No item with this ID or order number is in your account. - 422: Validation error. One or more fields are not correct. - 500: Server error. BCL did not complete the request. ## Participants A participant is one attendee of an event, with one ticket. Find participants by phone, email or MyKad, and change the details of one attendee. See [View and manage event participants](https://docs.bcl.my/event-participants/). ### Search participants `GET /participants` Find event participants by the phone or email of the attendee or the buyer. The response gives the participant, the order and the event details. It also gives the public URL of the ticket. Parameters: - `search` (query, string, required): The text to find. BCL compares it with: - the phone and the email of the attendee and of the buyer - the MyKad of the attendee (digits only) The `buyer` scope does not include MyKad. - `match_scope` (query, string, optional, one of: any, attendee, buyer): The fields that BCL compares with the search text: - `any`: the fields of the attendee or of the buyer - `attendee`: only the fields of the attendee - `buyer`: only the fields of the buyer (no MyKad) - `page` (query, integer, optional): The page number. The first page is 1. - `per_page` (query, integer, optional): The number of items on each page. - `include_custom_fields` (query, boolean, optional): Set to `true` to include the custom fields of each participant in the response. Responses: - 200: Success. - 401: Unauthenticated. The token is missing, not correct, or expired. - 422: Validation error. One or more fields are not correct. - 500: Server error. BCL did not complete the request. ### Change a participant `PATCH /participants/{id}` Change the name, email, phone and MyKad of one attendee. One participant is one check-in record. > [!NOTE] > `name` is necessary. BCL changes `email`, `phone` and `mykad` only if you send them. Parameters: - `id` (path, string, required): The ID of the participant. Request body (JSON): - `name` (string, required): The full name of the attendee. - `email` (string or null, optional): Optional. The email of the attendee. BCL changes it only if you send it. - `phone` (string or null, optional): Optional. The phone number of the attendee. BCL changes it only if you send it. - `mykad` (string or null, optional): Optional. The MyKad number of the attendee, in the format `YYMMDD-PB-XXXX`. BCL changes it only if you send it. Responses: - 200: Success. - 401: Unauthenticated. The token is missing, not correct, or expired. - 404: Not found. The item is not in your account. - 422: Validation error. One or more fields are not correct. - 500: Server error. BCL did not complete the request. ### List the participants of an event `GET /event-forms/{id}/participants` Get the attendees of one event form, one page at a time. You can search the list and filter it by status. Parameters: - `id` (path, integer, required): The ID of the event form. - `search` (query, string or null, optional): The text to find. BCL compares it with: - the phone and the email of the attendee and of the buyer - the MyKad of the attendee (digits only) The `buyer` scope does not include MyKad. - `match_scope` (query, string, optional, one of: any, attendee, buyer): The fields that BCL compares with the search text. BCL uses this parameter only when you send `search`. - `any`: the fields of the attendee or of the buyer - `attendee`: only the fields of the attendee - `buyer`: only the fields of the buyer (no MyKad) - `status` (query, string, optional, one of: active, checked_in, cancelled, no_show): Show only the participants with this status. - `page` (query, integer, optional): The page number. The first page is 1. - `per_page` (query, integer, optional): The number of items on each page. - `include_custom_fields` (query, boolean, optional): Set to `true` to include the custom fields of each participant in the response. Responses: - 200: Success. - 401: Unauthenticated. The token is missing, not correct, or expired. - 404: Not found. The item is not in your account. - 422: Validation error. One or more fields are not correct. - 500: Server error. BCL did not complete the request. ## Homepage showcase Your BCL homepage is one page that lists your forms. Get the forms that show on the homepage, in groups by form type. See [Share your BCL homepage](https://docs.bcl.my/homepage/). ### List the forms for the homepage `GET /showcase/forms` Get the payment forms, event forms and lead forms that are ready for the homepage. The response puts the forms in groups by category. Parameters: - `type` (query, string, optional, one of: payment, event, lead, all): The type of form to get. Use `all` for all types. - `per_page` (query, integer, optional): The number of items on each page. - `page` (query, integer, optional): The page number. The first page is 1. Responses: - 200: Success. - 401: Unauthenticated. The token is missing, not correct, or expired. - 422: Validation error. One or more fields are not correct. ## Customers and access ## Customers BCL adds each buyer who pays through a BCL form to your customer list. BCL finds the same customer again by the email address. Get your customers, with their totals and their recent transactions. See [See your customers](https://docs.bcl.my/customers/). ### List customers `GET /customers` Get the customers of your team, one page at a time. BCL calculates the transaction totals of each customer from the transactions at the time of the request. Parameters: - `page` (query, integer, optional): The page number. The first page is 1. - `per_page` (query, integer, optional): The number of items on each page. - `search` (query, string, optional): Find a customer by email or phone number. - `date_from` (query, string, optional): Show only the customers with a first transaction on this date or after it. Format `YYYY-MM-DD`. - `date_to` (query, string, optional): Show only the customers with a last transaction on this date or before it. Format `YYYY-MM-DD`. - `sort_by` (query, string, optional, one of: name, paid_amount, transaction_count, first_transaction_at, last_transaction_at): The field that BCL uses to sort the list. - `sort_order` (query, string, optional, one of: asc, desc): The sort direction: `asc` (from low to high) or `desc` (from high to low). Responses: - 200: Success. - 401: Unauthenticated. The token is missing, not correct, or expired. - 422: Validation error. One or more fields are not correct. - 500: Server error. BCL did not complete the request. ### Get a customer `GET /customers/{id}` Get all the information of one customer in one response: - the profile - the transaction statistics, from the transactions at the time of the request - the recent transactions - the event participants Use the query parameters to filter the recent transactions. Parameters: - `id` (path, string, required): The ULID of the customer. Example `01JA00000000000000000EXAM`. - `status` (query, string, optional): Show only the recent transactions with these statuses. To send more than one status, put a comma between them. Values: `pending`, `failed`, `success`, `cancelled`, `completed`. - `is_paid` (query, boolean, optional): Show only the paid recent transactions (`true`), or only the unpaid recent transactions (`false`). - `payment_channel` (query, string, optional): Show only the recent transactions with these payment channels. To send more than one channel, put a comma between them. Send the number of the channel: - `1`: FPX Online Banking - `3`: FPX Direct Debit - `4`: FPX Line of Credit - `5`: DuitNow Online Banking - `6`: DuitNow QR - `7`: SPayLater - `8`: Boost PayFlex - `9`: QRIS Online Banking - `10`: QRIS e-Wallet - `11`: NETS Singapore - `12`: Credit Card - `13`: Alipay - `14`: WeChat Pay - `15`: PromptPay Thailand - `16`: Touch 'n Go eWallet - `17`: Boost Wallet - `18`: GrabPay - `19`: Grab PayLater - `21`: ShopeePay - `23`: FPX B2B - `limit` (query, integer, optional): The number of recent transactions on each page. The maximum is 100. - `page` (query, integer, optional): The page number of the recent transactions. The first page is 1. - `include_custom_fields` (query, boolean, optional): Set to `true` to include the custom fields of each participant in the participant list. Responses: - 200: Success. - 401: Unauthenticated. The token is missing, not correct, or expired. - 404: Not found. No item with this ID or order number is in your account. - 422: Validation error. One or more fields are not correct. - 500: Server error. BCL did not complete the request. ## Coupons A coupon is a code that a buyer types at checkout to get a discount. You create coupons for your full account. Then you select the forms that accept them. Coupons work on payment forms, event forms and booking forms. See [Create a discount coupon](https://docs.bcl.my/create-coupon/). ### List coupons `GET /coupons` Get your coupons, one page at a time. You can search the list, filter it by status, and sort it. Parameters: - `page` (query, integer, optional): The page number. The first page is 1. - `per_page` (query, integer, optional): The number of items on each page. - `search` (query, string, optional): The text to find. - `status` (query, string, optional, one of: active, inactive, all): Show only `active` items, only `inactive` items, or `all` items. - `sort_by` (query, string, optional, one of: code, created_at, updated_at): The field that BCL uses to sort the list. - `sort_order` (query, string, optional, one of: asc, desc): The sort direction: `asc` (from low to high) or `desc` (from high to low). Responses: - 200: Success. - 401: Unauthenticated. The token is missing, not correct, or expired. - 422: Validation error. One or more fields are not correct. - 500: Server error. BCL did not complete the request. ### Get a coupon `GET /coupons/{id}` Get the details of one coupon by its ID. Parameters: - `id` (path, integer, required): The ID of the coupon. Responses: - 200: Success. - 401: Unauthenticated. The token is missing, not correct, or expired. - 404: Not found. No item with this ID or order number is in your account. - 500: Server error. BCL did not complete the request. ### Change a coupon `PATCH /coupons/{id}` Change the details of one coupon. All the fields are optional. The rules for each field are the same as in [Create a coupon](#tag/coupons/POST/coupons/coupons). Parameters: - `id` (path, integer, required): The ID of the coupon. Request body (JSON): - `code` (string, optional): The code that customers type at checkout. - `description` (string or null, optional): A description of the coupon. - `discount_type` (string, optional, one of: percentage, fixed): The type of discount: `percentage` or `fixed`. - `discount_amount` (number, optional): The value of the discount. A percentage without the `%` sign, or an amount in MYR. - `apply_to` (string, optional, one of: total, items): Where BCL applies the discount: `total` (the full order) or `items` (only the items that you select). - `is_active` (boolean, optional): Set to `true` to make the coupon active. - `enable_condition` (boolean, optional): Set to `true` to use purchase conditions for the coupon. - `min_purchase` (number or null, optional): The minimum purchase amount for the coupon, in MYR. - `max_purchase` (number or null, optional): The maximum purchase amount for the coupon, in MYR. - `usage_limit` (integer or null, optional): The maximum number of times that customers can use the coupon. - `enable_expiry` (boolean, optional): Set to `true` to give the coupon a validity period. - `start_date` (string or null, optional): The date and time when the coupon becomes active. - `expiry_date` (string or null, optional): The date and time when the coupon becomes inactive. Responses: - 200: Success. - 401: Unauthenticated. The token is missing, not correct, or expired. - 404: Not found. No item with this ID or order number is in your account. - 422: Validation error. One or more fields are not correct. - 500: Server error. BCL did not complete the request. ### Change the status of a coupon `PATCH /coupons/{id}/status` Make a coupon active or inactive. Set `is_active` to `true` or `false`. Parameters: - `id` (path, integer, required): The ID of the coupon. Request body (JSON): - `is_active` (boolean, required): `true` makes the coupon active. `false` makes it inactive. Responses: - 200: Success. - 401: Unauthenticated. The token is missing, not correct, or expired. - 404: Not found. No item with this ID or order number is in your account. - 422: Validation error. One or more fields are not correct. - 500: Server error. BCL did not complete the request. ### Create a coupon `POST /coupons/coupons` Create a discount coupon for your account. Each code must be different from the codes of your other coupons. A new coupon does not apply to a form automatically. To let a form accept the coupon, add the coupon ID to the coupon rules of the form: - [Change the coupon rules of a payment form](#tag/payment-forms/PATCH/forms/{id}/coupon) - [Change the coupon rules of an event form](#tag/event-forms/PATCH/event-forms/{id}/coupon) Request body (JSON): - `is_active` (boolean, optional): Set to `true` to make the coupon active. The default is `true`. - `code` (string, required): The code that customers type at checkout. Each code must be different from the codes of your other coupons. - `apply_to` (string, required, one of: total, items): Where BCL applies the discount: - `total`: the full order - `items`: only the items that you select - `discount_type` (string, required, one of: percentage, fixed): The type of discount: - `percentage`: a percentage of the price - `fixed`: a fixed amount in MYR - `discount_amount` (number, required): The value of the discount. - For `percentage`, send the number without the `%` sign. For example, send `20` for 20%. - For `fixed`, send the amount in MYR. For example, send `50` for RM50. - `description` (string or null, optional): Optional. A description of the coupon. - `enable_condition` (boolean, optional): Set to `true` to use purchase conditions for the coupon. - `min_purchase` (number or null, optional): The minimum purchase amount for the coupon, in MYR. Necessary when `enable_condition` is `true`. - `max_purchase` (number or null, optional): The maximum purchase amount for the coupon, in MYR. It must be equal to `min_purchase` or more. - `usage_limit` (integer or null, optional): The maximum number of times that customers can use the coupon. For an unlimited number, do not send a value. - `enable_expiry` (boolean, optional): Set to `true` to give the coupon a validity period. - `start_date` (string or null, optional): The date when the coupon becomes active. Necessary when `enable_expiry` is `true`. - `expiry_date` (string or null, optional): The date when the coupon becomes inactive. It must be after `start_date`. Necessary when `enable_expiry` is `true`. Responses: - 201: Created. - 401: Unauthenticated. The token is missing, not correct, or expired. - 422: Validation error. One or more fields are not correct. - 500: Server error. BCL did not complete the request. ## Protected content Protected Content is an add-on that locks your digital products in BCL: a video, a file, a text or a private link. When a customer pays, BCL gives the customer an access link. The customer types a one-time code before the content opens. The API sees only the content of the team of the token. See [Protected content by API](https://docs.bcl.my/protected-content-api/). ### List protected content `GET /protected-contents` Get the protected content of your team, one page at a time. Each item has its status, its number of customers and its access link (`access_url`). Parameters: - `page` (query, integer, optional): The page number. The first page is 1. - `per_page` (query, integer, optional): The number of items on each page. - `search` (query, string, optional): Find content by title. - `status` (query, string, optional, one of: active, inactive, all): Show only `active` items, only `inactive` items, or `all` items. - `content_type` (query, string, optional, one of: video, text, file, redirect): Show only the content of this type. - `access_type` (query, string, optional, one of: immediate, scheduled, duration): Show only the content with this access type. - `sort_by` (query, string, optional, one of: title, created_at, updated_at): The field that BCL uses to sort the list. - `sort_order` (query, string, optional, one of: asc, desc): The sort direction: `asc` (from low to high) or `desc` (from high to low). Responses: - 200: Success. - 401: Unauthenticated. The token is missing, not correct, or expired. - 422: Validation error. One or more fields are not correct. - 500: Server error. BCL did not complete the request. ### Get protected content `GET /protected-contents/{id}` Get one content item with its access configuration. The response also gives the statistics of customers, views and downloads. Parameters: - `id` (path, string, required): The ID of the content. It is in the list response, and in the address of the content in the BCL dashboard. Responses: - 200: Success. - 401: Unauthenticated. The token is missing, not correct, or expired. - 404: Not found. The item is not in your account. - 500: Server error. BCL did not complete the request. ### List the customers of protected content `GET /protected-contents/{id}/customers` Get the customers who have access to the content. Each customer has the order number and the usage counters. Parameters: - `id` (path, string, required): The ID of the content. It is in the list response, and in the address of the content in the BCL dashboard. - `page` (query, integer, optional): The page number. The first page is 1. - `per_page` (query, integer, optional): The number of items on each page. - `status` (query, string, optional, one of: active, expired, revoked, all): Show only the customers with this access status. Use `all` for all statuses. Responses: - 200: Success. - 401: Unauthenticated. The token is missing, not correct, or expired. - 404: Not found. The item is not in your account. - 422: Validation error. One or more fields are not correct. - 500: Server error. BCL did not complete the request. ### Change the status of protected content `PATCH /protected-contents/{id}/status` Make the public page of the content active or inactive. Set `is_active` to `true` or `false`. > [!NOTE] > If you send the status that the content has now, the API sends a `422` response. An example message is "The protected content is already inactive." Parameters: - `id` (path, string, required): The ID of the content. It is in the list response, and in the address of the content in the BCL dashboard. Request body (JSON): - `is_active` (boolean, required): `true` makes the content page active. `false` makes it inactive. Responses: - 200: Success. - 401: Unauthenticated. The token is missing, not correct, or expired. - 404: Not found. No item with this ID or order number is in your account. - 422: Validation error. One or more fields are not correct. - 500: Server error. BCL did not complete the request. ### Change the title of protected content `PATCH /protected-contents/{id}/title` Change the title of the content page. You can also change the subject of the access email in `email_title`. Parameters: - `id` (path, string, required): The ID of the content. It is in the list response, and in the address of the content in the BCL dashboard. Request body (JSON): - `title` (string, required): The new title of the content page. - `email_title` (string or null, optional): Optional. The new subject of the access email. Responses: - 200: Success. - 401: Unauthenticated. The token is missing, not correct, or expired. - 404: Not found. No item with this ID or order number is in your account. - 422: Validation error. One or more fields are not correct. - 500: Server error. BCL did not complete the request. ### Change the access rules of protected content `PATCH /protected-contents/{id}/access` Set the access rules of the content: - the access type - the schedule or the duration - the limits for devices and downloads > [!IMPORTANT] > The new rules apply only to new buyers. The dates of the buyers that have access now do not change. To change their dates, click **Sync Access Dates** on the **Customer Access** page of the content in BCL. Parameters: - `id` (path, string, required): The ID of the content. It is in the list response, and in the address of the content in the BCL dashboard. Request body (JSON): - `access_type` (string, required, one of: immediate, scheduled, duration): The access type of the content. - `scheduled_start_at` (string or null, optional): The start of the access. Necessary when `access_type` is `scheduled`. - `scheduled_end_at` (string or null, optional): Optional. The end of the access, for the `scheduled` access type. - `access_duration_days` (integer or null, optional): The number of days of access. Necessary when `access_type` is `duration`. - `max_devices` (integer or null, optional): The maximum number of devices that can use the access of one buyer at the same time. Through the API, use 1 or more. For an unlimited number of devices, set **Maximum Devices** to 0 in the BCL dashboard. - `max_downloads` (integer or null, optional): For file content only. The maximum number of downloads for each buyer. For an unlimited number, do not send a value. - `show_on_receipt` (boolean, optional): Set to `true` to show the content on the receipt page. Responses: - 200: Success. - 401: Unauthenticated. The token is missing, not correct, or expired. - 404: Not found. No item with this ID or order number is in your account. - 422: Validation error. One or more fields are not correct. - 500: Server error. BCL did not complete the request. ## Automations ## Automations An automation does an action when an event occurs in BCL. For example, when a customer pays, BCL can send a WhatsApp message to the customer. Each automation has one trigger. Get your automations, their run history and their statistics. See [What automations do](https://docs.bcl.my/automation-overview/). ### List automations `GET /automations` Get your automations, one page at a time. You can filter the list by trigger type and by status. Parameters: - `per_page` (query, integer, optional): The number of items on each page. - `trigger_type` (query, string, optional): Show only the automations with this trigger type. - `is_active` (query, boolean, optional): Show only the active automations (`true`), or only the inactive automations (`false`). - `sort_by` (query, string, optional): The field that BCL uses to sort the list. Responses: - 200: Success. - 401: Unauthenticated. The token is missing, not correct, or expired. - 500: Server error. BCL did not complete the request. ### Get an automation `GET /automations/{id}` Get the details of one automation, with its trigger conditions. Parameters: - `id` (path, integer, required): The ID of the automation. Responses: - 200: Success. - 401: Unauthenticated. The token is missing, not correct, or expired. - 404: Not found. The item is not in your account. - 500: Server error. BCL did not complete the request. ### List the executions of an automation `GET /automations/{id}/executions` Get the execution history of one automation, one page at a time. Parameters: - `id` (path, integer, required): The ID of the automation. Responses: - 200: Success. - 401: Unauthenticated. The token is missing, not correct, or expired. - 404: Not found. No item with this ID or order number is in your account. - 500: Server error. BCL did not complete the request. ### Get the statistics of an automation `GET /automations/{id}/stats` Get the number of executions of one automation, for each status. Parameters: - `id` (path, integer, required): The ID of the automation. Responses: - 200: Success. - 401: Unauthenticated. The token is missing, not correct, or expired. - 404: Not found. No item with this ID or order number is in your account. - 500: Server error. BCL did not complete the request.