Woocommerce Webhook procedure/flow how to use this API


(Delgesh_Shahab) #1

I don’t understand the procedure from documentation

How should I use this hooks?

Will API automatically call our site?

Or should we call API explicitly, is there any reference, I can use for flow diagram so i can code accordingly.


(John Borelli) #2

@Del_Chefv,

You will first need to verify each endpoint you wish to have with code that captures the header parameter X-Hook-Secret and then sends it back to IS.

Once having done this, IS will automatically send data to that endpoint that is registered and it will be up to you at that point what you wish to do with that information from there.

Documentation does not specify this registration requirement yet but the rest you need to know about verifying the endpoint can be found here:

https://developer.infusionsoft.com/docs/rest/#!/Rest_Hooks/createHookUsingPOST


(Delgesh_Shahab) #3

Thanks @John_Borelli, i can’t find anywhere in the Doc for GET the Order ID…


(John Borelli) #4

To list the available hooks you will have to poll for them

https://developer.infusionsoft.com/docs/rest/#!/Rest_Hooks/listHooksUsingGET

They will be adding more as time goes on


(Delgesh_Shahab) #5

Hello there,

Thanks for your reply.

Can you please provide me an example for this?

Thanks for your time and effort…


(John Borelli) #6

The webhook triggers is a growing list so it has a call so that you can stay current. At the moment, these are the ones available:

[
“contact.add”,
“contact.delete”,
“contact.edit”,
“contactGroup.add”,
“contactGroup.applied”,
“contactGroup.delete”,
“contactGroup.edit”,
“contactGroup.removed”,
“invoice.add”,
“invoice.delete”,
“invoice.edit”,
“leadsource.add”,
“leadsource.delete”,
“leadsource.edit”,
“opportunity.add”,
“opportunity.delete”,
“opportunity.edit”,
“opportunity.stage_move”,
“order.add”,
“order.delete”,
“order.edit”,
“product.add”,
“product.delete”,
“product.edit”,
“task.add”,
“task.delete”,
“task.edit”
]

examples detailing how to use each endpoint for REST webhooks are in documentation:

https://developer.infusionsoft.com/docs/rest/#!/Rest_Hooks/listHooksUsingGET