Register a webhook destination
POST /v1/webhook_destinations
Register a webhook destination
POST/v1/webhook_destinations
Autenticação
- Chave secretask_…, só no seu servidor
Envie a chave no cabeçalho Authorization: Bearer <chave>.
Corpo da requisição
urlstringobrigatórioeventsarray of stringobrigatórioValores:
checkoutsubscription_cyclesubscription
Resposta
200The same URL with the same events was already registered; nothing was written.
idstringpode ser nullobrigatório`null` for a destination managed by Paystation.
urlstringpode ser nullobrigatório`null` for a destination managed by Paystation.
originstringpode ser nullobrigatórioeventsarray of stringobrigatórioValores:
checkoutsubscription_cyclesubscriptionmanaged_bystringobrigatórioValores:
partnerpaystation
201OK
idstringpode ser nullobrigatório`null` for a destination managed by Paystation.
urlstringpode ser nullobrigatório`null` for a destination managed by Paystation.
originstringpode ser nullobrigatórioeventsarray of stringobrigatórioValores:
checkoutsubscription_cyclesubscriptionmanaged_bystringobrigatórioValores:
partnerpaystation
Erros
| 401 | Missing or invalid key, or a public key (`secret_key_required`). |
| 409 | The URL is registered with other events (`destination_exists`), managed by Paystation, or checkout is still configured by Paystation (`legacy_configuration_active`). |
| 422 | The body or URL is invalid, or the destination limit was reached. |
| 429 | Rate limited. |
| 500 | Unexpected error, or `api_unavailable`. |
| 503 | The URL could not be checked right now (`destination_check_unavailable`); retry after `Retry-After` seconds. |
Todo erro vem no mesmo envelope: error.type, error.code, error.message e error.request_id, também devolvido no cabeçalho X-Request-Id.