{"id":1907,"date":"2021-12-30T19:19:53","date_gmt":"2021-12-31T02:19:53","guid":{"rendered":"https:\/\/wpdatasync.com\/?post_type=wp_data_sync_doc&#038;p=1907"},"modified":"2021-12-31T12:17:24","modified_gmt":"2021-12-31T19:17:24","slug":"order-mapping-path","status":"publish","type":"wp_data_sync_doc","link":"https:\/\/wpdatasync.com\/documentation\/order-mapping-path\/","title":{"rendered":"Order Mapping &#8211; Path"},"content":{"rendered":"\n<p>When mapping an order, we must define the path to create the data object to send an order to a remote API. We use a method named Dot Notation.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What is Dot Notation?<\/h2>\n\n\n\n<p>Dot Notation is one way to access a property of an object. To use dot notation, write the name of the object, followed by a dot (.), followed by the name of the property.<\/p>\n\n\n\n<p>The WP Data Sync API extends Dot Notation with <code>[i]<\/code> to create the items for our request body.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Path Mapping<\/h2>\n\n\n\n<p>Path mapping is done by using the object keys. The correct format should be provided in your remote API documentation.<\/p>\n\n\n\n<p>Since a single order can contain multiple items. There are 2 methods to map items for an order.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Path Mapping Methods<\/h3>\n\n\n\n<ol class=\"wp-block-list\"><li><a href=\"#multiple-item-request\">Multiple Item Request<\/a><\/li><li><a href=\"#single-item-request\">Single Item Request<\/a><\/li><\/ol>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"multiple-item-request\">Multiple Item Request<\/h2>\n\n\n\n<p>A multiple item request sends all items in a single request.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Example: Multiple Item Request Object<\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n{\n    &quot;Order&quot;: {\n        &quot;FullName&quot;: &quot;Shipping Full Name&quot;,\n        &quot;Address&quot;: &quot;123 E Main St&quot;,\n        &quot;City&quot;: &quot;Scottsdale&quot;,\n        &quot;State&quot;: &quot;AZ&quot;,\n        &quot;Zip&quot;: &quot;85250&quot;,\n        &quot;Company&quot;: &quot;WP Data Sync&quot;,\n        &quot;Items&quot;: &#x5B;\n            {\n                &quot;ProductName&quot;: &quot;Product Name&quot;,\n                &quot;ProductID&quot;: 121,\n                &quot;Quantity&quot;: 1,\n                &quot;Price&quot;: &quot;12.66&quot;,\n                &quot;ShippingMethod&quot;: &quot;Standard Shipping&quot;\n            },\n            {\n                &quot;ProductName&quot;: &quot;Product Name 2&quot;,\n                &quot;ProductID&quot;: 1234,\n                &quot;Quantity&quot;: 1,\n                &quot;Price&quot;: &quot;17.66&quot;,\n                &quot;ShippingMethod&quot;: &quot;Standard Shipping&quot;\n            }\n        ]\n    }\n}\n<\/pre><\/div>\n\n\n<h4 class=\"wp-block-heading\">Paths for example multiple item request object<\/h4>\n\n\n\n<ul class=\"wp-block-list\"><li>Order.FullName<\/li><li>Order.Address<\/li><li>Order.City<\/li><li>Order.State<\/li><li>Order.Zip<\/li><li>Order.Company<\/li><li>Order.Items.[i].ProductName<\/li><li>Order.Items.[i].ProductID<\/li><li>Order.Items.[i].Quantity<\/li><li>Order.Items.[i].Price<\/li><li>Order.Items.[i].ShippingMethod<\/li><\/ul>\n\n\n\n<p><strong>NOTE<\/strong>: The <code>[i]<\/code> notation is used to define an item object. This instructs the WPDS API to create an item object for each item in the order.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"single-item-request\">Single Item Request<\/h2>\n\n\n\n<p>A single item request sends one item in multiple requests.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Example: Single Item Request Object<\/h3>\n\n\n\n<p>Each of the 2 item objects will be sent in a separate request.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n{\n    &quot;FullName&quot;: &quot;Shipping Full Name&quot;,\n    &quot;Address&quot;: &quot;123 E Main St&quot;,\n    &quot;City&quot;: &quot;Scottsdale&quot;,\n    &quot;State&quot;: &quot;AZ&quot;,\n    &quot;Zip&quot;: &quot;85250&quot;,\n    &quot;Company&quot;: &quot;WP Data Sync&quot;,\n    &quot;Item&quot;: {\n        &quot;productName&quot;: &quot;Items - Product Name&quot;,\n        &quot;productID&quot;: 121,\n        &quot;quantity&quot;: 1,\n        &quot;price&quot;: &quot;12.66&quot;,\n        &quot;shippingMethod&quot;: &quot;Standard Shipping&quot;\n    }\n},\n{\n    &quot;FullName&quot;: &quot;Shipping Full Name&quot;,\n    &quot;Address&quot;: &quot;123 E Main St&quot;,\n    &quot;City&quot;: &quot;Scottsdale&quot;,\n    &quot;State&quot;: &quot;AZ&quot;,\n    &quot;Zip&quot;: &quot;85250&quot;,\n    &quot;Company&quot;: &quot;WP Data Sync&quot;,\n    &quot;Item&quot;: {\n        &quot;productName&quot;: &quot;Items - Product Name 2&quot;,\n        &quot;productID&quot;: 1234,\n        &quot;quantity&quot;: 1,\n        &quot;price&quot;: &quot;17.66&quot;,\n        &quot;shippingMethod&quot;: &quot;Standard Shipping&quot;\n    }\n}\n<\/pre><\/div>\n\n\n<h4 class=\"wp-block-heading\">Paths for example single item request object<\/h4>\n\n\n\n<ul class=\"wp-block-list\"><li>[i].FullName<\/li><li>[i].Address<\/li><li>[i].City<\/li><li>[i].State<\/li><li>[i].Zip<\/li><li>[i].Company<\/li><li>[i].Item.ProductName<\/li><li>[i].Item.ProductID<\/li><li>[i].Item.Quantity<\/li><li>[i].Item.Price<\/li><li>[i].Item.ShippingMethod<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Order Mapping UI<\/h2>\n\n\n\n<p>Create the order map paths in the easy to use order mapping UI. See the screenshot below for an example. Once your paths are saved. You can use the request test feature to check for the correct order object format.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized is-style-default\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/wpdatasync.com\/wp-content\/uploads\/2021\/12\/wp-data-sync-order-mapping-path-1024x494.png\" alt=\"Order Mapping UI\" class=\"wp-image-1924\" width=\"1024\" height=\"494\" srcset=\"https:\/\/wpdatasync.com\/wp-content\/uploads\/2021\/12\/wp-data-sync-order-mapping-path-1024x494.png 1024w, https:\/\/wpdatasync.com\/wp-content\/uploads\/2021\/12\/wp-data-sync-order-mapping-path-400x193.png 400w, https:\/\/wpdatasync.com\/wp-content\/uploads\/2021\/12\/wp-data-sync-order-mapping-path-300x145.png 300w, https:\/\/wpdatasync.com\/wp-content\/uploads\/2021\/12\/wp-data-sync-order-mapping-path-768x371.png 768w, https:\/\/wpdatasync.com\/wp-content\/uploads\/2021\/12\/wp-data-sync-order-mapping-path-1536x742.png 1536w, https:\/\/wpdatasync.com\/wp-content\/uploads\/2021\/12\/wp-data-sync-order-mapping-path-2048x989.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n","protected":false},"parent":0,"template":"","doc_type":[65],"class_list":{"0":"post-1907","1":"wp_data_sync_doc","2":"type-wp_data_sync_doc","3":"status-publish","5":"doc_type-getting-started","6":"entry"},"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v25.7.1 (Yoast SEO v26.6) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Order Mapping - Path - WP Data Sync<\/title>\n<meta name=\"description\" content=\"Developer Documentation - Order Mapping - Path - WP Data Sync is a developer friendly plugin\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/wpdatasync.com\/documentation\/order-mapping-path\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Order Mapping - Path\" \/>\n<meta property=\"og:description\" content=\"Developer Documentation - Order Mapping - Path - WP Data Sync is a developer friendly plugin\" \/>\n<meta property=\"og:url\" content=\"https:\/\/wpdatasync.com\/documentation\/order-mapping-path\/\" \/>\n<meta property=\"og:site_name\" content=\"WP Data Sync\" \/>\n<meta property=\"article:modified_time\" content=\"2021-12-31T19:17:24+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/wpdatasync.com\/wp-content\/uploads\/2021\/12\/wp-data-sync-order-mapping-path-1024x494.png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/wpdatasync.com\/documentation\/order-mapping-path\/\",\"url\":\"https:\/\/wpdatasync.com\/documentation\/order-mapping-path\/\",\"name\":\"Order Mapping - Path - WP Data Sync\",\"isPartOf\":{\"@id\":\"https:\/\/wpdatasync.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/wpdatasync.com\/documentation\/order-mapping-path\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/wpdatasync.com\/documentation\/order-mapping-path\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/wpdatasync.com\/wp-content\/uploads\/2021\/12\/wp-data-sync-order-mapping-path-1024x494.png\",\"datePublished\":\"2021-12-31T02:19:53+00:00\",\"dateModified\":\"2021-12-31T19:17:24+00:00\",\"description\":\"Developer Documentation - Order Mapping - Path - WP Data Sync is a developer friendly plugin\",\"breadcrumb\":{\"@id\":\"https:\/\/wpdatasync.com\/documentation\/order-mapping-path\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/wpdatasync.com\/documentation\/order-mapping-path\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/wpdatasync.com\/documentation\/order-mapping-path\/#primaryimage\",\"url\":\"https:\/\/wpdatasync.com\/wp-content\/uploads\/2021\/12\/wp-data-sync-order-mapping-path.png\",\"contentUrl\":\"https:\/\/wpdatasync.com\/wp-content\/uploads\/2021\/12\/wp-data-sync-order-mapping-path.png\",\"width\":3194,\"height\":1542},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/wpdatasync.com\/documentation\/order-mapping-path\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/wpdatasync.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Documentation\",\"item\":\"https:\/\/wpdatasync.com\/documentation\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Getting Started\",\"item\":\"https:\/\/wpdatasync.com\/documentation-type\/getting-started\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Order Mapping &#8211; Path\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/wpdatasync.com\/#website\",\"url\":\"https:\/\/wpdatasync.com\/\",\"name\":\"WP Data Sync\",\"description\":\"The only data sync API for WordPress websites.\",\"publisher\":{\"@id\":\"https:\/\/wpdatasync.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/wpdatasync.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/wpdatasync.com\/#organization\",\"name\":\"WP Data Sync\",\"url\":\"https:\/\/wpdatasync.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/wpdatasync.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/wpdatasync.com\/wp-content\/uploads\/2020\/10\/poster.png\",\"contentUrl\":\"https:\/\/wpdatasync.com\/wp-content\/uploads\/2020\/10\/poster.png\",\"width\":3480,\"height\":2160,\"caption\":\"WP Data Sync\"},\"image\":{\"@id\":\"https:\/\/wpdatasync.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.linkedin.com\/company\/70502156\/admin\/\",\"https:\/\/www.youtube.com\/channel\/UCTWNRGTGaZRO2S3BRAbjY8w\"]}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Order Mapping - Path - WP Data Sync","description":"Developer Documentation - Order Mapping - Path - WP Data Sync is a developer friendly plugin","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/wpdatasync.com\/documentation\/order-mapping-path\/","og_locale":"en_US","og_type":"article","og_title":"Order Mapping - Path","og_description":"Developer Documentation - Order Mapping - Path - WP Data Sync is a developer friendly plugin","og_url":"https:\/\/wpdatasync.com\/documentation\/order-mapping-path\/","og_site_name":"WP Data Sync","article_modified_time":"2021-12-31T19:17:24+00:00","og_image":[{"url":"https:\/\/wpdatasync.com\/wp-content\/uploads\/2021\/12\/wp-data-sync-order-mapping-path-1024x494.png","type":"","width":"","height":""}],"twitter_card":"summary_large_image","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/wpdatasync.com\/documentation\/order-mapping-path\/","url":"https:\/\/wpdatasync.com\/documentation\/order-mapping-path\/","name":"Order Mapping - Path - WP Data Sync","isPartOf":{"@id":"https:\/\/wpdatasync.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/wpdatasync.com\/documentation\/order-mapping-path\/#primaryimage"},"image":{"@id":"https:\/\/wpdatasync.com\/documentation\/order-mapping-path\/#primaryimage"},"thumbnailUrl":"https:\/\/wpdatasync.com\/wp-content\/uploads\/2021\/12\/wp-data-sync-order-mapping-path-1024x494.png","datePublished":"2021-12-31T02:19:53+00:00","dateModified":"2021-12-31T19:17:24+00:00","description":"Developer Documentation - Order Mapping - Path - WP Data Sync is a developer friendly plugin","breadcrumb":{"@id":"https:\/\/wpdatasync.com\/documentation\/order-mapping-path\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/wpdatasync.com\/documentation\/order-mapping-path\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/wpdatasync.com\/documentation\/order-mapping-path\/#primaryimage","url":"https:\/\/wpdatasync.com\/wp-content\/uploads\/2021\/12\/wp-data-sync-order-mapping-path.png","contentUrl":"https:\/\/wpdatasync.com\/wp-content\/uploads\/2021\/12\/wp-data-sync-order-mapping-path.png","width":3194,"height":1542},{"@type":"BreadcrumbList","@id":"https:\/\/wpdatasync.com\/documentation\/order-mapping-path\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/wpdatasync.com\/"},{"@type":"ListItem","position":2,"name":"Documentation","item":"https:\/\/wpdatasync.com\/documentation\/"},{"@type":"ListItem","position":3,"name":"Getting Started","item":"https:\/\/wpdatasync.com\/documentation-type\/getting-started\/"},{"@type":"ListItem","position":4,"name":"Order Mapping &#8211; Path"}]},{"@type":"WebSite","@id":"https:\/\/wpdatasync.com\/#website","url":"https:\/\/wpdatasync.com\/","name":"WP Data Sync","description":"The only data sync API for WordPress websites.","publisher":{"@id":"https:\/\/wpdatasync.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/wpdatasync.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/wpdatasync.com\/#organization","name":"WP Data Sync","url":"https:\/\/wpdatasync.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/wpdatasync.com\/#\/schema\/logo\/image\/","url":"https:\/\/wpdatasync.com\/wp-content\/uploads\/2020\/10\/poster.png","contentUrl":"https:\/\/wpdatasync.com\/wp-content\/uploads\/2020\/10\/poster.png","width":3480,"height":2160,"caption":"WP Data Sync"},"image":{"@id":"https:\/\/wpdatasync.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.linkedin.com\/company\/70502156\/admin\/","https:\/\/www.youtube.com\/channel\/UCTWNRGTGaZRO2S3BRAbjY8w"]}]}},"_links":{"self":[{"href":"https:\/\/wpdatasync.com\/wp-json\/wp\/v2\/wp_data_sync_doc\/1907","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wpdatasync.com\/wp-json\/wp\/v2\/wp_data_sync_doc"}],"about":[{"href":"https:\/\/wpdatasync.com\/wp-json\/wp\/v2\/types\/wp_data_sync_doc"}],"wp:attachment":[{"href":"https:\/\/wpdatasync.com\/wp-json\/wp\/v2\/media?parent=1907"}],"wp:term":[{"taxonomy":"doc_type","embeddable":true,"href":"https:\/\/wpdatasync.com\/wp-json\/wp\/v2\/doc_type?post=1907"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}