This is the initial version of the UGAL API and is still subject to changes.
Email support@ugal.com with any question or comment.
UGAL API - Orders
The orders API application requires website authentication.
The application allows to retrieve and manipulate information on orders.
Reading a collection of orders
| URL | GET @ http://{sitename}.ugal.com/api/v1/orders.xml |
|---|---|
| Filters |
?status={new|pending|processed|cancelled} ?payStatus={paid|notPaid|refunded} ?customer={name or email} |
| Pagination | ?p={pageId} |
Returns a collection of orders (25 orders per page):
// Status: 200 OK
<orders>
<order>
<id>131061</id>
<name>Joe Shopper</name>
<email>joe@shopper.com</email>
<status>new</status>
<paystatus>notPaid</paystatus>
<link>http://sitename.ugal.com/api/v1/orders/131061.xml</link>
</order>
{...}
</orders>
Reading an order
| URL | GET @ http://{sitename}.ugal.com/api/v1/orders/{orderId}.xml |
|---|
Returns a representation of the order:
// Status: 200 OK
<?xml version="1.0" encoding="UTF-8"?>
<order>
<id>131061</id>
<name>Joe Shopper</name>
<email>joe@shopper.com</email>
<phone>01.45.54.42.00</phone>
<status>new</status>
<paystatus>paid</paystatus>
<payservice>ogone</payservice>
<promocode></promocode>
<comment>Deliver on the front porch if not at home.</comment>
<billto>
<company>UGAL</company>
<firstname>Joe</firstname>
<lastname>Shopper</lastname>
<address>212, rue LaFayette</address>
<city>Paris</city>
<state></state>
<zip>75012</zip>
<country>fr</country>
</billto>
<shipto>
<company>UGAL</company>
<firstname>Joe</firstname>
<lastname>Shopper</lastname>
<address>212, rue LaFayette</address>
<city>Paris</city>
<state></state>
<zip>75012</zip>
<country>fr</country>
</shipto>
<lines>
<line>
<id>1</id>
<quantity>1</quantity>
<item>
<name>Alfa Romeo 2600 (alfa-red)</name>
<reference>alfa-red</reference>
<price>
<pricelist>default</pricelist>
<currency>eur</currency>
<amount>7200.00</amount>
<vat>1179.93</vat>
<vatrate>0.1960</vatrate>
</price>
<link>http://sitename.ugal.com/api/v1/items/alfa-red.xml</link>
</item>
</line>
</lines>
<amount>
<total>
<currency>eur</currency>
<amount>7450.00</amount>
<vat>1220.90</vat>
</total>
<parts>
<currency>eur</currency>
<amount>7200.00</amount>
<vat>1179.93</vat>
</parts>
<shipping>
<currency>eur</currency>
<amount>250.00</amount>
<vat>40.97</vat>
</shipping>
<discount>
<currency>eur</currency>
<amount>0.00</amount>
<vat>0.00</vat>
</discount>
</amount>
<payments>
<payment>
<status>paid</status>
<service>ogone</service>
<reference>173648293</reference>
<method>visa</method>
<account>**4111 Joe Shopper</account>
<amount>
<currency>eur</currency>
<amount>7450.00</amount>
<fee>0.00</fee>
</amount>
<created-at>2010-10-03T14:28:54Z</created-at>
</payment>
</payments>
<created-at>2010-10-03T14:28:54Z</created-at>
<updated-at>2010-10-04T13:42:19Z</updated-at>
</order>
Notes:
- The <state> element is populated only for addresses in the United States.
- For sales tax based shops, the <vat> elements are not present in the representation of the order and a <salestax> element is added in the <amount> section:
{...}
<amount>
{...}
<salestax>
<currency>usd</currency>
<amount>745.00</amount>
</salestax>
</amount>
{...}
Updating an order
- The status and the payStatus properties can be updated.
- Send data in the request body only for the properties to be updated.
| URL | PUT @ http://{sitename}.ugal.com/api/v1/orders/{orderId}.xml |
|---|---|
| Body | // Status: 200 OK
<?xml version="1.0" encoding="UTF-8"?>
<order>
<status>processed</status>
<paystatus>paid</paystatus>
</order> |
Returns the updated representation of the order:
// Status: 200 OK
<order>
<id>131061</id>
{...}
</site>
