{"_id":"5834e58cb85f2f0f004638f5","__v":3,"category":{"_id":"56a97837f834950d0037b363","__v":8,"pages":["56a98ff62d8fd90d0036eee9","56a98ffc1801ac0d00881b8b","56a99013257fbc0d00d47633","56a99029257fbc0d00d47635","56a990541801ac0d00881b8e","56a99094f834950d0037b37e","56a9923e13a69a0d00a778dc","56a9a7161801ac0d00881ba5"],"project":"567f0c06143cc60d00c1fdbe","version":"567f0c06143cc60d00c1fdc1","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-01-28T02:08:55.258Z","from_sync":false,"order":2,"slug":"variations","title":"Variations"},"githubsync":"","project":"567f0c06143cc60d00c1fdbe","user":"567f0baca74a1c0d003e1fba","version":{"_id":"567f0c06143cc60d00c1fdc1","__v":9,"project":"567f0c06143cc60d00c1fdbe","createdAt":"2015-12-26T21:52:06.734Z","releaseDate":"2015-12-26T21:52:06.734Z","categories":["567f0c07143cc60d00c1fdc2","56a9783109cb9c0d00f0c7d3","56a97837f834950d0037b363","56a9783b2d8fd90d0036eed6","56a979912d8fd90d0036eed8","5834b5691a80690f00d31faf","5834b5e4f775120f00c45f9d","5bf1a1473031e4005075ae14","5c64c200244bda003204b97f"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1"},"parentDoc":null,"metadata":{"title":"","description":"","image":[]},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-11-23T00:40:44.223Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[{"name":"","code":"{  \n   \"product_identifier\": \"6631A\",\n   \"identifier\": \"6631A-PINK\",\n   \"internal_id\": 26090755,\n   \"size\": null,\n   \"color\": \"Pink\",\n   \"quantity\": 33,\n   \"created_at\": \"2018-04-03T23:08:45-07:00\",\n   \"disabled_at\": null,\n   \"deleted_at\": null\n}","language":"json","status":200}]},"settings":"","examples":{"codes":[{"code":"curl -X POST https://tophatter.com/merchant_api/v1/variations.json \\\n-d 'access_token=YOUR_ACCESS_TOKEN' \\\n-d 'product_identifier=6631A' \\\n-d 'identifier=6631A-PINK' \\\n-d 'color=Pink' \\\n-d 'quantity=33'","language":"curl"}]},"method":"post","auth":"required","params":[{"_id":"5834ef3007e6c80f004edfc8","ref":"","in":"body","required":true,"desc":"The unique identifier of the product this variation belongs to.","default":"","type":"string","name":"product_identifier"},{"_id":"5834ef3007e6c80f004edfc7","ref":"","in":"body","required":true,"desc":"The unique identifier or SKU that your system uses to recognize this product variation. Only letters, numbers, spaces, dashes and underscores are allowed.","default":"","type":"string","name":"identifier"},{"_id":"5834ef3007e6c80f004edfc6","ref":"","in":"body","required":false,"desc":"The size of the variation. You can specify any size you'd like, but we recommend you use a size from our standardized list of sizes here: https://tophatter.readme.io/docs/sizes.","default":"","type":"string","name":"size"},{"_id":"5834ef3007e6c80f004edfc5","ref":"","in":"body","required":false,"desc":"You can specify any color you'd like, but we recommend you use a size from our standardized list of colors here: https://tophatter.readme.io/docs/colors.","default":"","type":"string","name":"color"},{"_id":"5834ef3007e6c80f004edfc4","ref":"","in":"body","required":true,"desc":"The quantity available to sell for this variation.","default":"","type":"int","name":"quantity"}],"url":"/variations.json"},"isReference":false,"order":2,"body":"","excerpt":"","slug":"variation-create","type":"endpoint","title":"Create a Variation"}

postCreate a Variation


Definition

{{ api_url }}{{ page_api_url }}

Parameters

Body Params

product_identifier:
required
string
The unique identifier of the product this variation belongs to.
identifier:
required
string
The unique identifier or SKU that your system uses to recognize this product variation. Only letters, numbers, spaces, dashes and underscores are allowed.
size:
string
The size of the variation. You can specify any size you'd like, but we recommend you use a size from our standardized list of sizes here: https://tophatter.readme.io/docs/sizes.
color:
string
You can specify any color you'd like, but we recommend you use a size from our standardized list of colors here: https://tophatter.readme.io/docs/colors.
quantity:
required
integer
The quantity available to sell for this variation.

Examples


Result Format