openapi: 3.1.0
info:
  title: CashRelay API
  version: 0.1.0
  description: Verify ShamCash payments to merchant wallets and deliver signed webhooks.
servers:
  - url: http://127.0.0.1:3400
security:
  - bearerAuth: []
paths:
  /v1/invoices:
    post:
      summary: Create invoice
      tags: [Invoices]
      responses:
        '201':
          description: Created
  /v1/invoices/{id}:
    get:
      summary: Get invoice
      tags: [Invoices]
      parameters:
        - in: path
          name: id
          required: true
          schema: { type: string }
      responses:
        '200':
          description: OK
  /v1/link-sessions:
    post:
      summary: Create link session
      tags: [Accounts]
      responses:
        '201':
          description: Created
  /v1/accounts:
    get:
      summary: List linked accounts
      tags: [Accounts]
      responses:
        '200':
          description: OK
  /v1/webhook:
    put:
      summary: Set webhook URL
      tags: [Webhooks]
      responses:
        '200':
          description: OK
  /v1/api-keys:
    post:
      summary: Create API key
      tags: [Admin]
      responses:
        '201':
          description: Created
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: cr_test_ or cr_live_ API key