Skip to main content
POST
Create a payment link
Authenticate with an API key that belongs to the product’s organization and has Full access or the products:payment_links:write permission (Payment links under Can create and change in the dashboard). Only the Owner and Admin roles can grant it.
  • id is the ID of a product in your organization, whether it was created through the API or in the dashboard. A product from another organization, or one that doesn’t exist, returns 404.
  • Each call creates a new price for the product and its payment link, so one product can have several prices.
  • Send a unique Idempotency-Key header (required; 1–255 ASCII characters from 0x21 to 0x7E, no spaces), the same rule as checkout sessions. The same key with the same body returns the link created the first time (201) and creates nothing new. The same key with a different body, or for another product, returns 409. If the link created with that key was later removed, a retry also returns 409; send a new key.
  • pricingType is ONE_TIME or SUBSCRIPTION. pricing is a string in major units, such as "9.99". Omit pricing for a flexible “pay what you want” amount; this works for ONE_TIME only, and minAmount and maxAmount are then optional.
  • A SUBSCRIPTION price needs billingInterval (DAY, MONTH or YEAR). billingIntervalCount is optional and defaults to 1.
  • successUrl is an absolute HTTPS URL to send the customer to after they pay. If you leave it out, the customer sees the Anyway receipt.
  • Payments are collected on Anyway’s platform account. Links created through the API are card payment links only; crypto payment links are not available.
  • Unknown fields are rejected with 400.
  • Share the returned paymentLinkUrl as provided. The response has the same shape as an item from Get product payment links.
Checkout sessions can’t sell a flexible amount. To let the customer choose what to pay, create a flexible one-time payment link here instead.

Authorizations

X-API-Key
string
header
required

Merchant API key (format: ak_BASE64)

Headers

Idempotency-Key
string
required

Unique creation request key: 1-255 ASCII characters in the range 0x21-0x7E (no spaces or control characters)

Required string length: 1 - 255

Path Parameters

id
string
required

Product ID

Body

application/json

Price and payment link

pricingType
enum<string>
required
Available options:
SUBSCRIPTION,
ONE_TIME
currency
string
required

Currency code, for example USD

pricing
string

Fixed amount in major units, for example "9.99". Omit for a flexible (pay what you want) amount, which is ONE_TIME only.

minAmount
number

Optional minimum for a flexible amount (ONE_TIME only)

maxAmount
number

Optional maximum for a flexible amount (ONE_TIME only)

billingInterval
enum<string>
Available options:
DAY,
MONTH,
YEAR
billingIntervalCount
integer

Number of intervals between charges (SUBSCRIPTION). Defaults to 1.

pricingName
string

Name of the price

successUrl
string

Absolute HTTPS URL to send the customer to after paying. Defaults to the Anyway receipt.

Response

Created

data
object
error
object
message
string
success
boolean