Skip to Content
Docs
Prices

Create a price

POST/prices

Headers

AuthorizationstringRequired
HTTP Basic auth: your API key as the password, with an empty username. See Authentication.
idempotency-keystring

A unique key, such as a UUID, that makes a POST safe to retry. Pay.com keeps each key for 24 hours, separately for each workspace. A retry with the same key, endpoint and body gets the first response. Another endpoint or body gets 400 idempotency_error, and a retry while the first is running gets 409.

Parameters

productstringRequired
currencystringRequired

Three-letter ISO currency code, in lowercase.

unit_amountintegerRequired
tax_behaviorstring

exclusive adds tax to the amount, and inclusive includes it.

One of exclusive or inclusive.

referencestring

Your ID for the price, unique for its product.

scheduleobject

Makes the price recurring.

Show 2 child parametersHide child parameters
intervalstringRequired

One of day, week, month or year.

interval_countinteger

Default: 1

subscription_optionsobject

Defaults for subscriptions on this price: the engine, and rules that override your subscription settings'.

Show 4 child parametersHide child parameters
enginestring
connectionstring
failed_paymentobject

What Pay.com's engine does when a renewal fails, replacing a package's retry settings. Engines that retry themselves ignore it: Pay.com never retries a charge another system retries.

Show 3 child parametersHide child parameters
retry_after_daysarray of integers

Days after the failed renewal for each retry, for example [3, 5, 7]. Pay.com also retries soon after a card is updated.

final_actionstring

What happens after the last retry fails.

One of cancel, pause or leave_unpaid.

grace_daysinteger

Days the customer keeps access while unpaid.

disputesobject

What happens to a subscription when one of its payments is disputed.

Show 1 child parameterHide child parameters
actionstring

One of cancel, pause or none.

activeboolean

Default: true

metadataobject

Your key-value pairs. Up to 50 keys of 40 characters, with string values of up to 500 characters.

Returns

The price, at version 1.

idstring
resourcestring
productstring
referencestring or null
typestring

recurring for a price with a schedule.

One of one_time or recurring.

scheduleobject or null
Show 2 child attributesHide child attributes
Option 1object

How often a recurring price bills.

Show 2 child attributesHide child attributes
intervalstringRequired

One of day, week, month or year.

interval_countinteger

Default: 1

Option 2null
subscription_optionsobject or null
Show 2 child attributesHide child attributes
enginestring
connectionstring or null
currencystring

Three-letter ISO currency code, in lowercase.

Show 8 more attributesShow fewer attributes
unit_amountinteger
tax_behaviorstring

exclusive adds tax to the amount, and inclusive includes it.

One of exclusive or inclusive.

versioninteger
current_versioninteger

The latest version. Differs from version when you ask for an earlier one.

activeboolean
metadataobject

Your key-value pairs. Up to 50 keys of 40 characters, with string values of up to 500 characters.

createdstring
test_modeboolean

Errors

400
The request is invalid.
401
The API key is missing or wrong.
403
The key's permissions don't allow this route.
404
No such object in this workspace and environment.
409
A request with this idempotency key is still running.
Was this page helpful?