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

# Create an order

> The payer picked a coin: locks a quote and issues the order's deposit address. Public: no API key needed. Call it from your server.

The payer picked a coin: this locks the quote and returns the deposit address and exact amount. Call it from your server.


## OpenAPI

````yaml POST /payments/links/{linkId}/orders
openapi: 3.1.0
info:
  title: Paywire API
  version: 1.0.0
  description: >-
    Accept crypto payments: create payment links, follow orders, receive signed
    webhooks.
servers:
  - url: https://api.staging.paywire.xyz
    description: Staging (testnets)
security:
  - apiKey: []
tags:
  - name: Payment links
  - name: Orders
  - name: Account
  - name: Webhooks
paths:
  /payments/links/{linkId}/orders:
    post:
      tags:
        - Orders
      summary: Create an order
      description: >-
        The payer picked a coin: locks a quote and issues the order's deposit
        address. Public: no API key needed. Call it from your server.
      operationId: createOrder
      parameters:
        - name: linkId
          in: path
          required: true
          schema:
            type: string
            format: uuid
          description: The payment link's id.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateOrderRequest'
            example:
              network: solana_devnet
              token: native
              refundAddress: 4Nd1mBQtrMJVYVfKf2PJy9NZUZdTAsp7D4xWLs4gDB4T
      responses:
        '201':
          description: The order.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Order'
              example:
                id: 0193a0c5-0a1b-7c2d-8e3f-4a5b6c7d8e9f
                paymentLinkId: 0193a0c4-5f2e-7c1d-9b8a-3e4f5a6b7c8d
                status: AwaitingPayment
                network: solana_devnet
                token: native
                decimals: 9
                depositAddress: 8xKq3nV5pQ2rL7mT9wY4bF6hJ1dS3aZ8cX5vN2eR7uK
                refundAddress: null
                expectedAmount: '301204819'
                expectedAmountDisplay: 0.301204819
                confirmedAmount: '0'
                receivedAmount: '0'
                remainingAmount: '301204819'
                remainingAmountDisplay: 0.301204819
                fiatAmount: 49.9
                fiatCurrency: USD
                rate: 165.67
                createdAt: '2026-10-24T09:13:05.118Z'
                expiresAt: '2026-10-24T09:33:05.118Z'
                resolvedAt: null
                deposits: []
        '400':
          description: Invalid request.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
              example:
                title: PaymentLink.AssetNotAllowed
                status: 400
                detail: This asset is not on the link's allowlist.
        '404':
          description: No such link.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
              example:
                title: PaymentLink.NotFound
                status: 404
                detail: No payment link with this id.
        '409':
          description: The link is inactive.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
              example:
                title: PaymentLink.Inactive
                status: 409
                detail: This payment link is no longer active.
        '503':
          description: Temporarily unavailable; retry.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
              example:
                title: Order.PriceUnavailable
                status: 503
                detail: >-
                  No trustworthy price is available right now; try again
                  shortly.
      security: []
components:
  schemas:
    CreateOrderRequest:
      type: object
      required:
        - network
        - token
      properties:
        network:
          type: string
          example: solana_devnet
        token:
          type: string
          example: native
        refundAddress:
          type:
            - string
            - 'null'
          description: >-
            Where over- and underpayments are sent back. Must be valid on
            `network`.
    Order:
      type: object
      properties:
        id:
          type: string
          format: uuid
        paymentLinkId:
          type: string
          format: uuid
        status:
          type: string
          enum:
            - AwaitingPayment
            - Confirming
            - Settled
            - Overpaid
            - Expired
            - ExpiredUnderpaid
            - ManualReview
            - Refunded
        network:
          type: string
        token:
          type: string
        decimals:
          type: integer
        depositAddress:
          type: string
        refundAddress:
          type:
            - string
            - 'null'
        expectedAmount:
          type: string
          description: Base units the payer must send.
        expectedAmountDisplay:
          type: number
          description: The same, in whole coins.
        confirmedAmount:
          type: string
        receivedAmount:
          type: string
        remainingAmount:
          type: string
        remainingAmountDisplay:
          type: number
        fiatAmount:
          type: number
        fiatCurrency:
          type: string
        rate:
          type: number
          description: Fiat per coin used for the quote.
        createdAt:
          type: string
          format: date-time
        expiresAt:
          type: string
          format: date-time
        resolvedAt:
          type:
            - string
            - 'null'
          format: date-time
        deposits:
          type: array
          items:
            $ref: '#/components/schemas/Deposit'
    Problem:
      type: object
      description: RFC 7807 problem details. `title` is a stable error code.
      properties:
        type:
          type: string
        title:
          type: string
          example: PaymentLink.NotFound
        status:
          type: integer
        detail:
          type: string
    Deposit:
      type: object
      properties:
        id:
          type: string
          format: uuid
        txHash:
          type: string
        amount:
          type: string
          description: Base units.
        token:
          type: string
        status:
          type: string
          example: Confirmed
        isLate:
          type: boolean
        isUnexpectedAsset:
          type: boolean
        resolution:
          type: string
        observedAt:
          type: string
          format: date-time
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      description: Your gateway's API key (`w3g_...`).

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.