Skip to main content
Create a Webhook Endpoint V2
Use este endpoint para registrar uma URL para a qual o SpherePay entrega eventos, junto com a lista de eventos que ela deve receber. Assine com nomes exatos de eventos do catálogo de eventos, ou com um curinga — * para tudo, ou um curinga de recurso como customer.*. Um endpoint novo fica enabled imediatamente e passa a receber os eventos correspondentes.
O secret de assinatura (com prefixo whsec_) é retornado exatamente uma vez, nesta resposta. Nenhum GET o retorna e ele não pode ser recuperado depois. Guarde-o com segurança — você precisa dele para verificar a assinatura em cada entrega.
Cada aplicação pode ter no máximo seis endpoints ativos, contando os estados enabled, disabled e errored. Exceder esse limite retorna 409. Não existe operação de atualização, portanto alterar uma URL ou uma assinatura significa criar um substituto e excluir o endpoint anterior — veja gerenciamento de endpoints para a sequência sem interrupções.

Autorizações

Authorization
string
header
obrigatório

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Corpo

application/json
apiVersion
string
obrigatório

API version date string provided by the client.

Exemplo:

"2026-04-01"

subscribedEvents
string[]
obrigatório

List of event types this endpoint should receive.

Minimum array length: 1
Exemplo:
url
string<uri>
obrigatório

The HTTPS URL to deliver webhook events to.

Maximum string length: 2048
Exemplo:

"https://example.com/webhooks/sphere"

description
string

Human-readable description of this webhook endpoint.

Maximum string length: 500
Exemplo:

"Production payment events handler"

metadata
object

Arbitrary key-value metadata to attach to this endpoint.

Exemplo:

Resposta

The created webhook endpoint, including the signing secret. The secret is returned only here and cannot be retrieved again.

apiVersion
string | null
obrigatório
createdAt
string
obrigatório
description
string | null
obrigatório
id
string
obrigatório
metadata
unknown
obrigatório
secret
string
obrigatório

Signing secret for this endpoint. Returned only on creation and never retrievable afterwards.

Exemplo:

"whsec_a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6"

status
enum<string>
obrigatório
Opções disponíveis:
enabled,
errored,
disabled,
deleted
subscribedEvents
enum<string>[]
obrigatório
Opções disponíveis:
*,
customer.*,
transfer.*,
document.*,
service.*,
customer.created,
customer.pending,
customer.approved,
customer.rejected,
transfer.created,
transfer.pendingFunding,
transfer.pendingReview,
transfer.fundsReceived,
transfer.processing,
transfer.succeeded,
transfer.returned,
transfer.pendingRefundInformation,
transfer.failed,
transfer.canceled,
transfer.refunded,
transfer.unexpectedError,
transfer.failedPrecondition,
transfer.expired,
transfer.unfunded,
document.pending,
document.processing,
document.verified,
document.rejected,
service.pending,
service.processing,
service.succeeded,
service.failed,
service.cancelled
updatedAt
string
obrigatório
url
string
obrigatório
Última modificação em 27 de agosto de 2026