Overview
The Brevo integration provides two ready-made functions you can call when building mappings. Both start from the SKU on an iPaaS.com transaction line and find the id Brevo has for the product or the variant that was sold, so the order sent to Brevo names exactly the item Brevo knows, without you writing that lookup yourself. The default Add/Update Brevo Order Line FROM iPaaS.com mapping collection already uses them, so you need to read this article only if you build or change an order line mapping yourself.
Where you can use these functions
These functions are available anywhere you write a formula for the Brevo integration:
Dynamic Formula mappings: where a destination field's value is produced by a formula rather than mapped directly from a source field.
Mapping collection filters: where a formula decides whether a record should be processed.
Error filters: a mapping collection's error filter, which sits alongside its collection filter. When the error filter's formula resolves to true, the transfer raises an error that is held in the Error Logs for review and is not retried automatically.
Translation collections: where a translation entry uses a formula as its source value.
How to use them
Call a function by name and pass the values it needs in parentheses, for example:
BrevoProductId(Sku).Each function's signature shows its name, the parameters it accepts (with their types), and the type of value it returns. Use it as the reference for exactly how to call the function.
Function names and formula syntax are case-sensitive, so type each name exactly as shown. Whether the values a function matches are treated as case-sensitive varies by function, and is called out in the relevant parameter's description.
These functions are synchronous, so you call them directly (no
awaitis required).Each function runs at sync time, against the data in your iPaaS.com subscription. Neither function reads or writes Brevo.
The functions are grouped below by the area of the integration they support.
Orders
BrevoProductId
What it does: Returns the Brevo id of the product an iPaaS.com transaction line sold, found from the line's SKU. For the SKU of a variant, it returns the id of the variant's parent product.
Signature: string BrevoProductId(string sku)
How to call it: BrevoProductId(Sku)
Parameter | Type | Required | Default | Description |
|
| Yes | N/A | The SKU of the item sold on the iPaaS.com transaction line. Map the line's Sku field. The search ignores spaces at either end and ignores upper and lower case. |
Returns: string. The Brevo product id as text, or no value when the SKU is blank or no iPaaS.com product or variant has it.
Example: BrevoProductId("TSHIRT-RED-M") returns "221751" when TSHIRT-RED-M is a variant of iPaaS.com product 221751 and this subscription sent that product to Brevo as product 221751. The default Add/Update Brevo Order Line FROM iPaaS.com mapping collection maps its ProductId field with the formula return BrevoProductId(Sku);.
When to use it: Use it in the ProductId mapping of the order line collection FROM iPaaS.com, so the Brevo order names the product Brevo actually has. The id returned is the product's link for this subscription. For a product the integration created in Brevo, that is the iPaaS.com product id. For a product that collision handling linked to an existing Brevo product, it is that Brevo product's id. A product not yet sent to Brevo returns its iPaaS.com product id, the id the Add/Update Brevo Product FROM iPaaS.com mapping collection will give it, and Brevo accepts that id even when its catalog does not yet hold the product. If iPaaS.com holds a product and a variant with the same SKU, the variant is the one found, and the function returns the id of that variant's product. If two or more iPaaS.com variants have the SKU, or no variant has it and two or more iPaaS.com products do (for example SKUs that differ only in upper and lower case), the order is refused with BREV-BIZL-1019 until each has its own SKU. If the lookup in iPaaS.com fails, the transfer stops with BREV-INTL-1003 and iPaaS.com retries it. iPaaS.com normally refuses a transaction whose line names a SKU it does not hold when the transaction is created, so a line that reaches the function with an unknown SKU is rare. If one does, the function returns no value and the order is refused with BREV-VALD-1021, which names the line. The usual way a line reaches the function with no SKU is a gift card sold on the order: iPaaS.com holds a gift card line with no SKU, so the function returns no value for it. The default Add/Update Brevo Order Line FROM iPaaS.com mapping collection's filter leaves such a line out and the rest of the order is sent; if that filter is removed, the whole order is refused with BREV-VALD-1021, which names that line. iPaaS.com also accepts a transaction line that carries a SKU only when that SKU matches a product or variant exactly, case and spaces included, so the function's trimming and case-blind search matter mainly when two iPaaS.com SKUs differ only in upper and lower case.
BrevoVariantId
What it does: Returns the Brevo id of the variant an iPaaS.com transaction line sold, found from the line's SKU, or no value when the SKU belongs to a product rather than a variant.
Signature: string BrevoVariantId(string sku)
How to call it: BrevoVariantId(Sku)
Parameter | Type | Required | Default | Description |
|
| Yes | N/A | The SKU of the item sold on the iPaaS.com transaction line. Map the line's Sku field. The search ignores spaces at either end and ignores upper and lower case. |
Returns: string. The Brevo variant id as text, or no value when the SKU is blank, belongs to a product, or no iPaaS.com variant has it.
Example: BrevoVariantId("TSHIRT-RED-M") returns "v671217" when TSHIRT-RED-M is iPaaS.com variant 671217 and this subscription sent it to Brevo with its product; Brevo's id for the variant is the letter v followed by the iPaaS.com variant id. A line whose SKU is a product's returns no value. The default Add/Update Brevo Order Line FROM iPaaS.com mapping collection maps its VariantId field with the formula return BrevoVariantId(Sku);.
When to use it: Use it in the VariantId mapping of the order line collection FROM iPaaS.com, so the Brevo order names the exact item sold. The id returned is the variant's link for this subscription. A variant not yet sent to Brevo returns v followed by its iPaaS.com variant id, the id the integration gives the variant when it sends it to Brevo. The value is sent to Brevo as it is. If iPaaS.com holds a product and a variant with the same SKU, the variant is the one found. If two or more iPaaS.com variants have the SKU, or no variant has it and two or more iPaaS.com products do (for example SKUs that differ only in upper and lower case), the order is refused with BREV-BIZL-1019 until each has its own SKU. If the lookup in iPaaS.com fails, the transfer stops with BREV-INTL-1003 and iPaaS.com retries it. A gift card sold on the order is a line with no SKU, so the function returns no value for it; the default Add/Update Brevo Order Line FROM iPaaS.com mapping collection's filter leaves such a line out. iPaaS.com accepts a transaction line that carries a SKU only when that SKU matches a product or variant exactly, case and spaces included, so the function's trimming and case-blind search matter mainly when two iPaaS.com SKUs differ only in upper and lower case.
