Anchor to Local Pickup Delivery Option Generator Function APILocal Pickup Delivery Option Generator Function API
Local pickup allows customers to pick up their online orders at a retail location instead of having items shipped. To show local pickup options, you can only use the Local Pickup Option Generator Function API.
Shopify Functions enable you to customize Shopify's backend logic. The Local Pickup Delivery Option Generator API integrates this logic into the checkout flow.
Use the API to allow local pickup during specified days and times, or define products that are only available for pickup at a particular location. The API includes data such as buyer identity, fulfillment groups, and location addresses.
Only custom apps installed on stores on the Shopify Plus plan can use this API.
Merchants must be enrolled in the Partners program to deploy their own custom apps and location rules.
Anchor to Use casesUse cases
- Show local pickup options even when a location's inventory is unavailable, as long as items can be transferred from another location.
- Show local pickup options only for VIP customers.
- Modify the lead times of the pickup order depending on the items in the cart.
- Charge a fee for a local pickup in-store order (for example, $5 USD to pick up in two hours, free otherwise).
Anchor to Getting startedGetting started
Scaffolding the Function using Shopify CLI will automatically configure your TOML file. You can alter the default configuration to customize the way your Function operates.
Anchor to TargetsTargets
A target is an identifier in shopify.extension.toml
that specifies where you're injecting code into Shopify Function
APIs, or other parts of the Shopify platform. Each target is composed of three to four namespaces. The name begins with
a broad Shopify context and ends with the behavior of the extensible element.
Anchor to Run targetRun target
purchase.local-pickup-delivery-option-generator.run
The run target generates custom local pickup options either using Shopify data or hardcoded values. The target returns a list of operations to show local pickup options.
For example, you might use this to specify which locations can fulfill items in a cart, or the locations that have local pickup enabled.
- Anchor to InputInputOBJECT
The
Input
object is the complete GraphQL schema that your Function can query as input to customize local pickup options. Your Function receives only the fields that you request in the input query. To optimize performance, we highly recommend that you request only the fields that your Function requires.- Anchor to cartcart•Cart!non-null
The cart where the Function is running. A cart contains the merchandise that a customer intends to purchase and information about the customer, such as the customer's email address and phone number.
- Anchor to attributeattribute•Attribute
The custom attributes associated with a cart to store additional information. Cart attributes allow you to collect specific information from customers on the Cart page, such as order notes, gift wrapping requests, or custom product details. Attributes are stored as key-value pairs.
- •String
The key of the cart attribute to retrieve. For example,
.
Arguments
- •String!non-null
The key or name of the attribute. For example,
.
- Anchor to valuevalue
Fields
- •