The webhook allows a vendor to get a callback on the endpoint provided after the event he is subscribed to is executed.
Name | Description |
---|---|
Event Type |
Type of event
|
GET /v1/webhook-events
{ "events": [ { "type": "Orders.Refund", "description": "Refund for orders" }, { "type": "Orders.BatchRefund", "description": "Batch refund for orders" } ] }
POST /v1/webhooks
{ "eventType": "Orders.Refund", "href": "https://www.vendorUrl.com/amc-webhooks/order-refunds" }
HTTP/1.1 201 Created Location: https://api.amctheatres.com/v1/webhooks/token-8ada0d8e-25ff-4a35-aa82-1ff11098745a
GET /v1/webhooks
{ "count": 2, "_embedded": { "events": [ { "token": "8700e411-a814-475b-ba51-8e4c0b1f6719", "eventType": "Orders.Refund", "href": "https://www.vendorUrl.com/amc-webhooks/order-refunds", "_links": { "self": { "href": "http://amctheatres.com/v1/webhooks/8700e411-a814-475b-ba51-8e4c0b1f6719", "templated": false } } }, { "token": "cf855cba-0bf8-4808-b422-83205be7e20c", "eventType": "Orders.BatchRefund", "href": "http://www.VendorUrl/v1/order-batch-refunds", "_links": { "self": { "href": "http://amctheatres.com/v1/webhooks/cf855cba-0bf8-4808-b422-83205be7e20c", "templated": false } } } ] } }
POST /v1/webhooks/{webhooktokenid}/test
HTTP/1.1 200 OK
DELETE /v1/webhooks/{webhooktokenid}
HTTP/1.1 200 OK
POST (VendorEndPointUrl)
{ "eventType": "Orders.Refund", "eventDateUtc": "2019-03-20T16:12:06.373Z", "details": { "OrderId": 1, "OrderToken": "DE267635-B3F9-4C9B-833B-225883873637", "RefundAmount": 5.35, "OrderTotal": 15.23, "RefundReason": "testRefundReason", "CreationDateUTC": "2019-03-20T16:12:06.373Z", "LastUpdateDateUTC": "2019-03-20T16:12:06.373Z" } }
HTTP/1.1 200 OK
POST (VendorEndPointUrl)
{ "eventType": "Orders.BatchRefund", "eventDateUtc": "2019-03-20T16:12:06.373Z", "details": { "OrderId": 1, "OrderToken": "DE267635-B3F9-4C9B-833B-225883873637", "RefundAmount": 5.35, "OrderTotal": 15.23, "RefundReason": "testRefundReason", "CreationDateUTC": "2019-03-20T16:12:06.373Z", "LastUpdateDateUTC": "2019-03-20T16:12:06.373Z" } }
HTTP/1.1 200 OK