Order Lines

Each Order contains one or more Order Lines, which represent a specific Product Variant that a Customer purchases.

Available methods

    • POST /ecommerce/stores/{store_id}/orders/{order_id}/lines Add a new line item to an existing order

      Add a new line item to an existing order

      POST /ecommerce/stores/{store_id}/orders/{order_id}/lines

      Add a new line item to an existing order.

      Path parameters

      store_id The store id.
      order_id The id for the order in a store.

      Request body parameters

      id Type: String Title: Order Line Item Foreign ID Read only: false A unique identifier for the order line item.
      product_id Type: String Title: Order Line Item Product Foreign ID Read only: false A unique identifier for the product associated with the order line item.
      product_variant_id Type: String Title: Order Line Item Product Variant Foreign ID Read only: false A unique identifier for the product variant associated with the order line item.
      quantity Type: Integer Title: Quantity Read only: false The quantity of an order line item.
      price Type: Number Title: Price Read only: false The price of an order line item.
      discount Type: Number Title: Discount Read only: false The total discount amount applied to this line item.

      Response body parameters

      id Type: String Title: Order Line Item Foreign ID Read only: true A unique identifier for the order line item.
      product_id Type: String Title: Order Line Item Product Foreign ID Read only: false A unique identifier for the product associated with the order line item.
      product_title Type: String Title: Order Line Item Product Title Read only: true The name of the product for the order line item.
      product_variant_id Type: String Title: Order Line Item Product Variant Foreign ID Read only: false A unique identifier for the product variant associated with the order line item.
      product_variant_title Type: String Title: Order Line Item Product Variant Title Read only: true The name of the product variant for the order line item.
      quantity Type: Integer Title: Quantity Read only: false The quantity of an order line item.
      price Type: Number Title: Price Read only: false The price of an order line item.
      discount Type: Number Title: Discount Read only: false The total discount amount applied to this line item.
      _links Type: Array Title: Links Read only: true A list of link types and descriptions for the API schema documents.
      Show properties
      rel Type: String Title: Rel Read only: true As with an HTML ‘rel’ attribute, this describes the type of link.
      href Type: String Title: Href Read only: true This property contains a fully-qualified URL that can be called to retrieve the linked resource or perform the linked action.
      method Type: String Title: Method Read only: true The HTTP method that should be used when accessing the URL defined in ‘href’.
      Possible Values:
      • GET
      • POST
      • PUT
      • PATCH
      • DELETE
      • OPTIONS
      • HEAD
      targetSchema Type: String Title: Target Schema Read only: true For GETs, this is a URL representing the schema that the response should conform to.
      schema Type: String Title: Schema Read only: true For HTTP methods that can receive bodies (POST and PUT), this is a URL representing the schema that the body should conform to.

      Example request

      
      curl --request POST \
      --url 'https://usX.api.mailchimp.com/3.0/ecommerce/stores/MC001/orders/ord0001/lines' \
      --user 'anystring:apikey' \
      --header 'content-type: application/json' \
      --data '{"id":"L002", "product_id":"PROD001", "product_variant_id":"PROD001B", "quantity":1,"price":"5"}' \
      --include
                                      

      Example response

      
      HTTP/1.1 200 OK
      Server: nginx
      Date: Thu, 12 May 2016 13:47:06 GMT
      Content-Type: application/json; charset=utf-8
      Content-Length: 971
      Connection: keep-alive
      Vary: Accept-Encoding
      X-Request-Id: c6958163-de63-4db0-a3c1-127fc890574f
      Link: <https://api.mailchimp.com/schema/3.0/Ecommerce/Stores/Orders/Lines/Instance.json>; rel="describedBy"
      
      {
        "id": "L002",
        "product_id": "PROD001",
        "product_title": "Freddie's Jokes",
        "product_variant_id": "PROD001B",
        "product_variant_title": "Freddie's Jokes Volume 2",
        "quantity": 1,
        "price": 5,
        "_links": [
          {
            "rel": "self",
            "href": "https://usX.api.mailchimp.com/3.0/ecommerce/stores/MC001/orders/ord0001/lines/L002",
            "method": "GET",
            "targetSchema": "https://api.mailchimp.com/schema/3.0/Ecommerce/Stores/Orders/Lines/Instance.json"
          },
          {
            "rel": "parent",
            "href": "https://usX.api.mailchimp.com/3.0/ecommerce/stores/MC001/orders/ord0001",
            "method": "GET",
            "targetSchema": "https://api.mailchimp.com/schema/3.0/Ecommerce/Stores/Orders/Collection.json"
          },
          {
            "rel": "update",
            "href": "https://usX.api.mailchimp.com/3.0/ecommerce/stores/MC001/orders/ord0001/lines/L002",
            "method": "PATCH",
            "schema": "https://api.mailchimp.com/schema/3.0/Ecommerce/Stores/Orders/Lines/Instance.json"
          },
          {
            "rel": "delete",
            "href": "https://usX.api.mailchimp.com/3.0/ecommerce/stores/MC001/orders/ord0001/lines/L002",
            "method": "DELETE"
          }
        ]
      }
                                      

      Error response

      type Type: String Title: Problem Type Read only: false An absolute URI that identifies the problem type. When dereferenced, it should provide human-readable documentation for the problem type.
      title Type: String Title: Error Title Read only: false A short, human-readable summary of the problem type. It shouldn’t change based on the occurrence of the problem, except for purposes of localization.
      status Type: Integer Title: HTTP Status Code Read only: false The HTTP status code (RFC2616, Section 6) generated by the origin server for this occurrence of the problem.
      detail Type: String Title: Error Message Read only: false A human-readable explanation specific to this occurrence of the problem. Learn more about errors.
      instance Type: String Title: Instance ID Read only: false A string that identifies this specific occurrence of the problem. Please provide this ID when contacting support.
    • GET /ecommerce/stores/{store_id}/orders/{order_id}/lines Get information about an order’s line items.
      GET /ecommerce/stores/{store_id}/orders/{order_id}/lines/{line_id} Get information about a specific order line item

      Get information about an order's line items.

      GET /ecommerce/stores/{store_id}/orders/{order_id}/lines

      Get information about an order’s line items.

      Path parameters

      store_id The store id.
      order_id The id for the order in a store.

      Query string parameters

      fields Type: Array Title: Fields Read only: false A comma-separated list of fields to return. Reference parameters of sub-objects with dot notation.
      exclude_fields Type: Array Title: Exclude Fields Read only: false A comma-separated list of fields to exclude. Reference parameters of sub-objects with dot notation.
      count Type: Integer Title: Count Read only: true The number of records to return. Default value is 10.
      offset Type: Integer Title: Offset Read only: false The number of records from a collection to skip. Iterating over large collections with this parameter can be slow. Default value is 0.

      Response body parameters

      store_id Type: String Title: Store ID Read only: false The store id.
      order_id Type: String Title: Order ID Read only: false The order id.
      lines Type: Array Title: Ecommerce Order Lines Read only: false An array of objects, each representing an order’s line item.
      Show properties
      id Type: String Title: Order Line Item Foreign ID Read only: true A unique identifier for the order line item.
      product_id Type: String Title: Order Line Item Product Foreign ID Read only: false A unique identifier for the product associated with the order line item.
      product_title Type: String Title: Order Line Item Product Title Read only: true The name of the product for the order line item.
      product_variant_id Type: String Title: Order Line Item Product Variant Foreign ID Read only: false A unique identifier for the product variant associated with the order line item.
      product_variant_title Type: String Title: Order Line Item Product Variant Title Read only: true The name of the product variant for the order line item.
      quantity Type: Integer Title: Quantity Read only: false The quantity of an order line item.
      price Type: Number Title: Price Read only: false The price of an order line item.
      discount Type: Number Title: Discount Read only: false The total discount amount applied to this line item.
      _links Type: Array Title: Links Read only: true A list of link types and descriptions for the API schema documents.
      Show properties
      rel Type: String Title: Rel Read only: true As with an HTML ‘rel’ attribute, this describes the type of link.
      href Type: String Title: Href Read only: true This property contains a fully-qualified URL that can be called to retrieve the linked resource or perform the linked action.
      method Type: String Title: Method Read only: true The HTTP method that should be used when accessing the URL defined in ‘href’.
      Possible Values:
      • GET
      • POST
      • PUT
      • PATCH
      • DELETE
      • OPTIONS
      • HEAD
      targetSchema Type: String Title: Target Schema Read only: true For GETs, this is a URL representing the schema that the response should conform to.
      schema Type: String Title: Schema Read only: true For HTTP methods that can receive bodies (POST and PUT), this is a URL representing the schema that the body should conform to.
      total_items Type: Integer Title: Item Count Read only: false The total number of items matching the query regardless of pagination.
      _links Type: Array Title: Links Read only: true A list of link types and descriptions for the API schema documents.
      Show properties
      rel Type: String Title: Rel Read only: true As with an HTML ‘rel’ attribute, this describes the type of link.
      href Type: String Title: Href Read only: true This property contains a fully-qualified URL that can be called to retrieve the linked resource or perform the linked action.
      method Type: String Title: Method Read only: true The HTTP method that should be used when accessing the URL defined in ‘href’.
      Possible Values:
      • GET
      • POST
      • PUT
      • PATCH
      • DELETE
      • OPTIONS
      • HEAD
      targetSchema Type: String Title: Target Schema Read only: true For GETs, this is a URL representing the schema that the response should conform to.
      schema Type: String Title: Schema Read only: true For HTTP methods that can receive bodies (POST and PUT), this is a URL representing the schema that the body should conform to.

      Example request

      
      curl --request GET \
      --url 'https://usX.api.mailchimp.com/3.0/ecommerce/stores/MC001/orders/ord0001/lines' \
      --user 'anystring:apikey' \
      --include
                                      

      Example response

      
      HTTP/1.1 200 OK
      Server: nginx
      Date: Wed, 10 Feb 2016 16:53:59 GMT
      Content-Type: application/json; charset=utf-8
      Content-Length: 1132
      Connection: keep-alive
      Vary: Accept-Encoding
      X-Request-Id: 463170be-3ab0-4512-8cc4-a5890a926823
      Link: <https://api.mailchimp.com/schema/3.0/Ecommerce/Stores/Orders/Lines/Collection.json>; rel="describedBy"
      
      {
        "store_id": "MC001",
        "order_id": "ord0001",
        "lines": [
          {
            "id": "L001",
            "product_id": "PROD001",
            "product_title": "Freddie's Jokes",
            "product_variant_id": "PROD001A",
            "product_variant_title": "Freddie's Jokes Volume 1",
            "quantity": 2,
            "price": 10,
            "_links": [
              {
                "rel": "self",
                "href": "https://usX.api.mailchimp.com/3.0/ecommerce/stores/MC001/orders/ord0001/lines/L001",
                "method": "GET",
                "targetSchema": "https://api.mailchimp.com/schema/3.0/Ecommerce/Stores/Orders/Lines/Instance.json"
              },
              {
                "rel": "parent",
                "href": "https://usX.api.mailchimp.com/3.0/ecommerce/stores/MC001/orders/ord0001",
                "method": "GET",
                "targetSchema": "https://api.mailchimp.com/schema/3.0/Ecommerce/Stores/Orders/Collection.json"
              }
            ]
          }
        ],
        "total_items": 1,
        "_links": [
          {
            "rel": "self",
            "href": "https://usX.api.mailchimp.com/3.0/ecommerce/stores/MC001/orders/ord0001/lines",
            "method": "GET",
            "targetSchema": "https://api.mailchimp.com/schema/3.0/Ecommerce/Stores/Orders/Lines/Collection.json"
          },
          {
            "rel": "parent",
            "href": "https://usX.api.mailchimp.com/3.0/ecommerce/stores/MC001/orders/ord0001",
            "method": "GET",
            "targetSchema": "https://api.mailchimp.com/schema/3.0/Ecommerce/Stores/Orders/Instance.json"
          }
        ]
      }
                                      

      Error response

      type Type: String Title: Problem Type Read only: false An absolute URI that identifies the problem type. When dereferenced, it should provide human-readable documentation for the problem type.
      title Type: String Title: Error Title Read only: false A short, human-readable summary of the problem type. It shouldn’t change based on the occurrence of the problem, except for purposes of localization.
      status Type: Integer Title: HTTP Status Code Read only: false The HTTP status code (RFC2616, Section 6) generated by the origin server for this occurrence of the problem.
      detail Type: String Title: Error Message Read only: false A human-readable explanation specific to this occurrence of the problem. Learn more about errors.
      instance Type: String Title: Instance ID Read only: false A string that identifies this specific occurrence of the problem. Please provide this ID when contacting support.

      Get information about a specific order line item

      GET /ecommerce/stores/{store_id}/orders/{order_id}/lines/{line_id}

      Get information about a specific order line item.

      Path parameters

      store_id The store id.
      order_id The id for the order in a store.
      line_id The id for the line item of an order.

      Query string parameters

      fields Type: Array Title: Fields Read only: false A comma-separated list of fields to return. Reference parameters of sub-objects with dot notation.
      exclude_fields Type: Array Title: Exclude Fields Read only: false A comma-separated list of fields to exclude. Reference parameters of sub-objects with dot notation.

      Response body parameters

      id Type: String Title: Order Line Item Foreign ID Read only: true A unique identifier for the order line item.
      product_id Type: String Title: Order Line Item Product Foreign ID Read only: false A unique identifier for the product associated with the order line item.
      product_title Type: String Title: Order Line Item Product Title Read only: true The name of the product for the order line item.
      product_variant_id Type: String Title: Order Line Item Product Variant Foreign ID Read only: false A unique identifier for the product variant associated with the order line item.
      product_variant_title Type: String Title: Order Line Item Product Variant Title Read only: true The name of the product variant for the order line item.
      quantity Type: Integer Title: Quantity Read only: false The quantity of an order line item.
      price Type: Number Title: Price Read only: false The price of an order line item.
      discount Type: Number Title: Discount Read only: false The total discount amount applied to this line item.
      _links Type: Array Title: Links Read only: true A list of link types and descriptions for the API schema documents.
      Show properties
      rel Type: String Title: Rel Read only: true As with an HTML ‘rel’ attribute, this describes the type of link.
      href Type: String Title: Href Read only: true This property contains a fully-qualified URL that can be called to retrieve the linked resource or perform the linked action.
      method Type: String Title: Method Read only: true The HTTP method that should be used when accessing the URL defined in ‘href’.
      Possible Values:
      • GET
      • POST
      • PUT
      • PATCH
      • DELETE
      • OPTIONS
      • HEAD
      targetSchema Type: String Title: Target Schema Read only: true For GETs, this is a URL representing the schema that the response should conform to.
      schema Type: String Title: Schema Read only: true For HTTP methods that can receive bodies (POST and PUT), this is a URL representing the schema that the body should conform to.

      Example request

      
      curl --request GET \
      --url 'https://usX.api.mailchimp.com/3.0/ecommerce/stores/MC001/orders/ord0001/lines/L001' \
      --user 'anystring:apikey' \
      --include
                                      

      Example response

      
      HTTP/1.1 200 OK
      Server: nginx
      Date: Wed, 10 Feb 2016 16:54:48 GMT
      Content-Type: application/json; charset=utf-8
      Content-Length: 623
      Connection: keep-alive
      Vary: Accept-Encoding
      X-Request-Id: acb2a115-2e00-47c6-8913-a8f45110ef52
      Link: <https://api.mailchimp.com/schema/3.0/Ecommerce/Stores/Orders/Lines/Instance.json>; rel="describedBy"
      
      {
        "id": "L001",
        "product_id": "PROD001",
        "product_title": "Freddie's Jokes",
        "product_variant_id": "PROD001A",
        "product_variant_title": "Freddie's Jokes Volume 1",
        "quantity": 2,
        "price": 10,
        "_links": [
          {
            "rel": "self",
            "href": "https://usX.api.mailchimp.com/3.0/ecommerce/stores/MC001/orders/ord0001/lines/L001",
            "method": "GET",
            "targetSchema": "https://api.mailchimp.com/schema/3.0/Ecommerce/Stores/Orders/Lines/Instance.json"
          },
          {
            "rel": "parent",
            "href": "https://usX.api.mailchimp.com/3.0/ecommerce/stores/MC001/orders/ord0001",
            "method": "GET",
            "targetSchema": "https://api.mailchimp.com/schema/3.0/Ecommerce/Stores/Orders/Collection.json"
          }
        ]
      }
                                      

      Error response

      type Type: String Title: Problem Type Read only: false An absolute URI that identifies the problem type. When dereferenced, it should provide human-readable documentation for the problem type.
      title Type: String Title: Error Title Read only: false A short, human-readable summary of the problem type. It shouldn’t change based on the occurrence of the problem, except for purposes of localization.
      status Type: Integer Title: HTTP Status Code Read only: false The HTTP status code (RFC2616, Section 6) generated by the origin server for this occurrence of the problem.
      detail Type: String Title: Error Message Read only: false A human-readable explanation specific to this occurrence of the problem. Learn more about errors.
      instance Type: String Title: Instance ID Read only: false A string that identifies this specific occurrence of the problem. Please provide this ID when contacting support.
    • Update a specific order line item

      PATCH /ecommerce/stores/{store_id}/orders/{order_id}/lines/{line_id}

      Update a specific order line item.

      Path parameters

      store_id The store id.
      order_id The id for the order in a store.
      line_id The id for the line item of an order.

      Request body parameters

      product_id Type: String Title: Order Line Item Product Foreign ID Read only: false A unique identifier for the product associated with the order line item.
      product_variant_id Type: String Title: Order Line Item Product Variant Foreign ID Read only: false A unique identifier for the product variant associated with the order line item.
      quantity Type: Integer Title: Quantity Read only: false The quantity of an order line item.
      price Type: Number Title: Price Read only: false The price of an order line item.
      discount Type: Number Title: Discount Read only: false The total discount amount applied to this line item.

      Response body parameters

      id Type: String Title: Order Line Item Foreign ID Read only: true A unique identifier for the order line item.
      product_id Type: String Title: Order Line Item Product Foreign ID Read only: false A unique identifier for the product associated with the order line item.
      product_title Type: String Title: Order Line Item Product Title Read only: true The name of the product for the order line item.
      product_variant_id Type: String Title: Order Line Item Product Variant Foreign ID Read only: false A unique identifier for the product variant associated with the order line item.
      product_variant_title Type: String Title: Order Line Item Product Variant Title Read only: true The name of the product variant for the order line item.
      quantity Type: Integer Title: Quantity Read only: false The quantity of an order line item.
      price Type: Number Title: Price Read only: false The price of an order line item.
      discount Type: Number Title: Discount Read only: false The total discount amount applied to this line item.
      _links Type: Array Title: Links Read only: true A list of link types and descriptions for the API schema documents.
      Show properties
      rel Type: String Title: Rel Read only: true As with an HTML ‘rel’ attribute, this describes the type of link.
      href Type: String Title: Href Read only: true This property contains a fully-qualified URL that can be called to retrieve the linked resource or perform the linked action.
      method Type: String Title: Method Read only: true The HTTP method that should be used when accessing the URL defined in ‘href’.
      Possible Values:
      • GET
      • POST
      • PUT
      • PATCH
      • DELETE
      • OPTIONS
      • HEAD
      targetSchema Type: String Title: Target Schema Read only: true For GETs, this is a URL representing the schema that the response should conform to.
      schema Type: String Title: Schema Read only: true For HTTP methods that can receive bodies (POST and PUT), this is a URL representing the schema that the body should conform to.

      Example request

      
      curl --request PATCH \
      --url 'https://usX.api.mailchimp.com/3.0/ecommerce/stores/MC001/orders/ord05/lines/123abc' \
      --user 'anystring:apikey' \
      --header 'content-type: application/json' \
      --data '{"id": "ORD005", "product_id": "PROD001", "product_title": "Freddie'\''s Jokes", "product_variant_id": "PROD001B", "product_variant_title": "Freddie'\''s Jokes Volume 2", "quantity": 2, "price": 1.25}' \
      --include
                                      

      Example response

      
      HTTP/1.1 200 OK
      Server: nginx
      Date: Wed, 30 Mar 2016 20:33:47 GMT
      Content-Type: application/json; charset=utf-8
      Content-Length: 974
      Connection: keep-alive
      Vary: Accept-Encoding
      X-Request-Id: c92348a4-526a-44ad-b5af-44a28d08f24b
      Link: <https://api.mailchimp.com/schema/3.0/Ecommerce/Stores/Orders/Lines/Instance.json>; rel="describedBy"
      
      {
        "id": "ORD005",
        "product_id": "PROD001",
        "product_title": "Freddie's Jokes",
        "product_variant_id": "PROD001B",
        "product_variant_title": "Freddie's Jokes Volume 2",
        "quantity": 2,
        "price": 1.25,
        "_links": [
          {
            "rel": "self",
            "href": "https://usX.api.mailchimp.com/3.0/ecommerce/stores/MC001/orders/ord05/lines/ORD005",
            "method": "GET",
            "targetSchema": "https://api.mailchimp.com/schema/3.0/Ecommerce/Stores/Orders/Lines/Instance.json"
          },
          {
            "rel": "parent",
            "href": "https://usX.api.mailchimp.com/3.0/ecommerce/stores/MC001/orders/ord05",
            "method": "GET",
            "targetSchema": "https://api.mailchimp.com/schema/3.0/Ecommerce/Stores/Orders/Collection.json"
          },
          {
            "rel": "update",
            "href": "https://usX.api.mailchimp.com/3.0/ecommerce/stores/MC001/orders/ord05/lines/ORD005",
            "method": "PATCH",
            "schema": "https://api.mailchimp.com/schema/3.0/Ecommerce/Stores/Orders/Lines/Instance.json"
          },
          {
            "rel": "delete",
            "href": "https://usX.api.mailchimp.com/3.0/ecommerce/stores/MC001/orders/ord05/lines/ORD005",
            "method": "DELETE"
          }
        ]
      }
                                      

      Error response

      type Type: String Title: Problem Type Read only: false An absolute URI that identifies the problem type. When dereferenced, it should provide human-readable documentation for the problem type.
      title Type: String Title: Error Title Read only: false A short, human-readable summary of the problem type. It shouldn’t change based on the occurrence of the problem, except for purposes of localization.
      status Type: Integer Title: HTTP Status Code Read only: false The HTTP status code (RFC2616, Section 6) generated by the origin server for this occurrence of the problem.
      detail Type: String Title: Error Message Read only: false A human-readable explanation specific to this occurrence of the problem. Learn more about errors.
      instance Type: String Title: Instance ID Read only: false A string that identifies this specific occurrence of the problem. Please provide this ID when contacting support.
    • Delete a specific order line item

      DELETE /ecommerce/stores/{store_id}/orders/{order_id}/lines/{line_id}

      Delete a specific order line item.

      Path parameters

      store_id The store id.
      order_id The id for the order in a store.
      line_id The id for the line item of an order.

      Example request

      
      curl --request DELETE \
      --url 'https://usX.api.mailchimp.com/3.0/ecommerce/stores/MC001/orders/ord0006/lines/L002' \
      --user 'anystring:apikey' \
      --include
                                      

      Example response

      
      HTTP/1.1 204 No Content
      Server: nginx
      Date: Wed, 30 Mar 2016 20:39:51 GMT
      Content-Type: application/json; charset=utf-8
      Content-Length: 0
      Connection: keep-alive
      X-Request-Id: a0ecb889-371c-401f-bce2-78063aa6f928
                                      

      Error response

      type Type: String Title: Problem Type Read only: false An absolute URI that identifies the problem type. When dereferenced, it should provide human-readable documentation for the problem type.
      title Type: String Title: Error Title Read only: false A short, human-readable summary of the problem type. It shouldn’t change based on the occurrence of the problem, except for purposes of localization.
      status Type: Integer Title: HTTP Status Code Read only: false The HTTP status code (RFC2616, Section 6) generated by the origin server for this occurrence of the problem.
      detail Type: String Title: Error Message Read only: false A human-readable explanation specific to this occurrence of the problem. Learn more about errors.
      instance Type: String Title: Instance ID Read only: false A string that identifies this specific occurrence of the problem. Please provide this ID when contacting support.