The *trolley\_remove* method
============================
This method takes a "trolley\_token" plus a list of orders to remove,
specified by their item numbers, and produces a trolley with those items
removed from it. More than one item may be removed at a time, and an
item may be removed more than once without error. As item numbers are
not re-used within a trolley then it is not necessary to check that item
numbers are actually present in the trolley, as the end result is a
trolley absent of those items. As with all other trolley manipulation
methods, it is possible to ask the method to produce a full description
of the altered trolley in the output XML tree.
Required inputs
---------------
A "crypto\_block" from "start\_session" method must be present. This may
come from the original "start\_session" or may be one of the crypto
blocks produced from any of the other methods which are documented as
generating a "start\_session" compatible block. A "trolley\_token"
holding the trolley from which the items are to be removed must also be
present. The items are then specified by zero or more "remove\_item"
elements, each containing an integer specifying the item number of the
order to be removed.
An optional "describe\_trolley" element may be present to indicate that
the output data should contain the full trolley description.
Example input
~~~~~~~~~~~~~
.. code-block:: xml
demo
U_--LfP7rp3MoitCr2ofVaNShLkdOlMurxfADnkYLSOFxUoQo
YUZz_Kq23SaaVvPmF43Ndbq2o1t5Nq60tvNucAoeODYcVYViU_lXNIqmcKQa9ID
lXCTGZEvwqddnGIUevnZY
k1---IHQgb4xt2KimGiw-fPma5Oh1PFVyQJAx1hTrvv60DMz
73WJH8WgUVjBoxB5BLQo9pEilPGEmlk0uVX1Xb5gdejnDvVPYmf205VUlPVYwtd
zGfr1vBNznQp8OYLwx7kwNbQAFbcF_KlquVRXGLIH9YFGQARVJWGGLUDixXEkyq
fsF7DLEHd6kJYTaN0jzPGMMLdWsMIh1Nnms4jrDs1vzjUBVrv_uNX0CK4ezWxgp
jy1toCmQ-aWcrxkO7N-U1-Z9HX44b1CWwXDXVxecEhDjSUPrcKIB0Y6ZaHQABER
XTyMSsp3j4SZ36ESZjbOP8PfZ
2
0
Output data
-----------
The output contains a "crypto\_block"marked as coming from
"start\_session" for use in any subsequent calls, together with the
modified trolley in a "trolley\_token" element. The number of items in
the modified trolley is present as "trolley\_order\_count". If the
"describe\_trolley" element was present at the input then a "trolley"
element will be produced in the output containing the description of the
new trolley as documented for the "trolley\_describe" method.
Example output
~~~~~~~~~~~~~~
.. code-block:: xml
U_--LfP7rp3MoitCr2ofVaNShLkdOlMurxfADnkYLSOFxUoQo
YUZz_Kq23SaaVvPmF43Ndbq2o1t5Nq60tvNucAoe8EDBCmbWAKI6wq5NjH60XHD
lXCTGZEvwqddnGIUevnZY
k---w8xO3m6u8WH90wHc5Z9zQAeJBtYfbKEOoi5Xy5DgPJnp
P8i4zXEux9q1VOV0vqDOY
0
Potential failure codes
-----------------------
- **1** - the supplied crypto block was not generated by
"start\_session"
- **2** - the requested "mime\_text\_type" was not a supported value
- **801** - no "trolley\_token" has been supplied
- **802** - the supplied "trolley\_token" is corrupt
- **803** - the trolley has already been purchased
- **804** - the trolley has already been reserved