{"_id":"58112e72ded0340f0085d04e","category":{"_id":"58112e72ded0340f0085d033","project":"551e85be610f400d00837db7","version":"58112e71ded0340f0085d02a","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-09-25T13:57:54.835Z","from_sync":false,"order":8,"slug":"api-resources","title":"Merchant API Resources"},"parentDoc":null,"__v":0,"version":{"_id":"58112e71ded0340f0085d02a","project":"551e85be610f400d00837db7","__v":4,"createdAt":"2016-10-26T22:30:09.862Z","releaseDate":"2016-10-26T22:30:09.862Z","categories":["58112e72ded0340f0085d02b","58112e72ded0340f0085d02c","58112e72ded0340f0085d02d","58112e72ded0340f0085d02e","58112e72ded0340f0085d02f","58112e72ded0340f0085d030","58112e72ded0340f0085d031","58112e72ded0340f0085d032","58112e72ded0340f0085d033","58112e72ded0340f0085d034","581137cc604d3c230048b7e4","58dc367221742d0f00a73f98","590768e54669da0f00db5c0b"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"new designer","version_clean":"2.0.0","version":"2.0"},"project":"551e85be610f400d00837db7","user":"55f2fd49b5b25021002b7dfd","updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-11-24T15:37:01.728Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":2,"body":"# Properties\n[block:html]\n{\n  \"html\": \"<div class=\\\"property-table-wrap\\\">\\n    <table class=\\\"property-table\\\">\\n        <thead>\\n            <tr>\\n                <th class=\\\"prop-col\\\">Property</th>\\n                <th class=\\\"filter-col\\\">Filter</th>\\n                <th class=\\\"editable-col\\\">Edit</th>\\n                <th class=\\\"type-col\\\">Type</th>\\n                <th class=\\\"description-col\\\">Description</th>\\n            </tr>\\n        </thead>\\n\\n        <tbody class=\\\"properties\\\">\\n\\n            <tr class=\\\"fil ro\\\">\\n                <td class=\\\"prop-col\\\">id</td>\\n                <td class=\\\"filter-col\\\"></td>\\n                <td class=\\\"editable-col\\\"></td>\\n                <td class=\\\"type-col\\\">INT</td>\\n                <td class=\\\"description-col\\\">Unique identifier</td>\\n            </tr>\\n\\n            <tr class=\\\"ro\\\">\\n                <td class=\\\"prop-col\\\">country</td>\\n                <td class=\\\"filter-col\\\"></td>\\n                <td class=\\\"editable-col\\\"></td>\\n                <td class=\\\"type-col\\\">STRING</td>\\n                <td class=\\\"description-col\\\">Two letter country code for the customer as determined by the primary address</td>\\n            </tr>\\n\\n            <tr class=\\\"fil rw\\\">\\n                <td class=\\\"prop-col\\\">email</td>\\n                <td class=\\\"filter-col\\\"></td>\\n                <td class=\\\"editable-col\\\"></td>\\n                <td class=\\\"type-col\\\">STRING</td>\\n                <td class=\\\"description-col\\\">The customer's email address</td>\\n            </tr>\\n\\n            <tr class=\\\"rw\\\">\\n                <td class=\\\"prop-col\\\">first_name</td>\\n                <td class=\\\"filter-col\\\"></td>\\n                <td class=\\\"editable-col\\\"></td>\\n                <td class=\\\"type-col\\\">STRING</td>\\n              <td class=\\\"description-col\\\">First name as parsed from <code>name</code></td>\\n            </tr>\\n\\n            <tr class=\\\"rw\\\">\\n                <td class=\\\"prop-col\\\">last_name</td>\\n                <td class=\\\"filter-col\\\"></td>\\n                <td class=\\\"editable-col\\\"></td>\\n                <td class=\\\"type-col\\\">STRING</td>\\n              <td class=\\\"description-col\\\">Last name as parsed from <code>name</code></td>\\n            </tr>\\n\\n            <tr class=\\\"ro\\\">\\n                <td class=\\\"prop-col\\\">location</td>\\n                <td class=\\\"filter-col\\\"></td>\\n                <td class=\\\"editable-col\\\"></td>\\n                <td class=\\\"type-col\\\">STRING</td>\\n                <td class=\\\"description-col\\\">The customer's location (e.g. State + Country)</td>\\n            </tr>\\n\\n            <tr class=\\\"fil ro\\\">\\n                <td class=\\\"prop-col\\\">name</td>\\n                <td class=\\\"filter-col\\\"></td>\\n                <td class=\\\"editable-col\\\"></td>\\n                <td class=\\\"type-col\\\">STRING</td>\\n                <td class=\\\"description-col\\\">The customer's full name. Will update based on edits to <code>first_name</code> or <code>last_name</code></td>\\n            </tr>\\n\\n            <tr class=\\\"ro\\\">\\n                <td class=\\\"prop-col\\\">num_orders</td>\\n                <td class=\\\"filter-col\\\"></td>\\n                <td class=\\\"editable-col\\\"></td>\\n                <td class=\\\"type-col\\\">INT</td>\\n                <td class=\\\"description-col\\\">How many orders this customer has placed</td>\\n            </tr>\\n\\n            <tr class=\\\"ro\\\">\\n                <td class=\\\"prop-col\\\">num_subscriptions</td>\\n                <td class=\\\"filter-col\\\"></td>\\n                <td class=\\\"editable-col\\\"></td>\\n                <td class=\\\"type-col\\\">INT</td>\\n                <td class=\\\"description-col\\\">How many subscriptions the customer has ordered</td>\\n            </tr>\\n\\n            <tr class=\\\"ro\\\">\\n                <td class=\\\"prop-col\\\">subscription_status</td>\\n                <td class=\\\"filter-col\\\"></td>\\n                <td class=\\\"editable-col\\\"></td>\\n                <td class=\\\"type-col\\\">STRING</td>\\n                <td class=\\\"description-col\\\">User friendly name of this customers subscription status. Includes Active, Past Due, Expired, Cancelled, and Mixed (if the customer has multiple subscriptions with different statuses)</td>\\n            </tr>\\n\\n            <tr class=\\\"ro\\\">\\n                <td class=\\\"prop-col\\\">total_revenue</td>\\n                <td class=\\\"filter-col\\\"></td>\\n                <td class=\\\"editable-col\\\"></td>\\n                <td class=\\\"type-col\\\">INT</td>\\n                <td class=\\\"description-col\\\">The dollar amount this customer has paid</td>\\n            </tr>\\n\\n            <tr class=\\\"ro\\\">\\n                <td class=\\\"prop-col\\\">type</td>\\n                <td class=\\\"filter-col\\\"></td>\\n                <td class=\\\"editable-col\\\"></td>\\n                <td class=\\\"type-col\\\">STRING</td>\\n                <td class=\\\"description-col\\\">The type of the element. In this case, <code>customer</code></td>\\n            </tr>\\n\\n            <tr class=\\\"ro\\\">\\n                <td class=\\\"prop-col\\\">url</td>\\n                <td class=\\\"filter-col\\\"></td>\\n                <td class=\\\"editable-col\\\"></td>\\n                <td class=\\\"type-col\\\">STRING</td>\\n              <td class=\\\"description-col\\\">Direct link to <code>GET</code> the full details of the customer</td>\\n            </tr>\\n\\n            </tbody>\\n    </table>\\n</div>\"\n}\n[/block]\n## Relation Properties\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Property\",\n    \"h-1\": \"Resource\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"addresses\",\n    \"0-1\": \"Address\",\n    \"0-2\": \"A collection of addresses for this customer\",\n    \"1-0\": \"_md\",\n    \"1-1\": \"[CustomerMetadata](http://docs.cratejoy.com/docs/customer-metadata)\",\n    \"1-2\": \"User defined data about the customer\",\n    \"h-3\": \"Filter?\",\n    \"0-3\": \"Yes\",\n    \"1-3\": \"Yes\"\n  },\n  \"cols\": 4,\n  \"rows\": 2\n}\n[/block]\n## Additional Related Properties\nsee [Working with Object Relationships](doc:working-with-object-relationships) \n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Property\",\n    \"h-1\": \"Resource\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"logs\",\n    \"1-0\": \"carts\",\n    \"1-1\": \"[Cart](doc:cart)\",\n    \"2-0\": \"notes\",\n    \"2-1\": \"\",\n    \"3-0\": \"orders\",\n    \"3-1\": \"[Order](doc:order)\",\n    \"4-0\": \"shipments\",\n    \"4-1\": \"[Shipment](doc:shipment)\",\n    \"5-0\": \"subscriptions\",\n    \"5-1\": \"[Subscription](doc:subscription)\",\n    \"0-1\": \"CustomerLog\",\n    \"0-2\": \"A collection of customer log entries.\",\n    \"h-3\": \"Filter?\",\n    \"1-2\": \"A collection of carts associated with the customer.\",\n    \"2-2\": \"\",\n    \"3-2\": \"A collection of orders associated with the customer.\",\n    \"4-2\": \"A collection of shipments associated with the customer.\",\n    \"1-3\": \"Yes\",\n    \"0-3\": \"Yes\",\n    \"2-3\": \"Yes\",\n    \"3-3\": \"Yes\",\n    \"4-3\": \"Yes\",\n    \"5-2\": \"A collection of subscriptions associated with the customer\",\n    \"5-3\": \"Yes\"\n  },\n  \"cols\": 4,\n  \"rows\": 6\n}\n[/block]\nThe above properties on the customer are references to another Cratejoy resource or another collection of Cratejoy resources. The properties can either be a url to fetch the related resources OR contain the resources themselves","excerpt":"Customer data object specification for the Cratejoy Merchant API","slug":"customer-1","type":"basic","title":"Customer"}

Customer

Customer data object specification for the Cratejoy Merchant API

# Properties [block:html] { "html": "<div class=\"property-table-wrap\">\n <table class=\"property-table\">\n <thead>\n <tr>\n <th class=\"prop-col\">Property</th>\n <th class=\"filter-col\">Filter</th>\n <th class=\"editable-col\">Edit</th>\n <th class=\"type-col\">Type</th>\n <th class=\"description-col\">Description</th>\n </tr>\n </thead>\n\n <tbody class=\"properties\">\n\n <tr class=\"fil ro\">\n <td class=\"prop-col\">id</td>\n <td class=\"filter-col\"></td>\n <td class=\"editable-col\"></td>\n <td class=\"type-col\">INT</td>\n <td class=\"description-col\">Unique identifier</td>\n </tr>\n\n <tr class=\"ro\">\n <td class=\"prop-col\">country</td>\n <td class=\"filter-col\"></td>\n <td class=\"editable-col\"></td>\n <td class=\"type-col\">STRING</td>\n <td class=\"description-col\">Two letter country code for the customer as determined by the primary address</td>\n </tr>\n\n <tr class=\"fil rw\">\n <td class=\"prop-col\">email</td>\n <td class=\"filter-col\"></td>\n <td class=\"editable-col\"></td>\n <td class=\"type-col\">STRING</td>\n <td class=\"description-col\">The customer's email address</td>\n </tr>\n\n <tr class=\"rw\">\n <td class=\"prop-col\">first_name</td>\n <td class=\"filter-col\"></td>\n <td class=\"editable-col\"></td>\n <td class=\"type-col\">STRING</td>\n <td class=\"description-col\">First name as parsed from <code>name</code></td>\n </tr>\n\n <tr class=\"rw\">\n <td class=\"prop-col\">last_name</td>\n <td class=\"filter-col\"></td>\n <td class=\"editable-col\"></td>\n <td class=\"type-col\">STRING</td>\n <td class=\"description-col\">Last name as parsed from <code>name</code></td>\n </tr>\n\n <tr class=\"ro\">\n <td class=\"prop-col\">location</td>\n <td class=\"filter-col\"></td>\n <td class=\"editable-col\"></td>\n <td class=\"type-col\">STRING</td>\n <td class=\"description-col\">The customer's location (e.g. State + Country)</td>\n </tr>\n\n <tr class=\"fil ro\">\n <td class=\"prop-col\">name</td>\n <td class=\"filter-col\"></td>\n <td class=\"editable-col\"></td>\n <td class=\"type-col\">STRING</td>\n <td class=\"description-col\">The customer's full name. Will update based on edits to <code>first_name</code> or <code>last_name</code></td>\n </tr>\n\n <tr class=\"ro\">\n <td class=\"prop-col\">num_orders</td>\n <td class=\"filter-col\"></td>\n <td class=\"editable-col\"></td>\n <td class=\"type-col\">INT</td>\n <td class=\"description-col\">How many orders this customer has placed</td>\n </tr>\n\n <tr class=\"ro\">\n <td class=\"prop-col\">num_subscriptions</td>\n <td class=\"filter-col\"></td>\n <td class=\"editable-col\"></td>\n <td class=\"type-col\">INT</td>\n <td class=\"description-col\">How many subscriptions the customer has ordered</td>\n </tr>\n\n <tr class=\"ro\">\n <td class=\"prop-col\">subscription_status</td>\n <td class=\"filter-col\"></td>\n <td class=\"editable-col\"></td>\n <td class=\"type-col\">STRING</td>\n <td class=\"description-col\">User friendly name of this customers subscription status. Includes Active, Past Due, Expired, Cancelled, and Mixed (if the customer has multiple subscriptions with different statuses)</td>\n </tr>\n\n <tr class=\"ro\">\n <td class=\"prop-col\">total_revenue</td>\n <td class=\"filter-col\"></td>\n <td class=\"editable-col\"></td>\n <td class=\"type-col\">INT</td>\n <td class=\"description-col\">The dollar amount this customer has paid</td>\n </tr>\n\n <tr class=\"ro\">\n <td class=\"prop-col\">type</td>\n <td class=\"filter-col\"></td>\n <td class=\"editable-col\"></td>\n <td class=\"type-col\">STRING</td>\n <td class=\"description-col\">The type of the element. In this case, <code>customer</code></td>\n </tr>\n\n <tr class=\"ro\">\n <td class=\"prop-col\">url</td>\n <td class=\"filter-col\"></td>\n <td class=\"editable-col\"></td>\n <td class=\"type-col\">STRING</td>\n <td class=\"description-col\">Direct link to <code>GET</code> the full details of the customer</td>\n </tr>\n\n </tbody>\n </table>\n</div>" } [/block] ## Relation Properties [block:parameters] { "data": { "h-0": "Property", "h-1": "Resource", "h-2": "Description", "0-0": "addresses", "0-1": "Address", "0-2": "A collection of addresses for this customer", "1-0": "_md", "1-1": "[CustomerMetadata](http://docs.cratejoy.com/docs/customer-metadata)", "1-2": "User defined data about the customer", "h-3": "Filter?", "0-3": "Yes", "1-3": "Yes" }, "cols": 4, "rows": 2 } [/block] ## Additional Related Properties see [Working with Object Relationships](doc:working-with-object-relationships) [block:parameters] { "data": { "h-0": "Property", "h-1": "Resource", "h-2": "Description", "0-0": "logs", "1-0": "carts", "1-1": "[Cart](doc:cart)", "2-0": "notes", "2-1": "", "3-0": "orders", "3-1": "[Order](doc:order)", "4-0": "shipments", "4-1": "[Shipment](doc:shipment)", "5-0": "subscriptions", "5-1": "[Subscription](doc:subscription)", "0-1": "CustomerLog", "0-2": "A collection of customer log entries.", "h-3": "Filter?", "1-2": "A collection of carts associated with the customer.", "2-2": "", "3-2": "A collection of orders associated with the customer.", "4-2": "A collection of shipments associated with the customer.", "1-3": "Yes", "0-3": "Yes", "2-3": "Yes", "3-3": "Yes", "4-3": "Yes", "5-2": "A collection of subscriptions associated with the customer", "5-3": "Yes" }, "cols": 4, "rows": 6 } [/block] The above properties on the customer are references to another Cratejoy resource or another collection of Cratejoy resources. The properties can either be a url to fetch the related resources OR contain the resources themselves