Skip to content

Instantly share code, notes, and snippets.

View somewherewarm-snippets's full-sized avatar

SomewhereWarm Support somewherewarm-snippets

  • WooCommerce
  • Athens
View GitHub Profile
@somewherewarm-snippets
somewherewarm-snippets / response.txt
Created April 9, 2025 10:55
Store API products endpoint response enriched by Product Bundles
"extensions": {
"bundles": {
"bundle_stock_status": "instock",
"bundle_stock_quantity": 15,
"bundle_virtual": false,
"bundle_layout": "default",
"bundle_add_to_cart_form_location": "default",
"bundle_editable_in_cart": true,
"bundle_sold_individually_context": "product",
"bundle_item_grouping": "parent",
curl -X POST --location "https://example.com/wp-json/wc/store/v1/cart/add-item" \
-user consumer_key:consumer_secret \
-H "Accept: application/json" \
-H "nonce: deadbeef" \
-H "Content-Type: application/json" \
-d '{
"id": 653,
"quantity": 2,
"composite_configuration": [
{
@somewherewarm-snippets
somewherewarm-snippets / pb-store-api-cart-update-item.sh
Last active January 14, 2025 09:33
pb-store-api-cart-add-update.sh
curl -X POST --location "https://example.com/wp-json/wc/store/v1/cart/update-item" \
-u consumer_key:consumer_secret \
-H "Accept: application/json" \
-H "nonce: deadbeef" \
-H "Content-Type: application/json" \
-d '{
"key": "e3ead8396bb9598bf7092a1e78446b9f",
"quantity": 2
}'
@somewherewarm-snippets
somewherewarm-snippets / pb-store-api-cart-add-item.sh
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": [
{
curl -X PUT https://example.com/wp-json/wc/v3/products/123 \
-u customer_key:customer_secret \
-H "Content-Type: application/json" \
-d '{
"addons": [
{
"id": 1719406272
},
{
"id": 1719406273
curl -X PUT https://example.com/wp-json/wc/v3/products/123 \
-u customer_key:customer_secret \
-H "Content-Type: application/json" \
-d '{
"addons": [
{
"id": 1719406272
},
{
"id": 1719406273
curl -X PUT https://example.com/wp-json/wc/v3/products/123 \
-u customer_key:customer_secret \
-H "Content-Type: application/json" \
-d '{
"addons": [
{
"id": 1719406272,
"name": "Handmade Engraving",
"price": "120",
"max": 12
curl -X POST https://example.com/wp-json/wc/v3/products \
-u customer_key:customer_secret \
-H "Content-Type: application/json" \
-d '{
"name": "Happiness Ring",
"type": "simple",
"regular_price": "21.99",
"description": "Beautiful ring that will make you happy.",
"exclude_global_add_ons": true,
"addons": [
curl -X PUT https://example.com/wp-json/wc-product-add-ons/v2/global-add-ons/123 \
-u customer_key:customer_secret \
-H "Content-Type: application/json" \
-d '{
"fields": [
{
"id": 1719406272
},
{
"id": 1719406273
curl -X PUT https://example.com/wp-json/wc-product-add-ons/v2/global-add-ons/123 \
-u customer_key:customer_secret \
-H "Content-Type: application/json" \
-d '{
"fields": [
{
"id": 1719406272
},
{
"id": 1719406273