Request/Response Format

All API calls utilize json for the request and response format. The endpoints allow use of url query parameters with GET operations as necessary to filter or sort the returned results ( see individual module endpoints for specific sort/filter operations ).

Sample sort and filter

Sort and filters are passed on the url as GET parameters.

Typically the sort operations support both ascending and descending indicated by a plus or minus sign with the sort column ( default state to ascending if sort direction is not specified ). You can also specify multiple sort columns by separating them with a comma.

Example sorting desc by created time and ascending by id and filtering for orders created on or after 2:00am mountain time on July 14th 2015 ( please note to encode url parameters appropriately, example given without encoding for easy readability ).

https://www.sitedomain.com/site_api/shopping_cart/orders?sort=-created,+id&created_on_after=2015-07-14T02:00:00-0600

Sample request - POST

Request body should be passed as json. Sample post request to shopping cart order endpoint for status update on a specific order ( https://www.sitedomain.com/site_api/shoppping_cart/orders/54123 )

{
	"status": {
		"status": "Shipped",
		"notes": "Your order has been shipped on 7/15/2015",
		"notify_customer": true
	}
}

Sample Response - GET

Response body will be json. Sample response for call to shopping cart order endpoint for a specific order ( https://www.sitedomain.com/site_api/shoppping_cart/orders/54123 )

{
    "id": "54123",
    "user_id": "628",
    "user_email": "email@test.com",
    "current_status": "Complete",
    "order_num": "54123",
    "order_description": "Site shopping order",
    "customer_note": "",
    "first_name": "Test",
    "last_name": "Customer",
    "phone": "801-755-9966",
    "email": "email@test.com",
    "total": "322.85",
    "tax": "19.86",
    "is_paid": true,
    "payment_option": "Credit Card",
    "payment_option_type": "authorize.net",
    "payment_option_id": "16",
    "payment_detail": "",
    "check_num": "",
    "check_date": "0000-00-00",
    "transaction_id": "0",
    "card_last_4": "0027",
    "card_type": "Visa",
    "billing_first_name": "Test",
    "billing_last_name": "Customer",
    "billing_phone": "801-755-9966",
    "billing_email": "email@test.com",
    "billing_address": "10 w broadway ste 701",
    "billing_city": "salt lake city",
    "billing_state": "UT",
    "billing_zip": "84101",
    "billing_country": "us",
    "promo_code": "",
    "promo_code_info": "",
    "promo_code_discount": "0.00",
    "promo_rule_info": "",
    "promo_rule_info_admin": "",
    "promo_rule_discount": "0.00",
    "promo_rule_discount_shipping": "0.00",
    "gift_cert_id": null,
    "gift_cert_code": "",
    "gift_cert_info": "",
    "gift_cert_applied": "0.00",
    "gift_cert_is_credit_voucher": true,
    "shipping_option": "flat rate",
    "shipping_cost": "13.00",
    "shipping_first_name": "Test",
    "shipping_last_name": "Customer",
    "shipping_phone": "801-755-9966",
    "shipping_company": "",
    "shipping_address": "10 w broadway ste 701",
    "shipping_address2": "",
    "shipping_city": "salt lake city",
    "shipping_state": "UT",
    "shipping_zip": "84101",
    "shipping_country": "us",
    "is_fulfilled": false,
    "notes": "",
    "marketing_source_id": null,
    "marketing_source_choice": "",
    "marketing_source_other": "",
    "admin_created": false,
    "web_order": true,
    "is_guest_checkout": false,
    "created": "2015-04-27T17:34:31-0600",
    "created_ip": "127.0.0.1",
    "created_user_id": "628",
    "modified": "",
    "modified_user_id": null,
    "line_items": [
        {
            "id": "3223",
            "product_id": "16383",
            "name": "Test Product",
            "model": "",
            "sku": "",
            "description": "",
            "cost": "289.99",
            "quantity": "1",
            "total_cost": "289.99",
            "did_override_shipping_cost": false,
            "total_override_shipping_cost": "0.00",
            "is_gift_certificate": false,
            "gift_cert_amount": "0.00",
            "gift_cert_code": "",
            "is_fulfilled": false,
            "shipment_info": null
        }
    ],
    "statuses": [
        {
            "id": "187",
            "status": "Complete",
            "notes": "Order has been processed",
            "notify_customer": false,
            "created": "2015-07-15T08:50:07-0600",
            "created_ip": "127.0.0.1",
            "created_user_id": null,
            "modified": "",
            "modified_user_id": null
        },
        {
            "id": "186",
            "status": "Shipped",
            "notes": "Order has been shipped",
            "notify_customer": true,
            "created": "2015-07-15T08:49:44-0600",
            "created_ip": "127.0.0.1",
            "created_user_id": null,
            "modified": "",
            "modified_user_id": null
        },
        {
            "id": "185",
            "status": "Processing",
            "notes": "Order is processing",
            "notify_customer": true,
            "created": "2015-07-14T09:24:06-0600",
            "created_ip": "127.0.0.1",
            "created_user_id": "2",
            "modified": "",
            "modified_user_id": null
        }
    ]
}