Last active
January 14, 2025 09:28
-
-
Save somewherewarm-snippets/45f9bc327a3cd34f51ece92cfa94cc39 to your computer and use it in GitHub Desktop.
pb-store-api-cart-add-item.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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