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

# Create a payment request

> Returns a link your customer opens to pay you. Server-to-server only.

> [!NOTE]
>
> **Try it** creates a real link on your account. Cancel it in [Your requests](https://pesso.xyz/requests).


## OpenAPI

````yaml openapi.json POST /send
openapi: 3.1.0
info:
  title: Pesso API
  version: '1'
  description: >-
    Create Pesso payment requests from your server and get a signed
    `payment.succeeded` webhook when one is paid. Your customer pays your own
    address directly on-chain, in USDC on Base.


    The API is part of Pesso's Business plan ([see
    plans](https://pesso.xyz/plans)) and works wherever you are.


    The API is server-to-server only: call it from your backend with your API
    key, never from a browser.


    **Current limits, may change:**


    - 100 new requests per hour per account

    - 1 000 open links per account

    - `concept` up to 500 bytes

    - request body up to 8 192 characters

    - 10 API keys per account
servers:
  - url: https://api.pesso.xyz
security:
  - bearerAuth: []
paths:
  /send:
    post:
      summary: Create a payment request
      description: >-
        Creates a payment request and returns the link to send your customer to.
        Use `/send` with no trailing slash — `/send/` answers `308`.


        The request is paid to your own Pesso account; there is no field for a
        destination address.
      operationId: createPaymentRequest
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreatePaymentRequest'
            examples:
              fixed:
                summary: Fixed amount
                value:
                  amount: '25.00'
                  concept: 'Order #4418'
                  successUrl: https://shop.example.com/orders/4418/paid
                  cancelUrl: https://shop.example.com/cart
              minimum:
                summary: Minimum amount, payable more than once
                value:
                  minAmount: '5'
                  multiple: true
              json-concept:
                summary: JSON object concept
                value:
                  amount: '25.00'
                  concept:
                    Order: '#4418'
                    Items: 2 bags of coffee
                  expiresAt: '2027-09-30T23:59:59Z'
      responses:
        '201':
          description: The payment request was created. Send your customer to `url`.
          headers:
            Cache-Control:
              $ref: '#/components/headers/CacheControl'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentRequestCreated'
              example:
                id: 6a1f9d3c-27e4-4b8a-a0c5-93d81e2f4b76
                url: >-
                  https://pesso.xyz/send/?uid=6a1f9d3c-27e4-4b8a-a0c5-93d81e2f4b76
                expiresAt: null
        '400':
          description: >-
            The body was refused. `error` names the reason, for example an
            unknown field, both `amount` and `minAmount`, or a body that isn't
            JSON.
          headers:
            Cache-Control:
              $ref: '#/components/headers/CacheControl'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                unexpected-field:
                  summary: Unknown field
                  value:
                    error: unexpected field "address"
                both-amounts:
                  summary: Both amount and minAmount
                  value:
                    error: send either amount or minAmount, not both
                not-json:
                  summary: Body isn't JSON
                  value:
                    error: expected a JSON body
        '401':
          description: >-
            The API key is missing, malformed or unknown, or its account isn't
            on the Business plan. No body, and no detail about which.
          headers:
            Cache-Control:
              $ref: '#/components/headers/CacheControl'
        '413':
          description: The body is longer than 8 192 characters.
          headers:
            Cache-Control:
              $ref: '#/components/headers/CacheControl'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: body too large
        '429':
          description: >-
            Your account has created 100 requests in the last hour, or has 1 000
            open links. Wait `retryAfter` seconds (also in the `Retry-After`
            header) and try again.
          headers:
            Cache-Control:
              $ref: '#/components/headers/CacheControl'
            Retry-After:
              description: Seconds to wait before trying again.
              schema:
                type: integer
                minimum: 1
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimited'
              example:
                error: too many requests, try again later
                retryAfter: 3600
        '502':
          description: >-
            A temporary failure on Pesso's side, including looking up your API
            key. Nothing was created; try again later.
          headers:
            Cache-Control:
              $ref: '#/components/headers/CacheControl'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: could not create this request
components:
  schemas:
    CreatePaymentRequest:
      type: object
      additionalProperties: false
      description: >-
        Any field not listed here is refused with `400`, naming the field:
        `unexpected field "address"`.
      properties:
        amount:
          type: string
          pattern: ^\d+(\.\d{1,2})?$
          description: >-
            Exact amount the payer must pay, in USD, as a decimal string greater
            than 0 with at most 2 decimals. Send either `amount` or `minAmount`,
            not both. If you send neither, the request takes any amount of at
            least `"0.01"`.
          examples:
            - '25.00'
        minAmount:
          type: string
          pattern: ^\d+(\.\d{1,2})?$
          description: >-
            Smallest amount the payer may pay, in USD, as a decimal string
            greater than 0 with at most 2 decimals. Send either `amount` or
            `minAmount`, not both. Defaults to `"0.01"` when neither is sent.
          examples:
            - '5'
        multiple:
          type: boolean
          default: false
          description: >-
            `false`: the link can be paid once. `true`: it can be paid more than
            once.
        concept:
          oneOf:
            - type: string
              title: Text
            - type: object
              title: JSON object
          description: >-
            A message to the payer: a string, or a JSON object. Anything else
            (an array, a number) is refused with `400` (`concept must be a
            string or a JSON object`). A blank string means no concept.


            An object is stored as compact JSON. The limit is 500 bytes of
            UTF-8, measured after that compact serialisation (`400` `concept
            must be at most 500 bytes`).


            The payer sees it on the payment page, under the amount:


            - a string is shown as written, in quotation marks;

            - for an object, the **first key's value is the headline** (the key
            itself isn't shown) and the remaining keys follow as label/value
            rows, in the order you sent them;

            - a key is shown as a label: `order_id` and `orderId` both read
            "Order id";

            - a nested value gets one level of layout (a list joined with
            commas, a flat object as sub-rows); anything deeper is shown as
            compact JSON;

            - it is always rendered as text, never as HTML.


            Your verified email is shown above the amount. Pesso checks that
            email, not what the concept says.


            In the `payment.succeeded` webhook `data.concept` is always a
            string: an object comes back as its JSON string.
          examples:
            - Order: '#4418'
              Items: 2 bags of coffee
        successUrl:
          type: string
          format: uri
          maxLength: 2048
          description: >-
            Where the payer can return after paying, offered as a button on the
            paid screen (never an automatic redirect). Must be an `https` URL
            with no username or password, at most 2 048 characters.
          examples:
            - https://shop.example.com/orders/4418/paid
        cancelUrl:
          type: string
          format: uri
          maxLength: 2048
          description: >-
            Where the payer goes back to if they cancel. Must be an `https` URL
            with no username or password, at most 2 048 characters.
          examples:
            - https://shop.example.com/cart
        expiresAt:
          type: string
          format: date-time
          description: >-
            When the link stops accepting payments: an ISO 8601 date-time with a
            `Z` or `±hh:mm` offset, in the future and at most 365 days ahead.
            Leave it out for a link with no expiry.
          examples:
            - '2027-09-30T23:59:59Z'
    PaymentRequestCreated:
      type: object
      required:
        - id
        - url
        - expiresAt
      properties:
        id:
          type: string
          format: uuid
          description: >-
            The request's id. It comes back as `data.requestId` in the
            `payment.succeeded` webhook — store it against your order.
        url:
          type: string
          format: uri
          description: >-
            The link to send your customer to: `https://pesso.xyz/send/?uid=`
            followed by `id`.
        expiresAt:
          type:
            - string
            - 'null'
          format: date-time
          description: When the link stops accepting payments, or `null` for no expiry.
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          description: Why the request was refused.
    RateLimited:
      type: object
      required:
        - error
        - retryAfter
      properties:
        error:
          type: string
          const: too many requests, try again later
        retryAfter:
          type: integer
          minimum: 1
          description: >-
            Seconds to wait before trying again; the same as the `Retry-After`
            header.
  headers:
    CacheControl:
      description: Always `no-store`.
      schema:
        type: string
        const: no-store
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: psk_…
      description: >-
        `Authorization: Bearer psk_…` — `psk_` followed by 43 base64url
        characters (`A–Z`, `a–z`, `0–9`, `-`, `_`). Create keys in Your requests
        → API keys on pesso.xyz; each key is shown once.

````

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