Very Big error in POS app bridge actions data regarding cart and price in iOS and Android.

milindpatel
Explorer
60 1 10

We are willing to update our application's code related to the POS link for the Shopify POS application.

Every thing works great but we are getting cart amount related issues in iOS and Android.

I have added both the JSON response content(related to the only cart) receiving from cart fetch actions here please review it.

Fetch action mentioned here -> https://shopify.dev/apps/tools/app-bridge/actions/cart#fetch-cart

I have added the same product and same line item discount in both devices iOS and android.

1.  iOS

 {
    "subtotal": "0",
    "taxTotal": "0",
    "grandTotal": "0",
    "customer": {
        "email": "milind@email.com",
        "id": 1097745662048,
        "lastName": "Patel",
        "addresses": [
            {
                "country": "United States",
                "id": 1163603804256,
                "lastName": "Patel",
                "zip": "",
                "countryCode": "US",
                "name": "Milind",
                "firstName": "Milind"
            }
        ],
        "firstName": "Milind1234"
    },
    "lineItems": [
        {
            "quantity": 2,
            "discount": {
                "amount": 0.1,
                "type": "percent",
                "discountDescription": "Discount"
            },
            "taxLines": [],
            "taxable": false,
            "sku": "20389916-brown-30x35x11cm",
            "variantId": 39248250142816,
            "title": "DIDABEAR Brand Canvas Tote Bag Women Handbags Female Designer Large Capacity Leisure Shoulder Bags Big Travel Bags Bolsas",
            "price": 29.76,
            "productId": 6536341979232,
            "vendor": "milind-flits-2",
            "grams": 0,
            "variantTitle": "Brown / 30x35x11cm",
            "requiresShipping": true
        }
    ],
    "cartDiscount": {
        "amount": 1,
        "type": "percent",
        "discountDescription": "Discount"
    }
}

 

2. Android 

{
    "grandTotal": "0.00",
    "subtotal": "53.57",
    "taxTotal": "0.00",
    "lineItems": [
        {
            "quantity": 2,
            "price": 59.52,
            "title": "DIDABEAR Brand Canvas Tote Bag Women Handbags Female Designer Large Capacity Leisure Shoulder Bags Big Travel Bags Bolsas",
            "productId": 6536341979232,
            "variantId": 39248250142816,
            "discount": {
                "amount": 5.95,
                "discountDescription": "Discount",
                "type": "percent"
            },
            "custom": false,
            "taxable": null,
            "variantTitle": null,
            "taxLines": [],
            "fulfillmentService": "DEFAULT"
        }
    ],
    "customer": {
        "id": 1097745662048,
        "email": "milind@email.com",
        "firstName": "Milind1234",
        "lastName": "Patel",
        "addresses": [
            {
                "country": "United States",
                "id": 1163603804256,
                "lastName": "Patel",
                "zip": "",
                "countryCode": "US",
                "name": "Milind",
                "firstName": "Milind"
            }
        ]
    },
    "cartDiscount": {
        "discountCode": "",
        "amount": 53.57,
        "discountDescription": "Discount",
        "type": "percent"
    },
    "noteAttributes": []
}

 

You can get the difference in the subtotal, lineItems.price, lineitems.discount, cartDiscount.

I have also uploaded the screenshot for the same please review that as well.

android-cartandroid-cartandroid-lineitemandroid-lineitemandroind- responseandroind- responseiOS-cartiOS-cartiOS-lineitemiOS-lineitemiOS-responseiOS-response


On what price do we need to depend on and how we can get the actual subtotal it should not dependable on the device right? 

0 Likes