Webhook with Invoice Number

I would like to make use of the Webhook PaymentsCreated and InvoicesPaid that contained the Invoice Number rather than, or as well as, the InvoiceID. Is this possible?

Hi @Iain

This isn’t possible I’m afraid. The reference included with the webhook is the QuickFile reference (ID).

In an ideal world, you would perhaps have a map of IDs to Invoice Numbers, but if not, it would involve an API call to confirm the invoice number.

So you would have, as an example:

{
  "PayLoad": {
    "PaymentsCreated": [
      {
        "TimeStamp": "2021-09-29T10:00:00",
        "InvoiceId": 12345678,
        "PaymentId": 98765432,
        "AmountPaid": "72.00",
        "CurrencyCode": "GBP"
      }
    ],
    "Timestamp": "2021-09-29T10:00:00+00:00",
    "Signature": "Signature",
    "Hookid": "Webhook ID"
  }
}

From this, you could do an Invoice_Get API call. In JSON, this would look something like this:

{
  "payload": {
    "Header": {
      "MessageType": "Request",
      "SubmissionNumber": "00000001",
      "Authentication": {
        "AccNumber": "123456",
        "MD5Value": "7dd259dea3393880406d292e3f6f5830",
        "ApplicationID": "appID"
      }
    },
    "Body": {
      "InvoiceID": 12345678
    }
  }
}

There’s more information on the Invoice_Get endpoint, here: Invoice_Get API Schema

Hope this helps!

This is normal behaviour for webhooks in many systems - since the service provider (QuickFile in this case) has no way to securely verify who is actually receiving the hook notification, the hook payload deliberately contains only an opaque identifier. You have to authenticate yourself by making a call back to the provider’s REST API in order to dereference the identifier and obtain the actual (potentially sensitive) data.

Thank you to you both. Sounds as though this is something that I can use Zapier to make this work.

Just to be clear. What I am aiming for is when an invoice is paid an email is sent to an authorised third party saying that Invoice Number has been paid.

This topic was automatically closed after 2 days. New replies are no longer allowed.