Metadata is a free text field that you can use to store state against certain entities.

Although it's free text, to be compatible with the beta functionality of Pinch, it must conform to the following structure:

An Json array of objects:

[{"data": "my free text goes here"}, {"other": "don't worry about me"}]

or a single json object:

{"data": "my free text and no other objects"}'

Pinch uses special json objects to perform some beta functionality on some entities. Below are some the beta functions you can use:

The structure of beta functionality objects are:

{"metatype": "AccountingV1", "otherProperties": {"label": "value"}}

MetaType is what Pinch uses to pull out the relevant data and perform any actions with it.

Be warned, we might update the metadata internally, so be prepared to receive a new object or array.


Accounting system matching

Metadata can also be used to match API objects with objects in an accounting system (if using the Pinch integrated with Xero, QuickBooks or MYOB).

Payment

Payments created in the API can be matched to Invoices in the accounting system using 2 different methods.

  • InvoiceId - This is the identifier of the Invoice in the accounting system (ie. for Xero the Invoice Id is a guid).
  • InvoiceNumber - This is the text invoice number (typically what is used when displaying the invoice). This is most commonly shown in the format INV-123 but may change depending on accounting system configuration.

AccountingV1 Example

{
  "MetaType": "AccountingV1",
  "MatchInvoice": {
    "InvoiceId": "<InvoiceIdToMatch>",
    "InvoiceNumber": "<InvoiceNumberToMatch>"
  }
}

Payer

Payers created in the API can be matched to invoice in the accounting system using 2 different methods.

🚧

If the payer already exists in Pinch creating a new payer and matching it will not auto-merge the records and will result in duplicates.

  • AccountingContactId - This is the identifier of the contact in the accounting system (ie. for Xero the Contact Id is a guid).
  • Email - The email address of the contact in the accounting system to attempt to match on.

AccountingPayerV1 Example

{
  "MetaType": "AccountingPayerV1",
  "MatchPayer": {
    "AccountingContactId": "<ContactIdToMatch>",
    "Email": "<ContactEmailToMatch>"
  }
}