Skip to Content
Pymstr

Payments API

Create payment links, retrieve payment details, and cancel active payments.

For marketplace payment splitting, see Split Payments and the Marketplaces guide.

EndpointDescription
POST /v1/paymentsCreate a payment link
GET /v1/payments/:idRetrieve payment details
DELETE /v1/payments/:idCancel an active payment

Fee Model

Pymstr's fee is deducted from the amount. You receive amount − pymstrFee. The customer pays the network fee on top of amount, so it does not change what you receive.

pymstrFee=max⁡(amount×0.005, minFee)0.5%, at least minFeemerchantFee=amount−pymstrFeewhat you receive\begin{aligned} \texttt{pymstrFee} &= \max(\texttt{amount} \times 0.005,\ \texttt{minFee}) && \text{0.5\%, at least } \texttt{minFee} \\ \texttt{merchantFee} &= \texttt{amount} - \texttt{pymstrFee} && \text{what you receive} \end{aligned}

amount × 0.005 is rounded down to the currency's Decimals, and minFee, the currency's Min fee, applies when the result is lower (Currencies & Chains). The fee on a $49.99 payment is $0.24.

Example

A $250 payment in USDAmount
pymstrFee, to Pymstr$1.25
merchantFee, to your wallet$248.75

With sellers, the fee comes off every participant proportionally, see Split Payments.

Create PaymentPOST /v1/payments

Create a payment link for your customer. Share the paymentUrl in the response with your customer to complete the payment.

curl -X POST https://api.pymstr.com/v1/payments \
  -H "Authorization: Bearer pk_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": "250.00",
    "currency": "USD",
    "title": "Order #456",
    "externalId": "order-456",
    "acceptedChains": [
      42161,
      8453
    ],
    "acceptedTokens": [
      "USDC"
    ]
  }'

Request Body

Parameter

Type

Response201 Created

{
  "id": "01234567-89ab-cdef-0123-456789abcdef",
  "status": "ACTIVE",
  "amount": "250.00",
  "currency": "USD",
  "title": "Order #456",
  "externalId": "order-456",
  "acceptedChains": [
    42161,
    8453
  ],
  "acceptedTokens": [
    "USDC"
  ],
  "pymstrFee": "1.25",
  "merchantFee": "248.75",
  "sellers": null,
  "paymentUrl": "https://pay.pymstr.com/p/01234567-89ab-cdef-0123-456789abcdef",
  "expiresAt": "2026-03-01T00:00:00.000Z",
  "createdAt": "2026-02-24T10:00:00.000Z"
}

Parameter

Type

Error Responses

StatusCodeMeaning
400bad_requestThe request broke a rule in the field tables
400recipient_refusedA seller address cannot receive funds: Pymstr's fee wallet or a paymaster address, or an account that is suspended
401unauthorizedMissing or invalid API key
409conflictThe externalId is already in use by an ACTIVE, PROCESSING or SUCCESSFUL payment, and the body carries its id (see Lost Response)
429too_many_requestsRate limit exceeded

Get PaymentGET /v1/payments/:id

Retrieve payment details. Returns the full view when the request carries the owning merchant's own API key.

curl -X GET https://api.pymstr.com/v1/payments/01234567-89ab-cdef-0123-456789abcdef \
  -H "Authorization: Bearer pk_your_api_key"

Path Parameters

Parameter

Type

Response200 OK

{
  "id": "01234567-89ab-cdef-0123-456789abcdef",
  "status": "SUCCESSFUL",
  "amount": "250.00",
  "currency": "USD",
  "title": "Order #456",
  "externalId": "order-456",
  "acceptedChains": [
    42161,
    8453
  ],
  "acceptedTokens": [
    "USDC"
  ],
  "pymstrFee": "1.25",
  "merchantFee": "248.75",
  "sellers": null,
  "paymentUrl": "https://pay.pymstr.com/p/01234567-89ab-cdef-0123-456789abcdef",
  "chainId": 42161,
  "token": "USDC",
  "exchangeRate": "1.001500",
  "amountToken": "250.375000",
  "pymstrFeeToken": "1.251875",
  "merchantFeeToken": "249.123125",
  "gasActual": "0.001200",
  "txHash": "0x...",
  "buyer": {
    "smartAddress": "0x..."
  },
  "error": null,
  "expiresAt": "2026-03-01T00:00:00.000Z",
  "paidAt": "2026-02-24T10:05:00.000Z",
  "createdAt": "2026-02-24T10:00:00.000Z",
  "updatedAt": "2026-02-24T10:05:00.000Z"
}

Parameter

Type

Error Responses

StatusCodeMeaning
404not_foundNot found
429too_many_requestsRate limit exceeded

Cancel PaymentDELETE /v1/payments/:id

Cancel a payment with status ACTIVE. A payment in any other status answers 400 with record_not_active.

curl -X DELETE https://api.pymstr.com/v1/payments/01234567-89ab-cdef-0123-456789abcdef \
  -H "Authorization: Bearer pk_your_api_key"

Path Parameters

Parameter

Type

Response204 No Content

The response has no body.

Error Responses

StatusCodeMeaning
400record_not_activeThe payment is no longer ACTIVE
400bad_requestAn id that does not exist and an id on another account answer the same
401unauthorizedMissing or invalid API key
429too_many_requestsRate limit exceeded

Events & States

A payment moves through the statuses on Payment States and fires these webhook events:

EventDescription
payment.createdPayment link was created (dashboard only, see Webhooks)
payment.processingThe network accepted the customer's transaction
payment.completedPayment confirmed on-chain
payment.failedThe transaction reverted or was never confirmed
payment.expiredPayment expired before completion
payment.cancelledPayment was cancelled