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.

Order API return removed shipping fees as active

Order API return removed shipping fees as active

erpmathieu
Shopify Partner
4 0 1

Hello,

 

I have created an order with 2 shipping fees. I have updated the order and removed the first shipping fee. Everything is ok on the shopify web site, only the second shipping fee is applied, but the Admin Order Rest API return both shipping fees as active in shipping_lines array, and total_shipping_price_set returns the sum of the both shipping fees, even the removed one.

Do you know why, and how I can identified in the API if a shipping is active or not?

 

Thanks in advance

Eric

Reply 1 (1)

Simplio
Shopify Partner
6 0 0

Hi Eric,

 

This is Chuck from Simplio.

 

Unfortunately, it is not possible to retrieve it from the Admin Order REST API, but you can properly retrieve it from the GraphQL API:

 

 

$graphqlStringTemplate = '
    order: 
        order(id: "gid://shopify/Order/{order_id}") {
            shippingLines(first: 2,includeRemovals: true){
                edges {
                    node {
                        id
                        isRemoved
                    }
                }
            }
        }
';