Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save somewherewarm-snippets/c94d6dad36264c78dad64b1eba60734f to your computer and use it in GitHub Desktop.
Save somewherewarm-snippets/c94d6dad36264c78dad64b1eba60734f to your computer and use it in GitHub Desktop.
curl -X POST https://example.com/wp-json/wc/v1/products \
-u consumer_key:consumer_secret \
-H "Content-Type: application/json" \
-d '{
"name": "Happy Ninja Bundle",
"type": "bundle",
"regular_price": "53.0",
"sale_price": "37.0",
"description": "In pretium enim justo, at ornare libero aliquam quis. Nullam imperdiet rutrum volutpat. Suspendisse aliquet ex in ex volutpat vestibulum. Curabitur ultrices convallis condimentum.",
"short_description": "In pretium enim justo, at ornare libero aliquam quis.",
"categories": [
{
"id": 9
}
],
"images": [
{
"src": "http://somewherewarm.net/pb/wp-content/uploads/2016/09/Ninja_bundle.jpg",
"position": 0
},
{
"src": "http://somewherewarm.net/pb/wp-content/uploads/2013/06/hoodie_4_front.jpg",
"position": 1
},
{
"src": "http://somewherewarm.net/pb/wp-content/uploads/2013/06/hoodie_4_back.jpg",
"position": 2
},
{
"src": "http://somewherewarm.net/pb/wp-content/uploads/2013/06/T_7_front.jpg",
"position": 3
},
{
"src": "http://somewherewarm.net/pb/wp-content/uploads/2013/06/T_7_back.jpg",
"position": 4
}
],
"bundled_items": [
{
"product_id": 53,
"quantity_min": 1,
"quantity_max": 1,
"priced_individually": false,
"shipped_individually": false,
"optional": false,
"override_title": true,
"title": "Happy Ninja T-Shirt"
},
{
"product_id": 37,
"quantity_min": 1,
"quantity_max": 1,
"priced_individually": false,
"shipped_individually": false,
"optional": false,
"override_title": true,
"title": "Happy Ninja Hoodie"
}
],
"bundle_layout": "default"
}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment