Manage deferred purchase options
You can create purchase options using the GraphQL Admin API's sellingPlanGroupCreate
mutation. This guide describes the requirements for creating deferred purchase options and shows you how to manage deferred purchase options 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
For more information on requesting access scopes when your app is installed, refer to Getting started with OAuth.
You've familiarized yourself with purchase options and deferred purchase options.
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 deferred purchase options
Anchor link to section titled "Step 1: Create deferred purchase options"Create pre-order and try before you buy purchase 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 purchase options. For more information on input fields and values, refer to the following resources:
Create a pre-order purchase option 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 deferred purchase options
Anchor link to section titled "Step 2 (Optional): Manage deferred purchase options"Associate a purchase option to a product or product variant
Anchor link to section titled "Associate a purchase 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 purchase option with a product or product variant, without having to delete and recreate the purchase option.
Associate multiple purchase options to a product or product variant
Anchor link to section titled "Associate multiple purchase options to a product or product variant"You can use the productJoinSellingPlanGroups
mutation or the productVariantJoinSellingPlanGroups
mutation to associate multiple purchase options to a product or product variant.
Edit a purchase option
Anchor link to section titled "Edit a purchase option"You can use the sellingPlanGroupUpdate
mutation to edit the attributes associated with a purchase option. For example, you can change the purchase option's name
.
- Learn about shipping and delivery for deferred purchase options.