Carts
Fields
url
- Type: String
- Read Only
URL to this cart
id
- Type: Number
- Read Only
ID of this cart
lineitems
- Type: URL
- Read Only
URL to all the LineItems in this cart.
lineitems_count
- Type: Number
- Read Only
Number of LineItems in this cart.
lineitems_recent
- Type: Array of LineItems
- Read Only
the last 3 LineItems added to this cart. Here for convenience for Cart previews.
bill_to_address
- Type: URL
- Required
The url to the billing Address for this cart. If the user is logged in, this will have a default. Otherwise, you will need to update this cart with an address url.
ship_to_address
- Type: URL
- Required
The url to the shipping Address for this cart. If the user is logged in, this will have a default. Otherwise, you will need to update this cart with an address url.
addresses
- Array of Addresses
- Read Only
The Addresses associated with this cart. Provided for convenience.
shipping_url
- Type: URL
URL to an endpoint with Shipping methods. The following fields will be on shipping methods:
id- ID for the shipping methodkey- Southware key for shipping optiondescription- Displayable description of the shipping methodcarrier- if a specific carrier is associated with this shipping method, it will be shown hereprice- How much shipping will be charged on this cart.
shipping_method
- Type: Number
- Required
The ID of the shipping method for this cart. you will need to poll the
shipping_url for the shipping options to get the IDs.
cart_type
- Type: String the type of cart.
description
- Type: String The cart description. If a user wants to save a cart for later, you can use this to name the cart.
source_id
- Type: String
The source ID
default_location
- Type: String
The default Southware Location for this cart.
customer_po
- Type: String
If the customer has a PO number, put it here.
customer_freight_account
- Type: String
If the customer has their own freight account, and you allow them to use it, you can let them put that here.
cart_total
- Type: Number
- Read Only
The total cost of the cart. This is only refreshed on cart retrieval. if you update the cart, be sure to fetch the cart again to refresh this amount.
subtotal
- Type: Number
- Read Only
The cost of the lineitems in the cart. This is only refreshed on cart retrieval. if you update the cart, be sure to fetch the cart again to refresh this amount.
tax_amount
- Type: Number
- Read Only
the amount of tax applied to the cart. This is only refreshed on cart retrieval. if you update the cart, be sure to fetch the cart again to refresh this amount.
estimated_shipping
- Type: Number
- Read Only
The amount of shipping estimated on the cart. This is only refreshed on cart retrieval. if you update the cart, be sure to fetch the cart again to refresh this amount.
status
- Type: Choice [
open(default) ,checkout,processing,pending,submitted,accepted]
This value is used to track the cart through the process of putting it into Southware.
is_current
- Type: Boolean
You can set the current cart at the /api/carts/current endpoint. True if
cart is current.
comments
- Type: String
Customer comments about the cart.
contact_name
- Type: String
- Required
The contact who is ordering this cart.
contact_email
- Type: String
- Required
Email address for order the cart.
contact_phone
- Type: String
- Required
Phone number for the cart
contact_fax
- Type: String
fax number for the cart.
reference_code
- Type: String
- Read Only
This is a code generated by ItemExtend that is sent to Southware. You can display this to the customer and use it to look up the order in southware later. We use this ince the Southware order number will be generated asynchronously, and will not be available immediately.
order_number
- Type: String
This is where the Southware order number will be stored.
order_confirmation_timestamp
- Type: Date
Once the order is processed into southware, this will contain the timestamp of the finishing of that process.
Cart Endpoints
Endpoint supporting shopping cart actions, allowing end-users to add items to carts, view created carts, and delete existing carts. Carts are only viewable or modifiable by the user who created them. A single user may have many "saved" carts for later checkout.
List
GET /api/carts/
Return a list of Cart instances.
Create
POST /api/carts/
Create a new, empty cart. Returns Cart instance with primary key.
retrieve
GET /api/carts/:key/
Return an individual Cart instance by primary key.
Update
PUT /api/carts/:key/
Modify an existing Cart's information.
Partial Update
PATCH /api/carts/:key/
Modify specific fields on an existing Cart.
Destroy
DELETE /api/carts/:key/
Delete a Cart (and associated LineItems).
Cart LineItem Endpoints
Create LineItem
POST /api/carts/:key/lineitems/
Adds a new LineItem to an existing Cart.
List LineItems
GET /api/carts/:key/lineitems/
Display a list of LineItems currently placed in the requested Cart.
Current Cart Endpoints
Retrieve
GET /api/carts/current/
Get the current cart
Change Current
POST /api/carts/current/
{
"cart":{:id}
}
Set the current cart to cart with id of {id}
Unset Current Cart
DELETE /api/carts/current/
Unset all carts set as current for this user
TIP
You will want to set a current cart following this call.
Cart Shipping Options
List
GET /api/carts/:key/shipping/
Get a list of shipping options available to this cart with prices
