Skip to content

Price a cart

POST
/checkout/quotes
curl --request POST \
--url https://apisandbox.puurk.com/checkout/quotes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "oid": "example", "items": [ { "service_id": "example", "quantity": 1 } ], "candidates": [ "example" ] }'

Prices a cart of catalog services and returns its payment plans, the lowest monthly payment, the pay-in-full total, and, for each candidate service, what the cart would cost with one more of it. Nothing is saved. Callable with a service token or, from a browser, with a publishable client. A publishable client is an API client issued with POST /auth/clients whose scope is {resource: 'checkout', oid: <org>, actions: ['read', 'write'], public: true} and whose allowed_origins list is non-empty. Pass its id as client_id (or the X-Puurk-Client-Id header) instead of a bearer token. No secret is used, so the request must come from a browser Origin in allowed_origins and target the one organization the scope names.

client_id
string

Publishable client id, for browser calls with no bearer token. Omit when calling with a service token.

Cart to price

Media typeapplication/json
object
oid
required

Organization ID

string
items
required

Cart lines. May be empty, to price candidates on their own.

Array<object>
<= 20 items
object
service_id
required

Catalog service ID

string
quantity

Units of the service. Repeated service ids are merged.

integer
default: 1 >= 1 <= 10
candidates

Service ids to price as “one more of this” increments on the cart

Array<string>
<= 50 items

Successful operation

Media typeapplication/json
object
oid
string
amount

Cart total in cents

integer
down_payment

Cart down payment in cents

integer
max_term

Plan length cap in months from the services’ term caps, when the organization uses them

integer
nullable
lines
Array<object>
object
service_id
string
name
string
quantity
integer
unit_price

Price per unit in cents

integer
amount

Unit_price x quantity, in cents

integer
down_payment

Down payment for the line in cents

integer
as_low_as
object
monthly_payment

Lowest monthly payment in cents

integer
term_length

Plan length in months for that payment

integer
plans

Payment plans for the cart, in the same shape as a session’s plans

Array<object>
object
offer_id

Offer these terms belong to

string
uid

User the terms were generated for

string
down_payment

Down payment in cents

number
financed_amount

Amount financed in cents

number
provider_premium_share

Provider’s share of the premium as a fraction between 0 and 1

number
nullable
term_length

Plan length in months

number
monthly_premium

Premium charged per month in cents

number
monthly_provider_premium

Provider share of the monthly premium in cents

number
nullable
monthly_puurk_premium

Puurk share of the monthly premium in cents

number
nullable
monthly_principal

Principal per month in cents

number
monthly_fees

Fees included in each monthly payment in cents

number
nullable
monthly_payout_fees

Payout fees per month in cents

number
nullable
monthly_provider_fees

Provider fees per month in cents

number
nullable
monthly_payment

Monthly payment in cents

number
monthly_opportunity

Monthly opportunity for the provider in cents

number
nullable
total_amount

Total paid over the plan in cents

number
total_premium

Total premium over the plan in cents

number
total_provider_premium

Provider share of the total premium in cents

number
nullable
total_puurk_premium

Puurk share of the total premium in cents

number
nullable
total_principal

Total principal (down payment plus financed amount) in cents

number
total_fees

Total fees over the plan in cents

number
nullable
total_payout_fees

Total payout fees over the plan in cents

number
nullable
total_provider_fees

Total provider fees over the plan in cents

number
nullable
total_opportunity

Total opportunity for the provider in cents

number
nullable
pay_in_full
object
amount

Amount in cents

integer
fee_amount

Fee in cents

integer
total_amount

Amount plus fee in cents

integer
increments

Keyed by candidate service id

object
key
additional properties
object
amount

Cart amount in cents with one more unit of the service

integer
down_payment

Cart down payment in cents with one more unit of the service

integer
as_low_as
object
monthly_payment

Lowest monthly payment in cents

integer
term_length

Plan length in months for that payment

integer
delta

Change in the lowest monthly payment versus the current cart, in cents. May be zero or negative when the larger cart qualifies for a longer plan.

integer
nullable
pay_in_full
object
amount

Amount in cents

integer
fee_amount

Fee in cents

integer
total_amount

Amount plus fee in cents

integer
Examplegenerated
{
"oid": "example",
"amount": 1,
"down_payment": 1,
"max_term": 1,
"lines": [
{
"service_id": "example",
"name": "example",
"quantity": 1,
"unit_price": 1,
"amount": 1,
"down_payment": 1
}
],
"as_low_as": {
"monthly_payment": 1,
"term_length": 1
},
"plans": [
{
"offer_id": "example",
"uid": "example",
"down_payment": 1,
"financed_amount": 1,
"provider_premium_share": 1,
"term_length": 1,
"monthly_premium": 1,
"monthly_provider_premium": 1,
"monthly_puurk_premium": 1,
"monthly_principal": 1,
"monthly_fees": 1,
"monthly_payout_fees": 1,
"monthly_provider_fees": 1,
"monthly_payment": 1,
"monthly_opportunity": 1,
"total_amount": 1,
"total_premium": 1,
"total_provider_premium": 1,
"total_puurk_premium": 1,
"total_principal": 1,
"total_fees": 1,
"total_payout_fees": 1,
"total_provider_fees": 1,
"total_opportunity": 1
}
],
"pay_in_full": {
"amount": 1,
"fee_amount": 1,
"total_amount": 1
},
"increments": {
"additionalProperty": {
"amount": 1,
"down_payment": 1,
"as_low_as": {
"monthly_payment": 1,
"term_length": 1
},
"delta": 1,
"pay_in_full": {
"amount": 1,
"fee_amount": 1,
"total_amount": 1
}
}
}
}

Invalid input (missing oid, more than 20 lines, a quantity outside 1 to 10, or more than 50 candidates)

Unauthorized (no token, or an unknown client id)

Forbidden (origin not allowed, client inactive, or no checkout scope on the organization)

A service is not available for online checkout, or no payment plans can be generated for the cart

Internal server error