apiRegisterWebhook
تعديليتطلب مفتاحًاShop API: registers an https endpoint for the given events (order.*, listing.state_changed, …). Returns the signing secret once. At most 10 per store.
الوسائط
| الاسم | النوع | الوصف |
|---|---|---|
| events | [String!]! | مطلوب |
| url | String! | مطلوب |
يُرجع
مثال
mutation ApiRegisterWebhook($events: [String!]!, $url: String!) {
apiRegisterWebhook(events: $events, url: $url) {
endpoint {
connectionId
consecutiveFailures
createdAt
disabledAt
events
failingSince
id
lastDeliveryAt
lastHttpStatus
status
url
}
endpointId
secret
}
}curl -sS https://api.wamia.tn/connect/graphql \
-H 'content-type: application/json' \
-H 'x-api-key: wamia_…' \
-H 'user-agent: my-integration/1.0.0 (+https://shop.example.tn)' \
-H 'wamia-idempotency-key: 6f0e1a2b-…' \
--data '{"query":"mutation ApiRegisterWebhook($events: [String!]!, $url: String!) { apiRegisterWebhook(events: $events, url: $url) { endpoint { connectionId consecutiveFailures createdAt disabledAt events failingSince id lastDeliveryAt lastHttpStatus status url } endpointId secret } }"}'