Skip to content

Instantly share code, notes, and snippets.

@somewherewarm-snippets
Last active January 14, 2025 09:28
pb-store-api-cart-add-item.sh
curl -X POST --location "https://example.com/wp-json/wc/store/v1/cart/add-item" \
-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"
}
]
}
]
}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment