{"_id":"542f41eb9f1a690800b2b191","category":"5414d4864985e91a17cfa98f","excerpt":"","is_link":false,"__v":0,"body":"All requests will be made to the base url of https://api.startupthreads.com","createdAt":"2014-10-04T00:40:11.542Z","link_url":"","slug":"making-requests","title":"Making Requests","updates":[],"version":"541432ce720be937680a43e6","project":"541432ce720be937680a43e3","sync_unique":"","type":"basic","api":{"results":{"codes":[]},"basic_auth":false,"try":true,"params":[],"url":"","auth":"never"},"user":"541432a4720be937680a43e2","order":0,"childrenPages":[]}

Making Requests


All requests will be made to the base url of https://api.startupthreads.com
{"_id":"5414d3ff4985e91a17cfa979","excerpt":"","githubsync":"","link_external":false,"type":"basic","user":"541432a4720be937680a43e2","category":"5414d4864985e91a17cfa98f","hidden":false,"is_link":false,"link_url":"","project":"541432ce720be937680a43e3","sync_unique":"","body":"In order to make requests to the API you must make an authorized request using your API key (found on your StartupThreads Dashboard)\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"1. Where To Find Your API Key\"\n}\n[/block]\nThe API key can be found on the main page of your [dashboard](https://dashboard.startupthreads.com), after you have gone through the onboarding steps to create an item\n\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/xUKnBXGT9SSJmdhzOpFX_https___dashboard_startupthreads_com.png\",\n        \"https___dashboard_startupthreads_com.png\",\n        \"2348\",\n        \"646\",\n        \"#141454\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"2. SSL Required\"\n}\n[/block]\nAll requests must be made over SSL or they will be rejected\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"3. Authorization Token\"\n}\n[/block]\nYou must include your API key in an Authorization header on your requests. In addition, pass in the accept header for the API version.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"require 'rest-client'\\n\\nurl = \\\"https://api.startupthreads.com/items.json\\\"\\n\\nheaders =  { 'Authorization' => 'Token token=\\\"YOUR_API_KEY\\\"', :accept => 'application/vnd.startupthreads-v1+json' }\\n\\nrequest = RestClient.get url, headers\",\n      \"language\": \"ruby\"\n    }\n  ]\n}\n[/block]","slug":"authentication--security","title":"Authentication & Security","updates":[],"version":"541432ce720be937680a43e6","__v":3,"api":{"url":"","auth":"never","params":[],"results":{"codes":[{"language":"json","code":"{}","name":"Success"},{"language":"json","code":"{}","name":"Failure"}]},"settings":"","try":true},"createdAt":"2014-09-13T23:32:15.520Z","order":1,"childrenPages":[]}

Authentication & Security


In order to make requests to the API you must make an authorized request using your API key (found on your StartupThreads Dashboard) [block:api-header] { "type": "basic", "title": "1. Where To Find Your API Key" } [/block] The API key can be found on the main page of your [dashboard](https://dashboard.startupthreads.com), after you have gone through the onboarding steps to create an item [block:image] { "images": [ { "image": [ "https://files.readme.io/xUKnBXGT9SSJmdhzOpFX_https___dashboard_startupthreads_com.png", "https___dashboard_startupthreads_com.png", "2348", "646", "#141454", "" ] } ] } [/block] [block:api-header] { "type": "basic", "title": "2. SSL Required" } [/block] All requests must be made over SSL or they will be rejected [block:api-header] { "type": "basic", "title": "3. Authorization Token" } [/block] You must include your API key in an Authorization header on your requests. In addition, pass in the accept header for the API version. [block:code] { "codes": [ { "code": "require 'rest-client'\n\nurl = \"https://api.startupthreads.com/items.json\"\n\nheaders = { 'Authorization' => 'Token token=\"YOUR_API_KEY\"', :accept => 'application/vnd.startupthreads-v1+json' }\n\nrequest = RestClient.get url, headers", "language": "ruby" } ] } [/block]
In order to make requests to the API you must make an authorized request using your API key (found on your StartupThreads Dashboard) [block:api-header] { "type": "basic", "title": "1. Where To Find Your API Key" } [/block] The API key can be found on the main page of your [dashboard](https://dashboard.startupthreads.com), after you have gone through the onboarding steps to create an item [block:image] { "images": [ { "image": [ "https://files.readme.io/xUKnBXGT9SSJmdhzOpFX_https___dashboard_startupthreads_com.png", "https___dashboard_startupthreads_com.png", "2348", "646", "#141454", "" ] } ] } [/block] [block:api-header] { "type": "basic", "title": "2. SSL Required" } [/block] All requests must be made over SSL or they will be rejected [block:api-header] { "type": "basic", "title": "3. Authorization Token" } [/block] You must include your API key in an Authorization header on your requests. In addition, pass in the accept header for the API version. [block:code] { "codes": [ { "code": "require 'rest-client'\n\nurl = \"https://api.startupthreads.com/items.json\"\n\nheaders = { 'Authorization' => 'Token token=\"YOUR_API_KEY\"', :accept => 'application/vnd.startupthreads-v1+json' }\n\nrequest = RestClient.get url, headers", "language": "ruby" } ] } [/block]
{"_id":"5414d4c34985e91a17cfa995","excerpt":"","slug":"creating-items","sync_unique":"","updates":[],"createdAt":"2014-09-13T23:35:31.865Z","order":2,"project":"541432ce720be937680a43e3","title":"Creating Items","user":"541432a4720be937680a43e2","body":"In order to use the API, you will have to interact and get IDs for items. To create items, you must use the dashboard to visually create an item. You can get to the dashboard [here](dashboard.startupthreads.com/login)","category":"5414d4864985e91a17cfa98f","is_link":false,"type":"basic","api":{"params":[],"results":{"codes":[{"name":"Success","language":"json","code":"{}"},{"language":"json","code":"{}","name":"Failure"}]},"try":true,"url":"","auth":"never"},"link_url":"","version":"541432ce720be937680a43e6","__v":1,"childrenPages":[]}

Creating Items


In order to use the API, you will have to interact and get IDs for items. To create items, you must use the dashboard to visually create an item. You can get to the dashboard [here](dashboard.startupthreads.com/login)
In order to use the API, you will have to interact and get IDs for items. To create items, you must use the dashboard to visually create an item. You can get to the dashboard [here](dashboard.startupthreads.com/login)
{"_id":"5414d0994985e91a17cfa963","link_external":false,"version":"541432ce720be937680a43e6","createdAt":"2014-09-13T23:17:45.885Z","excerpt":"Get a list of your items","hidden":false,"isReference":false,"is_link":false,"link_url":"","project":"541432ce720be937680a43e3","updates":["553aa1ed69c2630d00a85648"],"__v":15,"user":"541432a4720be937680a43e2","type":"get","category":"5414d4cb4985e91a17cfa997","api":{"url":"/items.json","examples":{"codes":[]},"params":[],"method":"get","results":{"codes":[{"language":"json","code":"{\n  \"items\": [\n        {\n            \"id\": \"iodvqu1p\",\n            \"name\": \"Make Something People Love\",\n            \"description\": \"Red MSPL tee, no print on back\",\n            \"status\": \"approved\",\n            \"color\": \"ltgray\",\n            \"mockup\": \"https://www.filestack.com/api/file/w2uJsHDNSouOSpcbd28E\",\n            \"number_of_colors\": {\n                \"location_1\": \"1\",\n                \"location_2\": \"1\",\n                \"location_3\": null,\n                \"location_4\": null\n            },\n          \t\"inventory\": [],\n            \"created_at\": \"2014-09-02T18:41:12Z\",\n            \"updated_at\": \"2014-09-30T18:23:36Z\"\n        },\n        {\n            \"id\": \"gf-qotmp\",\n            \"name\": \"Mailjet\",\n            \"description\": \"Airplane logo tee\",\n            \"status\": \"approved\",\n            \"color\": \"black\",\n            \"mockup\": \"https://www.filestack.com/api/file/w2uJsHDNSouOSpcbd28E\",\n            \"number_of_colors\": {\n                \"location_1\": \"2\",\n                \"location_2\": \"2\",\n                \"location_3\": null,\n                \"location_4\": null\n            },\n         \t \t\"inventory\": [\n                {\n                    \"size\": \"WL\",\n                    \"quantity\": 5\n                },\n                {\n                    \"size\": \"MXL\",\n                    \"quantity\": 5\n                },\n                {\n                    \"size\": \"ML\",\n                    \"quantity\": 5\n                },\n                {\n                    \"size\": \"MM\",\n                    \"quantity\": 5\n                },\n                {\n                    \"size\": \"WS\",\n                    \"quantity\": 5\n                },\n                {\n                    \"size\": \"MS\",\n                    \"quantity\": 321\n                }\n            ],\n          \t\"weight\": [{\n\t\t\t\t\t\t\t\t\"size\": \"WS\",\n\t\t\t\t\t\t\t\t\"weight\": 4.1\n\t\t\t\t\t\t\t\t}, {\n\t\t\t\t\t\t\t\t\"size\": \"WM\",\n\t\t\t\t\t\t\t\t\"weight\": 4.2\n\t\t\t\t\t\t\t\t}, {\n\t\t\t\t\t\t\t\t\"size\": \"WL\",\n\t\t\t\t\t\t\t\t\"weight\": 4.6\n\t\t\t\t\t\t\t\t}, {\n\t\t\t\t\t\t\t\t\"size\": \"WXL\",\n\t\t\t\t\t\t\t\t\"weight\": 4.6\n\t\t\t\t\t\t\t\t}, {\n\t\t\t\t\t\t\t\t\"size\": \"W2XL\",\n\t\t\t\t\t\t\t\t\"weight\": 4.6\n\t\t\t\t\t\t\t\t}, {\n\t\t\t\t\t\t\t\t\"size\": \"MS\",\n\t\t\t\t\t\t\t\t\"weight\": 5.2\n\t\t\t\t\t\t\t\t}, {\n\t\t\t\t\t\t\t\t\"size\": \"MM\",\n\t\t\t\t\t\t\t\t\"weight\": 5.4\n\t\t\t\t\t\t\t\t}, {\n\t\t\t\t\t\t\t\t\"size\": \"ML\",\n\t\t\t\t\t\t\t\t\"weight\": 5.8\n\t\t\t\t\t\t\t\t}, {\n\t\t\t\t\t\t\t\t\"size\": \"MXL\",\n\t\t\t\t\t\t\t\t\"weight\": 6.3\n\t\t\t\t\t\t\t\t}, {\n\t\t\t\t\t\t\t\t\"size\": \"M2XL\",\n\t\t\t\t\t\t\t\t\"weight\": 7.2\n\t\t\t\t\t\t}],\n          \t\"item_sizes\": [\"MXS\", \"MS\", \"MM\", \"ML\", \"MXL\", \"M2XL\", \"WS\", \"WM\", \"WL\", \"WXL\"],\n            \"created_at\": \"2014-08-22T18:56:18Z\",\n            \"updated_at\": \"2014-09-30T18:23:36Z\"\n        }\n\t]\n}","name":"Success"},{"language":"json","code":"{}","name":"Failure"}]},"settings":"","try":false,"auth":"never","basic_auth":false},"body":"[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"\"\n}\n[/block]\nUse the ```/v1/items.json``` endpoint to get a list of your StartupThreads. The weights are in ounces.\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"Secure Your Requests With SSL\",\n  \"body\": \"Make sure all api requests are served over https and include your api key in the basic auth ([link]))\"\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Example\"\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"require 'rest-client'\\nheaders =  { 'Authorization' => 'Token token=\\\"YOUR_API_KEY\\\"', :accept => 'application/vnd.startupthreads-v1+json' }\\nurl = \\\"https://api.startupthreads.com/items.json\\\"\\nrequest = RestClient.get url, headers\",\n      \"language\": \"ruby\"\n    },\n    {\n      \"code\": \"curl -H 'Authorization:Token token=\\\"YOUR_API_KEY\\\"' \\\\\\n-H 'accept:application/vnd.startupthreads-v1+json' \\\\\\n'https://api.startupthreads.com/items.json'\\n\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Questions?\",\n  \"body\": \"Email us at [info@startupthreads.com](mailto:info@startupthreads.com)\"\n}\n[/block]","githubsync":"","order":0,"slug":"items","sync_unique":"","title":"/items","childrenPages":[]}

get/items

Get a list of your items

[block:api-header] { "type": "basic", "title": "" } [/block] Use the ```/v1/items.json``` endpoint to get a list of your StartupThreads. The weights are in ounces. [block:callout] { "type": "warning", "title": "Secure Your Requests With SSL", "body": "Make sure all api requests are served over https and include your api key in the basic auth ([link]))" } [/block] [block:api-header] { "type": "basic", "title": "Example" } [/block] [block:code] { "codes": [ { "code": "require 'rest-client'\nheaders = { 'Authorization' => 'Token token=\"YOUR_API_KEY\"', :accept => 'application/vnd.startupthreads-v1+json' }\nurl = \"https://api.startupthreads.com/items.json\"\nrequest = RestClient.get url, headers", "language": "ruby" }, { "code": "curl -H 'Authorization:Token token=\"YOUR_API_KEY\"' \\\n-H 'accept:application/vnd.startupthreads-v1+json' \\\n'https://api.startupthreads.com/items.json'\n", "language": "shell" } ] } [/block] [block:callout] { "type": "info", "title": "Questions?", "body": "Email us at [info@startupthreads.com](mailto:info@startupthreads.com)" } [/block]

Definition

{{ api_url }}{{ page_api_url }}

Result Format



[block:api-header] { "type": "basic", "title": "" } [/block] Use the ```/v1/items.json``` endpoint to get a list of your StartupThreads. The weights are in ounces. [block:callout] { "type": "warning", "title": "Secure Your Requests With SSL", "body": "Make sure all api requests are served over https and include your api key in the basic auth ([link]))" } [/block] [block:api-header] { "type": "basic", "title": "Example" } [/block] [block:code] { "codes": [ { "code": "require 'rest-client'\nheaders = { 'Authorization' => 'Token token=\"YOUR_API_KEY\"', :accept => 'application/vnd.startupthreads-v1+json' }\nurl = \"https://api.startupthreads.com/items.json\"\nrequest = RestClient.get url, headers", "language": "ruby" }, { "code": "curl -H 'Authorization:Token token=\"YOUR_API_KEY\"' \\\n-H 'accept:application/vnd.startupthreads-v1+json' \\\n'https://api.startupthreads.com/items.json'\n", "language": "shell" } ] } [/block] [block:callout] { "type": "info", "title": "Questions?", "body": "Email us at [info@startupthreads.com](mailto:info@startupthreads.com)" } [/block]
{"_id":"542065b87eb16bb64f83c10c","editedParams2":true,"excerpt":"","order":1,"slug":"inventory_shipmentsid","sync_unique":"","__v":5,"title":"/inventory_shipments/:id","updates":[],"user":"541432a4720be937680a43e2","createdAt":"2014-09-22T18:08:56.658Z","link_url":"","project":"541432ce720be937680a43e3","type":"get","api":{"params":[{"in":"query","_id":"542f3d5d21dada08004f3d8f","required":true,"desc":"Shipment ID (same as order)","default":"","type":"string","name":":id"}],"results":{"codes":[{"name":"Success","code":"{\n\"inventory_shipment\": {\n        \"id\": \"4_udfnyn\",\n        \"type\": \"Inventory\",\n        \"status\": \"address_verified\",\n        \"shipping_cost\": 554,\n        \"fulfillment_cost\": 0,\n        \"total_costs\": null,\n        \"total_quantity\": 2,\n        \"payment_method\": \"account_balance\",\n        \"test_mode\": true,\n        \"line_items\": [\n            {\n                \"item_id\": \"av3gte2t\",\n                \"size\": \"MS\",\n                \"quantity\": 2\n            }\n        ],\n        \"address\": {\n            \"id\": 35,\n            \"name\": \"Johnny Ive\",\n            \"business_name\": null,\n            \"street1\": \"902 Broadway\",\n            \"street2\": \"4th Floor\",\n            \"city\": \"New York\",\n            \"state\": \"New York\",\n            \"zip\": \"10010\",\n            \"country\": \"US\",\n            \"order_id\": 35,\n            \"user_id\": null,\n            \"account_id\": 4,\n            \"created_at\": \"2014-09-03T14:28:37Z\",\n            \"updated_at\": \"2014-09-22T18:20:17Z\"\n        },\n        \"notes\": \"The address for this shipment has been verified and is scheduled for fulfillment. The selected payment method will be charged at that time.\",\n        \"created_at\": \"2014-09-03T14:28:37Z\",\n        \"updated_at\": \"2014-09-30T18:23:37Z\"\n    }\n}","language":"json"},{"name":"Failure","code":"{}","language":"json"}]},"try":false,"url":"/inventory_shipments/:id","auth":"never","basic_auth":false,"method":"get"},"body":"Use this endpoint to get the status of a current inventory shipment\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"require 'rest-client'\\nshipment_id = \\\"YOUR_SHIPMENT_ID\\\"\\nurl = \\\"https://api.startupthreads.com/inventory_shipments/\\\" + shipment_id\\n\\nheaders = { 'Authorization' => 'Token token=\\\"API_KEY\\\"', \\n  \\t\\t\\t\\t\\t:accept => 'application/vnd.startupthreads-v1+json'}\\n\\nrequest = RestClient::Resource.new(url, :headers => headers)\\n\\nresult = request.get\",\n      \"language\": \"ruby\"\n    }\n  ]\n}\n[/block]","category":"5414d4cb4985e91a17cfa997","editedParams":true,"is_link":false,"version":"541432ce720be937680a43e6","childrenPages":[]}

get/inventory_shipments/:id


Query Params

id:
required
string
Shipment ID (same as order)
Use this endpoint to get the status of a current inventory shipment [block:code] { "codes": [ { "code": "require 'rest-client'\nshipment_id = \"YOUR_SHIPMENT_ID\"\nurl = \"https://api.startupthreads.com/inventory_shipments/\" + shipment_id\n\nheaders = { 'Authorization' => 'Token token=\"API_KEY\"', \n \t\t\t\t\t:accept => 'application/vnd.startupthreads-v1+json'}\n\nrequest = RestClient::Resource.new(url, :headers => headers)\n\nresult = request.get", "language": "ruby" } ] } [/block]

Definition

{{ api_url }}{{ page_api_url }}

Result Format



Use this endpoint to get the status of a current inventory shipment [block:code] { "codes": [ { "code": "require 'rest-client'\nshipment_id = \"YOUR_SHIPMENT_ID\"\nurl = \"https://api.startupthreads.com/inventory_shipments/\" + shipment_id\n\nheaders = { 'Authorization' => 'Token token=\"API_KEY\"', \n \t\t\t\t\t:accept => 'application/vnd.startupthreads-v1+json'}\n\nrequest = RestClient::Resource.new(url, :headers => headers)\n\nresult = request.get", "language": "ruby" } ] } [/block]
{"_id":"542066e77eb16bb64f83c114","__v":5,"category":"5414d4cb4985e91a17cfa997","editedParams2":true,"isReference":false,"is_link":false,"project":"541432ce720be937680a43e3","slug":"inventory_shipment","type":"post","createdAt":"2014-09-22T18:13:59.639Z","link_external":false,"editedParams":true,"hidden":false,"link_url":"","sync_unique":"","title":"/inventory_shipments","updates":[],"api":{"auth":"never","method":"post","params":[{"in":"body","_id":"5420673f7eb16bb64f83c11a","default":"account_balance","desc":"Payment method. Accepted values: \"account_balance\" , \"active_card\"","name":"inventory_shipment.payment_method","ref":"","required":true,"type":"string"},{"default":"","desc":"Item ID from the dashboard","name":"inventory_shipment.line_items.item_id","ref":"","required":true,"type":"string","in":"body","_id":"542f3b1c21dada08004f3d8c"},{"required":true,"type":"string","in":"body","_id":"542f3b1c21dada08004f3d8b","default":"","desc":"Item size. Accepted values: \"M2XS\", \"MXS\", \"MS\", \"MM\", \"ML\", \"MXL\", \"M2XL\", \"M3XL\",  \"M4XL\", \"W2XS\", \"WXS\", \"WS\", \"WM\", \"WL\", \"WXL\", \"W2XL\", \"W3XL\", \"W4XL\". Each item has their own list of accepted sizes which is a subset of these sizes, which you can find in items.json. Items that need no size should use \"NS\".","name":"inventory_shipment.line_items.size","ref":""},{"desc":"Number of items for the order","name":"inventory_shipment.line_items.quantity","ref":"","required":true,"type":"int","in":"body","_id":"542f3b1c21dada08004f3d8a","default":""},{"ref":"","required":false,"type":"string","in":"body","_id":"542f3b1c21dada08004f3d89","default":"","desc":"First and last name of the recipient","name":"inventory_shipment.address.name"},{"_id":"542f3b1c21dada08004f3d88","default":"","desc":"Name of business where shipment is heading","name":"inventory_shipment.address.business_name","ref":"","required":false,"type":"string","in":"body"},{"_id":"542f3b1c21dada08004f3d87","default":"","desc":"Main street address of shipment","name":"inventory_shipment.address.street1","ref":"","required":true,"type":"string","in":"body"},{"in":"body","_id":"542f3b1c21dada08004f3d86","default":"","desc":"Secondary street address of shipment","name":"inventory_shipment.address.street2","ref":"","required":false,"type":"string"},{"default":"","desc":"City where shipment is heading","name":"inventory_shipment.address.city","ref":"","required":true,"type":"string","in":"body","_id":"542f3b1c21dada08004f3d85"},{"desc":"State/Province where shipment is heading","name":"inventory_shipment.address.state","ref":"","required":true,"type":"string","in":"body","_id":"542f3b1c21dada08004f3d84","default":""},{"ref":"","required":true,"type":"string","in":"body","_id":"542f3b1c21dada08004f3d83","default":"","desc":"Zip code where shipment is heading","name":"inventory_shipment.address.zip"},{"_id":"542f3b1c21dada08004f3d82","default":"","desc":"2 letter country code","name":"inventory_shipment.address.country","ref":"","required":true,"type":"string","in":"body"},{"in":"body","_id":"56c10451dd69cf0d00f81dcb","default":"","desc":"Email address of recipient. Tracking information will be sent there","name":"inventory_shipment.address.email","ref":"","required":false,"type":"string"},{"default":"","desc":"Phone number of recipient","name":"inventory_shipment.address.phone_numer","ref":"","required":false,"type":"string","in":"body","_id":"56c10451dd69cf0d00f81dca"},{"ref":"","required":false,"type":"boolean","_id":"542f3b1c21dada08004f3d81","default":"false","desc":"Set to true if you'd like to send a test request","in":"body","name":"inventory_shipment.test_mode"}],"settings":"","basic_auth":false,"examples":{"codes":[]},"results":{"codes":[{"name":"Success","code":"{\n    \"inventory_shipment\" =>{\n        \"id\"=>\"d6l5n59n\",\n        \"type\"=>\"Inventory\",\n        \"status\"=>\"unconfirmed\",\n        \"shipping_cost\"=>nil,\n        \"fulfillment_cost\"=>nil,\n        \"total_costs\"=>nil,\n        \"total_quantity\"=>3,\n        \"payment_method\"=>\"account_balance\",\n        \"test_mode\"=>true,\n        \"line_items\"=>[\n            {\n                \"item_id\"=>\"dfsea4rs\",\n                \"size\"=>\"MS\",\n                \"quantity\"=>3\n            }\n        ],\n        \"address\"=>{\n            \"id\"=>142,\n            \"name\"=>\"Frank Denbow\",\n            \"business_name\"=>nil,\n            \"street1\"=>\"902 Broadway\",\n            \"street2\"=>\"4th Floor\",\n            \"city\"=>\"New York\",\n            \"state\"=>\"New York\",\n            \"zip\"=>\"10010\",\n            \"country\"=>\"US\",\n            \"order_id\"=>168,\n            \"user_id\"=>nil,\n            \"account_id\"=>nil,\n            \"created_at\"=>\"2014-10-04T16:38:30Z\",\n            \"updated_at\"=>\"2014-10-04T16:38:30Z\"\n        },\n        \"notes\"=>\"This shipment has been created and the address is being verified.\",\n        \"created_at\"=>\"2014-10-04T16:38:30Z\",\n        \"updated_at\"=>\"2014-10-04T16:38:30Z\"\n    }\n\n}","language":"json"},{"name":"Failure","code":"{}","language":"json"}]},"try":false,"url":"/inventory_shipments"},"body":"[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Example\"\n}\n[/block]\nUse this endpoint when you want to make a shipment to a customer or fan. Make sure to include line items for all of the items you would like to send (if you'd like to send a full package of items, fill out multiple line items with the appropriate item ids and quantities).\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"require 'rest-client'\\n\\nurl = \\\"https://api.startupthreads.com/inventory_shipments\\\"\\n\\nheaders = { 'Authorization' => 'Token token=\\\"API_KEY\\\"', \\n  \\t\\t\\t\\t\\t:accept => 'application/vnd.startupthreads-v1+json', \\n \\t\\t\\t\\t\\t\\t:content_type => :json }\\n\\nrequest = RestClient::Resource.new(url, :headers => headers)\\n\\norder_info = {\\n  inventory_shipment: {\\n    payment_method: 'account_balance',\\n    line_items: [\\n      {\\n        item_id: 'dfsea4rs',\\n        size: 'MS',\\n        quantity: 3\\n      }\\n    ],\\n    address: {\\n      email: \\\"frank@ordersometshirts.com\\\",\\n      name: 'Frank Denbow',\\n      street1: '902 Broadway',\\n      street2: '4th Floor',\\n      city: 'New York',\\n      state: 'New York',\\n      zip: '10010',\\n      country: 'US'\\n    },\\n    test_mode: true\\n  }\\n}\\n\\nresult = request.post order_info.to_json\",\n      \"language\": \"ruby\"\n    }\n  ]\n}\n[/block]","excerpt":"Create a new shipment using items currently in inventory","githubsync":"","order":2,"user":"541432a4720be937680a43e2","version":"541432ce720be937680a43e6","childrenPages":[]}

post/inventory_shipments

Create a new shipment using items currently in inventory

Body Params

inventory_shipment.payment_method:
required
stringaccount_balance
Payment method. Accepted values: "account_balance" , "active_card"
inventory_shipment.line_items.item_id:
required
string
Item ID from the dashboard
inventory_shipment.line_items.size:
required
string
Item size. Accepted values: "M2XS", "MXS", "MS", "MM", "ML", "MXL", "M2XL", "M3XL", "M4XL", "W2XS", "WXS", "WS", "WM", "WL", "WXL", "W2XL", "W3XL", "W4XL". Each item has their own list of accepted sizes which is a subset of these sizes, which you can find in items.json. Items that need no size should use "NS".
inventory_shipment.line_items.quantity:
required
integer
Number of items for the order
inventory_shipment.address.name:
string
First and last name of the recipient
inventory_shipment.address.business_name:
string
Name of business where shipment is heading
inventory_shipment.address.street1:
required
string
Main street address of shipment
inventory_shipment.address.street2:
string
Secondary street address of shipment
inventory_shipment.address.city:
required
string
City where shipment is heading
inventory_shipment.address.state:
required
string
State/Province where shipment is heading
inventory_shipment.address.zip:
required
string
Zip code where shipment is heading
inventory_shipment.address.country:
required
string
2 letter country code
inventory_shipment.address.email:
string
Email address of recipient. Tracking information will be sent there
inventory_shipment.address.phone_numer:
string
Phone number of recipient
inventory_shipment.test_mode:
booleanfalse
Set to true if you'd like to send a test request
[block:api-header] { "type": "basic", "title": "Example" } [/block] Use this endpoint when you want to make a shipment to a customer or fan. Make sure to include line items for all of the items you would like to send (if you'd like to send a full package of items, fill out multiple line items with the appropriate item ids and quantities). [block:code] { "codes": [ { "code": "require 'rest-client'\n\nurl = \"https://api.startupthreads.com/inventory_shipments\"\n\nheaders = { 'Authorization' => 'Token token=\"API_KEY\"', \n \t\t\t\t\t:accept => 'application/vnd.startupthreads-v1+json', \n \t\t\t\t\t\t:content_type => :json }\n\nrequest = RestClient::Resource.new(url, :headers => headers)\n\norder_info = {\n inventory_shipment: {\n payment_method: 'account_balance',\n line_items: [\n {\n item_id: 'dfsea4rs',\n size: 'MS',\n quantity: 3\n }\n ],\n address: {\n email: \"frank@ordersometshirts.com\",\n name: 'Frank Denbow',\n street1: '902 Broadway',\n street2: '4th Floor',\n city: 'New York',\n state: 'New York',\n zip: '10010',\n country: 'US'\n },\n test_mode: true\n }\n}\n\nresult = request.post order_info.to_json", "language": "ruby" } ] } [/block]

Definition

{{ api_url }}{{ page_api_url }}

Result Format



[block:api-header] { "type": "basic", "title": "Example" } [/block] Use this endpoint when you want to make a shipment to a customer or fan. Make sure to include line items for all of the items you would like to send (if you'd like to send a full package of items, fill out multiple line items with the appropriate item ids and quantities). [block:code] { "codes": [ { "code": "require 'rest-client'\n\nurl = \"https://api.startupthreads.com/inventory_shipments\"\n\nheaders = { 'Authorization' => 'Token token=\"API_KEY\"', \n \t\t\t\t\t:accept => 'application/vnd.startupthreads-v1+json', \n \t\t\t\t\t\t:content_type => :json }\n\nrequest = RestClient::Resource.new(url, :headers => headers)\n\norder_info = {\n inventory_shipment: {\n payment_method: 'account_balance',\n line_items: [\n {\n item_id: 'dfsea4rs',\n size: 'MS',\n quantity: 3\n }\n ],\n address: {\n email: \"frank@ordersometshirts.com\",\n name: 'Frank Denbow',\n street1: '902 Broadway',\n street2: '4th Floor',\n city: 'New York',\n state: 'New York',\n zip: '10010',\n country: 'US'\n },\n test_mode: true\n }\n}\n\nresult = request.post order_info.to_json", "language": "ruby" } ] } [/block]
{"_id":"542f3cc2b4457608000cb1e5","editedParams":true,"editedParams2":true,"body":"[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Example\"\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"order_id = \\\"YOUR_ORDER_ID\\\"\\nurl = \\\"https://api.startupthreads.com/orders/\\\" + order_id\\n\\nheaders = { 'Authorization' => 'Token token=\\\"API_KEY\\\"', \\n  \\t\\t\\t\\t\\t:accept => 'application/vnd.startupthreads-v1+json'}\\n\\nrequest = RestClient::Resource.new(url, :headers => headers)\\n\\nresult = request.get\",\n      \"language\": \"ruby\"\n    }\n  ]\n}\n[/block]","link_url":"","order":3,"sync_unique":"","title":"/orders/:id","version":"541432ce720be937680a43e6","api":{"params":[{"required":true,"desc":"ID of an order that has been placed","default":"","type":"string","name":":id","in":"query","_id":"542f3cc2b4457608000cb1e6"}],"results":{"codes":[{"language":"json","code":"{\n    \"order\": {\n        \"id\": \"4_udfnyn\",\n        \"type\": \"Inventory\",\n        \"status\": \"address_verified\",\n        \"shipping_cost\": 554,\n        \"fulfillment_cost\": 0,\n        \"total_costs\": 554,\n        \"total_quantity\": 2,\n        \"payment_method\": \"account_balance\",\n        \"test_mode\": true,\n        \"line_items\": [\n            {\n                \"item_id\": \"av3gte2t\",\n                \"size\": \"MS\",\n                \"quantity\": 2\n            }\n        ],\n        \"notes\": \"The address for this order has been verified and is ready for payment.\",\n        \"created_at\": \"2014-09-03T14: 28: 37Z\",\n        \"updated_at\": \"2014-09-30T18: 23: 37Z\"\n    }\n}","name":"Success"},{"code":"{}","name":"Failure","language":"json"}]},"try":false,"url":"/orders/:id","auth":"never","basic_auth":false,"method":"get"},"category":"5414d4cb4985e91a17cfa997","createdAt":"2014-10-04T00:18:10.812Z","is_link":false,"slug":"testinput-1","type":"get","__v":0,"excerpt":"Get information for an order","project":"541432ce720be937680a43e3","updates":[],"user":"541432a4720be937680a43e2","childrenPages":[]}

get/orders/:id

Get information for an order

Query Params

id:
required
string
ID of an order that has been placed
[block:api-header] { "type": "basic", "title": "Example" } [/block] [block:code] { "codes": [ { "code": "order_id = \"YOUR_ORDER_ID\"\nurl = \"https://api.startupthreads.com/orders/\" + order_id\n\nheaders = { 'Authorization' => 'Token token=\"API_KEY\"', \n \t\t\t\t\t:accept => 'application/vnd.startupthreads-v1+json'}\n\nrequest = RestClient::Resource.new(url, :headers => headers)\n\nresult = request.get", "language": "ruby" } ] } [/block]

Definition

{{ api_url }}{{ page_api_url }}

Result Format



[block:api-header] { "type": "basic", "title": "Example" } [/block] [block:code] { "codes": [ { "code": "order_id = \"YOUR_ORDER_ID\"\nurl = \"https://api.startupthreads.com/orders/\" + order_id\n\nheaders = { 'Authorization' => 'Token token=\"API_KEY\"', \n \t\t\t\t\t:accept => 'application/vnd.startupthreads-v1+json'}\n\nrequest = RestClient::Resource.new(url, :headers => headers)\n\nresult = request.get", "language": "ruby" } ] } [/block]
{"_id":"542f3da69f1a690800b2b181","editedParams":true,"githubsync":"","is_link":false,"link_external":false,"user":"541432a4720be937680a43e2","hidden":false,"order":4,"slug":"orders","updates":[],"link_url":"","title":"/orders","category":"5414d4cb4985e91a17cfa997","createdAt":"2014-10-04T00:21:58.823Z","excerpt":"Create a new order of items to be printed","isReference":false,"editedParams2":true,"project":"541432ce720be937680a43e3","sync_unique":"","type":"post","__v":3,"api":{"results":{"codes":[{"code":"{\n    \"order\": {\n        \"id\": \"dg1-qy5n\",\n        \"type\": \"NewBulk\",\n        \"status\": \"unconfirmed\",\n        \"shipping_cost\": null,\n        \"fulfillment_cost\": null,\n        \"total_costs\": null,\n        \"total_quantity\": 30,\n        \"payment_method\": \"account_balance\",\n        \"test_mode\": true,\n        \"line_items\": [\n            {\n                \"item_id\": \"dfsea4rs\",\n                \"size\": \"MS\",\n                \"quantity\": 30\n            }\n        ],\n        \"notes\": \"This order has been recently placed, but not yet paid for.\",\n        \"created_at\": \"2014-10-04T16:43:29Z\",\n        \"updated_at\": \"2014-10-04T16:43:29Z\"\n    }\n\n}","name":"Success","language":"json"},{"name":"Failure","language":"json","code":"{}"}]},"settings":"","examples":{"codes":[]},"method":"post","params":[{"in":"body","_id":"542f3e705eceb608003fdcff","default":"NewBulk","desc":"Order type. Accepted values: Restock (add order to inventory), NewBulk (create a new order to be shipped - DEFAULT)","name":"order.type","ref":"","required":true,"type":"string"},{"default":"account_balance","desc":"Method of payment. Values: \"account_balance\", \"active_card\"","name":"order.payment_method","ref":"","required":true,"type":"string","in":"body","_id":"542f3e705eceb608003fdcfe"},{"required":true,"type":"string","in":"body","_id":"542f3e705eceb608003fdcfd","default":"","desc":"Item ID for item you are using","name":"order.line_items.item_id","ref":""},{"desc":"Item size. Accepted values: \"M2XS\", \"MXS\", \"MS\", \"MM\", \"ML\", \"MXL\", \"M2XL\", \"M3XL\",  \"M4XL\", \"W2XS\", \"WXS\", \"WS\", \"WM\", \"WL\", \"WXL\", \"W2XL\", \"W3XL\", \"W4XL\". Each item has their own list of accepted sizes which is a subset of these sizes, which you can find in items.json. Items that need no size should use \"NS\".","name":"order.line_items.size","ref":"","required":true,"type":"string","in":"body","_id":"542f3e705eceb608003fdcfc","default":""},{"ref":"","required":true,"type":"int","in":"body","_id":"542f3f5b9f1a690800b2b18e","default":"","desc":"Quantity of items you would like in the order. Total minimum is 25","name":"order.line_items.quantity"},{"in":"body","_id":"542f3f5b9f1a690800b2b18d","default":"","desc":"First and Last name of recipient (if needed, Restock orders go in inventory and don't need address)","name":"address.name","ref":"","required":false,"type":"string"},{"type":"string","in":"body","_id":"542f3f5b9f1a690800b2b18c","default":"","desc":"Name of company being shipped to","name":"address.business_name","ref":"","required":false},{"name":"address.street1","ref":"","required":false,"type":"string","in":"body","_id":"542f3f5b9f1a690800b2b18b","default":"","desc":"Primary address line"},{"type":"string","in":"body","_id":"542f3f5b9f1a690800b2b18a","default":"","desc":"Secondary address line","name":"address.street2","ref":"","required":false},{"name":"address.city","ref":"","required":false,"type":"string","in":"body","_id":"542f3f5b9f1a690800b2b189","default":"","desc":"City for the shipment"},{"type":"string","in":"body","_id":"542f3f5b9f1a690800b2b188","default":"","desc":"State or province for shipment","name":"address.state","ref":"","required":false},{"name":"address.zip","ref":"","required":false,"type":"string","in":"body","_id":"542f3f5b9f1a690800b2b187","default":"","desc":"Zip code for the address"},{"default":"US","desc":"2 character code for country","name":"address.country","ref":"","required":false,"type":"string","in":"body","_id":"542f3f5b9f1a690800b2b186"},{"desc":"Set to true to send a test request","name":"test_mode","ref":"","required":false,"type":"string","in":"body","_id":"542f3f5b9f1a690800b2b185","default":"false"}],"try":false,"url":"/orders","auth":"never","basic_auth":false},"body":"[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Example\"\n}\n[/block]\nThis endpoint creates new orders (i.e printing new items). It is not for shipping items from your inventory (use the inventory_shipments endpoint for that). If you'd like to print a set of new shirts for an event or conference, this is the endpoint you can use to automate it (similar to creating an order through the dashboard).\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"require 'rest-client'\\nrequire 'json'\\nurl = \\\"https://api.startupthreads.com/orders\\\"\\n\\nheaders = {'Authorization'=> 'Token token=\\\"API_KEY\\\"',\\n  \\t\\t\\t\\t\\t:content_type => :json, \\n  \\t\\t\\t\\t\\t:accept => 'application/vnd.startupthreads-v1+json'}\\n\\nrequest = RestClient::Resource.new(url, :headers => headers)\\n\\norder_info = {\\n  order: {\\n    type: 'NewBulk',\\n    payment_method: 'account_balance',\\n    line_items: [\\n      {\\n        item_id: 'dfsea4rs',\\n        size: 'MS',\\n        quantity: 30\\n      }\\n    ],\\n    address: {\\n      name: 'Frank Denbow',\\n      street1: '902 Broadway',\\n      street2: '4th Floor',\\n      city: 'New York',\\n      state: 'New York',\\n      zip: '10010',\\n      country: 'US'\\n    },\\n    test_mode: true\\n  }\\n}\\n     \\nresult = request.post order_info.to_json\",\n      \"language\": \"ruby\"\n    }\n  ]\n}\n[/block]","version":"541432ce720be937680a43e6","childrenPages":[]}

post/orders

Create a new order of items to be printed

Body Params

order.type:
required
stringNewBulk
Order type. Accepted values: Restock (add order to inventory), NewBulk (create a new order to be shipped - DEFAULT)
order.payment_method:
required
stringaccount_balance
Method of payment. Values: "account_balance", "active_card"
order.line_items.item_id:
required
string
Item ID for item you are using
order.line_items.size:
required
string
Item size. Accepted values: "M2XS", "MXS", "MS", "MM", "ML", "MXL", "M2XL", "M3XL", "M4XL", "W2XS", "WXS", "WS", "WM", "WL", "WXL", "W2XL", "W3XL", "W4XL". Each item has their own list of accepted sizes which is a subset of these sizes, which you can find in items.json. Items that need no size should use "NS".
order.line_items.quantity:
required
integer
Quantity of items you would like in the order. Total minimum is 25
address.name:
string
First and Last name of recipient (if needed, Restock orders go in inventory and don't need address)
address.business_name:
string
Name of company being shipped to
address.street1:
string
Primary address line
address.street2:
string
Secondary address line
address.city:
string
City for the shipment
address.state:
string
State or province for shipment
address.zip:
string
Zip code for the address
address.country:
stringUS
2 character code for country
test_mode:
stringfalse
Set to true to send a test request
[block:api-header] { "type": "basic", "title": "Example" } [/block] This endpoint creates new orders (i.e printing new items). It is not for shipping items from your inventory (use the inventory_shipments endpoint for that). If you'd like to print a set of new shirts for an event or conference, this is the endpoint you can use to automate it (similar to creating an order through the dashboard). [block:code] { "codes": [ { "code": "require 'rest-client'\nrequire 'json'\nurl = \"https://api.startupthreads.com/orders\"\n\nheaders = {'Authorization'=> 'Token token=\"API_KEY\"',\n \t\t\t\t\t:content_type => :json, \n \t\t\t\t\t:accept => 'application/vnd.startupthreads-v1+json'}\n\nrequest = RestClient::Resource.new(url, :headers => headers)\n\norder_info = {\n order: {\n type: 'NewBulk',\n payment_method: 'account_balance',\n line_items: [\n {\n item_id: 'dfsea4rs',\n size: 'MS',\n quantity: 30\n }\n ],\n address: {\n name: 'Frank Denbow',\n street1: '902 Broadway',\n street2: '4th Floor',\n city: 'New York',\n state: 'New York',\n zip: '10010',\n country: 'US'\n },\n test_mode: true\n }\n}\n \nresult = request.post order_info.to_json", "language": "ruby" } ] } [/block]

Definition

{{ api_url }}{{ page_api_url }}

Result Format



[block:api-header] { "type": "basic", "title": "Example" } [/block] This endpoint creates new orders (i.e printing new items). It is not for shipping items from your inventory (use the inventory_shipments endpoint for that). If you'd like to print a set of new shirts for an event or conference, this is the endpoint you can use to automate it (similar to creating an order through the dashboard). [block:code] { "codes": [ { "code": "require 'rest-client'\nrequire 'json'\nurl = \"https://api.startupthreads.com/orders\"\n\nheaders = {'Authorization'=> 'Token token=\"API_KEY\"',\n \t\t\t\t\t:content_type => :json, \n \t\t\t\t\t:accept => 'application/vnd.startupthreads-v1+json'}\n\nrequest = RestClient::Resource.new(url, :headers => headers)\n\norder_info = {\n order: {\n type: 'NewBulk',\n payment_method: 'account_balance',\n line_items: [\n {\n item_id: 'dfsea4rs',\n size: 'MS',\n quantity: 30\n }\n ],\n address: {\n name: 'Frank Denbow',\n street1: '902 Broadway',\n street2: '4th Floor',\n city: 'New York',\n state: 'New York',\n zip: '10010',\n country: 'US'\n },\n test_mode: true\n }\n}\n \nresult = request.post order_info.to_json", "language": "ruby" } ] } [/block]
{"_id":"556a800071f3960d00b1e80d","__v":1,"category":"5414d4cb4985e91a17cfa997","createdAt":"2015-05-31T03:29:04.630Z","excerpt":"Create a new giveaway","body":"[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Example\"\n}\n[/block]\nUse this endpoint when you want to create a giveaway. A giveaway is a link that a user can go to, fill out their size and address information and have the item shipped to them from inventory. If you put in an email address, and email will be sent to that user with the link information.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"require 'rest-client'\\n\\nurl = \\\"https://api.startupthreads.com/giveaways\\\"\\n\\nheaders = { 'Authorization' => 'Token token=\\\"API_KEY_HERE\\\"', \\n            :accept => 'application/vnd.startupthreads-v1+json', \\n            :content_type => :json }\\n\\nrequest = RestClient::Resource.new(url, :headers => headers)\\n\\n info = {\\n  giveaway: {\\n  \\t\\titem_id: \\\"t1yjuo2a\\\",\\n\\t\\t\\tname: \\\"startupthreadsforlife\\\",\\n      item_claim_limit: 100,\\n\\t\\t\\tpayment_method: \\\"account_balance\\\",\\n\\t\\t\\temails: [\\\"frank@startupthreads.com\\\"],\\n\\t\\t\\tonly_sizes_in_inventory: true,\\n\\t\\t\\tus_only: true\\n  \\t}\\n  }\\n  \\n  result = request.post info.to_json\",\n      \"language\": \"ruby\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Using The Link\"\n}\n[/block]\nThe link that you can use to send to your users will be from the ID that is returned. If the ID returned is \"startupthreads-top-nps-scorers\". The link will be: https://dashboard.startupthreads.com/giveaways/startupthreads-top-nps-scorers/claim","hidden":false,"link_url":"","order":999,"title":"/giveaways","type":"post","updates":[],"editedParams":true,"githubsync":"","project":"541432ce720be937680a43e3","sync_unique":"","user":"541432a4720be937680a43e2","version":"541432ce720be937680a43e6","api":{"url":"/giveaways","auth":"required","examples":{"codes":[{"language":"ruby","code":"require 'rest-client'\n\nurl = \"https://api.startupthreads.com/giveaways\"\n\nheaders = { 'Authorization' => 'Token token=\"API_KEY_HERE\"', \n            :accept => 'application/vnd.startupthreads-v1+json', \n            :content_type => :json }\n\nrequest = RestClient::Resource.new(url, :headers => headers)\n\n info = {\n  giveaway: {\n  \t\titem_id: \"t1yjuo2a\",\n\t\t\tname: \"startupthreadsforlife\",\n      item_claim_limit: 100,\n\t\t\tpayment_method: \"account_balance\",\n\t\t\temails: [\"frank@startupthreads.com\"],\n\t\t\tonly_sizes_in_inventory: true,\n\t\t\tus_only: true\n  \t}\n  }\n  \n  result = request.post info.to_json","name":""}]},"method":"post","params":[{"in":"body","_id":"5420673f7eb16bb64f83c11a","default":"","desc":"Item ID from the dashboard (available on the item detail page)","name":"giveaway.item_id","ref":"","required":true,"type":"string"},{"type":"string","in":"body","_id":"542f3b1c21dada08004f3d8c","default":"","desc":"Either \"account_balance\" or \"active_card\"","name":"giveaway.payment_method","ref":"","required":true},{"name":"giveaway.item_claim_limit","ref":"","required":false,"type":"int","in":"body","_id":"542f3b1c21dada08004f3d8b","default":"1","desc":"Amount of times the giveaway that can be claimed"},{"default":"","desc":"Name for the giveaway","name":"giveaway.name","ref":"","required":false,"type":"string","in":"body","_id":"542f3b1c21dada08004f3d8a"},{"desc":"Array of emails you'd like the giveaway to be sent to","name":"giveaway.emails","ref":"","required":false,"type":"array_string","in":"body","_id":"542f3b1c21dada08004f3d89","default":""},{"name":"giveaway.us_only","ref":"","required":false,"type":"boolean","in":"body","_id":"556a869cebb4890d0054232c","default":"false","desc":"Set to true if you want to limit the giveaway claimers to only be from the United States"},{"type":"boolean","in":"body","_id":"556a869cebb4890d0054232b","default":"true","desc":"Set to true if you'd like to limit the sizes to only what you have in inventory","name":"giveaway.only_sizes_in_inventory","ref":"","required":false}],"results":{"codes":[{"name":"Success","code":"{\n    \"giveaway\": {\n        \"id\": \"startupthreads-261b79c3-6e81-490f-a1bd-39ba0b1f25c3\",\n        \"name\": \"startupthreads-261b79c3-6e81-490f-a1bd-39ba0b1f25c3\",\n      \t\"url\": \"https://dashboard.startupthreads.com/giveaways/startupthreads-261b79c3-6e81-490f-a1bd-39ba0b1f25c3/claim\" ,\n        \"status\": \"Active\",\n        \"total_claimed\": 0,\n        \"emails\": [\n            \"frank@startupthreads.com\"\n        ],\n        \"us_only\": true,\n        \"only_sizes_in_inventory\": true,\n        \"created_at\": \"2015-05-31T03: 19: 02Z\",\n        \"updated_at\": \"2015-05-31T03: 19: 02Z\"\n    }\n}","language":"json"},{"name":"Failure","code":"{}","language":"json"}]},"settings":""},"editedParams2":true,"isReference":false,"link_external":false,"slug":"giveaways","childrenPages":[]}

post/giveaways

Create a new giveaway

Body Params

giveaway.item_id:
required
string
Item ID from the dashboard (available on the item detail page)
giveaway.payment_method:
required
string
Either "account_balance" or "active_card"
giveaway.item_claim_limit:
integer1
Amount of times the giveaway that can be claimed
giveaway.name:
string
Name for the giveaway
giveaway.emails:
array of strings
Array of emails you'd like the giveaway to be sent to
giveaway.us_only:
booleanfalse
Set to true if you want to limit the giveaway claimers to only be from the United States
giveaway.only_sizes_in_inventory:
booleantrue
Set to true if you'd like to limit the sizes to only what you have in inventory
[block:api-header] { "type": "basic", "title": "Example" } [/block] Use this endpoint when you want to create a giveaway. A giveaway is a link that a user can go to, fill out their size and address information and have the item shipped to them from inventory. If you put in an email address, and email will be sent to that user with the link information. [block:code] { "codes": [ { "code": "require 'rest-client'\n\nurl = \"https://api.startupthreads.com/giveaways\"\n\nheaders = { 'Authorization' => 'Token token=\"API_KEY_HERE\"', \n :accept => 'application/vnd.startupthreads-v1+json', \n :content_type => :json }\n\nrequest = RestClient::Resource.new(url, :headers => headers)\n\n info = {\n giveaway: {\n \t\titem_id: \"t1yjuo2a\",\n\t\t\tname: \"startupthreadsforlife\",\n item_claim_limit: 100,\n\t\t\tpayment_method: \"account_balance\",\n\t\t\temails: [\"frank@startupthreads.com\"],\n\t\t\tonly_sizes_in_inventory: true,\n\t\t\tus_only: true\n \t}\n }\n \n result = request.post info.to_json", "language": "ruby" } ] } [/block] [block:api-header] { "type": "basic", "title": "Using The Link" } [/block] The link that you can use to send to your users will be from the ID that is returned. If the ID returned is "startupthreads-top-nps-scorers". The link will be: https://dashboard.startupthreads.com/giveaways/startupthreads-top-nps-scorers/claim

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



[block:api-header] { "type": "basic", "title": "Example" } [/block] Use this endpoint when you want to create a giveaway. A giveaway is a link that a user can go to, fill out their size and address information and have the item shipped to them from inventory. If you put in an email address, and email will be sent to that user with the link information. [block:code] { "codes": [ { "code": "require 'rest-client'\n\nurl = \"https://api.startupthreads.com/giveaways\"\n\nheaders = { 'Authorization' => 'Token token=\"API_KEY_HERE\"', \n :accept => 'application/vnd.startupthreads-v1+json', \n :content_type => :json }\n\nrequest = RestClient::Resource.new(url, :headers => headers)\n\n info = {\n giveaway: {\n \t\titem_id: \"t1yjuo2a\",\n\t\t\tname: \"startupthreadsforlife\",\n item_claim_limit: 100,\n\t\t\tpayment_method: \"account_balance\",\n\t\t\temails: [\"frank@startupthreads.com\"],\n\t\t\tonly_sizes_in_inventory: true,\n\t\t\tus_only: true\n \t}\n }\n \n result = request.post info.to_json", "language": "ruby" } ] } [/block] [block:api-header] { "type": "basic", "title": "Using The Link" } [/block] The link that you can use to send to your users will be from the ID that is returned. If the ID returned is "startupthreads-top-nps-scorers". The link will be: https://dashboard.startupthreads.com/giveaways/startupthreads-top-nps-scorers/claim
{"_id":"5762f760e3e44d0e000a4b37","body":"[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Shipping Cost\"\n}\n[/block]\nUse this endpoint when you want to check out what the shipping cost will be for a certain package. No actual shipment is made via this action, it just returns the cost of shipping (in cents) for you to use in your application.","createdAt":"2016-06-16T19:00:48.102Z","excerpt":"Get the shipping rate for a shipment of items","title":"/shipping_cost","__v":0,"githubsync":"","hidden":false,"isReference":false,"link_external":false,"order":999,"sync_unique":"","version":"541432ce720be937680a43e6","api":{"params":[{"ref":"","required":true,"desc":"Item ID from the dashboard","default":"","type":"string","name":"order.line_items.item_id","in":"body","_id":"542f3b1c21dada08004f3d8c"},{"required":true,"type":"string","in":"body","_id":"542f3b1c21dada08004f3d8b","default":"","desc":"Item size. Accepted values: \"M2XS\", \"MXS\", \"MS\", \"MM\", \"ML\", \"MXL\", \"M2XL\", \"M3XL\",  \"M4XL\", \"W2XS\", \"WXS\", \"WS\", \"WM\", \"WL\", \"WXL\", \"W2XL\", \"W3XL\", \"W4XL\". Each item has their own list of accepted sizes which is a subset of these sizes, which you can find in items.json. Items that need no size should use \"NS\".","name":"order.line_items.size","ref":""},{"type":"int","name":"order.line_items.quantity","in":"body","_id":"542f3b1c21dada08004f3d8a","ref":"","required":true,"desc":"Number of items for the order","default":""},{"type":"string","name":"order.address.street1","in":"body","_id":"542f3b1c21dada08004f3d87","ref":"","required":true,"desc":"Main street address of shipment","default":""},{"type":"string","name":"order.address.street2","in":"body","_id":"542f3b1c21dada08004f3d86","ref":"","required":false,"desc":"Secondary street address of shipment","default":""},{"type":"string","name":"order.address.city","in":"body","_id":"542f3b1c21dada08004f3d85","ref":"","required":true,"desc":"City where shipment is heading","default":""},{"type":"string","name":"order.address.state","in":"body","_id":"542f3b1c21dada08004f3d84","ref":"","required":true,"desc":"State/Province where shipment is heading","default":""},{"required":true,"desc":"Zip code where shipment is heading","default":"","type":"string","name":"order.address.zip","in":"body","_id":"542f3b1c21dada08004f3d83","ref":""},{"desc":"2 letter country code","default":"","type":"string","name":"order.address.country","in":"body","_id":"542f3b1c21dada08004f3d82","ref":"","required":true}],"results":{"codes":[{"name":"Success","code":"{\"shipping\":{\"cost\":312}}","language":"json"},{"status":400,"name":"Failure","code":"{\"error\":\"XXX is not valid size for item ITEM_ID. Check the available sizes in items.json under item_sizes\"}","language":"json"}]},"settings":"","url":"/shipping_cost","auth":"required","examples":{"codes":[{"language":"ruby","code":"require 'rest-client'\n\nurl = \"https://api.startupthreads.com/shipping_cost\"\n\nheaders = { 'Authorization' => 'Token token=\"YOU_API_KEY_HERE\"', \n            :accept => 'application/vnd.startupthreads-v1+json', \n            :content_type => :json }\n\nrequest = RestClient::Resource.new(url, :headers => headers)\n\norder_info = {\n  order: {\n    line_items: [\n      {\n        item_id: 'ITEM_ID_HERE',\n        size: '2_CHARACTER_ITEM_SIZE_HERE',\n        quantity: 1\n      }\n    ],\n    address: {\n      name: 'Johnny Five',\n      street1: '902 Broadway',\n      street2: '4th Floor',\n      city: 'New York',\n      state: 'New York',\n      zip: '10010',\n      country: 'US'\n    }\n  }\n}\n\nresult = request.post order_info.to_json"}]},"method":"post"},"editedParams2":true,"link_url":"","slug":"shipping_cost","type":"post","updates":[],"user":"541432a4720be937680a43e2","category":"5414d4cb4985e91a17cfa997","editedParams":true,"project":"541432ce720be937680a43e3","childrenPages":[]}

post/shipping_cost

Get the shipping rate for a shipment of items

Body Params

order.line_items.item_id:
required
string
Item ID from the dashboard
order.line_items.size:
required
string
Item size. Accepted values: "M2XS", "MXS", "MS", "MM", "ML", "MXL", "M2XL", "M3XL", "M4XL", "W2XS", "WXS", "WS", "WM", "WL", "WXL", "W2XL", "W3XL", "W4XL". Each item has their own list of accepted sizes which is a subset of these sizes, which you can find in items.json. Items that need no size should use "NS".
order.line_items.quantity:
required
integer
Number of items for the order
order.address.street1:
required
string
Main street address of shipment
order.address.street2:
string
Secondary street address of shipment
order.address.city:
required
string
City where shipment is heading
order.address.state:
required
string
State/Province where shipment is heading
order.address.zip:
required
string
Zip code where shipment is heading
order.address.country:
required
string
2 letter country code
[block:api-header] { "type": "basic", "title": "Shipping Cost" } [/block] Use this endpoint when you want to check out what the shipping cost will be for a certain package. No actual shipment is made via this action, it just returns the cost of shipping (in cents) for you to use in your application.

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



[block:api-header] { "type": "basic", "title": "Shipping Cost" } [/block] Use this endpoint when you want to check out what the shipping cost will be for a certain package. No actual shipment is made via this action, it just returns the cost of shipping (in cents) for you to use in your application.
{"_id":"5414d44f4985e91a17cfa987","api":{"results":{"codes":[{"language":"json","code":"{}","name":"Success"},{"language":"json","code":"{}","name":"Failure"}]},"try":true,"url":"","auth":"never","params":[]},"updates":[],"user":"541432a4720be937680a43e2","is_link":false,"slug":"introduction","type":"basic","title":"Introduction","__v":1,"excerpt":"","link_url":"","order":0,"sync_unique":"","version":"541432ce720be937680a43e6","body":"Welcome to our StartupThreads API documentation. Refer back here if you have any questions about using our API.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"1. What is StartupThreads?\"\n}\n[/block]\nStartupThreads is a merchandising solution which enables you to design, print and ship custom apparel. The API enables you to programmatically distribute that merchandise to your customers.","category":"5414d4464985e91a17cfa986","createdAt":"2014-09-13T23:33:35.659Z","project":"541432ce720be937680a43e3","childrenPages":[]}

Introduction


Welcome to our StartupThreads API documentation. Refer back here if you have any questions about using our API. [block:api-header] { "type": "basic", "title": "1. What is StartupThreads?" } [/block] StartupThreads is a merchandising solution which enables you to design, print and ship custom apparel. The API enables you to programmatically distribute that merchandise to your customers.
Welcome to our StartupThreads API documentation. Refer back here if you have any questions about using our API. [block:api-header] { "type": "basic", "title": "1. What is StartupThreads?" } [/block] StartupThreads is a merchandising solution which enables you to design, print and ship custom apparel. The API enables you to programmatically distribute that merchandise to your customers.
{"_id":"5414d4784985e91a17cfa98d","category":"5414d4464985e91a17cfa986","slug":"contact-us","api":{"auth":"never","basic_auth":false,"params":[],"results":{"codes":[{"language":"json","code":"{}","name":"Success"},{"language":"json","code":"{}","name":"Failure"}]},"try":true,"url":""},"body":"If you have any questions, email [us](mailto:frank+api@startupthreads.com) and we will help out.","order":1,"sync_unique":"","type":"basic","createdAt":"2014-09-13T23:34:16.712Z","excerpt":"","link_url":"","title":"Contact Us","user":"541432a4720be937680a43e2","__v":2,"is_link":false,"project":"541432ce720be937680a43e3","updates":[],"version":"541432ce720be937680a43e6","childrenPages":[]}

Contact Us


If you have any questions, email [us](mailto:frank+api@startupthreads.com) and we will help out.
If you have any questions, email [us](mailto:frank+api@startupthreads.com) and we will help out.