Dear Shopify Support Team,
I am currently facing an issue while integrating the Shopify Checkout API. I am attempting to create a checkout session and prefill user data before redirecting to the Shopify checkout page, but it is not working as expected.
Here are the details of my API call:
API Request:
curl --verbose --location 'https://mystore.myshopify.com/admin/api/2023-01/checkouts.json' \
--header 'X-Shopify-Access-Token: {{adminToken}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"checkout": {
"email": "test@example.com",
"line_items": [
{
"variant_id": 42340311335014,
"quantity": 1
}
]
}
}'
Issue:
- The API response I receive is as follows:
{
"checkouts": []
}
This response does not include a valid checkout session or any checkout details.
2. While the user email (test@example.com
) is prefilled when redirecting to the Shopify checkout page, I am unable to prefill other important fields such as:
- Shipping Address
- Billing Address
- Phone Number
- Additionally, I am unsure about the correct approach to pass product data to the checkout page effectively.
Expected Behavior:
When users are redirected to the Shopify checkout page, I would like the following details to be prefilled:
- Shipping Address
- Billing Address
- Phone Number
Questions:
- Is it possible to prefill all these details on the Shopify checkout page using this API?
- If yes, could you please provide the correct API payload or additional steps required to achieve this functionality?
- If no, what alternative methods are available to prefill these details during the checkout process?
- Could you also clarify what is required to pass product data effectively to the checkout page?
Additional Information:
- Store URL: https://mystore.myshopify.com
I would greatly appreciate your guidance and support in resolving this issue.
Thank you in advance for your assistance.