Skip to content

Instantly share code, notes, and snippets.

@somewherewarm-snippets
Last active January 14, 2025 09:28

Revisions

  1. somewherewarm-snippets revised this gist Jan 14, 2025. 1 changed file with 0 additions and 1 deletion.
    1 change: 0 additions & 1 deletion pb-store-api-cart-add-item.sh
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,4 @@
    curl -X POST --location "https://example.com/wp-json/wc/store/v1/cart/add-item" \
    --basic \
    -u customer_key:customer_secret \
    -H "Accept: application/json" \
    -H "nonce: deadbeef" \
  2. somewherewarm-snippets renamed this gist Jan 14, 2025. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  3. somewherewarm-snippets created this gist Jan 14, 2025.
    36 changes: 36 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,36 @@
    curl -X POST --location "https://example.com/wp-json/wc/store/v1/cart/add-item" \
    --basic \
    -u customer_key:customer_secret \
    -H "Accept: application/json" \
    -H "nonce: deadbeef" \
    -H "Content-Type: application/json" \
    -d '{
    "id": 138,
    "quantity": 2,
    "bundle_configuration": [
    {
    "bundled_item_id": 123,
    "quantity" : 2
    },
    {
    "bundled_item_id": 124,
    "quantity" : 1
    },
    {
    "bundled_item_id": 125,
    "variation_id" : 256,
    "quantity" : 2,
    "attributes" : [
    {
    "name" : "pa_size",
    "option": "small"
    },
    {
    "name" : "pa_colour",
    "option": "blue"
    }
    ]
    }
    ]
    }'