openapi: 3.0.3
info:
  title: SablePay API
  version: 1.0.0
  description: |
    SablePay REST API for creating and managing stablecoin payments.
servers:
  - url: https://api.sablepay.io/api/v1
    description: Production
  - url: https://sandbox-api.sablepay.io/api/v1
    description: Sandbox
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
    MerchantId:
      type: apiKey
      in: header
      name: X-Merchant-ID
security:
  - ApiKeyAuth: []
    MerchantId: []
paths:
  /payments/create:
    post:
      summary: Create Payment
      description: Create a new payment intent and receive a hosted payment link.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - amount
              properties:
                amount:
                  type: number
                  format: float
                  example: 10.0
                currency:
                  type: string
                  example: USD
                metadata:
                  type: object
                  additionalProperties: true
      responses:
        '200':
          description: Payment created
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                  status:
                    type: string
                  amount:
                    type: number
                  linkToken:
                    type: string
        '400':
          description: Bad request
        '401':
          description: Unauthorized
  /payments:
    get:
      summary: List Payments
      description: List recent payments for the merchant.
      parameters:
        - in: query
          name: limit
          schema:
            type: integer
            default: 10
        - in: query
          name: status
          schema:
            type: string
      responses:
        '200':
          description: Payments list
          content:
            application/json:
              schema:
                type: object
                properties:
                  items:
                    type: array
                    items:
                      type: object
  /payments/{id}:
    get:
      summary: Get Payment Status
      description: Get payment status by ID.
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Payment status
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                  status:
                    type: string
                  amount:
                    type: number
        '404':
          description: Not found
