Zapier integration with ERPNext

I have a use case… was originally planning to integrate work between ERPNext and woocommerce. But I think via Zapier would be faster. I could start a bounty but I don’t know for how much or if ERPNext is open enough for a 2 way sync. Also usable for everyone.
If I put the use case would you please check and quote?
Thanks
Deepak

@Deepak_Pai maybe define a minimum use case and commit X amount. I am sure lots of service providers here might be open to pick it up

Hi !

is this project abandoned? Would like to know how far did this go. Interested on this.

I posted the same on this thread Lets make a Zapier integration! - #9 by Softwareprofs
I’m stuck on authentication which @pdvyas mentioned that “Authentication: Frappe, at the moment doesn’t support any of the
four authentication schemes Zapier supports. However, The HTTP Basic
auth would be reasonable scheme for Frappe to have. (on our list)”

1 Like

Hello!

solved authentication error [Zapier Integration] What to put in redirect uri (OAuth)?

problem now is I can’t get my request through. I’m getting 417 Error

**REQUEST INFORMATION**
ID: N/A
Method: POST
URL/Path:
http://:censored:17:d1b6aff9f7:/api/resource/Sales Invoice

Headers:
content-type: application/json
user-agent: Zapier
Authorization: Bearer :censored:30:967487ceab:

Params:
N/A

Data:
{"customer_name":"John CompanyJohn","company":"John Company","items":[{"rate":1,"item_code":"1","qty":1}],"posting_date":"2018-03-21T03:23:12+08:00","due_date":"2018-03-21T03:23:12+08:00"}

Duration (ms): 1484

RESPONSE INFORMATION
Status Code: 417
Headers:
content-type: text/html; charset=utf-8
content-length: 7509
x-page-name: message
x-from-cache: False
set-cookie: sid=Guest; Expires=Tue, 03-Apr-2018 11:08:17 GMT; Path=/
server: Werkzeug/0.13 Python/2.7.12
date: Sat, 31 Mar 2018 03:08:17 GMT
1 Like

Troubleshoot:

  • URL encode the “delivery url” e.g. Sales%20Invoice
  • Data is JSON string payload=json.dumps(data) NOT a dict
  • if you’re using POST, try setting content-type application/x-www-form-urlencoded
  • I’ll suggest 3 levels of debugging.
    1. use print() it dumps output on bench start screen as API requests are made.
    2. Errors are missed because of broad global try/except(s) use local try/except(s) with specific Exceptions, they’ll help identify problems.
    3. Tests help identify problems missed by above two steps! checkout woocommerce test: erpnext/test_woocommerce.py at eae500d61698bbded227327725b8dbd9160dc003 · mntechnique/erpnext · GitHub It emulates a request made from woocommerce server (you can capture one sandbox/test zapier request and emulate it)
3 Likes

Cool, thanks! Will try this one.

was you able to http post to frappe or erpnext. I really need it. Zapier would be great

any update on this integration, wish to contribute

Really like to have Zapier integration…

Sure enough it’s here on the request wish todo list Integration to Zapier · Issue #9943 · frappe/erpnext · GitHub

But not here on the bounty list https://erpnext.org/bounties

1 Like

Hello everyone,

I recently published the first ERPNext app for Zapier.

Features:

  • Search all records in ERPNext.
  • Create a new record in ERPNext with data from any Zapier app.
  • Trigger any Zapier app when something happens in ERPNext.
  • Works for all DocTypes. (Especially well for Leads and Opportunities.)

Please email me about a custom integration (raffael@alyf.de / German Website) and feel free to contribute on Github.

Best regards,
Raffael

11 Likes

Hi

I cannot seem to see this app on Zapier.

Hi Olamide,

you are correct, it’s not a public app on zapier. You have to deploy it as a private app. This has the following reasons:

  1. ERPNext has no single API (like Facebook) but, in contrast, everybody has his own ERPNext instance with his own API and oAuth clients.

  2. I’m not the ERPNext foundation, so I should not publish an app in their name.

The consequence is, that you have to deploy the app privately to Zapier, using the Zapier command line interface tool.

Afterwards, “ERPNext v0.0.1” will appear in your list of available apps on Zapier.

If you cannot deploy the app on your own, I’ll be happy to help. (raffael@alyf.de)

Best regards,

Raffael

3 Likes

Hi-Is your app limited to only Leads and opportunities? e.g if we wanted to do the following use cases

Sales invoice creation on My ERP instance> Zapier>Messaging App e.g Twillo or ZipWhip or
Appointment created on myERPNext instance> Zapier> Integrated Zapier chatbot

What changes to this app do we need to make?

It’s not limited to a specific DocType. You can can create a trigger for any event of any DocType. For example, on_submit of Sales Invoice. No changes required.

3 Likes

@MichaelPinkowski let’s see if we can get the team to take a look at the Zapier capabilities. There are so many potential uses for this, it could accelerate some of our customer adoption.

3 Likes

I’m using Zapier actions to accomplish the following:

  1. Listen via webhook for a transaction from a marketplace site
  2. Call the marketplace api to get some order details
  3. Parse and error check
  4. Construct a json object to create a new Sales Invoice in ERPNext

The new token-based authentication in ERPNext V11 made it possible. Trying to authenticate in prior versions was problematic.

1 Like

@Mike_Z any chance you could help with a step-by-step guide to setting up Zapier for ERPNext?

Sure, I’ll put something together.
Mike

2 Likes

Hi,
I’ve been away at my son’s wedding, sorry for the delay.

Creating a record via Zapier
This works with ERPNext v11, as we’re relying on the API Access feature of the User DocType to give us token-based authentication

  1. Generate API Access keys in ERPNext. Good process would be to create a Zapier user dedicated to this purpose. You will need the API Key and API Secret

  2. In Zapier, add a Webhook Action to your zap. This should be after the point in your zap that you’ve rendered all of the necessary data that you will be writing to ERPNext.

  3. Use the “Custom Request Action”.

  4. Method = “Post” if you’re creating a new record

  5. URL like https://erp.yoursite.com/api/resource/Sales Invoice for creating a Sales invoice

  6. For “Data”, enter the raw json to create the record. What I did was to use Postman to read a Sales Invoice, then pare the json down to the fields I needed. I then validated the json using one of the web tools avalable to make sure I didn’t drop any braces, etc. To learn and play, start with a simple DocType first, like a Customer or an Item

  7. You need three headers: Content-Type = application/json, Accept = application/json and Authorization. Authorization is “token {apikey}:{apisecret}”, (token space apikey colon apisecret) like
    token 819abcxxxxx558e:4da5xxxxxxxx292

Hope that helps!
Mike

5 Likes