القائمة

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!]!مطلوب
urlString!مطلوب

يُرجع

RegisteredWebhookView!

مثال

GraphQL
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
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 } }"}'