Simulate an order callback
POST /v2/fulfillment_sandbox/orders/{order_id}/callbacks
Simulate an event callback for some order statuses that are not covered by the batch statuses.
The following table describes the valid values for the event_status
attribute.
Status | Description |
---|---|
canceled | Simulates a canceled order. |
rescheduled | Simulates a rescheduled order. |
late_delivery | Simulates a late delivery. |
Security
Name | In | Description |
---|---|---|
Authorization | header | The Authorization header with the bearer token acquired during authentication. |
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
order_id | path | string | The ID of the order. |
Request
Field | Type | Required | Description |
---|---|---|---|
event_name | string | The event name. |
Request examples
- cURL
- Java
- Python
- Go
curl --request POST \
--url 'https://connect.instacart.com/v2/fulfillment_sandbox/orders/{order_id}/callbacks' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"event_name": "string"
}'
HttpResponse<String> response = Unirest.post("https://connect.instacart.com/v2/fulfillment_sandbox/orders/{order_id}/callbacks")
.header("Accept", "application/json")
.header("Content-Type", "application/json")
.header("Authorization", "Bearer <token>")
.body("{\n \"event_name\": \"string\"\n}")
.asString();
import http.client
conn = http.client.HTTPSConnection("connect.instacart.com")
payload = "{\n \"event_name\": \"string\"\n}"
headers = {
'Accept': "application/json",
'Content-Type': "application/json",
'Authorization': "Bearer <token>"
}
conn.request("POST", "/v2/fulfillment_sandbox/orders/{order_id}/callbacks", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://connect.instacart.com/v2/fulfillment_sandbox/orders/{order_id}/callbacks"
payload := strings.NewReader("{\n \"event_name\": \"string\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Accept", "application/json")
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
Response
Field | Type | Required | Description |
---|---|---|---|
success | boolean | Whether the request was successful. |
Response examples
200 Success
200
Order Event Simulated
{
"success": true
}
4XX Errors
Error responses return either a single error or multiple errors.
HTTP Code | Cause | Error Message | Error Code | Error Meta |
---|---|---|---|---|
404 | Order not found | "Resource not found" | 4000 | Not applicable |