createWebhook
Overview
This mutation takes a Webhook endpoint and creates the Webhook, returning a success message and a Webhook token. Notifications for received payments will go to this endpoint.
Special Considerations
- Requires a Webhook endpoint as input
- Must be using a business account.
Inputs
MutationCreateWebhookArgs
Required Data
webhookEndpoint: string
Returns
Promise<CreateWebhookResult>
A promise containing the following object / data:
message: string
webhookSecret: string
Example
Running this mutation:
mutation {
createWebhook(data: {
webhookEndpoint: "test-endpoint"
}) {
message
webhookSecret
}
}
Gives us:
{
"data": {
"createWebhook": {
"message": "Webhook successfully created.",
"webhookSecret": "12940b96-0b1b-4d90-95c0-f797f9376965"
}
}
}
Common Errors
N/A