For open-source platforms (such as Magento, WooCommerce, PrestaShop, etc., connected via either bridge or native API), issues often arise due to connection blocking on the store's firewall. Clients frequently encounter situations where the firewall blocks legitimate requests from Api2Cart, considering them potentially harmful. This can disrupt integrations and lead to an increase in support requests.

To prevent such issues on these platforms, we recommend using the user_agent parameter, which allows for clear identification of requests made through Api2Cart. Unlike IP addresses, which can change or may not be unique, user_agent enables the creation of a persistent identifier for each connection. As a result, if the firewall supports configuring rules for User-Agent, you can predefine rules to allow requests from Api2Cart without blocking them.

The user_agent parameter is supported in the account.cart.add and account.config.update methods, as well as when adding or editing a store in the UI under the additional parameters section.

If this parameter is set, Api2Cart will send requests to the store with the User-Agent header.

For example, the Cloudflare firewall allows you to permit or block connections based on the User-Agent.

To configure this rule, follow these steps:

  • In your Cloudflare account, go to Security > WAF.
  • In the WAF (Web Application Firewall) security options, select the Firewall Rules tab.
  • Create a new rule by clicking Create Firewall Rule.
  • Specify a rule name, set the Field to User Agent, Operator to Equals, and the Value to the "user_agent" parameter value, defined when adding the store to Api2Cart. Set Then... to Allow.
  • Apply the rule by clicking Deploy.

If the firewall does not support filtering by User-Agent, the only solution is to whitelist Api2Cart’s IP addresses.