Event-Stream Webhooks (v0)
Download OpenAPI specification:Download
publishEvent
Incoming call from NewStore that contains an event. The event is described in the request.
Managing duplicate events: You can receive data from Newstore via Event stream webhooks, as Newstore supports emitting data at least once to your integration point. However, Event stream webhooks sometimes deliver events more than once. To protect your integration point from duplicate events, we advise you to make your event processing idempotent. You can detect duplicate events by comparing your event's idempotency key with the idempotency keys of previous events. For each event, you will see an idempotency key in your webhook description. For more information, see Stripe's blog on idempotency or the NewStore guide.
NOTE: Currently the idempotency key is only unique per event. Add the event name to the idempotency key to get a unique key across all events.
Order of events:
You will not receive events in a specific order. You may receive an order.cancelled
event before the
corresponding order.created
event.
Event delivery: We take at most 15 minutes to send an event to your integration endpoint according to the service-level agreement (SLA) between a retailer and NewStore. However, usually, it takes seconds to complete this operation.
Response code: The response code you send back decides whether the whole stream should be interrupted or maintained. See the Responses section below for more information.
Deprecation note:
The order.shipped
event has been deprecated. Use the order.completed
event
for data related to orders that are closed in the NewStore platform.
Authorizations:
Request Body schema: application/json
tenant required | string The tenant name. |
name required | string Enum: "fulfillment_request.assigned" "fulfillment_request.items_completed" "fulfillment_request.items_failed" "fulfillment_request.items_ready_for_handover" "order.created" "order.opened" "order.shipped" "order.completed" "order.cancelled" "order.items_swapped" "order.items_cancelled" "order.items_on_hold" "invoice.created" "return.processed" "refund_request.issued" "payment_account.amount_authorized" "payment_account.amount_captured" "payment_account.amount_refunded" "payment_account.amount_voided" "inventory_transaction.items_received" "inventory_transaction.items_ready_for_handover" "inventory_transaction.asn_created" "inventory_transaction.adjustment_created" "inventory_count.items_counted" "customer.created" "customer.updated" "customer.address_created" "customer.address_updated" "customer.address_deleted" "employee.created" "employee.updated" The name of the external event. |
published_at required | string <date-time> UTC timestamp indicating when this event was generated. |
required | order.created (object) or order.opened (object) or order.completed (object) or order.cancelled (object) or order.items_cancelled (object) or order.items_on_hold (object) or order.items_swapped (object) or invoice.created (object) or return.processed (object) or fulfillment_request.assigned (object) or fulfillment_request.items_completed (object) or fulfillment_request.items_failed (object) or fulfillment_request.items_ready_for_handover (object) or refund_request.issued (object) or payment_account.amount_authorized (object) or payment_account.amount_captured (object) or payment_account.amount_refunded (object) or payment_account.amount_voided (object) or inventory_transaction.items_received (object) or inventory_transaction.items_ready_for_handover (object) or inventory_transaction.asn_created (object) or inventory_transaction.adjustment_created (object) or inventory_count.items_counted (object) or customer.created (object) or customer.updated (object) or customer.address_created (object) or customer.address_updated (object) or customer.address_deleted (object) or employee.created (object) or employee.updated (object) Content of the event defined by the 'name' property. |
Responses
Request samples
- Payload
The order has been successfully created in the NewStore Omnichannel Cloud.
If the payment authorization fails, this event is not emitted but you might be able to see this order in NewStore Omnichannel Manager, depending on your configuration.
This event is sent at the beginning of the grace period.
See the order lifecycle for more information about the possible next events to expect.
Idempotency key: id
{- "tenant": "businessname",
- "name": "order.created",
- "published_at": "2010-01-01T12:00:00.000Z",
- "payload": {
- "id": "04d02325-f4ea-4a7b-bfeb-2ff74a0e1a0d",
- "external_id": "NSD000000001",
- "created_at": "2018-07-06T11:56:34.712Z",
- "placed_at": "2018-07-06T12:06:25.989Z",
- "associate_id": "fe203100e1e2416ba6932d1561ccc380",
- "associate_email": "some@qa2.com",
- "channel_type": "web",
- "channel": "webshop-123",
- "is_exchange": false,
- "customer_email": "johndoe@example.com",
- "customer_id": "3dd42342-0937-4c12-b393-d2c849a590d5",
- "external_customer_id": "CUST123423",
- "is_historical": false,
- "discounts": [
- {
- "trigger": "coupon",
- "discount_id": "xxyz1b25-0937-4c12-b393-d2c849a590d5",
- "coupon_code": "COUPON10E"
}
], - "billing_address": {
- "first_name": "John",
- "last_name": "Doe",
- "address_line_1": "800 California St",
- "address_line_2": "",
- "address_line1": "800 California St",
- "address_line2": "",
- "zip_code": "94108",
- "city": "San Francisco",
- "state": "CA",
- "country": "US",
- "phone": ""
}, - "shipping_address": {
- "first_name": "John",
- "last_name": "Doe",
- "address_line_1": "800 California St",
- "address_line_2": "",
- "address_line1": "800 California St",
- "address_line2": "",
- "zip_code": "94108",
- "city": "San Francisco",
- "state": "CA",
- "country": "US",
- "phone": "07534706323"
}, - "price_method": "tax_excluded",
- "subtotal": 295,
- "discount_total": 0,
- "shipping_total": 42,
- "shipping_tax": 0,
- "tax_total": 25.08,
- "grand_total": 320.08,
- "currency": "USD",
- "tax_strategy": "fixedrate",
- "tax_exempt": false,
- "extended_attributes": [ ],
- "items": [
- {
- "id": "c1348089-1889-4cb8-8846-ad054d066fbf",
- "item_type": "product",
- "product_id": "1005404",
- "pricebook_id": "default",
- "pricebook_price": 295,
- "list_price": 295,
- "item_discounts": 0,
- "order_discounts": 0,
- "tax": 25.08,
- "tax_provider_details": [
- {
- "name": "Custom Tax",
- "amount": 25.08,
- "rate": 0.2
}
], - "tax_class": "PC040100",
- "quantity": 1,
- "status": "created",
- "shipping_service_level": "STANDARD_OVERNIGHT",
- "is_preorder": false,
- "future_fulfillment_location_id": "874e9179-b87f-40f0-a07e-3e6d28ef8fd9",
- "shipping_method": "traditional_carrier",
- "discounts": [
- {
- "id": "ac568994-28ce-420a-b053-c0010e315920",
- "price_adjustment": 44,
- "reason": "Coupon EMPLOYEE",
- "action": "percentage",
- "value": 50,
- "level": "order",
- "coupon_code": "CODE123",
- "externalRef": "914e9179-b87f-40f0-a07e-3e6d287f8fd8"
}
]
}
]
}
}