Create webhooks
POST
/merchants/{merchantCode}/webhooks
const url = 'https://webhook.shopgate.io/v1/merchants/example/webhooks';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"webhooks":[{"code":"string","name":"example","endpoint":"example","active":true,"events":[{"code":"example"}]}]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://webhook.shopgate.io/v1/merchants/example/webhooks \ --header 'Content-Type: application/json' \ --data '{ "webhooks": [ { "code": "string", "name": "example", "endpoint": "example", "active": true, "events": [ { "code": "example" } ] } ] }'Register new webhooks
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”merchantCode
required
string
Request Body
Section titled “Request Body”The following event codes are supported:
- cartReminderTimeReached
- customerDeleted
- fulfillmentOrderAdded
- fulfillmentOrderStatusUpdated
- fulfillmentOrderUpdated
- importCompleted
- inventoryReservationCreated
- inventoryReservationUpdated
- inventoryReservationDeleted
- inventoryReservationSettled
- locationCreated
- locationDeleted
- locationUpdated
- orderNotPickedUp
- productCreated
- productUpdated
- salesOrderAdded
- salesOrderFulfillmentAdded
- salesOrderStatusUpdated
- salesOrderUpdated
- returnOrderAdded
- returnOrderStatusUpdated
- schedulePickTimeReached
- schedulePickupReminderTimeReached
Media typeapplication/json
object
webhooks
required
Array<object>
object
code
string | null
Example
stringname
required
string
endpoint
required
string
active
required
boolean
events
required
Array<object>
object
code
required
string
Responses
Section titled “Responses”Invalid request
Media typeapplication/json
object
errors
Array<object>
object
code
number
entity
string
entityId
string
entityIndex
number
reason
string
subentityPath
Array<number | string>
ids
Array<string>
Example
{ "errors": [ { "code": 409, "entity": "webhook", "entityId": "salesOrderAddedMagento", "entityIndex": 0, "reason": "Webhook with code 'salesOrderAddedMagento' already exists", "subentityPath": [] } ], "ids": [ "123e4567-e89b-12d3-a456-426614174000" ]}Validation error
Media typeapplication/json
object
message
string
code
string
error
object
paramName
The parameter-field, that failed to validate, like “userId”
string
paramValue
The value, that was sent, like “xxx”
null | string | number | object | array
code
Machine readable error code
string
message
required
Human readable error code
string
results
object
errors
Array<object>
object
code
Machine readable error code
string
message
Human readable error code
string
description
string
path
Array<string>
warnings
Array<object>
object
code
Machine readable error code
string
message
Human readable error code
string
description
string
path
Array<string>
Example
{ "error": { "code": "SCHEMA_VALIDATION_FAILED", "results": { "errors": [ { "code": "ENUM_MISMATCH", "description": "human readable error code" } ], "warnings": [ { "code": "ENUM_MISMATCH", "description": "human readable error code" } ] } }}Merchant not found
Media typeapplication/json
object
code
required
string
message
required
string
Example
{ "code": "NotFound", "message": "Merchant not found"}
