> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lerian.studio/llms.txt
> Use this file to discover all available pages before exploring further.

# Receive provider webhook

> Receives and persists a webhook event from the payment provider. Uses the provider's own Bearer token for authentication.



## OpenAPI

````yaml en/openapi/v3-current/payments.yaml post /v1/webhooks/btg
openapi: 3.0.3
info:
  title: Payments — via BTG API
  description: >-
    API for the Lerian Payments interface via BTG. It covers boleto issuance,
    cancellation, installments, and queries; bill payments (bankslip, utilities,
    and DARF), cancellation, and queries; aggregated boleto and payment
    dashboards; provider connection and outbound webhook configuration; and the
    provider webhook receiver for settlement events.
  version: v1.0.0
servers:
  - url: https://payments.sandbox.lerian.net
security: []
tags:
  - name: Health
    description: Service health and readiness endpoints
  - name: Boletos
    description: Boleto issuance, cancellation, installments, and queries
  - name: Payments
    description: Bill payments (bankslip, utilities, DARF), cancellation, and queries
  - name: Dashboards
    description: Aggregated metrics and dashboards for boletos and payments
  - name: Admin
    description: Administrative endpoints for webhook configuration
  - name: Webhooks
    description: Provider webhook receiver for settlement events
paths:
  /v1/webhooks/btg:
    post:
      tags:
        - Webhooks
      summary: Receive provider webhook
      description: >-
        Receives and persists a webhook event from the payment provider. Uses
        the provider's own Bearer token for authentication.
      parameters:
        - description: Provider Bearer token
          in: header
          name: Authorization
          required: true
          schema:
            type: string
        - description: Correlation ID for tracing
          in: header
          name: X-Correlation-Id
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/http.webhookPayload'
        description: Webhook event payload
        required: true
      responses:
        '202':
          description: Accepted
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/http.webhookErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/http.webhookErrorResponse'
        '413':
          description: Request Entity Too Large
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/http.webhookErrorResponse'
        '415':
          description: Unsupported Media Type
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/http.webhookErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/http.webhookErrorResponse'
components:
  schemas:
    http.webhookPayload:
      properties:
        event:
          type: string
        webhookId:
          type: string
      type: object
    http.webhookErrorResponse:
      properties:
        error:
          example: Unauthorized
          type: string
      type: object

````