Bundle App

r

https://www.figma.com/file/lcAiv9quIJybAT09WtMD42/Cart-Bundling%2FLinking?node-id=751%3A330https://secretlabsg.slack.com/files/U02BXMH4T1P/F03BBBPEA9Y/image_from_ios.jpgproblem:price validation, the item price passed from frontend cannot be trusted to create a draft order. Might need to take the price from shopify api.for variant needed to be auto removal if main product is gone, where to indicate that? does this variant need to be removed from a single rule or all the rules?

a

V3 Api

bundle list

r

Product PageMethod:Get

params

sku

response

r

rule 1:[  {   "bundle_name":"A",   "bundle_type":"1",   "priority":1,   "stackable":false,   "has_discount":true,   "discount_type":"value",   "discount_value":20.00,   "minimum_quantity":3,   "maximum_quantity":0,   "variants":[     {      "id":1,      "variant_id":100,      "sku":"2022",      "minimum_quantity":1,      "maximum_quanity":1,      "is_main":false,      "auto_add":false,      "has_discount":false,      "discount_type":null,      "discount_value":null     },     {      "id":2,      "variant_id":101,      "sku":"wiper",      "minimum_quantity":1,      "maximum_quanity":0,      "is_main":false,      "auto_add":false,      "has_discount":false,      "discount_type":null,      "discount_value":null     }   ]  }]---------------------------------------rule 2:[  {   "bundle_name":"A",   "bundle_type":"2",   "priority":1,   "stackable":false,   "has_discount":"ture",   "discount_type":"value",   "discount_value":20.00,   "minimum_quantity":3,   "maximum_quantity":0,   "variants":[     {      "id":1,      "variant_id":100,      "sku":"2022",      "minimum_quantity":1,      "maximum_quanity":1,      "is_main":true,      "auto_add":false,      "has_discount":false,      "discount_type":null,      "discount_value":null     },     {      "id":2,      "variant_id":101,      "sku":"wiper",      "minimum_quantity":1,      "maximum_quanity":1,      "is_main":false,      "auto_add":true,      "has_discount":false,      "discount_type":null,      "discount_value":null     }   ]  }]---------------------------------------rule 3:[  {   "bundle_name":"A",   "bundle_type":"3",   "priority":1,   "stackable":false,   "has_discount":"ture",   "discount_type":"percentage",   "discount_value":10,   "minimum_quantity":3,   "maximum_quantity":3,   "variants":[     {      "id":1,      "variant_id":100,      "sku":"2022",      "minimum_quantity":1,      "maximum_quanity":1,      "is_main":true,      "auto_add":false,      "has_discount":false,      "discount_type":null,      "discount_value":null     },     {      "id":2,      "variant_id":101,      "sku":"dry-wiper",      "minimum_quantity":0,      "maximum_quanity":2,      "is_main":false,      "auto_add":false,      "has_discount":false,      "discount_type":null,      "discount_value":null     },     {      "id":3,      "variant_id":102,      "sku":"wet-wiper",      "minimum_quantity":0,      "maximum_quanity":2,      "is_main":false,      "auto_add":false,      "has_discount":false,      "discount_type":null,      "discount_value":null     }   ]  }]

Recommended bundles

r

Cart PageMethod:Post

params

cart object

r

Shopify Cart Object

response

r

the response is same as product page, it is just giving more rules by multiple skus

Validation

r

Cart PageMethod:Post

params

cart object

response

r

has_bundle: booleandoes the cart object fit into any bundle rule?cart_items: arrayskus and its discount amounterror: arrayskus needs to be removedskus needs to be added{"has_bundle": true,"cart_items": [{"sku": "2022","discounted_amount":0,},{"sku": "2022","discounted_amount":10,},{"sku": "2022","discounted_amount":10,}],"error":[{"sku": "2022","add":1,"deduct":0,"message":""]]

Create/Update draft order

r

Checkout cartMethod:Post

params

cart object

draft order id

nullable

response

draft order id

checkout url

logic

validation

return error

has draft order id

update draft order

no draft order id

create draft order

r

https://shopify.dev/api/admin-rest/2021-10/resources/draftorder#post-draft-orders- use line item discount

V3 UI

List

Add new

store selection

copy bundle rules to other store

selectable

check for existence

update rules to all stores if same name existed

Add/Edit

bundle name

bundle type

optional

> 2 skus

mandatory

n+m

has main product

auto add sub product

limited

n+m

has main product

customer optional to add sub product

discount

has_discount

type

amount

validity

start_time

end_time

priority

r

0:highest-10: lowest

stackable

r

does this bundle rule can be stack with other bundle rules?not on sales price

quantity

minimum

maximum

sku list

id

r

this id is sku list item id, not present in UI.the primary key is also used for multiple same sku item do sales like buy 1 get the same 1 free or buy 1 get the same one at 50% discount.

variant_id

sku

min quantity

max quantity

discount

has_discount

type

value

is_main

auto_add

should_remove_exceeded

r

if the quantity in cart exceed the max quantity, should remove the exceeded quantity?

price_overwrite

r

to overwrite the original price,if set to 0 means this is free