Pular para o conteúdo

Create a webhook

Registers a webhook URL and subscription type for a sub-tenant so Lina Pay can notify your systems on state changes.

POST/api/v1/webhooks

Create a sub-tenant webhook

Creates a webhook configuration for the given sub-tenant and notification category.

Auth: Bearer Token

Corpo da requisição

3 campos
webhookUrl
bodystring

HTTPS endpoint that will receive webhook POST callbacks.

subTenantId
bodystring

Business identifier of the sub-tenant.

type
bodystring

Notification category to subscribe to.

curl --request POST \
  --url 'https://embedded-payment-manager.hml.linaob.com.br/api/v1/webhooks' \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer <SEU_TOKEN>' \
  --data '{
  "webhookUrl": "https://api.example.com/lina/webhook",
  "subTenantId": "subTenant123",
  "type": "PAYMENT"
}'

Response

200Webhook created successfully.
Response body
object
  • dataobjectrequired

    Created webhook record.

    • idstringrequired

      Webhook id.

    • subTenantstringrequired

      Sub-tenant identifier.

    • webhookUrlstringrequired

      Configured callback URL.

    • typestringrequired

      Notification category.

  • messagestring

    Response message.

  • typestring

    Envelope type: `error`, `warning`, `info`, or `success`.

  • statusCodenumber· nullable

    HTTP status carried in the envelope.

200 · Webhook created successfully.
{
  "data": {
    "id": "webhook123",
    "subTenant": "subTenant123",
    "webhookUrl": "https://api.example.com/lina/webhook",
    "type": "PAYMENT"
  },
  "message": "",
  "type": "success",
  "statusCode": 200
}

Next steps