Request/response calls GreenLeaze makes to URLs the shop provides at order creation.
These calls go straight from the API to URLs the shop provides. They are not webhook subscriptions: they do not appear in the delivery logs and, except the order success URL, are not retried.
Order success URL (urls.success)
urls.success) The urls.success given at order creation receives the order_confirmed payload (isBooking: false, no services[].tags) through the gateway, so the delivery rules apply. Specifics:
- Sent when the order is validated (subject to the shop's
webhook_delay) and when an admin starts it with "validate external shop". Requires the order'scartSecureKey. - The response is read:
shopifyOrderId(top level or underdata) is saved as the order'sexternalOrderId.
Customer data update (urls.sendData)
urls.sendData)Sent when the customer edits their identity during checkout.
PATCH <urls.sendData>
Content-Type: application/json
Accept: application/json
| Field | Type | Description |
|---|---|---|
cartId | string | null | |
cartSecureKey | string | null | |
email | string, optional | Present only when changed. |
phone | string, optional | Same. |
firstName | string, optional | Same. |
lastName | string, optional | Same. |
Not sent when none of the four fields changed. No signature, 10 s timeout, no retry.
Product removal (urls.deleteProduct)
urls.deleteProduct)Sent when the customer removes a product from their order, once per removed line (grouped lines included).
PATCH <urls.deleteProduct>
Content-Type: application/json
| Field | Type | Description |
|---|---|---|
cartId | string | null | |
cartSecureKey | string | null | |
id | string | Shop product id. |
combinationId | string, optional | Shop variant id, when the line has one. |
No signature, no retry. The response is not read.
Discount code check (shop.discountCodeWebhookUrl)
shop.discountCodeWebhookUrl)This one is more an API endpoint than a webhook endpoint as we check response
Sent when a customer enters a code GreenLeaze does not know, if the shop has both a discountCodeWebhookUrl and a discountCodeWebhookSecret.
POST <discountCodeWebhookUrl>
Content-Type: application/json
X-Webhook-Signature: base64(HMAC_SHA256(discountCodeWebhookSecret, rawBody))
{ "discountCode": "SUMMER10" }
Expected response when the code is valid (any other answer means "unknown code"):
| Field | Type | Description |
|---|---|---|
code | string | Must equal the code sent. |
id | string | Code id on the shop side. |
type | "fixed_amount" | "product_percentage" | |
value | number | € TTC for fixed_amount, % for product_percentage. |
minimumAmount | number | null | Minimum cart amount. |
GreenLeaze then imports the code as an active code on every product.
