• Resolved salman96

    (@salman96)


    Hello team

    Razorpay has asked us to add additional fields to be passed via API.

    Link: https://razorpay.com/docs/payments/international-payments/accept-international-payments-from-indian-customers/standard-integration/build-integration/

    The use case falls under the goods flow, you’ll need to pass the line_items parameter while creating the order in order's api.

    In order api:
    {
    "amount": 10000,
    "currency": "INR",
    "receipt": "receipt#1",
    "customer_id": "cust_OwZZseNBf9Uqsi",
    "customer_details": {
    "name": "Customer name",
    "email": "[email protected]",
    "contact": "999999999",
    "shipping_address": {
    "line1": "Mantri apartment",
    "line2": "Koramangala",
    "city": "Bengaluru",
    "country": "IND",
    "state": "Karnataka",
    "zipcode": "560032",
    "latitude": "123123",
    "longitude": "1231231"
    }
    },
    "line_items": [
    {
    "type": "e-commerce",
    "name": "TEST",
    "e-commerce": {
    "other_product_codes": {
    "hs_code": "620520"
    }
    }
    }
    ],
    "notes": {
    "key2": "value2"
    }
    }

    You can add multiple line items in the same format if required, based on the products involved in the order.
    Sample snippet:
    "line_items": [
    {
    "type": "",
    "name": "",
    "e-commerce": {
    "other_product_codes": {
    "hs_code": "620520"
    }
    }
    }
    {
    "type": "",
    "name": "",
    "e-commerce": {
    "other_product_codes": {
    "hs_code": "586243"
    }
    }
    }
    ]

    hs_code : Can be fetched from Woocommerce Product Tags

    e-commerce is a static value

Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Support Jignesh

    (@jigneshmpatel)

    Hello,

    Thanks for reaching out.

    For the hs_code, I will provide a filter so you can implement the logic as per your requirements.

    This line_items update (including hs_code) is planned to be released by this week.

    I will keep you posted once the update is available.

    Thanks for your patience.

    Best regards

    Thread Starter salman96

    (@salman96)

    Hi, There’s an update in which hs_code to be passed. hs_code is saved as product tags name.

    Integration Changes Required

    Pass HS code in the ‘Create Order API’

    Request : POST /order

    JavaScriptGoods Flow Under PACBFor Goods flow, there are additional information requirements from the bank to processtransactions and the same needs to be facilitated to enable the processing of settlements forGoods merchants.Integration Changes Required●

    Pass HS code in the ‘Create Order API’Request :POST /order.curl -u [YOUR_KEY_ID]:[YOUR_KEY_SECRET] \-X POST https://api.razorpay.com/v1/orders \-H "content-type: application/json" \-d'{"amount": 10000, "currency": "INR", "receipt": "receipt#1", "customer_id": "cust_OwZZseNBf9Uqsi", "customer_details": { "name": "Gaurav Kumar", "email": "[email protected]", "contact": "9123456780", "shipping_address": { "line1": "Mantri apartment", "line2": "Koramangala", "city": "Bengaluru", "country": "IND", "state": "Karnataka", "zipcode": "560032", "latitude": "123123", "longitude": "123123 }, "identity": [ { "type": "tax_id", "id": "HSCPE4563G" } ] }, "notes": { hs_code: "" //NEW "key2": "value2" }}'

    Plugin Support Jignesh

    (@jigneshmpatel)

    Hi Salman,

    We’ve added a filter so you can pass the required fields in Razorpay’s Create Order API as per your requirement (for example, HS code from product tags). No hardcoding is done from our side.

    This filter is included in v1.0.5.1. Download: https://drive.google.com/file/d/1zkkMxmg9Zqy7ehNEdbW2wtQHdiuDfr6M/view?usp=sharing

    Example code

    You can add this in functions.php or a custom plugin and update it as needed.

    add_filter('easy_razorpay_create_order_payload', function ($data, $order) {
    // Example: set HS code manually
    // $data['notes']['hs_code'] = '620520';

    // Or fetch HS code from product tag like: hs_code:620520
    if ($order instanceof WC_Order) {
    foreach ($order->get_items() as $item) {
    $product = $item->get_product();
    if (!$product) continue;

    $tags = wp_get_post_terms($product->get_id(), 'product_tag', ['fields' => 'names']);
    foreach ($tags as $tag) {
    if (strpos(strtolower($tag), 'hs_code:') === 0) {
    $data['notes']['hs_code'] = preg_replace('/[^0-9]/', '', $tag);
    break 2;
    }
    }
    }
    }

    return $data;

    }, 10, 2);

    Please try this and let us know how it works for you.

    Best Regards

    Thread Starter salman96

    (@salman96)

    /checkout/order-pay/483/?key=wc_order_BrvvZNWRtTeOh

    Order number: 483

    Date: 10/02/2026

    Total: Rs1.00

    Payment method: Razorpay

    Please wait while we are processing your payment.

    The payment stuck here and Razorpay popup didn’t show up. My account is not normal Razorpay account. It’s Razorpay Import flow account. Please refer to this documentation link https://razorpay.com/docs/payments/international-payments/accept-international-payments-from-indian-customers/standard-integration/build-integration/

    Also please check this attachment for adding hs code https://drive.google.com/file/d/1-VpA7qyXv-oaOWz0dyNDGPFDtvT9PYRE/view?usp=drivesdk

    Thread Starter salman96

    (@salman96)

    Also can you please add my whatsapp? I shall explain the full scenario Number is in this link https://docs.google.com/document/d/1sdpM6KvMkOk9kHa8oBs3oCfbkq-vEGIEZuoguDQtKh8/edit?usp=drivesdk

    • This reply was modified 3 months, 2 weeks ago by salman96.
    Plugin Support Jignesh

    (@jigneshmpatel)

    Hello @salman96,

    We’re actively working on the Razorpay Import Flow (Account) update and will keep you posted once it’s completed.

    Best regards

    Plugin Support Jignesh

    (@jigneshmpatel)

    Hello @salman96,

    We’ve included an update for the Razorpay Import Flow (Account) in version 1.0.5.2 : Download

    Please make sure to add the shared above code (pass hs_code in request) in your functions.php file or using a Code Snippets plugin. Also, ensure your products have the HS code added as a product tag, as shown here:
    https://drive.google.com/file/d/1BY40euYqTq0Qqm83Mq8HQruqIn6Yv1Co/view?usp=sharing

    Kindly test this setup and let us know how it works for you.

    If the issue persists, please provide the log file.

    How to get the log file (quick steps):

    1. Go to WooCommerce → Status → Logs
    2. Select the latest razorpay-*.log file
    3. Download and upload it here:
      https://forms.gle/ujw7CrV3eKWYjgPQ6

    Best regards

    Thread Starter salman96

    (@salman96)

    Hello sir @jigneshmpatel

    Thank you for the file update. But the log file is not getting created. I would like to provide you access to the website. Can you please contact me using call or whatsapp. Or let me know to can I share you the credentials. Contact info: https://docs.google.com/document/d/1sdpM6KvMkOk9kHa8oBs3oCfbkq-vEGIEZuoguDQtKh8/edit?usp=drive_link

    • This reply was modified 3 months, 2 weeks ago by salman96.
    Plugin Support Jignesh

    (@jigneshmpatel)

    Hello @salman96,

    Please check my previous comment. I’ve shared the ZIP file along with additional notes.

    Best Regards

    Thread Starter salman96

    (@salman96)

    Hello sir @jigneshmpatel

    I have updated the log file after changing the hs code from 85122020 to hs_code: 85122020.

    Also checking the error log, the statename should be the full name and not 2 digit code TN, DL, KL, GJ etc

    Thank you

    Thread Starter salman96

    (@salman96)

    Hello sir @jigneshmpatel

    If I change 'state' => $order->get_shipping_state() ?: $order->get_billing_state(), to 'state' => 'Tamilnadu', Razorpay popup opens. Reason: State name should be full name

    After payment successful, no redirect happens and order is not marking as paid in Woocommrece and razorpay dashboard not showing any payment ID. Only Order ID is created in Razorpay dashboard and Woocommerce.

    Kindly check and update

    • This reply was modified 3 months, 2 weeks ago by salman96.
    Moderator Support Moderator

    (@moderator)

    @jigneshmpatel Right now, contact the plugin developer and ask them to add you as a plugin support role for this plugin if that is who you are.

    Do not wait, please do that now.

Viewing 12 replies - 1 through 12 (of 12 total)

You must be logged in to reply to this topic.