Checkout api error for shipping methods with shipping_line and shipping_rate

Shopify Partner
1 0 0

Dear Shopify's,

I am using shopify checkout api to sell my products. I am getting concern in checkout api. I am placing a checkout with recommended api with required data. But I am not able to place complete order with selected  shipping method. I have two shipping methods.

1. Free Shipping 

2. COD shipping.

I was when i place order from my website, it should auto select a particular shipping method in checkout api but I am not able to pass data in checkout api's shipping line and shipping rate. When i am placing shipping lines and rate, Its displaying me error   "{"errors":{"shipping_line":{"id":[{"code":"expired","message":"has expired","options":{}}]},"shipping_rate":{"id":[{"code":"expired","message":"has expired","options":{}}]}}}" .

But When i am not passing data in shipping_line and shipping_rate, checkout working prefectly but i need to select shipping method manually to complete order.

Can anybody help me.? How to pass shipping_line and shipping_rate values and get proper response to checkout page with selected shipping method.

Here mentioned below is my data for checkoout api.

{
    "checkout": {
        "completed_at": null,
        "created_at": "2018-04-05T11:30:12+05:30",
        "currency": "INR",
        "customer_id": 557355565124,
        "customer_locale": "en",
        "device_id": null,
        "discount_code": "5OFF",
        "email": "abckirpal@gmail.com",
        "location_id": null,
        "name": "#3323512324164",
        "note": "",
        "note_attributes": {},
        "order_id": null,
        "order_status_url": null,
        "order": null,
        "payment_due": "2659.05",
        "payment_url": "https:\/\/elb.deposit.shopifycs.com\/sessions",
        "payments": [],
        "phone": null,
        "shopify_payments_account_id": null,
        "privacy_policy_url": "https:\/\/checkout.shopify.com\/23099743\/policies\/39682324.html",
        "refund_policy_url": "https:\/\/checkout.shopify.com\/23099743\/policies\/39682260.html",
        "requires_shipping": true,
        "reservation_time_left": 0,
        "reservation_time": null,
        "source_identifier": null,
        "source_name": "2337106",
        "source_url": null,
        "subtotal_price": "2659.05",
        "tax_exempt": false,
        "taxes_included": true,
        "terms_of_service_url": "https:\/\/checkout.shopify.com\/23099743\/policies\/39682388.html",
        "token": "abfb167758641944503d5fe1b7c46530",
        "total_price": "2659.05",
        "total_tax": "284.90",
        "total_line_items_price": "2799.00",
        "updated_at": "2018-04-05T11:30:12+05:30",
        "user_id": null,
        "web_url": "https:\/\/vcnutra.myshopify.com\/23099743\/checkouts\/abfb167758641944503d5fe1b7c46530",
        "line_items": [{
            "id": "d0a98fa9bfcdcf10a9525e74de7c8eae",
            "key": "d0a98fa9bfcdcf10a9525e74de7c8eae",
            "product_id": 11518234580,
            "variant_id": 49515125908,
            "sku": "GC-01",
            "vendor": "Nutrafy",
            "title": "Nutrafy Garcinia Cambogia",
            "variant_title": "Pack of 1",
            "image_url": "https:\/\/cdn.shopify.com\/s\/files\/1\/2309\/9743\/products\/1Bottle_0b46cfb1-3441-4f6f-91db-570d99f60390.jpg?v=1520280268",
            "taxable": true,
            "requires_shipping": true,
            "price": "2799.00",
            "compare_at_price": "2990.00",
            "line_price": "2799.00",
            "properties": {},
            "quantity": 1,
            "grams": 100,
            "fulfillment_service": "manual",
            "applied_discounts": []
        }],
        "gift_cards": [],
        "tax_lines": [{
            "price": "284.90",
            "rate": 0.12,
            "title": "IGST",
            "compare_at": 0.12
        }],
        "tax_manipulations": [],
        "shipping_line": {
          "handle": "shopify-Express%20Shipping-0.00",
          "price": "0.00",
          "title": "Express Shipping"
        },
        "shipping_rate": {
          "id": "shopify-Express%20Shipping-0.00",
          "price": "0.00",
          "title": "Express Shipping"
        }
        "shipping_address": {
            "id": 759530684484,
            "first_name": "Kirpal",
            "last_name": "Singh",
            "phone": "9914269187",
            "company": null,
            "address1": "Phase 7",
            "address2": null,
            "city": "Mohali",
            "province": "Punjab",
            "province_code": "PB",
            "country": "India",
            "country_code": "IN",
            "zip": "160055"
        },
        "credit_card": null,
        "billing_address": {
            "id": 759530684484,
            "first_name": "Kirpal",
            "last_name": "Singh",
            "phone": "9914269187",
            "company": null,
            "address1": "Phase 7",
            "address2": null,
            "city": "Mohali",
            "province": "Punjab",
            "province_code": "PB",
            "country": "India",
            "country_code": "IN",
            "zip": "160055"
        },
        "applied_discount": {
            "amount": "139.95",
            "title": "5OFF",
            "description": null,
            "value": "5.00",
            "value_type": "percentage",
            "non_applicable_reason": null,
            "applicable": true
        }
    }
}

And I am getting error:

{
    "errors": {
        "shipping_line": {
            "id": [{
                "code": "expired",
                "message": "has expired",
                "options": {}
            }]
        },
        "shipping_rate": {
            "id": [{
                "code": "expired",
                "message": "has expired",
                "options": {}
            }]
        }
    }
}
 

Please have a discussion over this topic or any other method to solve it.

 

0 Likes
Highlighted
New Member
2 0 0

Hello, any update in this issue?

0 Likes