Find orders based on Invoice ID or Transaction ID

Arjun_Ohri
New Member
2 0 0

https://help.shopify.com/api/reference/order#index

For the purposes of PayPal dispute resolution, I'd like to know how to programatically retrieve an Order ID when all I have is the an "Invoice ID" or a "Transaction ID". I am already aware of retrieving orders by the filters provided by the API. Further, I am already aware of the search feature in the dashboard pictured below:

shopify search

You can use the search widget and type an "invoice id" or "transaction id" and if a matching order is found, then a link is given.

Further, I am already aware the "Transaction API" endpoint:

https://help.shopify.com/api/reference/transaction

While this is helpful as I can match against the attributes in the receipt property, it is not helpful because it requires that I already know the order ID in the first place in order to get the transactions.

0 Likes
Kristina
Shopify Staff (Retired)
Shopify Staff (Retired)
46 0 3

Hi Arjun,

There isn't currently a way to access order details by invoice or transaction ID. The best solution would likely be to search orders using the created_at_min/max range attribute and then filter the returned data. 

You could pass something like:

/admin/orders.json?created_at_min=2014-04-25T16:15:47-04:00&created_at_max=2014-04-25T16:15:47-04:00

which will return the full order details for all orders matching the time range:

{
  "orders": [
    {
      "id": 4717813892,
      "email": "",
      "closed_at": null,
      "created_at": "2017-01-20T14:35:47-05:00",
      "updated_at": "2017-01-20T14:35:47-05:00",
      "number": 1,
      "note": "Some note",
      "token": "1a57aaf600b8ce16a7f963a1d8e5cdbd",
      "gateway": "manual",
      "test": false,
      "total_price": "330.60",
      "subtotal_price": "292.57",
      "total_weight": 0,
      "total_tax": "38.03",
 ...


Kristina
Developer Experience 

0 Likes
SalesLink
New Member
4 0 0

Arjun,

We have much the same issue.  Our context is Gift Cards specifically but we have the same problem resolving back to the order on which a Gift Card was tendered from the 'order_transaction_id' supplied in the Gift Card Adjustments API.

Did you ever come up with a solution or a reasonable work-around?

Thanks

Kent

0 Likes