# Link created

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: ''
  description: ''
  version: 1.0.0
paths: {}
webhooks:
  payment_link.created:
    post:
      summary: Link created
      deprecated: false
      description: Sent when an external link is created and webhookUrl is set.
      tags:
        - Webhooks
        - Webhooks
      parameters:
        - name: User-Agent
          in: header
          description: Delivery user agent. Always sent as `SXPay-Webhook/1.0`.
          required: true
          example: SXPay-Webhook/1.0
          schema:
            type: string
        - name: x-sxpay-signature
          in: header
          description: >
            HMAC-SHA256 hex digest of "{timestamp}.{rawBody}" using the payment
            link webhookSecret. Sent only when a webhookSecret is configured.
          required: false
          example: ''
          schema:
            type: string
        - name: x-sxpay-timestamp
          in: header
          description: >-
            Unix epoch timestamp in milliseconds used with signature
            verification.
          required: false
          example: ''
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebhookPaymentLinkCreatedEvent'
            example:
              id: 5e3d2c6a-1d40-4a54-9e1c-1a2b3c4d5e6f
              type: payment_link.created
              createdAt: '2024-12-05T18:31:00.000Z'
              data:
                id: 01KDKKYMM61YP04ZE9M6YM95TG
                title: Payment Title
                description: Payment Description
                externalReference: 4ebd0208-8328-5d69-8c44-ec50939c0967
                status: ACTIVE
                isMultiUse: false
                expiresAt: '2025-01-31T23:59:59.000Z'
                amount: 129.9
                currency: USD
                url: >-
                  https://app.sxdigitalpay.com/quote/[merchantShortName]/[paymentLinkId]
                shortUrl: https://sxpay.me/[paymentLinkShortId]
                metadata: null
                createdAt: '2024-12-05T18:31:00.000Z'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties: {}
                x-apidog-orders: []
                x-apidog-ignore-properties: []
          headers: {}
          x-apidog-name: Success
      security:
        - ApiKeyAuth: []
          x-apidog:
            schemeGroups:
              - id: aSabarTaLKMkoazJDLTtw
                schemeIds:
                  - ApiKeyAuth
            required: true
            use:
              id: aSabarTaLKMkoazJDLTtw
            scopes:
              aSabarTaLKMkoazJDLTtw:
                ApiKeyAuth: []
      x-apidog-folder: Webhooks
      x-apidog-status: released
      x-run-in-apidog: https://app.apidog.com/web/project/1147027/apis/api-25254366-run
components:
  schemas:
    WebhookPaymentLinkCreatedEvent:
      type: object
      properties:
        id:
          type: string
          format: uuid
        type:
          type: string
          enum:
            - payment_link.created
        createdAt:
          type: string
          format: date-time
        data:
          $ref: '#/components/schemas/WebhookLinkPayloadBase'
      required:
        - id
        - type
        - createdAt
        - data
      x-apidog-orders:
        - id
        - type
        - createdAt
        - data
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
    WebhookLinkPayloadBase:
      type: object
      properties:
        id:
          type: string
        title:
          type: string
        description:
          type:
            - string
            - 'null'
        externalReference:
          type:
            - string
            - 'null'
        status:
          $ref: '#/components/schemas/PaymentLinkStatus'
        isMultiUse:
          type: boolean
          description: Always false for this API.
        expiresAt:
          type:
            - string
            - 'null'
          format: date-time
        amount:
          type: number
        currency:
          type: string
        url:
          type: string
          format: uri
        shortUrl:
          type: string
          format: uri
        metadata:
          type:
            - object
            - 'null'
          additionalProperties: true
          properties: {}
          x-apidog-orders: []
          x-apidog-ignore-properties: []
        createdAt:
          type: string
          format: date-time
      required:
        - id
        - title
        - status
        - isMultiUse
        - amount
        - currency
        - url
        - shortUrl
      x-apidog-orders:
        - id
        - title
        - description
        - externalReference
        - status
        - isMultiUse
        - expiresAt
        - amount
        - currency
        - url
        - shortUrl
        - metadata
        - createdAt
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
    PaymentLinkStatus:
      type: string
      enum:
        - ACTIVE
        - INACTIVE
        - EXPIRED
      x-apidog-folder: ''
  securitySchemes:
    ApiKeyAuth:
      type: apikey
      in: header
      name: x-api-key
      description: >-
        API key provisioned per merchant. Authorization: Bearer <api-key> is
        also accepted.
    WebhookSignature:
      type: apikey
      in: header
      name: x-sxpay-signature
      description: >
        HMAC-SHA256 signature calculated over "{timestamp}.{rawBody}" using the
        link's webhookSecret. Includes header x-sxpay-timestamp (epoch ms) for
        replay protection. These headers are only sent when a webhookSecret is
        configured for the link.
servers:
  - url: https://sandbox.sxdigitalpay.com/api/v1
    description: Sandbox
  - url: https://app.sxdigitalpay.com/api/v1
    description: Prod
security:
  - ApiKeyAuth: []
    x-apidog:
      schemeGroups:
        - id: aSabarTaLKMkoazJDLTtw
          schemeIds:
            - ApiKeyAuth
      required: true
      use:
        id: aSabarTaLKMkoazJDLTtw
      scopes:
        aSabarTaLKMkoazJDLTtw:
          ApiKeyAuth: []

```
