How to get line item details for payments app

I have a payments app, and I need access to line items so I can include them with the transaction details for reconciliation. I’d also like to display these line items to the user when they make a payment on our site.

Since payment apps don’t have permission to read orders, what is the best approach to achieve this? Would I need to build a companion app to obtain the required permissions?

I understand that an order isn’t created until after payment is completed, but I need the line item details before the order is finalised. Is there a way to access checkout details without building a full UI app, or is that not possible?

Hi @Developers_Centrapay,

I’m afraid that this is not possible with payment apps at this time.

The only insight into the actual order/cart that you receive as a payment app is the Payment Session Request, which does not include info on the actual line items from the order, just the info needed to actually process the payment itself.

Additionally as you mentioned, Payment Apps are not allowed to call other APIs other than the Payments Apps API, though this limitation does also include not using a companion app to bypass this restriction.

Payments extensions (including those using checkout UI extensions) aren’t permitted to do any of the following:

Unfortunately this means there is no way that your payment app would be able to retrieve the cart line items in the checkout.

I’m happy to submit some feedback on your behalf internally, that you would like to see a way to receive this information, either from the Payment Session Request or other Payment App API call, if you can provide us with some more context on why you are wanting to display the line items to the user on the payment site directly when they’ve confirmed the items in the Shopify checkout and are completing the payment with your offsite payment gateway?

Hi @Kellan-Shopify, thanks again for the detailed response.

The reason we need access to line items is that our gateway processes Farmlands transactions. Farmlands directly invoices the customer, and for specific transaction types they require detailed line-item information as part of the invoice. Without access to these line items, we can’t meet the requirements of these merchants or expand usage of the payment method.

Regarding the prohibited action:

require merchants to install additional apps alongside the payments extension.

Because we wouldn’t require merchants to install an additional app in order to use the payment app, we were wondering whether it would still be acceptable to offer an optional companion app solely for retrieving checkout/cart information. Merchants who need this enhanced functionality could choose to install it, while others could continue using the payment app without it.

There also appear to be existing payment apps that offer optional companion apps, such as:

These examples suggest that companion apps can coexist with a payment app where appropriate, so long as they aren’t required for basic payment functionality.

If possible, we’d really appreciate it if you could submit internal feedback that there is strong demand for a way — either via the Payment Session Request or another Payments Apps API call — to receive line-item data before or after the order is created. This limitation is currently blocking broader adoption of our gateway for merchants who rely on Farmlands’ invoicing requirements.

Thanks again for your help on this.