Join us for an upcoming Shopify Partner webinar on February 27, 2024. Discover the latest Checkout Extensibility features, and deep dive on improvements to Shopify Functions and Web Pixels. Register now for either the 10am EST or 2pm EST sessions.

missing payment id in transaction api for shopify razorpay payment gateway

prateekkaushik
Shopify Partner
5 0 1

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?
Reply 1 (1)

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.