Xero invoice automation guide

Leveraging the Pinch API to automate your Xero invoice workflow.

This guide will outline the workflow to enable Xero integration when using the Pinch API to take payments or store payment information (See Pre-Approval).

Pre-requisites

  • A fully approved Pinch Merchant Portal account. (Click here to create an account if you don't already have one)
  • The Merchant Id, Secret key and Publishable key to work with the API (These are available in the Integrations section of the Merchant Portal and See Authentication for how to use these with the API).
  • Xero integration enabled and syncing.
  • Account flags Generate Payments from API and Create Agreements from API Source will need to be enabled (these need to be done by the support team).
  • Webhook events are setup and handled (as defined below).

Existing Payer (Xero Contact) Workflow outline

  • Contact is created through Xero (Account flag Sync all Payers to Pinch API is also required here) and is pulled in from the API to get the payer id value (pyr_ string identifier) and save it for later usage.
  • Payment information form is given to the payer through your own platform.
  • Payment information is tokenised directly from the client using the Pinch Capture JS script.
  • Payment token is saved and used to call the Create Payment Source Endpoint to add a payment source to the Payer.
  • The payment source has now been added and will appear in the Merchant Portal as a Pre-Approval momentarily.
  • Now the payer is setup for auto payments which means when an invoice comes in from Xero it will automatically be paid on the due date using this payment source.

New Payer Workflow outline

  • Payer sign up and Payment information form is given to the payer through your own platform.
  • Payment information is tokenised directly from the client using the Pinch Capture JS script.
  • Create or Update Payer is called and the payer id is saved (pyr_ string identifier).
  • Payment token from Capture JS is saved and used to call the Create Payment Source Endpoint to add a payment source to the Payer.
  • Here you will need to wait for the payer to get into Xero at this point (there will be a webhook event notifying the payer being updated at which point it will have a Xero contact Id, this will show when it is in Xero). Once this is done the payment source will also show in the Merchant Portal as a Pre-Approval on this payer.
  • Now the payer is setup for auto payments which means when an invoice comes in from Xero it will automatically be paid on the due date using this payment source.

๐Ÿ“˜

Got feedback on this feature?

Send an email to [email protected] or book in a chat with our API team.