Pular para o conteúdo principal
POST
/
api
/
webhooks-config
Configurar webhook
curl --request POST \
  --url https://sandbox.ntxpay.com/api/webhooks-config \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "url": "https://example.com/webhooks/mx",
  "events": [
    "cash_in",
    "cash_out"
  ],
  "secret": "whsec_abc123"
}
'
{
  "id": 42,
  "url": "https://example.com/webhooks/mx",
  "events": [
    "cash_in",
    "cash_out"
  ],
  "isActive": true,
  "secret": "whsec_abc123"
}

Autorizações

Authorization
string
header
obrigatório

JWT obtido em POST /api/auth/token

Corpo

application/json
url
string<uri>
obrigatório

URL HTTPS que receberá os webhooks

Exemplo:

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

events
enum<string>[]
obrigatório
Required array length: 1 - 5 elements
Opções disponíveis:
cash_in,
cash_out,
refund_in,
refund_out,
internal_transfer
Exemplo:
["cash_in", "cash_out"]
secret
string

Secret HMAC para assinatura. Se omitido, o NTX Pay gera automaticamente.

Required string length: 8 - 128
Exemplo:

"whsec_abc123"

Resposta

Webhook configurado

id
integer
Exemplo:

42

url
string
Exemplo:

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

events
string[]
Exemplo:
["cash_in", "cash_out"]
isActive
boolean
Exemplo:

true

secret
string

Secret gerado pelo NTX Pay — exibido apenas na criação. Guarde com segurança.

Exemplo:

"whsec_abc123"