For example, you can rely on webhooks to trigger an action in your app when a customer creates a new order or shirtplatform fulfills an order.
By using webhooks subscriptions you can make fewer API calls overall, which makes sure that your apps are more efficient and update quickly.
/accounts/{accountId}/shops/{shopId}/webhooks
Create a new webhook subscription.
| Name | In | Default | Constraints | Description | |
|---|---|---|---|---|---|
x-auth-token |
header | The authentication token | |||
accountId |
required | path | int | the unique identifier of the account | |
shopId |
required | path | int | the unique identifier of the shop |
| Media Type | Data Type | Description |
|---|---|---|
application/json |
Webhook | the webhook subscription data including callback URL and subscribed events |
application/xml |
Webhook |
<webhook>
<id>...</id>
<address>https://whatever.hostname.com/</address>
<topic>orders/updated</topic>
<secret>mysecretword</secret>
<mediaType>JSON</mediaType>
</webhook>
{
"webhook" : {
"id" : 12345,
"address" : "https://whatever.hostname.com/",
"topic" : "orders/updated",
"secret" : "mysecretword",
"mediaType" : "JSON"
}
}
<webhook>
<id>...</id>
<address>https://whatever.hostname.com/</address>
<topic>orders/updated</topic>
<secret>mysecretword</secret>
<mediaType>JSON</mediaType>
</webhook>
{
"webhook" : {
"id" : 12345,
"address" : "https://whatever.hostname.com/",
"topic" : "orders/updated",
"secret" : "mysecretword",
"mediaType" : "JSON"
}
}
/accounts/{accountId}/shops/{shopId}/webhooks
Get a list of webhook subscriptions for your shop.
| Name | In | Default | Constraints | Description | |
|---|---|---|---|---|---|
x-auth-token |
header | The authentication token | |||
accountId |
required | path | int | the unique identifier of the account | |
shopId |
required | path | int | the unique identifier of the shop | |
filterId |
query | |
optional saved Filter.Webhook ID; empty string for all | ||
page |
query | 0 |
int | zero-based page index | |
size |
query | 10 |
int | number of items per page |
<pagedData>
<records>...</records>
<totalElements>...</totalElements>
</pagedData>
{
"pagedData" : {
"records" : [ { }, { } ],
"totalElements" : 12345
}
}
/accounts/{accountId}/shops/{shopId}/webhooks/{id}
Get a single webhook by its id.
| Name | In | Default | Constraints | Description | |
|---|---|---|---|---|---|
x-auth-token |
header | The authentication token | |||
accountId |
required | path | int | the unique identifier of the account | |
id |
required | path | int | the unique identifier of the webhook subscription | |
shopId |
required | path | int | the unique identifier of the shop |
<webhook>
<id>...</id>
<address>https://whatever.hostname.com/</address>
<topic>orders/updated</topic>
<secret>mysecretword</secret>
<mediaType>JSON</mediaType>
</webhook>
{
"webhook" : {
"id" : 12345,
"address" : "https://whatever.hostname.com/",
"topic" : "orders/updated",
"secret" : "mysecretword",
"mediaType" : "JSON"
}
}
/accounts/{accountId}/shops/{shopId}/webhooks/{id}
Update a webhook subscription.
| Name | In | Default | Constraints | Description | |
|---|---|---|---|---|---|
x-auth-token |
header | The authentication token | |||
accountId |
required | path | int | the unique identifier of the account | |
id |
required | path | int | the unique identifier of the webhook subscription | |
shopId |
required | path | int | the unique identifier of the shop |
| Media Type | Data Type | Description |
|---|---|---|
application/json |
Webhook | the updated webhook subscription data |
application/xml |
Webhook |
<webhook>
<id>...</id>
<address>https://whatever.hostname.com/</address>
<topic>orders/updated</topic>
<secret>mysecretword</secret>
<mediaType>JSON</mediaType>
</webhook>
{
"webhook" : {
"id" : 12345,
"address" : "https://whatever.hostname.com/",
"topic" : "orders/updated",
"secret" : "mysecretword",
"mediaType" : "JSON"
}
}
<webhook>
<id>...</id>
<address>https://whatever.hostname.com/</address>
<topic>orders/updated</topic>
<secret>mysecretword</secret>
<mediaType>JSON</mediaType>
</webhook>
{
"webhook" : {
"id" : 12345,
"address" : "https://whatever.hostname.com/",
"topic" : "orders/updated",
"secret" : "mysecretword",
"mediaType" : "JSON"
}
}
/accounts/{accountId}/shops/{shopId}/webhooks/{id}
Delete a webhook subscription.
| Name | In | Default | Constraints | Description | |
|---|---|---|---|---|---|
x-auth-token |
header | The authentication token | |||
accountId |
required | path | int | the unique identifier of the account | |
id |
required | path | int | the unique identifier of the webhook subscription | |
shopId |
required | path | int | the unique identifier of the shop |
| Media Type | Data Type | Description |
|---|---|---|
application/json |
object
|
|
application/xml |
anyType
|
/accounts/{accountId}/shops/{shopId}/webhooks/{id}/testOrderEvent/{orderId}
Test a webhook subscription. It will trigger a predefined shop event on the specified order.
| Name | In | Default | Constraints | Description | |
|---|---|---|---|---|---|
x-auth-token |
header | The authentication token | |||
accountId |
required | path | int | the unique identifier of the account | |
id |
required | path | int | the unique identifier of the webhook subscription to test | |
orderId |
required | path | int | the unique identifier of the order to use for the test event | |
shopId |
required | path | int | the unique identifier of the shop |
<webhook>
<id>...</id>
<address>https://whatever.hostname.com/</address>
<topic>orders/updated</topic>
<secret>mysecretword</secret>
<mediaType>JSON</mediaType>
</webhook>
{
"webhook" : {
"id" : 12345,
"address" : "https://whatever.hostname.com/",
"topic" : "orders/updated",
"secret" : "mysecretword",
"mediaType" : "JSON"
}
}