Question

Creating barcode from json received via webhook

  • 10 September 2020
  • 5 replies
  • 181 views

Userlevel 1

Hi there,

 

Relatively new to Zapier and very limited coding knowledge so go easy on me.

 

The Goal:

To create an email with barcodes generated from ean codes from a variable list (line items) of items depending on the information passed via webhook in json format.

 

So, I have created the webhook and I am receiving the JSON when the zap it triggered. That was fairly straight forward.

My issue now is parsing the ean code out of the json with some other information like product name, price, department. The ean code has a prefix and suffix of *. When I parse this out I would then like to generate a barcode, code 39, which can then be embedded in the email on each line.

 

The final email that is to be sent should be essentially like a shopping list with a barcode attached that can then be scanned by a handheld scanner.

 

Now this may seem like a crazy idea but I am dealing with some pretty old legacy systems that have no API capability (and wont be getting it) so this is very much a workaround to speed up a checkout process.

 

Any thoughts or suggestions would be greatly appreciated!

 

Thanks


This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

5 replies

Userlevel 7
Badge +11

Hi @DerekK,

That’s an interesting workflow you’re tryin to accomplish! I can’t think of how you’d do that, but we’ve got a handful of folks in the Community who might be able to help you out.

@TimS and/or @ikbelkirasan: do either of you have any ideas here? This one’s pretty complex!

Userlevel 7
Badge +12

@nicksimard - Sure thing!

@DerekK - Can you show us an example webhook data? Also, if possible an example email so we know how it should look like. Thanks!

Userlevel 1

@nicksimard - Sure thing!

@DerekK - Can you show us an example webhook data? Also, if possible an example email so we know how it should look like. Thanks!


Hey @ikbelkirasan 

 

Webhook data, no problem. Email…. Thats still to be designed, but I could do something like simply attaching a link or a google sheet to the order email as it is the google sheet that will translate the ean code to a scanable barcode.

 

Order data via webhook below. As you can see in one of the product description fields I’ve added a prefix and a suffix to the ean code of “*” Thats a star in-case it isn't clear.

 

{"Type":"order.created","CreateTime":"2020-09-10T10:45:17.3242579Z","Body":{"EventName":"order.created","Description":"1773035 placed a collection order (#21407580) for €12.37 with Dereks test store.","OrderCreatedTime":"2020-09-10T10:45:17.3086385Z","Order":{"Store":{"Id":10529,"Name":"Dereks test store","MenuId":31304,"Metadata":{},"Currency":"EUR","Coordinates":{"Latitude":xxx,"Longitude":-xxx},"StoreTimezone":"GMT Standard Time","StoreGroupId":10811},"Customer":{"Id":1773035,"Name":"Derek K","EmailAddress":null,"PhoneNumberLocalFormat":"08xxxxxxxx","PhoneNumber":"+3538xxxxxxxx"},"Voucher":null,"Fees":null,"OrderItems":[{"OrderItemOptions":[],"Metadata":{},"MenuItemPublicId":"96fb8eea-c1c8-4e09-9f14-6ef5c6193ac1","MenuSectionName":"Household","MenuSectionDisplayOrder":0,"Name":"Fairy Original 500ml","Description":"*5413149980761*","Price":1.87,"PriceIncludingOptionSetItems":1.87,"MenuItemId":2277063,"MenuItemDisplayOrder":8,"IsAvailable":true},{"OrderItemOptions":[],"Metadata":{},"MenuItemPublicId":"8a6b73d0-7af7-495b-bbae-8d6f469c1ba2","MenuSectionName":"Household","MenuSectionDisplayOrder":0,"Name":"Plenty The Original One Kitchen Roll","Description":"","Price":2.5,"PriceIncludingOptionSetItems":2.5,"MenuItemId":2277067,"MenuItemDisplayOrder":12,"IsAvailable":true},{"OrderItemOptions":[],"Metadata":{},"MenuItemPublicId":"8a6b73d0-7af7-495b-bbae-8d6f469c1ba2","MenuSectionName":"Household","MenuSectionDisplayOrder":0,"Name":"Plenty The Original One Kitchen Roll","Description":"","Price":2.5,"PriceIncludingOptionSetItems":2.5,"MenuItemId":2277067,"MenuItemDisplayOrder":12,"IsAvailable":true},{"OrderItemOptions":[],"Metadata":{},"MenuItemPublicId":"8a6b73d0-7af7-495b-bbae-8d6f469c1ba2","MenuSectionName":"Household","MenuSectionDisplayOrder":0,"Name":"Plenty The Original One Kitchen Roll","Description":"","Price":2.5,"PriceIncludingOptionSetItems":2.5,"MenuItemId":2277067,"MenuItemDisplayOrder":12,"IsAvailable":true},{"OrderItemOptions":[],"Metadata":{},"MenuItemPublicId":"8a6b73d0-7af7-495b-bbae-8d6f469c1ba2","MenuSectionName":"Household","MenuSectionDisplayOrder":0,"Name":"Plenty The Original One Kitchen Roll","Description":"","Price":2.5,"PriceIncludingOptionSetItems":2.5,"MenuItemId":2277067,"MenuItemDisplayOrder":12,"IsAvailable":true}],"DeliveryLocation":null,"CustomerLocation":{"Latitude":xxxx,"Longitude":-xxxx},"MaskedPhoneNumber":{"IsEnabled":true,"PhoneNumber":"+353xxxxxxx","Code":"50623691"},"DropOffLocationId":null,"DropOffLocation":null,"AcceptedFor":null,"InFraudZone":false,"UnusualHighValueOrder":false,"RejectedByUserId":null,"OrderId":21407580,"LocalOrderId":null,"DeliveryType":"Pickup","PickupLocationType":"TakeOut","TableServiceCatagory":"Generic","TipAmount":0.0,"DeliveryAmount":0.0,"OrderItemsAmount":11.87,"Amount":12.37,"ProcessingFee":0.5,"PaymentAccountType":"Cash","PaymentAccountDescription":"Cash","OrderState":"ReadyToProcess","IsPreOrder":true,"PlacedTime":"2020-09-10T10:44:53.26","RequestedForTime":"2020-09-10T11:20:00","ChefNote":null,"AppType":"Web","UserRating":null,"PaymentStatus":"Paid","RejectionReason":null,"RefundedAmount":null,"DeliveryTrackingStatus":"Unassigned","DriverId":null,"TotalTax":0.0,"OrderTrackingCode":null},"EventId":"263104e9-22ee-4a33-bf10-fd70e27931eb","CreateTime":"2020-09-10T10:45:17.3242579Z","Position":0,"AppId":"7448"}}

Userlevel 7
Badge +8

Hi @ikbelkirasan! Based on the above, do you think this workflow could be accomplished? Thank you!

Userlevel 7
Badge +8

@DerekK checking back in to see if you were able to get this workflow up and running! Would love to know how!