createWebhook
Creates a webhook endpoint on the current account (Add new webhook in the dashboard), with a new signingSecret. signingSecret is null in the result without the credentials:read permission. When enabled is true (the default), MONEI first sends a {"type":"webhook.test"} request. Its v1 is made with the account API key and its v2 with the new signingSecret, which the receiver gets only from this result. So answer webhook.test with a 2xx status also when you cannot verify it yet. The mutation fails when the URL does not answer with a 2xx status, or when the account has no API key and is not allowed to have one. Arguments: - input: URL, event types and initial state of the webhook.
createWebhook(
input: CreateWebhookInput!
): Webhook!
Arguments
createWebhook.input ● CreateWebhookInput! non-null input
Type
Webhook object
Endpoint that receives MONEI events as HTTP POST requests with a JSON body. The dashboard shows
endpoints on Settings > Webhooks.
The body is the event: id, type, livemode, accountId, objectType, objectId, createdAt
(Unix seconds) and object.
MONEI signs each attempt in the MONEI-Signature header, such as
t=<unix seconds>,v1=<signature>,v2=<signature>. Each signature is the hex HMAC-SHA256 of
<t>.<body>. An element can be absent and the header can hold more elements, so read each element
by its key and do not match the full header.
v1is made with the account API key. When the account has no API key, it is made with the legacysecretof the webhook. With neither, the header has nov1.v2is made with thesigningSecretof the webhook, the fullwhsec_...string. For 24 hours afterrollWebhookSecret, the header holds twov2elements: the new secret first, then the old one. A webhook without asigningSecretsends nov2. Thewebhook.testrequest ofcreateWebhookandupdateWebhookis signed the same way, but itsv1is made only with the account API key. Only a 2xx answer counts as delivered. MONEI does not follow redirects, and waits 60 seconds at most for an answer. MONEI does not send to a URL that resolves to a private or local address. A failed live delivery is retried with growing delays, up to 18 attempts over about 3 days. A test-mode delivery gets 3 attempts. A URL on a tunnelling or request-inspection host (ngrok, webhook.site) gets 1 attempt. MONEI emails the account admin when a live endpoint starts to fail, and disables the endpoint only after it fails without a break for 7 days.