Cart

Contain data reffered to cart.


Receive a list of all carts

Query parameters:
  • fields - list of fields returning in response
  • limit - number of returned carts (default: 50)
  • page - currently displayed page (default: 1)
  • since_id - restrict carts to greater identifiers than specified id
  • user_key - filter with product id
  • created_at_min - shows carts, which creation date was later than specified (format: 2011-06-19 13:18:50)
  • created_at_max - shows carts, which creation date was earlier than specified (format: 2011-06-19 13:18:50)
GET /services/carts

Returns all categories

HTTP/1.1 200 OK
{
	"carts": [
		{
			"id" : 1,
			"user_key" : "Fu1Ttc6G4xlIOH4QnIuWp0RWEqK40Eeh",
			"product_id" : 12,
			"variant_id" : 54,
			"price" : 19900,
			"tax" : 23,
			"quantity" : 1,
			"weight" : 500,
			"sku" : "t-shirt-231a",
			"require_shipping" : 1,
			"created_at" : "2011-09-22 01:15:35",
			"expire_at" : "2011-09-22 01:35:35"
		},
		{
			"id" : 2,
			"user_key" : "ONee6yuqXwisBJ2irzrEQFmvA0PuLLzo",
			"product_id" : 34,
			"variant_id" : 62,
			"price" : 14900,
			"tax" : 23,
			"quantity" : 2,
			"weight" : 500,
			"sku" : "t-shirt-432a",
			"require_shipping" : 1,
			"created_at" : "2011-09-22 02:15:35",
			"expire_at" : "2011-09-22 02:35:35"
		},
	]
}

Receive a count of all carts

Query parameters:
  • user_key - filter by user key
  • created_at_min - counts carts, which creation date was later than specified (format: 2011-06-19 13:18:50)
  • created_at_max - counts carts, which creation date was earlier than specified (format: 2011-06-19 13:18:50)
GET /services/carts/count

Receive a count of all Carts

HTTP/1.1 200 OK
{
	"count": 5
}

Receive a single Cart

Query parameters:
  • fields - list of fields returning in response
GET services/carts/{id}

Receive a single Cart

Response
HTTP/1.1 200 OK
{
	"cart": {
		"id" : 1,
		"user_key" : "Fu1Ttc6G4xlIOH4QnIuWp0RWEqK40Eeh",
		"product_id" : 12,
		"variant_id" : 54,
		"price" : 19900,
		"tax" : 23,
		"quantity" : 1,
		"weight" : 500,
		"sku" : "t-shirt-231a",
		"require_shipping" : 1,
		"created_at" : "2011-09-22 01:15:35",
		"expire_at" : "2011-09-22 01:35:35"
	},
}

Create a Cart/Add variant to cart

POST services/carts

Create category with specified parameters

Request
{
	"cart": {
		"variant_id" : 54,
		"quantity" : 2,
		"user_key"	: "Fu1Ttc6G4xlIOH4QnIuWp0RWEqK40Eeh"
	},
}
Response
HTTP/1.1 200 OK
{
	"cart": {
		"id" : 1,
		"user_key" : "Fu1Ttc6G4xlIOH4QnIuWp0RWEqK40Eeh",
		"product_id" : 12,
		"variant_id" : 54,
		"price" : 19900,
		"tax" : 23,
		"quantity" : 2,
		"weight" : 500,
		"sku" : "t-shirt-231a",
		"require_shipping" : 1,
		"created_at" : "2011-09-22 01:15:35",
		"expire_at" : "2011-09-22 01:35:35"
	},
}

Update an existing Cart Item

PUT services/carts/{id}

You can update a quantity of a given category

Request
{
	"cart": {
		"quantity"	: 3
	},
}
Response
HTTP/1.1 200 OK
{
	"cart": {
		"id" : 1,
		"user_key" : "Fu1Ttc6G4xlIOH4QnIuWp0RWEqK40Eeh",
		"product_id" : 12,
		"variant_id" : 54,
		"price" : 19900,
		"tax" : 23,
		"quantity" : 2,
		"weight" : 500,
		"sku" : "t-shirt-231a",
		"require_shipping" : 1,
		"created_at" : "2011-09-22 01:15:35",
		"expire_at" : "2011-09-22 01:35:35"
	},
}

Delete an existing Cart Item/Remove variant from cart

DELETE services/carts/{id}

Delete an existing cart item

Response
HTTP/1.1 200 OK
{
	"status"	: "ok",
}

Add/update cart item discount

PUT services/carts_discount/{id}

You can add or update a discount for cart item.

Request
{
	"cart_discount": {
		"discount_type"	: "2" //"1" for price discount, "2" for percentage discount
		"discount_value": "30",
		"discount_code": "DISCOUNT20XX",
		"discount_title": "Summer sale",
		"properties": "{\"Zestaw\": \"Zestaw 1\"}" //field optional, when it doesn't exists, discount will be added to all line items
	},
						
}
Response
HTTP/1.1 200 OK
{
	"status"	: "ok",
}

Delete cart item discount

DELETE services/carts_discount/{id}

You can delete previously added discount to a cart item

Response
HTTP/1.1 200 OK
{
	"status"	: "ok",
}