Getting itemized order from offsite payment gateway

Highlighted
Shopify Partner
3 0 0

I'm trying to get an itemized list of order items from an hosted payment gateway for fraud-prevention reasons.

Per the documentation at /hosted-payment-sdk/api-reference/request-values the closest thing I have to an order ID is x_reference which is not an order ID but rather an invoice ID and there seems to be no API to get invoice details. And it only tells me the total price not the itemized order items.

Is there any way to get the itemized list from x_reference or any other field in the request?

For our purposes, it is safe to assume we have an API key for the shop.

Giving an offsite gatway access to order items makes a lot of sense, almost all gatways support itemized lists. I'm surprised there is not an easy way to get them.

Any help is appreciated, thank you.

Note: i have the gateway 100% working otherwise. But I can't go live with it unless I can get the itemized list :(

0 Likes
Highlighted
Shopify Staff (Retired)
Shopify Staff (Retired)
531 0 96

Hey Andrew,

There's no official support for this via the Hosted Payments SDK, but if you have API access to the shop you may be able to do the following:

1) Subscribe to cart/create and checkout/create webhooks
2) When you receive the x_reference parameter from Shopify, match this to the ID provided in the checkout/create webhook (x_reference always refers to a checkout ID)
3) Match the cart_token parameter in the checkout data with the token parameter for the cart data
4) Retrieve the line items from the cart data

Hope this helps!

0 Likes
Highlighted
Shopify Partner
3 0 0

Thanks Jamie,

From the initial test it looks like this is going to work!

It is far from ideal, though.

1. It requires the shop owner installing an app
2. The webhooks seem to be delayed by up to 10 seconds so it's a poor shopper experience too.
3. Now we need to mirror the data at least temporarily which means keeping state

But at least all the data we need is there. 

Thanks again! I'll update when we get it working to let eveyrone know how it goes. In the meantime if anyone things of a more efficient solution I'm all ears.

0 Likes
Highlighted
Shopify Partner
3 0 0

Worked great. Less than ideal as I said but a vaste majority of the time the webhook comes in fast enough where the user doesn't know the difference.

0 Likes
Highlighted
New Member
1 0 0

Hi, 
I'm new in Shopify. 
I have project to create new payment in my site. then i have issue regarding the response that Hosted Payment provide. same as the discussion i need the detail order.

I want to follow the solution, "Subscribe to cart/create and checkout/create webhooks".
already  configure a webhook, using event checkout/create register url RequestBin tools
then test send notification. check in requestbin i got the post. But when i try in my site
create order then try checkout. check again in requestbin. i didn't see the post.

I think nothing wrong in my url requestbin, because already try manually post data and check, i found the response.  

Maybe Any requirement that i miss, while setting my webhook.
i just follow this https://help.shopify.com/api/getting-started/webhooks

Thanks

0 Likes
Highlighted
New Member
1 0 0

Have there been any updates to the SDK regarding this?

0 Likes