I am currently implementing an Offsite Payment Extension for Shopify.
Our payment gateway requires detailed information about the purchased items, specifically:
- Line item name
- Unit price
- Quantity
- SKU (if available)
When Shopify initiates the payment session, I can access the payment session payload, but I cannot find the line item details.
My questions are:
- Is there a supported way for an Offsite Payment Extension to access the cart or order line items during the payment session?
- If not, what is the recommended approach to retrieve this information before redirecting the customer to our payment gateway?
- Is there any GraphQL API or webhook that can be used to obtain the purchased items while the payment is still in progress?
- If line items are intentionally unavailable during the payment session, what is the rationale behind this design?
Our payment gateway requires this information to display the purchased products on the payment page before the customer completes the payment.
Any guidance or recommended implementation would be greatly appreciated.
Hi, upping this (because it was the newest one about this topic I found :))
There is an undocumented feature you can request directly from your Shopify contact, where the payment payload will include line items, but:
- as said, it’s undocumented and not super officially supported
- the data is very basic, for example IIRC there’s no tax or discount information
As far as I know, the only supported way is to have a separate, optional companion app that can receive webhook/events from Shopify and use that data to enrich your payment sessions.
Hey @Miguel_Angel_Camacho
thanks for reaching out
I did some digging here, and as it mentioned in the thread already an offsite payments extension can’t get cart or order line items during the payment session in any supported way.
The offsite payment request doesn’t include line items or an order ID, and the payments extension limitations say that line items, order ID, and checkout ID aren’t available through the Payments Apps APIs.
There also isn’t a documented GraphQL API or webhook for getting them while the payment is in progress. Under the prohibited actions, payments extensions can’t use any Shopify API other than the Payments Apps API and mandatory webhooks. They also can’t require merchants to install other apps alongside the payments extension. I’d avoid using a companion app or undocumented payload fields for this.
The request can include transaction_metadata with shipping, tax, order-level discount, and country-specific fields. Shopify includes these based on your app’s data access and API version, and none of them are line-item details. The docs don’t explain why line items are left out.
On the design question, the docs list this as a payments extension limitation, but I don’t have context on the official rationale of why this is the case
To help me document this use case, what does your gateway need the line items for before the customer pays? For example, do you only show the items on the payment page, or do you also use them for risk checks, financing approval, invoicing, or a legal requirement in specific markets? It would also help to know which fields you need and which are nice to have. @mropanen, if you could share context behind your use case as well, the same details would help.