Webhooks
Create webhook subscription
Subscribes a notification URL to event types.
此内容尚不支持你的语言。
https://api.maple.inc/v1/webhook_subscriptionsAPI keySubscribes a notification URL to event types. Returns the HMAC signing secret once.
Authorization
Send your API key as Authorization: Bearer <key>: mpk_test_… against the sandbox (https://api.staging.maple.inc/v1), mpk_live_… against production. See Authentication. The samples read the key from MAPLE_KEY and the base URL from MAPLE_BASE, as set up in the Quickstart.
Request body
application/json, required.
-
notification_urlstring required -
event_typesstring[] required
Responses
200 OK
-
objectstring requiredAlways
webhook_subscription.created. -
subscriptionobject required -
subscription.objectstring requiredAlways
webhook_subscription. -
subscription.idstring required -
subscription.environmentstring requiredOne of
test,live. -
subscription.notification_urlstring required -
subscription.event_typesstring[] required -
subscription.statusstring requiredOne of
enabled,disabled. -
subscription.created_atstring required -
subscription.updated_atstring required -
signing_secretstring requiredOne-time HMAC-SHA256 signing secret (
mwhsec_…) used to verify webhook deliveries. Store it now; it is never shown again.
Errors
-
400Bad request -
401Unauthorized -
403Forbidden -
429Too many requests
Every error body names the error in _tag, explains it in message, and says where to report it in feedback. See Errors.
A 429 also sends Retry-After: Seconds to wait before retrying; also returned as retry_after in the body.