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

# Set the webhook URL

> Registers the default delivery target and returns a new signing secret. The secret is shown exactly once and is never retrievable afterwards.



## OpenAPI

````yaml /openapi.json put /v1/webhooks/config
openapi: 3.0.0
info:
  title: Spendin Merchant API
  description: Cross-border remittance and financial services API
  version: '1.0'
  contact: {}
servers:
  - url: https://api.spendin.app
    description: Production
security:
  - api-key: []
tags: []
paths:
  /v1/webhooks/config:
    put:
      tags:
        - webhooks
      summary: Set the webhook URL
      description: >-
        Registers the default delivery target and returns a new signing secret.
        The secret is shown exactly once and is never retrievable afterwards.
      operationId: WebhooksController_setWebhook
      parameters:
        - name: Idempotency-Key
          in: header
          required: true
          description: >-
            Unique idempotency token per logical write (UUID v4). Re-send the
            same value on safe retries.
          schema:
            type: string
            format: uuid
            example: a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SetWebhookDto'
      responses:
        '200':
          description: Webhook configured — secret revealed once
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebhookSecretRevealDto'
        '400':
          description: Invalid webhook URL (must be HTTPS)
      security:
        - api-key: []
components:
  schemas:
    SetWebhookDto:
      type: object
      properties:
        webhook_url:
          type: string
          example: https://merchant.example.com/webhooks/spendin
          description: >-
            HTTPS URL that receives webhook events (http allowed only for
            localhost).
      required:
        - webhook_url
    WebhookSecretRevealDto:
      type: object
      properties:
        webhook_url:
          type: object
          nullable: true
        signing_secret:
          type: string
          example: whsec_a1b2c3...
          description: Shown once — store it securely.
        warning:
          type: string
          example: Store this secret securely. It will not be shown again.
      required:
        - webhook_url
        - signing_secret
        - warning
  securitySchemes:
    api-key:
      type: apiKey
      in: header
      name: X-API-Key

````