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

# Create a new payment link (Partner or Merchant authentication)

> Create a new payment link (Partner or Merchant authentication)



## OpenAPI

````yaml /api-reference/openapi.json post /api/v1/payment-links
openapi: 3.1.0
info:
  title: Quidkey API
  version: 1.0.0
  description: API documentation for Quidkey Core Services
servers:
  - url: https://core.quidkey.com
    description: Production
security: []
paths:
  /api/v1/payment-links:
    post:
      tags:
        - Payment Links
      summary: Create a new payment link (Partner or Merchant authentication)
      description: Create a new payment link (Partner or Merchant authentication)
      requestBody:
        required: true
        description: Request body
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/paymentLink_CreateInput'
            example:
              order:
                amount: 1000
                currency: GBP
                payment_reference: 'Invoice #123'
                order_id: ORD-123456
                locale: en
                test_transaction: true
              redirect_urls:
                success_url: https://example.com/payment/success
                failure_url: https://example.com/payment/failure
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/paymentLink_CreateResponse'
              example:
                success: true
                data:
                  payment_link_url: https://core.quidkey.com/payment-link/a1b2c3d4e5f6...
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/shared_Error400'
              example:
                success: false
                error:
                  message: Invalid input provided
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/shared_Error401'
              example:
                success: false
                error:
                  message: Invalid input provided
      security:
        - bearerAuth: []
components:
  schemas:
    paymentLink_CreateInput:
      additionalProperties: false
      type: object
      required:
        - order
      properties:
        merchant_id:
          format: uuid
          description: >-
            Required for Partner authentication, forbidden for Merchant
            authentication
          type: string
        order:
          additionalProperties: false
          type: object
          required:
            - amount
            - currency
            - payment_reference
          properties:
            amount:
              minimum: 1
              examples:
                - 1000
              description: Amount in minor units (e.g., cents)
              type: integer
            currency:
              pattern: ^[A-Za-z]{3}$
              minLength: 3
              maxLength: 3
              description: ISO 4217 currency code
              examples:
                - GBP
                - USD
                - EUR
                - JPY
              type: string
            payment_reference:
              maxLength: 18
              examples:
                - 'Invoice #123'
              description: Up to 18 chars, appears on customer bank statement
              type: string
            order_id:
              examples:
                - ORD-123456
              description: Merchant's order identifier
              type: string
            locale:
              default: en
              examples:
                - en
                - pt
                - es
              description: BCP-47 locale tag
              type: string
            test_transaction:
              examples:
                - true
              description: Flag to force sandbox mode
              type: boolean
        metadata:
          description: Optional metadata to attach to the payment link
          type: object
          patternProperties:
            ^(.*)$: {}
        redirect_urls:
          additionalProperties: false
          type: object
          required:
            - success_url
            - failure_url
          properties:
            success_url:
              format: uri
              maxLength: 2048
              description: >-
                URL to redirect customer to after successful payment (HTTPS
                required in production)
              examples:
                - https://example.com/payment/success
              type: string
            failure_url:
              format: uri
              maxLength: 2048
              description: >-
                URL to redirect customer to after failed payment (HTTPS required
                in production)
              examples:
                - https://example.com/payment/failure
              type: string
    paymentLink_CreateResponse:
      type: object
      required:
        - success
        - data
      properties:
        success:
          description: Indicates if the request was successful
          examples:
            - true
          type: boolean
        data:
          type: object
          required:
            - link_id
            - payment_link_url
            - expires_at
            - status
          properties:
            link_id:
              format: uuid
              description: Internal payment link identifier (for reference only)
              type: string
            payment_link_url:
              format: uri
              description: >-
                Full URL to share with customer. Contains a secure 64-char hex
                token (not the link_id). Token is only returned once.
              examples:
                - https://core.quidkey.com/payment-link/a1b2c3d4e5f6...
              type: string
            expires_at:
              format: date-time
              description: ISO 8601 timestamp when link expires
              type: string
            status:
              enum:
                - active
              description: Payment link status
              type: string
    shared_Error400:
      title: Bad Request Error
      description: 400 Bad Request Error Response
      type: object
      required:
        - success
        - error
      properties:
        success:
          description: Always false for error responses
          examples:
            - false
          const: false
          type: boolean
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              allOf:
                - description: Error code for the specific error type
                  examples:
                    - INVALID_INPUT
                  type: string
                - description: Error code for the specific error type
                  examples:
                    - VALIDATION_ERROR
                  type: string
            message:
              description: Human-readable error message
              examples:
                - Invalid input provided
              type: string
            metadata:
              additionalProperties: true
              description: >-
                Additional error context. For VALIDATION_ERROR, includes a
                per-field `errors` array.
              type: object
              properties:
                errors:
                  type: array
                  items:
                    type: object
                    required:
                      - field
                      - message
                    properties:
                      field:
                        type: string
                      message:
                        type: string
    shared_Error401:
      title: Unauthorized Error
      description: 401 Unauthorized Error Response
      type: object
      required:
        - success
        - error
      properties:
        success:
          description: Always false for error responses
          examples:
            - false
          const: false
          type: boolean
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              allOf:
                - description: Error code for the specific error type
                  examples:
                    - INVALID_INPUT
                  type: string
                - const: UNAUTHORIZED
                  type: string
            message:
              description: Human-readable error message
              examples:
                - Invalid input provided
              type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````