Zapier Integration - invalid API token

Hi Guys,

Invoice Ninja v5 is a great application and I’d like to thank you all for the investment of your time and effort to bring this to the world!!

Having got v5 set up and working as expected, I’m taking it to the next level and trying to add a Zapier integration to enable an automated payment once a relevant transaction hits my bank account. My bank is a Zapier partner, and so far that side of the integration works fine.

When I try to connect to my self-hosted Invoice Ninja v5 installation, I’m getting an error as follows:

  • I successfully generated an API token in Invoice Ninja/Account Management/API Tokens

  • I copied the API Token to the clipboard using the button in Invoice Ninja

  • I pasted the API Token into the correct field in the authentication form on Zapier (redacted in screenshot below)

  • I pasted the correct self-hosted URL in the authentication form on Zapier (redacted in screenshot below)

I’ve searched fairly extensively on this issue, and the only thing I think is that the current Zapier integration is setup for v4, and the X-Ninja-Token token type rather than the v5 X-Api-Token type.

Can anyone provide any insight as to what might be happening here, and how I can maybe get it to work?

Thanks in advance for your kind assistance…

Hi,

I think you may be using the v4 Zapier, here’s the v5 version:

https://zapier.com/developer/public-invite/95884/5e4368b9efb9d377dc0a0b0465b7c1a7

Hi @hillel, this worked great, thanks. However I now have a different problem:

when using the Find Invoice Search action, the component is retrieving the first invoice in the invoices table, irrespective of which value I put in the Invoice Number search field. I’m not sure if I’m misunderstanding how to use this, or if there is an underlying issue in the component.

In this attempt, I’m using the text “ThisIsNotAnInvoiceNumber” as the search value to test with:

And the component is “successfully” retrieving an Invoice for me…

As you can see from the data retrieved, the Invoice Number is “IN2021:TES_Deleted”, which is the first row (of 3) in the invoices table. It does not seem to matter whether I send a correct Invoice Number or random text as the search criteria, I always get the first row back. :thinking:

Can you help?

Are you able to post the info from data in/out in the Zapier logs, it’d be helpful to see the API request to determine if it’s a problem with Zapier or the app.

Hi @hillel,

here’s the info you requested - as you can see, invoice_number (IN2021:001) on “Data in” does not match number (IN2021:TES_Deleted) on “Data out”:

  • Data In

include_pdf: no
_zap_search_success_on_miss: false
invoice_number: IN2021:001

  • Data Out

id: K4oeElkd0B

user_id: VolejRejNm

amount: 1

balance: 1

client_id: l4zbqx2apr

status_id: 2

design_id: kzPdy7aQro

created_at: 1621105533

updated_at: 1621112228

archived_at: 1621112228

is_deleted: true

number: IN2021:TES_Deleted

discount: 0

date: 2021-05-15

next_send_date: 2021-05-15

due_date: 2021-05-22

terms:

uses_inclusive_taxes: false

tax_rate1: 0

tax_rate2: 0

tax_rate3: 0

total_taxes: 0

is_amount_discount: false

footer:

partial: 0

has_tasks: false

has_expenses: false

custom_surcharge1: 0

custom_surcharge2: 0

custom_surcharge3: 0

custom_surcharge4: 0

exchange_rate: 1

custom_surcharge_tax1: false

custom_surcharge_tax2: false

custom_surcharge_tax3: false

custom_surcharge_tax4: false

line_items: 1:

product_key: Test Item

notes: Testing

cost: 1

quantity: 1

tax_name1:

tax_rate1: 0

tax_name2:

tax_rate2: 0

tax_name3:

tax_rate3: 0

custom_value1:

custom_value2:

custom_value3:

custom_value4:

discount: 0

type_id: 1

createdAt: 1621105519265000

is_amount_discount: false

sort_id: 0

line_total: 1

date:

entity_type: invoice

paid_to_date: 0

invitations:

1:

id: K4oeElkd0B

client_contact_id: l4zbqx2apr

key: 5TvwQJM9wyt91mYQVwcnT1Mw5JxgaIXPPT3AVo4QQRrnxDP6CQeYtlkT3PMKzFZe

link: https://shinobi.solutions/ninja/public/client/invoice/5TvwQJM9wyt91mYQVwcnT1Mw5JxgaIXPPT3AVo4QQRrnxDP6CQeYtlkT3PMKzFZe

sent_date: 2021-05-15 19:05:46

viewed_date:

opened_date:

updated_at: 1621105546

archived_at: 0

created_at: 1621105533

email_status:

email_error:

_zap_search_was_found_status: true

Fields with no value:

project_id

assigned_user_id

vendor_id

recurring_id

po_number

last_sent_date

public_notes

private_notes

tax_name1

tax_name2

tax_name3

partial_due_date

custom_value1

custom_value2

custom_value3

custom_value4

reminder1_sent

reminder2_sent

reminder3_sent

reminder_last_sent

subscription_id

documents

@david does v5 support filtering invoices using ?invoice_number=

By way of additional info: I can’t choose the name of the field to query in the Find Action, I just have to supply an Invoice Number (required):

you can filter by ?number=

it must be an exact match however.

It looks like the Zapier action “Find Invoice” is currently hard coded to user ?invoice_number=

Is somebody able to check/update this?

Thanks both

That’s correct, we’ll look into updating our Zapier integration