Shipping address none

Solved
New Member
4 0 0

Hi,

I am trying to create a order via orders.json api. i am posting this payload.

 

 

{
  "order": {
    "line_items": [
      {
        "variant_id": "1234",
        "quantity": 1
      }
    ],
    "customer": {
      "id": "",
      "first_name": "Amjad",
      "last_name": "Is",
      "email": "xyz@gmail.com"
    },
    "financial_status": "pending",
    "note": "Test Order From Android APP",
    "shipping_address": {
      "first_name": "Amjad",
      "last_name": "Is",
      "address1": "Lahore",
      "phone": "999-999-9999",
      "city": "Lahore",
      "province": "",
      "country": "",
      "zip": ""
    },
    "billing_address": {
      "first_name": "Amjad",
      "last_name": "Is",
      "address1": "Lahore",
      "phone": "999-999-9999",
      "city": "Lahore",
      "province": "",
      "country": "",
      "zip": ""
    },
    "email": "xyz@gmail.com"
  }
}

 

I am getting success response but shipping and billing is none. Please help me on it. 

0 Likes

Success.

Shopify Partner
723 63 97

You have a couple of critical fields you don't provide in your payload, I'd suggest you try providing a full address for both billing_address and shipping_address, with all fields populated to make sure the missing/non-populated fields are not the issue. An example from -  https://help.shopify.com/en/api/reference/orders/order#create-2019-07 - would be:

"billing_address": {
  "address1": "2259 Park Ct",
  "address2": "Apartment 5",
  "city": "Drayton Valley",
  "company": null,
  "country": "Canada",
  "first_name": "Christopher",
  "last_name": "Gorski",
  "phone": "(555)555-5555",
  "province": "Alberta",
  "zip": "T0E 0M0",
  "name": "Christopher Gorski",
  "province_code": "AB",
  "country_code": "CA",
  "latitude": "45.41634",
  "longitude": "-75.6868"
}

 

Sergiu Svinarciuc | CTO @ visely.io
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution!
- To learn more about the awesome stuff we do head over to visely.io or our blog
1 Like
New Member
4 0 0

Thanks for response. Yes issue solved by using country_code and province_code params. 

0 Likes