Purchases
Buy a quote for the person, with their saved card
Live
https://shopitup.ca/api/v1/purchases
For an assistant the person connected through the agent registration door (/oauth/register/agent) AND allowed
to buy on ShopItUp's consent page — the elevated purchase:write scope. Puts the card saved in the person's
ShopItUp account ON HOLD, off-session, within the spending limits they set (per order and per 30 days), for a quote
to the address saved in their account, and charges it 24 hours later unless they cancel (charges_at). The item is
held for them meanwhile; if it sells elsewhere first, the hold is released and nothing is charged. Only stores whose
agent_checkout is direct sell this way.
Purchases are served in Canada, except for delivery to Quebec. One purchase per quote. The person is emailed a copy of the order with a link to cancel it within
24 hours — the hold is released and nothing is charged.
201 held (the card is on hold until charges_at; then it becomes paid). 202 processing (the bank has not answered; follow it with
GET /purchases/{purchase_id}). 402 requires_person: the bank wants the person to confirm, or the card was
declined — nothing is charged and checkout.checkout_url is a link they can pay themselves. 409/429/403
refused, nothing charged: agent_purchases_unavailable, too_many_purchases, quote_already_purchased,
quote_expired, item_unavailable, not_available_in_market, address_not_on_file, store_requires_checkout_link, purchases_paused, spending_limit_not_set, no_saved_card,
card_not_on_this_account, price_changed, price_unavailable, over_spending_limit (with limit and room).
Send an Idempotency-Key: the same key and quote return the first answer, so a retry never charges twice.
- Access
-
purchase:writeHow to get a token - Returns
- Held — the order is placed and the card is on hold until charges_at
Headers
-
Idempotency-Keystring RequiredAny unique string per purchase you mean to make. Repeating it returns the first response.
Request body
JSON, sent with Content-Type: application/json.
-
quote_idstring RequiredA quote to the address saved in the person's account (
GET /me/shipping-address).
Response
201 Held — the order is placed and the card is on hold until charges_at
-
purchase_idstring -
statusstring -
order_numberstring -
fulfilmentstring -
totalsobject1 child attribute
-
grand_totalMoney2 child attributes
-
amountstring RequiredDecimal string, two places
-
currencystring Required
-
-
-
cancel_untilstring date-timeUntil when the person can cancel from their email. For a held purchase, cancelling releases the hold and nothing is charged.
-
charges_atstring date-timeWhile held, when the card will be charged unless the person cancels; null once charged or closed.
-
created_atstring date-time -
checkoutobjectOnly with
requires_person— a checkout link for the person to pay themselves.3 child attributes
-
checkout_idstring -
checkout_urlstring uri -
expires_atstring date-time
-
-
errorobjectWhy it was refused, or why the person must pay themselves.
2 child attributes
-
codestring -
messagestring
-
Response
202 Processing — the bank has not answered yet
-
purchase_idstring -
statusstring -
order_numberstring -
fulfilmentstring -
totalsobject1 child attribute
-
grand_totalMoney2 child attributes
-
amountstring RequiredDecimal string, two places
-
currencystring Required
-
-
-
cancel_untilstring date-timeUntil when the person can cancel from their email. For a held purchase, cancelling releases the hold and nothing is charged.
-
charges_atstring date-timeWhile held, when the card will be charged unless the person cancels; null once charged or closed.
-
created_atstring date-time -
checkoutobjectOnly with
requires_person— a checkout link for the person to pay themselves.3 child attributes
-
checkout_idstring -
checkout_urlstring uri -
expires_atstring date-time
-
-
errorobjectWhy it was refused, or why the person must pay themselves.
2 child attributes
-
codestring -
messagestring
-
Status codes
Held — the order is placed and the card is on hold until charges_at
Processing — the bank has not answered yet
The person must pay themselves (their bank wants them to confirm, or the card was declined); nothing was charged
Refused; nothing was charged
Missing, invalid or expired access token
The token does not carry the scope this endpoint needs
The request is invalid; fields says which field and why
Too many requests; retry after the number of seconds in Retry-After
A service the API depends on is briefly unavailable; retry after the number of seconds in Retry-After