Skip to main content

Square Mapping Functions

Reference for the Square-specific functions you can use in Dynamic Formula mappings and mapping collection filters.

Overview

The Square integration provides a set of ready-made functions you can call when building mappings. They handle common lookups and conversions against Square and your iPaaS.com data, such as resolving a Square catalog SKU or location name, matching categories between the two systems, and confirming that order products exist, so you do not have to write that logic yourself in a formula.

Where you can use these functions

These functions are available anywhere you write a formula for the Square 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: await GetiPaaSCustomerIdByEmailAsync(SourceEmail).

  • 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.

  • Every function that returns a Task is asynchronous and must be called with await, as shown in each How to call it example.

  • Each function runs at sync time, against the data in your connected Square account and your iPaaS.com subscription.

The functions are grouped below by the area of the integration they support.

Products and Categories

GetSquareSkuByCatalogObjectIdAsync

What it does: Looks up a Square catalog object by its ID and returns the SKU of its item variation.

Signature: Task<string> GetSquareSkuByCatalogObjectIdAsync(string objectCatalogId)

How to call it: await GetSquareSkuByCatalogObjectIdAsync(objectCatalogId)

Parameter

Type

Required

Default

Description

objectCatalogId

string

Yes

N/A

The ID of the Square catalog object to retrieve the SKU for.

Returns: string. The Square catalog SKU, or null if the catalog object has no item variation SKU.

Example: "GKSJIUZQ7RQBNL6GHDQCBY6V" returns the SKU of that Square catalog object.

When to use it: Use this when a mapping needs the Square SKU for a catalog object, for example to link an order line item to its catalog product. If the SKU cannot be resolved, the line item can still be processed as a non-catalog item.

ConvertiPaaSCategoriesToSquareUp

What it does: Converts a set of iPaaS.com category assignments to the matching Square category IDs. It looks up each iPaaS.com category, finds Square categories with the same name, and compares the full parent-child hierarchy so only an exact hierarchy match is returned.

Signature: Task<List<Categories>> ConvertiPaaSCategoriesToSquareUp(object iPaaSCategories)

How to call it: await ConvertiPaaSCategoriesToSquareUp(iPaaSCategories)

Parameter

Type

Required

Default

Description

iPaaSCategories

object

Yes

N/A

One or more iPaaS.com category assignments, typically a serialized collection that can be read as a list of iPaaS.com category assignments.

Returns: List<Categories>. The matching Square category IDs, one entry per iPaaS.com category whose full hierarchy matches a Square category. Categories with no exact match are skipped.

Example: [{"category_id": 23232, "category_name": "Clothing"}] returns the Square category IDs whose hierarchy matches those iPaaS.com categories.

When to use it: Use this in the product flow to map iPaaS.com category assignments to Square categories while ensuring the full parent-child hierarchy matches, so products are not assigned to the wrong Square category.

Customers

GetiPaaSCustomerIdByEmailAsync

What it does: Looks up an iPaaS.com customer by email address and returns that customer's iPaaS.com ID.

Signature: Task<string> GetiPaaSCustomerIdByEmailAsync(string email)

How to call it: await GetiPaaSCustomerIdByEmailAsync(email)

Parameter

Type

Required

Default

Description

email

string

Yes

N/A

The customer email address to match against iPaaS.com customers. The match is on the exact email.

Returns: string. The iPaaS.com customer ID, or null if no customer matches the email.

Example: "test@example.com" returns the iPaaS.com customer ID for the customer with that email.

When to use it: Use this when a mapping needs to link an order or other record to the correct iPaaS.com customer and you have only the customer's email.

Orders and Locations

CheckSquareProductExistIniPaaSAsync

What it does: Checks that every SKU on a set of Square order line items exists in iPaaS.com. For each line item it resolves the SKU from the Square catalog object (falling back to the line item name), then confirms a matching iPaaS.com product or product variant exists.

Signature: Task<bool> CheckSquareProductExistIniPaaSAsync(List<OrderLineItem> lineItems)

How to call it: await CheckSquareProductExistIniPaaSAsync(lineItems)

Parameter

Type

Required

Default

Description

lineItems

List<OrderLineItem>

Yes

N/A

The Square order line items to validate against iPaaS.com.

Returns: bool. true when every line item SKU exists in iPaaS.com. If any SKUs are missing, the function raises an error listing the missing SKUs rather than returning false.

Example: Passing an order's line items returns true when all of their SKUs are already present in iPaaS.com.

When to use it: Use this in an error filter or mapping to stop a Square order from processing when one or more of its products has not yet been created in iPaaS.com, and to see which SKUs are missing.

GetLocationNameByLocationIdAsync

What it does: Looks up a Square location by its ID and returns the location's name.

Signature: Task<string> GetLocationNameByLocationIdAsync(string locationId)

How to call it: await GetLocationNameByLocationIdAsync(locationId)

Parameter

Type

Required

Default

Description

locationId

string

Yes

N/A

The Square location ID to fetch the name for.

Returns: string. The Square location name, or null if the location is not found.

Example: "LEA7DZEF87W1K" returns the name of that Square location.

When to use it: Use this in the order flow to map a Square order's location ID to the location name, for example to store it in an order custom field.

Related Documents

Did this answer your question?