Skip to main content

BlueSnap Mapping Functions

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

Overview

The iPaaS.com BlueSnap integration provides ready-made functions you can call when you build mappings. They look up the iPaaS.com customer linked to an invoice, so you don't have to write that lookup yourself.

Where you can use these functions

These functions are available anywhere you write a formula for the BlueSnap 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 GetCustomerNameAsync(CustomerId).

  • 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 BlueSnap account and your iPaaS.com subscription.

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

Customers

GetCustomerNameAsync

What it does: Returns the name of the iPaaS.com customer linked to a transaction: the customer's company when it has one, otherwise the customer's first and last name.

Signature: Task<string> GetCustomerNameAsync(object customerId)

How to call it: await GetCustomerNameAsync(CustomerId)

Parameter

Type

Required

Default

Description

customerId

object

Yes

N/A

The iPaaS.com customer ID linked to the transaction (the transaction's CustomerId).

Returns: string. The iPaaS.com customer's company or name, or null when the transaction has no linked customer or the customer has no company or name.

Example: For a transaction whose customer is the company Whitfield Supply Co., await GetCustomerNameAsync(CustomerId) returns "Whitfield Supply Co.".

When to use it: In LineDescription on Add/Update BlueSnap Invoice FROM iPaaS.com, the line the payer sees under the item on the pay page, for example "Bill to: Whitfield Supply Co.". A formula like this replaces the template's own LineDescription formula ("Order {number}" for an order placed on account). The integration never fills in BlueSnap checkout fields, so this, like LineLabel, is one way to show the payer more on the pay page. The customer is looked up on iPaaS.com and reused for about a minute, so repeated calls for the same customer don't call iPaaS.com again.

GetCustomerEmailAsync

What it does: Returns the email address of the iPaaS.com customer linked to a transaction.

Signature: Task<string> GetCustomerEmailAsync(object customerId)

How to call it: await GetCustomerEmailAsync(CustomerId)

Parameter

Type

Required

Default

Description

customerId

object

Yes

N/A

The iPaaS.com customer ID linked to the transaction (the transaction's CustomerId).

Returns: string. The iPaaS.com customer's email address, or null when the transaction has no linked customer or the customer has no email address.

Example: EmailAddress ?? await GetCustomerEmailAsync(CustomerId) returns the transaction's own email address when it has one, otherwise the customer's, for example "ap@whitfield.example.com".

When to use it: In any BlueSnap formula that needs the customer's email address when the transaction has none of its own, for example a mapping collection filter or error filter. No BlueSnap pay link field takes an email address: the integration sends no payer details to BlueSnap. The customer is looked up on iPaaS.com and reused for about a minute, so repeated calls for the same customer don't call iPaaS.com again.

Related Documents

Did this answer your question?