Created
September 15, 2022 01:05
-
-
Save gje4/99f79dbc3c75d781f0b0315ed92daea3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
// Fetch Order Data | |
fetch('/api/storefront/order/{{checkout.order.id}}', { | |
credentials: 'include' | |
}).then(function (response) { | |
return response.json(); | |
}).then(function (orderData) { | |
const orderDate = Date.now(); | |
const requestOptions = { | |
method: 'POST', | |
headers: { 'Content-Type': 'application/json' }, | |
body: JSON.stringify({ customerName: orderData.billingAddress.firstName + ' ' + orderData.billingAddress.lastName , | |
mobileNumber: orderData.billingAddress.phone, | |
orderNumber: orderData.orderId, | |
orderDate: orderDate }) | |
}; | |
fetch('https://www.workato.com/webhooks/rest/9691b9f9-9c12-42d8-8380-afaabcd7dd2c/mckessonsms', requestOptions) | |
.then(response => response.json()) | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment