in [beta], (not tested on big ofn instances, use an api key limited to a small amount of enterprises)
- there are certainly bugs in there :)
- webhooks and code hooks are implemented
- config "API" (google sheet structure and column names) is pretty stable, I'll try to apply "Open to extension close to modification on it"
This is hook system for OFN that runs on n8n.
Every times something happen on the system (new order, order status updated, ...), you can configure which n8n workflows you would like to run with the event data or which url you want to be called.
Polling last x minutes orders based on updated_at field
Configuration is through a google sheet, you can make a copy of https://docs.google.com/spreadsheets/d/1v_Cq9HG6sWcn8nFSauZrNYxgNm7NDiTjGke1nz5T1ps/edit#gid=1177960502 (delete content of revisions
page and adapt the rest). You then need to create an api user in google and give it access to the sheet (so the workflow has access to the sheet). You also need an api key for OFN
Output samples can be found at https://requestbin.com/r/enbuwfku3ixpb/2DlQ4sfJAVBSAKQGhTf6Jg0AtsY
Supported events :
- order_created_or_updated
You can filter to only get events for specific enterprise_id, status, shipment_status
Todos are written as notes in the workflow definition
Sample
{
"type": "order_created_or_updated",
"id": "071b9ad6-1cc6-433d-ae45-5411b2526140",
"at": "2022-08-18T17:42:04.461Z",
"enterprise_id": 591,
"user_id": 3497,
"data": {
"id": 421000,
"number": "R776777631",
"created_at": "2022-08-18",
"status": "complete",
"payment_status": "balance_due",
"shipment_status": "pending",
"total_price": "1.0",
"customer": {
"id": 2997
},
"billing_address": {
"phone": "+32999999",
"first_name": "Olivier",
"last_name": "Wouters",
"street_address_1": "Grand rue, 5352",
"street_address_2": "",
"postal_code": "6850",
"locality": "Carlsbourg",
"region": {
"id": 166,
"name": "Luxembourg"
},
"country": {
"id": 29,
"name": "Belgium"
}
},
"shipping_address": {
"phone": "+32999999",
"first_name": "Olivier",
"last_name": "Wouters",
"street_address_1": "Rue provinciale, 285",
"street_address_2": "",
"postal_code": "1301",
"locality": "Wavre",
"region": {
"id": 162,
"name": "Brabant Wallon"
},
"country": {
"id": 29,
"name": "Belgium"
}
},
"shipping_method": {
"id": 2,
"name": "Retrait à la centrale Oxfam-Magasins du monde"
},
"order_cycle": {
"id": 2545
},
"line_items": [
{
"quantity": 1,
"variant": {
"id": 23800,
"name": "Chocolat noir sans sucre",
"sku": "00454000020023"
},
"product": {
"id": 9737,
"name": "Chocolat noir sans sucre",
"category": {
"id": 2
}
}
}
]
}
}
order_created product_created product_updated product_deleted customer_created customer_updated customer_deleted