Skip to main content

PayTrace Mapping Functions

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

Overview

The PayTrace integration provides a ready-made function you can call when building mappings. It handles a common lookup against your iPaaS.com data, so you do not have to write that logic yourself.

Where you can use these functions

These functions are available anywhere you write a formula for the PayTrace 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 GetCustomerEmailAsync(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 PayTrace account and your iPaaS.com subscription.

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

Invoices

GetCustomerEmailAsync

What it does: Returns the email address of the iPaaS.com customer linked to a transaction. Use it to decide where PayTrace emails the invoice when the transaction itself has no email address.

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). A value that is empty, not a number, or 0 or less returns null.

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

Example: For a transaction with no email address of its own whose linked iPaaS.com customer has the email address ap@whitfield.example.com, the default template's Email formula return !string.IsNullOrWhiteSpace(EmailAddress) ? EmailAddress : await GetCustomerEmailAsync(CustomerId); returns "ap@whitfield.example.com".

When to use it: In the Email mapping of Add/Update PayTrace Invoice FROM iPaaS.com, as a fallback when the transaction has no email address. The default template already uses it this way. It makes one iPaaS.com lookup per customer, which is reused for the rest of the transfer.

Related Documents

Did this answer your question?