OrderCreateRequest Shipping Examples
The Shipping
element in OrderCreateRequest
can contain different
Destinations
element types depending on the destination type. Each of these
types have different information that is expected. This page includes
examples of different destination types.
MailingAddress
The How to Build an Order Create API Request page uses a mailing address in its example.
StoreLocation
A StoreLocation
can be used for things such a Ship-to Store fulfillment type.
Copy
<?xml version="1.0" encoding="UTF-8"?>
<OrderCreateRequest xmlns="http://api.gsicommerce.com/schema/checkout/1.0"
requestId="123456789">
<Order customerOrderId="12345">
...
<Shipping>
<ShipGroups>
<ShipGroup chargeType="FLATRATE"
id="shipGroup1">
<DestinationTarget ref="storelocation1"/> <!-- see NOTE1 -->
<OrderItems>
<Item ref="orderItem1"/>
</OrderItems>
</ShipGroup>
</ShipGroups>
<Destinations>
<StoreLocation id="storelocation1"> <!-- see NOTE2 -->
<StoreCode>123</StoreCode> <!-- see NOTE3 -->
<StoreName>King of Prussia</StoreName> <!-- see NOTE4 -->
<StoreEmail>store123@gsicommerce.com</StoreEmail> <!-- see NOTE5 -->
<Address> <!-- see NOTE6 -->
<Line1>935 1st Ave</Line1>
<City>King of Prussia</City>
<MainDivision>PA</MainDivision>
<CountryCode>US</CountryCode>
<PostalCode>19406</PostalCode>
</Address>
</StoreLocation>
</Destinations>
</Shipping>
...
</Order>
...
</OrderCreateRequest>
NOTE1 | The destination for the ship group. Notice this can be a reference to a
StoreLocation (required). |
NOTE2 | A StoreLocation destination. It contains an id attribute that can be used
in references elsewhere, like the DestinationTarget above. |
NOTE3 | A unique string that identifies the specific store. |
NOTE4 | The name of the store or the way the store is referred to. |
NOTE5 | The email address to contact the store. |
NOTE6 | The address where the store is located. |
An Email
can be used as a destination for items like electronic gift cards.
Copy
<?xml version="1.0" encoding="UTF-8"?>
<OrderCreateRequest xmlns="http://api.gsicommerce.com/schema/checkout/1.0"
requestId="123456789">
<Order customerOrderId="12345">
...
<Shipping>
<ShipGroups>
<ShipGroup chargeType="FLATRATE"
id="shipGroup1">
<DestinationTarget ref="email1"/> <!-- see NOTE1 -->
<OrderItems>
<Item ref="orderItem1"/>
</OrderItems>
</ShipGroup>
</ShipGroups>
<Destinations>
<Email id="email1"> <!-- see NOTE2 -->
<EmailAddress>janedoe@gsicommerce.com</EmailAddress> <!-- see NOTE3 -->
</Email>
</Destinations>
</Shipping>
...
</Order>
...
</OrderCreateRequest>
NOTE1 | The destination for the ship group. Notice this can be a reference to an
Email (required). |
NOTE2 | An Email destination. It contains an id attribute that can be used in
references elsewhere, like the DestinationTarget above. |
NOTE3 | The email address to email the purchased item to. |
Gifting
You can add a ShipGroup
level Gifting
element, in the same way that you can on OrderItem
elements. This represents gift instructions to an entire ship group. The example
below is just one type of Gifting
element.
Copy
<?xml version="1.0" encoding="UTF-8"?>
<OrderCreateRequest xmlns="http://api.gsicommerce.com/schema/checkout/1.0"
requestId="123456789">
<Order customerOrderId="12345">
...
<Shipping>
<ShipGroups>
<ShipGroup chargeType="FLATRATE"
id="shipGroup1">
<DestinationTarget ref="email1"/>
<OrderItems>
<Item ref="orderItem1"/>
</OrderItems>
<Gifting>
<Packslip>
<Message>
<To>Jane</To>
<From>John</From>
<Message>Happy birthday</Message>
</Message>
</Packslip>
</Gifting>
</ShipGroup>
</ShipGroups>
<Destinations>
<Email id="email1">
<EmailAddress>janedoe@gsicommerce.com</EmailAddress>
</Email>
</Destinations>
</Shipping>
...
</Order>
...
</OrderCreateRequest>