Update a Quote

PATCH /quote/{id|number}

Path Parameters

Parameter Type Description
id Integer The ID of the quote.

Request Body Data

Attribute Type Description
name String The name of the quote.
type String The type of the quote, must match one of the following: draft/saved/registered/guest
items Array An array of cart items, must be an array. Each item must match the following shape:

items: [
 {
  product_id:1, /* required */
  quantity: 1, /* defaults to 1 */
  options: {
   OptionName: "bob",
   Size: "large",
   Colour: "red"
  },
  x_billing_plan_id: 1,
  is_trial_product: true,
  extras: [
   "extra-sku",
   "hat"
  ],
  custom_fields: {
   fieldName: "fieldValue",
   Label: "Julie's Coffee",
  },
 },
 …
]

Note: Passing this field will delete the quote's current items, and replace them with the items defined in the current PATCH reqeuest.
x_billing_plan_id Int The ID of a billing plan to be assigned to the quote.
customer_groups Array An array of customer groups “api code” that define which (if any) customer groups are applicable to receive the quote.

Note: Passing this field will delete the quote's current customer groups, and replace them with the groups defined in the PATCH reqeuest.
customer_emails Array An array of customer emails that defines which emails the quote will be sent to. This is in addition to the customer group’s customer emails. Relevant for the shop:send-quote email template.

Note: Passing this field will delete the quote's current emails, and replace them with the emails defined in the PATCH reqeuest.
customer_id Int The ID of a customer. This field should only be used if the quote is assigned to a single customer only and ensures only 1 customer can see this quote.
coupon_code String A coupon code to save to the quote. Must match an existing coupon code.
cart_link_id String Alphanumeric string representing the link location that will be used in the URL of the quote. Optionally defined here. If left empty, this will be randomly generated and visible in the store's backend admin area. This will be used in the Cart Link that is sent to customer, for example:

“lemonstore.com/cart/0ad7308590bffb8d41bc00fdffc007df1e1fce5a”

“lemonstore.com/cart/

See “Manage Your Store”-> Quotes” doc page.
expires_x_days Int The number of days the Quote has from creation until it expires.

Request

Content-Type: application/json
Authorization: Bearer y5QNsEEGg8s9XqiQFuqGOB5a1zV22pGRFJgHgCbH
{
  "name": "test-quote-1",
  "x_billing_plan_id": 1,
  "customer_emails": ["test@lemonstand.com"],
  "customer_id": 66,
  "customer_groups": ["groupA", "groupB"],
  "cart_link_id": "linktest123456789",
  "coupon_code": "testcoupon",
  "items": [
  	{
  		"product_id": 12,
  		"quantity": 13,
  		"options": {
  			"Colour": "White",
  			"Logo Colour": "Yellow"
  		},
  		"is_trial_product": 1,
		"x_billing_plany_id": null
  	}
  ]
}

Response 200

Content-Type: application/json
ETag: 809e55a8f8fdabb0932a6a5e3f565a5d
Cache-Control: private, max-age=60
Last-Modified: Mon, 09 Jun 2014 16:54:11 GMT
Content-Length: 4642
{
    "meta": {
        "status": 201,
        "success": true
    },
    "data": {
        "id": 1334,
        "name": "test-quote-1",
        "billing_plan_id": 1,
        "type": "draft",
        "status": "active",
        "checkout_step": "billing_info",
        "customer_id": 66,
        "customer_groups": [
            {
                "id": 3,
                "name": "groupA",
                "description": null,
                "api_code": "groupA",
                "show_tax_inclusive": 0,
                "is_tax_exempt": 0,
                "created_at": "2018-02-15 15:54:14",
                "updated_at": "2018-02-28 12:46:26",
                "pivot": {
                    "shop_cart_id": 1334,
                    "shop_customer_group_id": 3
                },
                "customers_count": 2
            },
            {
                "id": 4,
                "name": "groupB",
                "description": null,
                "api_code": "groupB",
                "show_tax_inclusive": 0,
                "is_tax_exempt": 0,
                "created_at": "2018-02-15 15:54:20",
                "updated_at": "2018-02-28 14:04:34",
                "pivot": {
                    "shop_cart_id": 1334,
                    "shop_customer_group_id": 4
                },
                "customers_count": 1
            }
        ],
        "customer_emails": [
            "test@lemonstand.com"
        ],
        "cart_link_id": "linktest123456789",
        "coupon_code": "testcoupon",
        "total": "0.00",
        "total_tax": "0.00",
        "items": [
            {
                "id": 1373,
                "cart_id": 1334,
                "shop_product_id": 12,
                "shop_products_related_id": null,
                "extras": [],
                "quantity": 13,
                "postponed": 0,
                "key": null,
                "created_at": "2018-03-07 10:20:38",
                "updated_at": "2018-03-07 10:20:38",
                "x_billing_plan_id": null,
                "is_trial_product": 1,
                "shop_product_variant_id": 33,
                "price": 25,
                "discount": "0.00",
                "total": 208,
                "product": {
                    "id": 12,
                    "name": "LS Logo",
                    "sku": "ls-logo",
                    "description": "<p>A minimalist design repping LemonStand's logo in an assortment of colours. Feel the power of developer-friendly online stores in this comfy garment.</p><p>• 100% organic cotton • Fairtrade</p>",
                    "short_description": null,
                    "meta_description": null,
                    "meta_keywords": null,
                    "url_name": "ls-logo",
                    "base_price": "25.00",
                    "cost": null,
                    "depth": null,
                    "width": null,
                    "height": null,
                    "weight": "1.00",
                    "enabled": 1,
                    "enabled_backend": 0,
                    "is_on_sale": 0,
                    "sale_price_or_discount": null,
                    "track_inventory": 0,
                    "allow_preorder": 0,
                    "in_stock_amount": null,
                    "hide_out_of_stock": 0,
                    "out_of_stock_threshold": "0.00",
                    "low_stock_threshold": null,
                    "expected_availability_date": null,
                    "allow_negative_stock": 0,
                    "is_catalog_visible": 1,
                    "is_search_visible": 1,
                    "created_at": "2017-11-06 14:59:09",
                    "updated_at": "2018-02-27 17:55:13",
                    "title": null,
                    "enable_product_shipping_rates": 0,
                    "barcode": null,
                    "is_subscription_only": 0,
                    "sort_order": null,
                    "options": [
                        {
                            "id": 8,
                            "product_id": 12,
                            "sort_order": 1,
                            "name": "Colour",
                            "deleted_at": null
                        },
                        {
                            "id": 9,
                            "product_id": 12,
                            "sort_order": 2,
                            "name": "Logo Colour",
                            "deleted_at": null
                        }
                    ],
                    "category": "Men's",
                    "manufacturer": null,
                    "tax_class": "Product",
                    "type": "Goods",
                    "date_created": "11/06/2017",
                    "date_updated": "02/28/2018",
                    "sku_id": "ID: 12",
                    "description_stripped": "A minimalist design repping LemonStand's logo in an assortment of colours. Feel the power of developer-friendly online stores in this comfy garment.• 100% organic cotton • Fairtrade",
                    "list_base_price": "$25.00",
                    "list_in_stock_amount": 0
                }
            }
        ]
    }
}