PaystationdocsPaystation

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ório
  • eventsarray of stringobrigatório

    Valores: 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ório
  • eventsarray of stringobrigatório

    Valores: checkoutsubscription_cyclesubscription

  • managed_bystringobrigatório

    Valores: 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ório
  • eventsarray of stringobrigatório

    Valores: checkoutsubscription_cyclesubscription

  • managed_bystringobrigatório

    Valores: partnerpaystation

Erros

401Missing or invalid key, or a public key (`secret_key_required`).
409The URL is registered with other events (`destination_exists`), managed by Paystation, or checkout is still configured by Paystation (`legacy_configuration_active`).
422The body or URL is invalid, or the destination limit was reached.
429Rate limited.
500Unexpected error, or `api_unavailable`.
503The 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.