Subscribe to the Store events
POST/store/subscribe
URL | Description |
---|---|
https://petstore.swagger.io/v2 | Default server |
https://petstore.swagger.io/sandbox | Sandbox server |
http://127.0.0.1:4010 | Prism Mock API (local) |
Add subscription for a store events
Request
- application/json
Body
This URL will be called by the server when the desired event will occur
Event name for the subscription
Possible values: [orderInProgress
, orderShipped
, orderDelivered
]
Responses
- 201
Subscription added
- application/json
- Schema
- Example (from schema)
Schema
{
"subscriptionId": "AAA-123-BBB-456"
}
Callbacks
- POST orderInProgress
- PUT orderInProgress
- POST orderShipped
- POST orderDelivered
POST{$request.body#/callbackUrl}?event={$request.body#/eventName}
A callback triggered every time an Order is updated status to "inProgress" (Description)
- application/json
- application/xml
Body
Body
Callbacks Responses
- 200
- 299
- 500
Callback successfully processed and no retries will be performed
- application/json
- Schema
- Example (from schema)
Schema
{
"someProp": "123"
}
Response for cancelling subscription
Callback processing failed and retries will be performed
PUT{$request.body#/callbackUrl}?event={$request.body#/eventName}
Order in Progress (Only Description)
- application/json
- application/xml
Body
Body
Callbacks Responses
- 200
Callback successfully processed and no retries will be performed
- application/json
- Schema
- Example (from schema)
Schema
{
"someProp": "123"
}
POST{$request.body#/callbackUrl}?event={$request.body#/eventName}
A callback triggered every time an Order is shipped to the recipient
- application/json
Body
Callbacks Responses
- 200
Callback successfully processed and no retries will be performed
POSThttp://notificationServer.com?url={$request.body#/callbackUrl}&event={$request.body#/eventName}
A callback triggered every time an Order is delivered to the recipient
- application/json
Body
Callbacks Responses
- 200
Callback successfully processed and no retries will be performed