Skip to main content

Create Custom-price Link

Create a link that sells the product at amount. The response's checkout_url is the link to share.

max_purchases and expires_at are optional — the link stops selling at whichever limit is reached first. See Limits. The product does not need to be published, but the link only sells while it is.

Request​

POST /products/{productId}/custom-price-links

Path Parameters​

ParameterTypeRequiredDescription
productIdstringYesProduct UUID.

Request Body​

ParameterTypeRequiredDescription
amountintegerYesPrice in minor units (e.g. cents) of the product's currency. 0–999,999,999.
is_netbooleanNoWhether amount is net, with tax added at checkout. Defaults to false.
variant_idstringNoPin the link to a published one-time variant of this product that is currently on sale. Hidden variants are allowed. Omit or null to use the default one-time variant. See Variant.
max_purchasesintegerNoPurchase cap, 1–1,000,000. Omit or null for no cap.
expires_atstringNoWhen the link stops selling. RFC 3339 with an offset, in the future. Omit or null for no expiry.

amount, is_net, and variant_id cannot be changed later.

Example Request​

curl -X POST "https://cart.easy.tools/api/v1/products/0632bef5-c308-42cd-9cba-89a7a4f722bb/custom-price-links" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"amount": 1499,
"variant_id": "d91c65aa-b221-4aa4-b626-cf0d8a198749",
"max_purchases": 20,
"expires_at": "2026-12-31T23:59:00-05:00"
}'

Response​

Success Response (201)​

expires_at is the instant you sent, possibly with a different offset.

{
"id": "3f9c2b7e-8d41-4a6f-b2e5-7c1d9a0e4f63",
"product_id": "0632bef5-c308-42cd-9cba-89a7a4f722bb",
"variant_id": "d91c65aa-b221-4aa4-b626-cf0d8a198749",
"amount": 1499,
"currency": "usd",
"is_net": false,
"max_purchases": 20,
"purchases_count": 0,
"expires_at": "2027-01-01T05:59:00+01:00",
"archived_at": null,
"status": "active",
"checkout_url": "https://cart.easy.tools/checkout/mystore/premium-coffee?_sig=amount%2Cplan%2Cprice_link&amount=1499&plan=price_123&price_link=3f9c2b7e-8d41-4a6f-b2e5-7c1d9a0e4f63&signature=4b8f0c2e9d7a6153e1f04b9c8a2d7e6f5c3b1a0d9e8f7c6b5a4d3e2f1c0b9a8e",
"created_at": "2026-11-18T15:20:41+01:00"
}

See Custom-price Link Object.

Error Responses​

Bad Request (400)​

{
"message": "Invalid product ID"
}

Not Found Error (404)​

{
"message": "Product with ID 0632bef5-c308-42cd-9cba-89a7a4f722bb not found"
}

Validation Error (422 Unprocessable Entity)​

Returned when a field fails validation: amount is missing or out of range, max_purchases is out of range, or expires_at is not a date in the future. Field errors use { message, errors }. Messages on a field may be in Polish:

{
"message": "The given data was invalid.",
"errors": {
"expires_at": [
"Podaj przyszłą datę"
]
}
}

A variant_id that cannot be pinned — not a variant of this product, a recurring or archived variant, or one outside its sale window — returns a flat { message }:

{
"message": "`variant_id` \"e903c6d6-163e-4080-a99a-4ee5a1e4f17a\" must be a published one-time variant of this product"
}

A test-mode product — see Test-mode products:

{
"message": "Product \"0632bef5-c308-42cd-9cba-89a7a4f722bb\" is a test-mode product; custom-price links for test-mode products are managed in the dashboard"
}

Unauthorized Error (401)​

{
"message": "Unauthenticated."
}

Forbidden Error (403)​

{
"message": "You do not have API access to the requested store."
}