Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Re: missing payment id in transaction api for shopify razorpay payment gateway

missing payment id in transaction api for shopify razorpay payment gateway

prateekkaushik
Shopify Partner
5 0 2

Hello, I am facing an issue wherein I am not unable to get a Payment ID through Shopify's GET Transaction API

 

GET API: https://{{store-name}}.myshopify.com/admin/api/2020-10/orders/5021064200357/transactions.json

Response:

{
    "transactions": [
        {
            "id"5930788323493,
            "order_id"5021064200357,
            "kind""sale",
            "gateway""Razorpay",
            "status""success",
            "message"null,
            "created_at""2023-03-16T00:37:37+05:30",
            "test"false,
            "authorization""order_LRuRageikTISbl|pay_LRuSN6BTqivghg",
            "location_id"null,
            "user_id"null,
            "parent_id"null,
            "processed_at""2023-03-16T00:37:37+05:30",
            "device_id"null,
            "error_code"null,
            "source_name""3579543553",
            "receipt": {},
            "amount""1257.75",
            "currency""INR",
            "admin_graphql_api_id""gid://shopify/OrderTransaction/5930788323493"
        }
    ]
}
 
If we see here, the payment gateway used here is Razorpay, however, still, the Payment_id which exists in the receipt key is null or empty. Now If I try to call the same API with another order, I do get Payment_id in the response.
Response:
{
    "transactions": [
        {
            "id"5930770661541,
            "order_id"5021050601637,
            "kind""sale",
            "gateway""Razorpay Secure",
            "status""success",
            "message"null,
            "created_at""2023-03-16T00:23:16+05:30",
            "test"false,
            "authorization"null,
            "location_id"null,
            "user_id"null,
            "parent_id"null,
            "processed_at""2023-03-16T00:23:16+05:30",
            "device_id"null,
            "error_code"null,
            "source_name""web",
            "receipt": {
                "payment_id""nIMwivjebHvn8L8lwX83H9mJz"
            },
            "amount""1166.75",
            "currency""INR",
            "admin_graphql_api_id""gid://shopify/OrderTransaction/5930770661541"
        }
    ]
}
 
Here if we see the payment gateway is the same but still in one order we are getting payment_id but in another order we are not getting any payment_id, can anyone please explain why this is happening?
Replies 2 (2)

Oniondev
Visitor
1 0 0

Hi Prateek, I am also facing the same problem i am also not getting the paymentid in transaction.json Can you share your json body you used to create the Order.

Finserve
Visitor
1 0 0

Hi folks,

 

We are also facing the same issue in Razorpay.