Checkout

Buy a basket by card, with or without an account

Auth optional. Without a key: email is required, payment creates the account, and the buyer receives a sign-in link with their orders placed. With a customer key: the balance is spent first and only the shortfall is charged; a basket the balance covers is placed immediately with no card (checkout_url null), and an Idempotency-Key header is REQUIRED. A card processing fee (2.9% + 30c, grossed up) is a separate line item. Nothing is charged or ordered by this call itself; orders are placed by the payment webhook once money is captured. A presented-but-invalid key is a 401, not a guest. An optional buyer-approved max_total_credits ceiling refuses the checkout with 409 price_changed if the reviewed total has risen, so a catalogue move between review and buy is never charged silently; a purchase is only ever placed on an explicit buyer action, never by the comparison itself. Limited to 10 baskets an hour per address and per customer.

post/v1/checkout/basket

Request

  • Base URL: https://api.placementapi.com
  • URL: https://api.placementapi.com/v1/checkout/basket
  • Auth: one of:
    • none
    • HTTP bearer

Headers

Idempotency-Keystring

Required when authenticated; optional for guests (the card form is the confirmation).

Request body

emailstring email

Required when unauthenticated; ignored when a key is sent.

return_urlstring uri required

https URL on an allowed host; where the buyer is sent back with ?basket=&token= appended.

max_total_creditsinteger

Optional, additive buyer-approved ceiling on the whole basket in credits (placement + content). When the audited total has risen above it, the checkout is refused with 409 price_changed carrying current_total_credits and max_total_credits, and nothing is debited, charged or ordered; the buyer must compare again and accept the current total. Absent, the route behaves exactly as before (repriced tolerance unchanged). This is the ceiling the hosted Perch review sends as the total it showed the buyer.

Response

OK

basket_idstring
status_tokenstring
checkout_urlstring nullable

Null when the balance covered everything.

statusstring
total_creditsinteger

placement_credits + content_credits.

placement_creditsinteger
content_creditsinteger

Writing fees priced into the basket (service tier or papi_written).

fee_centsinteger
charge_centsinteger
balance_used_creditsinteger
shortfall_creditsinteger
expires_atstring date-time
replayedboolean
linesobject[]

Changes

No recorded changes to this operation across all 1 revision of this API.