try out ↗

← API Index


/api/client/savecart1

Save the current cart server-side. Always updates the session cart from the given positions (backup of an unsubmitted cart). If cart autosave is active for the customer (shop setting cartAutosave plus customer opt-in), the cart is additionally written into an order: a new order on the first storable save, the same order on every following save - its id is returned as oid. Order mails of such autosaved orders are deferred to the end of the session. (JS) clients can call this periodically after cart changes; a later NewOrder/ChangeOrder for the same cart is routed to that order server-side, never to a duplicate.

Change Note: replaces /api/client/modifiedcart and /api/client/resetcart (exec1.jsp), which stay for old bundles

Parameters

Name Description Type
position HTTP POST list parameter with the index p of every cart position; the position data follows in itemid-

, amount-

, unit-

, unitid-

, ... (see below)

int[]
itemid-

item id of position p (negative: assortment id) int
amount-

amount of position p in the given unit float
unit-

unit of position p in text form (e.g. Stück, kg) string
unitid-

unit id of position p (negative, if it is an alternative unit) int
price-

price the client displayed for position p (logging only) float
note-

optional customer note for position p string
aboid-

optional subscription reference of position p int
assid-

optional assortment reference of position p int
repeatnote-

optional period of a new subscription created from position p int
opos alternative to position/itemid-

...: order positions as HTTP POST list parameter, one occurrence per position, pipe-delimited: iid, amount, unit, unitid, aboid, isPre, note, extref (see /api/client/neworder8)

string
ddate_iso delivery date of the cart in ISO format (the session date is used when missing) string
tour tour id int
adrid delivery address id (0: default address) int
used_paycode payment code the customer indicated int
orders.cnote optional note related to the whole order string
reset if true, the client signals that its cart equals the loaded order again (unmodified) - and it does not need to be auto saved for now. The positions are still taken over, but the session cart is marked as loaded, so it does not count as an unsaved change at session end, and the shop log records a reset instead of a change. Replaces the former /api/client/resetcart URL, which was this very call with reset=true boolean
dupcheck random number per request, repeated submits of the same number are ignored string
shot set to true by the JS shop (single-shot mode: positions are the complete cart) boolean
oo-rf optionally define the response-format for this call. One of: compact (default) | compacts | full | fulls | json | md | html | js | openapi | yaml String
oo-auth optionally force the API to check against the role (instead of silently not returning data). For guests or public access, the default is -1. 0 (regular customer) and above define the role for which the current session is expected to be authorized. int

Error Responses

HTTP Status Error Code Description
403 not_auth User is not authenticated
403 security Security violation

Response Types

Type Version Description
SaveCartResult 1 Result of saving the current cart server-side (/api/client/savecart1)

OpenAPI

See savecart1.yaml

Referenced in skills