Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,15 @@ body:
"quantity": 1,
"variants": []
}
scripts:
- type: afterResponse
code: |-
// Update item in Cart and Remove item from cart address {{line_item_id}} —
// the cart ITEM id (cart_item_*), not the product id. Nothing set it.
var json_response = pm.response.json();

if (Array.isArray(json_response.items) && json_response.items.length) {
pm.environment.set("line_item_id", json_response.items[0].id);
}
language: text/javascript
order: 1000
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
$kind: http-request
description: |-
Removes a line item or product from a cart. The response returns the updated cart after the item is removed.
url: "{{base_url}}/{{api_prefix}}/{{namespace}}/carts/{id}/{line_item_id}"
url: "{{base_url}}/{{api_prefix}}/{{namespace}}/carts/{{cart_id}}/{{line_item_id}}"
method: DELETE
pathVariables:
id: ""
line_item_id: ""
order: 4000
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
$kind: http-request
description: |+
You can update all properties of the Zone.

url: "{{base_url}}/{{api_prefix}}/{{namespace}}/carts/{id}/{line_item_id}"
description: |-
Updates a line item already in the cart. Send any of `quantity`, `variants`,
`addons` or `scheduled_at`; omitted fields are left unchanged. The response
returns the updated cart.
url: "{{base_url}}/{{api_prefix}}/{{namespace}}/carts/{{cart_id}}/{{line_item_id}}"
method: PUT
pathVariables:
id: ""
line_item_id: ""
headers:
- key: Content-Type
value: application/json
body:
type: json
content: |-
{
"quantity": 2
}
order: 3000
Loading