一旦创建了要发货的产品,也可以使用这些产品创建组合销售,即使用Create Bundle端点创建虚拟捆绑产品。
curl --location --request POST '<https://api.deliverr.com/bundles/v1/bundle>' \\
--header 'Content-Type: application/json' \\
--header 'Accept: application/json' \\
--header 'Authorization: Bearer {valid_access_token}' \\
--data-raw '{
"externalBundleId": "string",
"title": "string",
"sku": "string",
"bundleContents": [
{
"productId": "string",
"quantity": 0
}
]
}'
该响应具有 bundleId
字段,该字段与卖家门户的DSKU值相对应。您可以在卖方门户查看所创建的产品,网址为: *https://sellerportal.deliverr.com/inventory/bundles/{bundleId}*
若要将externalBundleId连接到现有的Deliverr优惠捆绑套餐,请向LLink externalBundleId 端点发出请求,将自定义的externalBundleId连接到现有的Deliverr产品。
curl --location --request PATCH '<https://api.deliverr.com/bundles/v1/bundle/{bundleId}/link/{externalBundleId}>' \\
--header 'Authorization: Bearer {valid_access_token}'
在该请求中,productId
应该是现有产品的DSKU值,而 externalProductId
由您定义。
创建和/或链接优惠捆绑套餐后,您可以使用 Get Bundle by externalBundleId 端点来确认已正确设置,并确认优惠捆绑套餐如您所期。
curl --location --request GET '<https://api.deliverr.com/products/v1/product/{productId}/inventory>' \\
--header 'Authorization: Bearer {valid_access_token}'
您可以运行 Get Bundle Inventory 端点并确保 availableUnits
大于0,来确认优惠捆绑套餐已准备好接收订单并发货。
curl --location --request GET '<https://api.deliverr.com/bundles/v1/bundle/{bundleId}/inventory>' \\
--header 'Authorization: Bearer {valid_access_token}'
注:若要在创建订单时使用优惠捆绑套餐,请在订单行项目的externalProductId字段中,使用externalBundleId。