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.

Not able to get customer details in order webhook response

Not able to get customer details in order webhook response

gajenderdh947
Shopify Partner
13 0 1

Hi all,

 

after post order i am getting null in  phone tag of response and even not able to get it using fetch customer api

 

please find the post order response below , please help

 

{"id":5645582729526,"admin_graphql_api_id":"gid:\/\/shopify\/Order\/5645582729526","app_id":61010903041,"browser_ip":null,"buyer_accepts_marketing":false,"cancel_reason":null,"cancelled_at":null,"cart_token":null,"checkout_id":null,"checkout_token":null,"client_details":null,"closed_at":null,"company":null,"confirmation_number":"35UJVLC6D","confirmed":true,"created_at":"2023-11-14T23:38:29-05:00","currency":"INR","current_subtotal_price":"999.00","current_subtotal_price_set":{"shop_money":{"amount":"999.00","currency_code":"INR"},"presentment_money":{"amount":"999.00","currency_code":"INR"}},"current_total_additional_fees_set":null,"current_total_discounts":"0.00","current_total_discounts_set":{"shop_money":{"amount":"0.00","currency_code":"INR"},"presentment_money":{"amount":"0.00","currency_code":"INR"}},"current_total_duties_set":null,"current_total_price":"1048.00","current_total_price_set":{"shop_money":{"amount":"1048.00","currency_code":"INR"},"presentment_money":{"amount":"1048.00","currency_code":"INR"}},"current_total_tax":"0.00","current_total_tax_set":{"shop_money":{"amount":"0.00","currency_code":"INR"},"presentment_money":{"amount":"0.00","currency_code":"INR"}},"customer_locale":null,"device_id":null,"discount_codes":[],"estimated_taxes":false,"financial_status":"pending","fulfillment_status":null,"landing_site":null,"landing_site_ref":null,"location_id":null,"merchant_of_record_app_id":null,"name":"#1107","note":null,"note_attributes":[],"number":107,"order_number":1107,"order_status_url":"https:\/\/code-947.myshopify.com\/83546276150\/orders\/337a9579368ab0354729859f038796ab\/authenticate?key=8075821195fbb57f8f55038b56bfa003","original_total_additional_fees_set":null,"original_total_duties_set":null,"payment_gateway_names":[],"po_number":null,"presentment_currency":"INR","processed_at":"2023-11-14T23:38:29-05:00","reference":null,"referring_site":null,"source_identifier":null,"source_name":"61010903041","source_url":null,"subtotal_price":"999.00","subtotal_price_set":{"shop_money":{"amount":"999.00","currency_code":"INR"},"presentment_money":{"amount":"999.00","currency_code":"INR"}},"tags":"COD ORDER","tax_exempt":false,"tax_lines":[],"taxes_included":false,"test":false,"token":"337a9579368ab0354729859f038796ab","total_discounts":"0.00","total_discounts_set":{"shop_money":{"amount":"0.00","currency_code":"INR"},"presentment_money":{"amount":"0.00","currency_code":"INR"}},"total_line_items_price":"999.00","total_line_items_price_set":{"shop_money":{"amount":"999.00","currency_code":"INR"},"presentment_money":{"amount":"999.00","currency_code":"INR"}},"total_outstanding":"1048.00","total_price":"1048.00","total_price_set":{"shop_money":{"amount":"1048.00","currency_code":"INR"},"presentment_money":{"amount":"1048.00","currency_code":"INR"}},"total_shipping_price_set":{"shop_money":{"amount":"49.00","currency_code":"INR"},"presentment_money":{"amount":"49.00","currency_code":"INR"}},"total_tax":"0.00","total_tax_set":{"shop_money":{"amount":"0.00","currency_code":"INR"},"presentment_money":{"amount":"0.00","currency_code":"INR"}},"total_tip_received":"0.00","total_weight":0,"updated_at":"2023-11-14T23:39:30-05:00","user_id":null,"billing_address":{"province":"Delhi","country":"India","latitude":null,"longitude":null,"country_code":"IN","province_code":"DL"},"customer":{"id":7350512484662,"accepts_marketing":false,"created_at":"2023-09-19T07:12:27-04:00","updated_at":"2023-11-14T23:38:29-05:00","state":"disabled","note":null,"verified_email":true,"multipass_identifier":null,"tax_exempt":false,"email_marketing_consent":{"state":"not_subscribed","opt_in_level":"single_opt_in","consent_updated_at":null},"sms_marketing_consent":null,"tags":"","currency":"INR","accepts_marketing_updated_at":"2023-09-19T07:12:27-04:00","marketing_opt_in_level":null,"tax_exemptions":[],"admin_graphql_api_id":"gid:\/\/shopify\/Customer\/7350512484662","default_address":{"id":9546030645558,"customer_id":7350512484662,"company":null,"province":"Delhi","country":"India","province_code":"DL","country_code":"IN","country_name":"India","default":true}},"discount_applications":[],"fulfillments":[],"line_items":[{"id":14580904722742,"admin_graphql_api_id":"gid:\/\/shopify\/LineItem\/14580904722742","attributed_staffs":[],"fulfillable_quantity":1,"fulfillment_service":"manual","fulfillment_status":null,"gift_card":false,"grams":0,"name":"AirPods Pro 2nd Gen High Quality Product - red","price":"999.00","price_set":{"shop_money":{"amount":"999.00","currency_code":"INR"},"presentment_money":{"amount":"999.00","currency_code":"INR"}},"product_exists":true,"product_id":8875718836534,"properties":[],"quantity":1,"requires_shipping":true,"sku":"gajender","taxable":true,"title":"AirPods Pro 2nd Gen High Quality Product","total_discount":"0.00","total_discount_set":{"shop_money":{"amount":"0.00","currency_code":"INR"},"presentment_money":{"amount":"0.00","currency_code":"INR"}},"variant_id":47421621403958,"variant_inventory_management":"shopify","variant_title":"red","vendor":"code_947","tax_lines":[],"duties":[],"discount_allocations":[]}],"payment_terms":null,"refunds":[],"shipping_address":{"province":"Delhi","country":"India","company":null,"country_code":"IN","province_code":"DL"},"shipping_lines":[{"id":4593878106422,"carrier_identifier":null,"code":"Standard","discounted_price":"49.00","discounted_price_set":{"shop_money":{"amount":"49.00","currency_code":"INR"},"presentment_money":{"amount":"49.00","currency_code":"INR"}},"phone":null,"price":"49.00","price_set":{"shop_money":{"amount":"49.00","currency_code":"INR"},"presentment_money":{"amount":"49.00","currency_code":"INR"}},"requested_fulfillment_service_id":null,"source":"COD","title":"Standard","tax_lines":[],"discount_allocations":[]}],"gateway":""}

Reply 1 (1)

Liam
Community Manager
3108 342 884

Hi Gajenderdh947,

 

It looks like the phone number field is not included in your response because it is not provided in the shipping address details of the original order post request. To get the phone, it should be included when the order is being created in the shipping address details like this:

"shipping_address": {
  "first_name": "John",
  "last_name": "Doe  "address1": "123 Amoebobacterieae St",
  "city": "Ottawa",
  "province": "ON",
  "country": "Canada",
  "zip": "K2P0V6",
  "phone": "1234567890",
  "name": "John Doe",
  "province_code": "ON",
  "country_code": "CA",
  "country_name": "Canada"
}

If the phone number is not included in the shipping address when the order is being created, it won't be included in the response when fetching the order details.

 

If you need to add or update the phone number for an existing order, you would need to use the update order endpoint and provide the phone number in the shipping address details.

 

Hope this helps! 

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog