Build a Pre-order and Try Before You Buy (TBYB) solution
You can create pre-order and TBYB options using the GraphQL Admin API's sellingPlanGroupCreate
mutation. This guide describes the requirements for creating pre-order or TBYB options and shows you how to manage them using the GraphQL Admin API.
Requirements
Anchor link to section titled "Requirements"- Your app can make authenticated requests to the GraphQL Admin API.
Your app has the following access scopes:
write_products
read_all_orders
read_customer_payment_methods
read_purchase_options
write_purchase_options
read_payment_mandate
write_payment_mandate
Learn how to configure your access scopes using Shopify CLI.
You've familiarized yourself with selling plans and pre-orders and TBYB.
You've created products and product variants in your development store.
The merchant that you're developing for meets the qualifying criteria.
Step 1: Create pre-order and TBYB options
Anchor link to section titled "Step 1: Create pre-order and TBYB options"Create pre-order and TBYB options using the sellingPlanGroupCreate
mutation. The SellingPlanGroup
object includes one or more SellingPlan
objects. The SellingPlan
object specifies how a product can be sold.
Learn more about GraphQL Admin API objects for selling plans. For more information on input fields and values, refer to the following resources:
Create a pre-order with a selling plan (SellingPlan
) that contains the following policies:
- Billing (
billingPolicy.fixed
): The 20% of the total amount will be charged as a deposit at checkout. The remaining amount will be charged on 2022-07-24. - Delivery (
deliveryPolicy.fixed
): The fulfillment timeline is unknown. - Pricing (
pricingPolicies.fixed
): A 15% product reduction is applied to the variant. - Inventory (
inventoryPolicy.reserve
): The inventory will be updated when the order is fulfilled.
The category
field should be set to PRE_ORDER
.
Create a try before you buy with a selling plan (SellingPlan
) that contains the following policies:
- Billing (
billingPolicy.fixed
): There's no deposit. The full amount will be charged 14 days after checkout. TheremainingBalanceChargeTimeAfterCheckout
value must be in ISO 8601 duration format (P14D
). - Delivery (
deliveryPolicy.fixed
): The product will be fulfilled as soon as possible. - Inventory (
inventoryPolicy.reserve
): The inventory will be updated when the order is created.
The category
field should be set to TRY_BEFORE_YOU_BUY
.
Step 2 (Optional): Manage pre-order and TBYB options
Anchor link to section titled "Step 2 (Optional): Manage pre-order and TBYB options"Associate a pre-order or TBYB option to a product or product variant
Anchor link to section titled "Associate a pre-order or TBYB option to a product or product variant"You can use the sellingPlanGroupAddProducts
mutation or the sellingPlanGroupAddProductVariants
mutation to make a separate request to associate a pre-order or TBYB option with a product or product variant, without having to delete and recreate the pre-order or TBYB option.
Associate multiple pre-order or TBYB options to a product or product variant
Anchor link to section titled "Associate multiple pre-order or TBYB options to a product or product variant"You can use the productJoinSellingPlanGroups
mutation or the productVariantJoinSellingPlanGroups
mutation to associate multiple pre-orders or TBYB to a product or product variant.
Edit pre-order and TBYB options
Anchor link to section titled "Edit pre-order and TBYB options"You can use the sellingPlanGroupUpdate
mutation to edit the attributes associated with a pre-order or TBYB option. For example, you can change the pre-order or TBYB options name
.
- Learn about shipping and delivery for pre-orders and TBYB.