So, there’s a website that parses your emails for online orders, like Grubhub, and packs it into JSON format and can send it as a webhook to a destination of your choice.
How do I format the “Target URL” so that the JSON reaches the Graphql API? Do I need headers? If so, should I use username:password over tokens?
Edit: this is what the JSON payload looks like.
{
"getSwiftTemplate": "rightguy's restaurant",
"pickupPhone": "(123) 456-7890",
"confirmationCode": "3361",
"reference": "91001280 — 1508420",
"orderType": "DELIVERY",
"dateTime": "Sep 15, 2020, 12:24 PM",
"itemCount": "3",
"items": [
{
"quantity": "1",
"description": "Goat Cheese Omelet Platter",
"price": "$12.60"
},
{
"quantity": null,
"description": "* Substitute for Butter Bagel\n* Add Red Onion",
"price": null
},
{
"quantity": "1",
"description": "Hot Coffee",
"price": "$2.95"
},
{
"quantity": null,
"description": "* Large\n* NO Milk\n* NO Sugar",
"price": null
},
{
"quantity": "1",
"description": "Pastrami Melt Hero Instructions: NO tomato please. Thanks!",
"price": "$10.35"
},
{
"quantity": null,
"description": "* Add Jalapeno",
"price": null
}
],
"dropoffDescription": "Include napkins and utensils? YES",
"subTotal": "$25.90",
"customerFee": "$1.00",
"serviceFee": "$0.00",
"tax": "$2.39",
"tip": "$6.08",
"grandTotal": "$35.37",
"paymentMode": "PREPAID DO NOT CHARGE",
"confirmationLink": "https://orderemails.grubhub.com/xxxx-xxx-xxx-xxxxxx",
"dropoffName": "Example Customer Name",
"dropoffAddress": "12-33 90th street",
"unitNumber": "6G",
"dropoffCity": "Queens",
"dropoffState": "NY",
"dropoffZip": "00010",
"dropoffPhone": "Customer's Phone#",
"deliveryInstructions": "For Apt. 6G - press the bell button. Leave at the front door of my apt.",
"source": "grubhub",
"ParentID": null,
"Sender": "orders@eat.grubhub.com",
"Recipient": "klemail@in.parseur.com",
"To": "xxx@gmail.com"
}