orders
Recommended version is 2016.3001
List orders
Lists one or more orders for the logged on and authenticated user.
Request
HTTP GET to /orders
Filter
 Name | Required | Value | Description | Data type | Default |
---|---|---|---|---|---|
number | no | number=1254 | Order number | String | Â |
businessunitids | no | businessunitids=4,3 | Only specified business units/facilities | ID-list | Â |
fromdate | no | fromdate=2011-12-24 | Start date | Date | One year ago |
todate | no | todate=2012-12-25 | End date | Date | Tomorrow |
orderedbyid | no | orderedbyid=6389 | Customer's ID | ID | Â |
Example:
APIURL/orders.xml?apikey=338934897438&businessunitids=4,3
Response
Tag | Data type | Example | Description |
---|---|---|---|
orders | Â | <orders> | The root tag that encloses all orders |
order | Â | <order> | Order |
id | ID | <id>12</id> | Unique ID |
number | Integer | <number>51</number> | Order number |
created | Time stamp | <created>2011-04-26 14:45</created> | When the order was created |
orderedby | Â | <orderedby> | Customer |
id | ID | <id>5</id> | The customers ID |
number | String | <number>1345</number> | The customer's customer number |
name | String | <name>John Doe</name> | The customer's full name |
streetaddress | String | <streetaddress>Mainstreet 10</streetaddress> | Street address1 |
postaladdress | String | <postaladdress>590 23 Springfield</postaladdress> | Postal address1 |
country | String | <country>Sweden</country> | Country1 |
businessunit | Â | <businessunit><id>11</id><name>Main street Center</name></businessunit> | The customers active business unit/facility |
items | Â | <items> | The items tag that surrounds the order rows |
item | Â | <item> | An order row |
id | ID | <id>1402</id> | The order's ID |
producttype | String | <producttype>Service</producttype> | Type of product |
productname | String | <productname>Tennis 1 hour</productname> | Name of product |
resources | String | <id>11</id><name>Court 1</name><type>Employee</type> | Resource |
valuecard | Â | See Valuecards | Valuecard information. Included if producttype of the item is of valuecard. |
start | Time stamp | <start><timepoint><timestamp>1340920800</timestamp><datetime>2012-06-29 00:00</datetime><date>2012-06-29</date><time>00:00</time></timepoint></start> | The order's start time |
end | Time stamp | <end><timepoint><timestamp>1340923600</timestamp><datetime>2012-06-30 00:00</datetime><date>2012-06-30</date><time>00:00</time></timepoint></end> | The order's end time |
numberofproducts | Integer | <numberofproducts>1</numberofproducts> | Number of units |
participant | String | <participant>Jane Doe</participant> | Â |
priceexvat | Integer | <priceexvat>3600</priceexvat> | Ammount in cents/ören without VAT |
priceincvat | Integer | <priceincvat>4500</priceincvat> | The ammount in cents/ören with VAT |
campaignitems | Â | <campaignitems><id>1403</id>...</campaignitems> | (Only available on the subscription product type) The ID for the order rows that have used the campaign feature. |
userid | ID | <userid>44</userid> | (Only available on the subscription product type) The user of the subscription. |
vatsums | Â | <vatsums> | Â |
vatsum | Â | <vatsum> | Shows the VAT rate and how much of the order that is paid with this rate. |
rate | Integer | <rate>25</rate> | The VAT rate in percent |
amount | Integer | <amount>7200</amount> | Ammount in cents/ören |
sum | Integer | <sum>54000</sum> | The total sum in cents/ören |
lefttopay | Integer | <lefttopay>0</lefttopay> | Remaining ammount to be paid in cents/ören, 0 if the order is paid in full. |
fullydebited | Boolean | <fullydebited>true</fullydebited> | True if all incleded items have been debited. |
mark | String | <mark>Tennis</mark> | Label. A short text string displayed on the header of the invoice. |
externalnote | String | <externalnote>Thank you for your order</externalnote> | External message. A text string printed out beneath the order rows on an invoice. When the invoice is created the user may select if this is to be included or not. |
internalnote | String | <internalnote>Internal message here</internalnote> | Internal message. |
bringnotetoinvoice | Boolean | <bringnotetoinvoice>true</bringnotetoinvoice> | Bring external note to invoice. |
preliminary | Boolean | <preliminary>true</preliminary> | Preliminary |
preliminaryuntil | Time stamp | <preliminaryuntil>2011-04-26 14:55</preliminaryuntil> | Preliminary until. If not payed for (or set to preliminary=false) the order will be removed after this timepoint. Preliminary until will be updated when items are added to the order. |
seller | Â | <seller><id>5</id><name>John Doe</name></seller> | Name and id of the person who made the sale. (By default this is the same as orderedby. If sellerid is not specified at order creation) |
coupons | Â | <coupons> | Â |
coupon | Â | <coupon> | Discount coupon |
name | String | <name>DISCOUNTCODE</name> | Discount code |
coupondiscount | integer | <coupondiscount>68400</coupondiscount> | The amount of discount received from coupons on this order, in cents/ören. |
1Â The customers address if it is complete, otherwise the customers invoice address will be used. A final option is the customer's organisation address and/or invoice address. An address is considered complete if it contains a street, zip code and city.
Â
<orders> <order> <id>65</id> <number>51</number> <created>2011-04-26 14:45</created> <orderedby> <id>5</id> <number>1345</number> <name>John Doe</name> <streetaddress>Main Street 10</streetaddress> <postaladdress>590 23 Springfield</postaladdress> <country>Sweden</country> </orderedby> <businessunit> <id>11</id> <name>Main Street Center</name> </businessunit> <items> <item> <id>1402</id> <producttype>Service</producttype> <productname>Tennis 1 hour</productname> <productid>18</productid> <resources> <resource> <id>11</id> <name>Wilander</name> <type>Room</type> </resource> </resources> <start> <timepoint> <timestamp>1340920800</timestamp> <datetime>2012-06-29 00:00</datetime> <date>2012-06-29</date> <time>00:00</time> </timepoint> </start> <end> <timepoint> <timestamp>1340923600</timestamp> <datetime>2012-06-30 00:00</datetime> <date>2012-06-30</date> <time>00:00</time> </timepoint> </end> <numberofproducts>1</numberofproducts> <participant>Jane Doe</participant> Â <priceexvat>3600</priceexvat> <priceincvat>4500</priceincvat> </item> <item> ... </item> </items> <sumexvat>45781</sumexvat> <vatsums> <vatsum> <rate>25</rate> <amount>7200</amount> </vatsum> <vatsum> <rate>6</rate> <amount>1019</amount> </vatsum> </vatsums> <sum>54000</sum> <lefttopay>0</lefttopay> <coupondiscount>0</coupondiscount> <mark>Tennis</mark> <externalnote>Thank you for your order</externalnote> <internalnote>Internal message here</internalnote> <bringnotetoinvoice>true</bringnotetoinvoice> <preliminary>true</preliminary> <preliminaryuntil>2011-04-26 14:55</preliminaryuntil> <seller> <id>5</id> <name>John Doe</name> </seller> <coupons> <coupon> <name>DISCOUNTCOUPON</name> </coupon> </coupons> </order> </orders>
Create order
Create an order that can be filled with order rows and paid. Requires basic HTTP-authentication
Request
Name | Required | Value | Date type | Description |
---|---|---|---|---|
currentbusinessunitid | no | currentbusinessunitid=331 | ID | To create an order on a different business unit/facility than current one specify this. |
sellerid | no | Â | ID | Id of the person who made the sale. Same as orderdby if not specified. |
externalnote | no | Â | String | External note on order. |
internalnote | no | Â | String | Internal note on order. |
bringnotetoinvoice | no | Â | Boolean | Bring external note to invoice. |
coupons | no | coupons=EXAMPLECODE,ANOTHEREXAMPLE | String | Comma separated list of discount codes. If any of the codes are not found, the request will result in status 400 and error code 1107 |
Â
Example:
POST:APIURL/orders.xml apikey=338934897438
Response
Same as listing of an order
Change order
Change the values of an order. Requires basic HTTP-authentication
Request
Order values that may be changed
Â
Name | Value | Description | Date type |
---|---|---|---|
preliminary | preliminary=false | A preliminary order is automatically deleted | Boolean |
mark | mark=Jag%20%26%20Mia%20kommer%20sent | A URL encoded note | Sträng |
externalnote | externalnote=Gl%C3%B6m%20inte%20handduk | A URL encoded external note | Sträng |
internalnote | internalnote=internal%20message | A URL encoded internal note | String |
bringnotetoinvoice | bringnotetoinvoice=true | Bring external note to invoice | Boolean |
coupons | coupons=EXAMPLECODE,ANOTHEREXAMPLE | Comma separated list of discount codes to replace any current discount codes. If any of the codes are not found, the request will result in status 400 and error code 1107. | String |
Example:
PUT:APIURL/orders/{id}.xml?apikey=338934897438&preliminary=false
Request
Same as for listing of an order
Delete
Deletes the order and it's contents. Each order row must be booked on the internet, be undebited and fullfill the cancellation rules in order for the entire order to be deleted.
If the order is anonymous include the parameter anonymous=true
Request
Example:
DELETE:APIURL/orders/\{id\}.xml?apikey=338934897438
Response
HTTP 204
No content.
Servicebooking with entry rights.
/wiki/spaces/INST/pages/2343010442 A special case where an order with service bookings is used to let users through a gate based on a QR-code.
Â