fulfillment Function

location_id

  • string

    Location ID where the cart is expected to be fulfilled. It only needs to be included if the location ID of a cart needs to be changed.

      {
          "location_id": "LXGG1JK52W3Z8"
      }
    

fulfillment

  • object required
    • fulfillment_type string required

      Fulfillment type being applied to the cart. Each fulfillment type has corresponding options that can be provided.

      Values: SHIPMENT, MANUAL, PICKUP, DELIVERY

    • pickup_details object

      Required if fulfillment_type is PICKUP.

      • schedule_type string

        Type of scheduling used for the PICKUP order.

        Values: ASAP, SCHEDULED

      • curbside_pickup_requested boolean

        Denotes whether the pickup will be done curbside.

      • curbside_pickup_details object

        • curbside_details string

          Contains details of the curbside pickup

      • pickup_at string

        RFC3339 date-time string for the scheduled pickup.

        {
            "pickup_details": {
                "schedule_type": "ASAP",
                "curbside_pickup_requested": true,
                "curbside_pickup_details": {
                    "curbside_details": "Coming in a white t-shirt with black jeans"
                },
                "pickup_at": "2023-08-21T22:08:25+00:00"
            }
        }
      
    • delivery_details object

      Required if fulfillment_type is DELIVERY.

      • schedule_type string

        Type of scheduling used for the DELIVERY order.

        Values: ASAP, SCHEDULED

      • recipient object

        Contains delivery address information.

          {
              "recipient": {
                  "address": {
                      "locality": "New York",
                      "country": "US",
                      "postal_code": "10013",
                      "administrative_district_level_1": "New York",
                      "administrative_district_level_2": "New York County",
                      "administrative_district_level_3": "Town of New york",
                      "sub_locality": "District 7",
                      "sub_locality_2": "Neighborhood",
                      "sub_locality_3": "Housing colony",
                      "address_line_1": "100 6th Avenue",
                      "address_line_2": "",
                      "address_line_3": ""
                  }
              }
          }
        
      • no_contact_delivery boolean

        Denotes whether the delivery should done with no contact

      • note string

        Order note information provided to the seller

      • deliver_at string

        RFC3339 date-time string for the scheduled delivery. Ignored if schedule_type is ASAP.

        {
            "delivery_details": {
                "schedule_type": "ASAP",
                "no_contact_delivery": true,
                "note": "Please include a place setting",
                "recipient": {
                    "address": {
                        "locality": "New York",
                        "country": "US",
                        "postal_code": "10013",
                        "administrative_district_level_1": "New York",
                        "administrative_district_level_2": "New York County",
                        "administrative_district_level_3": "Town of New york",
                        "sub_locality": "District 7",
                        "sub_locality_2": "Neighborhood",
                        "sub_locality_3": "Housing colony",
                        "address_line_1": "100 6th Avenue",
                        "address_line_2": "",
                        "address_line_3": ""
                    }
                }
            }
        }
      

Replaces the fulfillment options of a cart. If the fulfillment_type is PICKUP, all pickup_detail fields are required.

Example

fetch('/s/api/v1/cart/{order_id}/fulfillment', {
	method: 'PUT',
	headers: {
		'X-CSRF-TOKEN': 'csrf_token_from_csrf_meta_tag',
	},
	body: JSON.stringify({
		"location_id": "LOCATION_ID",
		"fulfillment": {
			"fulfillment_type": "PICKUP",
			"pickup_details": {
				"schedule_type": "ASAP",
				"curbside_pickup_requested": true,
				"curbside_pickup_details": {
					"curbside_details": "Coming up in a blue van"
				},
				"pickup_at": "2023-09-10T22:24:04+00:00"
			}
		}
	})
})
	.then((response) => ...);

You can use the Site Theme SDK instead of calling the Cart API directly. The SDK is intended to simplify cart actions.