Are you creating this customer natively within Shopify's backend, or are you using an application to create this customer? --> I am creating customers within Shopify's backend through Shopify's create customer API. After creating the customer I have created 2 orders through Shopify's create order API. Please refer the all the 3 API request/response; Request 1: Create Customer:
API: https://ankur-staging-new.myshopify.com/admin/api/2019-04/customers.json
Request : {"customer":{"email":"shivam@gmail.com","accepts_marketing":"false","first_name":"Shivam","last_name":"Soni"}}
Response : {
"customer": {
"id": 5508244111425,
"email": "shivam@gmail.com",
"accepts_marketing": false,
"created_at": "2022-01-19T14:06:33+05:30",
"updated_at": "2022-01-19T14:06:33+05:30",
"first_name": "Shivam",
"last_name": "Soni",
"orders_count": 0,
"state": "disabled",
"total_spent": "0.00",
"last_order_id": null,
"note": null,
"verified_email": true,
"multipass_identifier": null,
"tax_exempt": false,
"phone": null,
"tags": "",
"last_order_name": null,
"currency": "INR",
"addresses": [],
"accepts_marketing_updated_at": "2022-01-19T14:06:33+05:30",
"marketing_opt_in_level": null,
"tax_exemptions": [],
"admin_graphql_api_id": "gid://shopify/Customer/5508244111425"
}
}
Request 2: First Order for above customer:API : https://ankur-staging-new.myshopify.com/admin/api/2019-04/orders.json
Request : {
"order":{
"email":"shivam@gmail.com",
"shipping_address":{
"first_name":"Rahul",
"last_name":"Jain",
"name":"Rahul Jain",
"address1":"S11",
"address2":"S22, S33",
"company":"DFG",
"phone":"7867564534",
"city":"Indore",
"zip":"452001",
"province":"Madhya Pradesh",
"country":"IN",
"country_code":null,
"province_code":"MP"
},
"billing_address":{
"first_name":"Rahul",
"last_name":"Jain",
"name":"Rahul Jain",
"address1":"S11",
"address2":"S22, S33",
"company":"DFG",
"phone":"7867564534",
"city":"Indore",
"zip":"452001",
"province":"Madhya Pradesh",
"country":"IN",
"country_code":null,
"province_code":"MP"
},
"line_items":[
{
"variant_id":null,
"quantity":1,
"price":"222.00",
"title":"2-month-plan",
"taxable":true,
"tax_lines":null
}
],
"total_tax":"0.00",
"total_discounts":"0.00",
"taxes_included":false,
"transactions":[
{
"amount":"222.00",
"authorization":null,
"currency":"USD",
"test":false,
"kind":"sale",
"id":null,
"status":null,
"gateway":"CARD",
"parent_id":null,
"orderId":null
}
],
"tags":"ank-local",
"customer":{
"id":5508244111425,
"email":"shivam@gmail.com",
"accepts_marketing":"false",
"first_name":"Shivam",
"last_name":"Soni",
"tags":"ank-loc"
},
"metafields":[
{
"id":null,
"namespace":"chargebee",
"key":"order_id",
"value":"301",
"value_type":"String",
"description":"Test Order"
}
],
"currency":"USD",
"inventory_behaviour":"decrement_obeying_policy"
}
}
Response : {
"order": {
"id": 4149357871169,
"admin_graphql_api_id": "gid://shopify/Order/4149357871169",
"app_id": 6362413,
"browser_ip": null,
"buyer_accepts_marketing": false,
"cancel_reason": null,
"cancelled_at": null,
"cart_token": null,
"checkout_id": null,
"checkout_token": null,
"closed_at": null,
"confirmed": true,
"contact_email": "shivam@gmail.com",
"created_at": "2022-01-19T14:08:55+05:30",
"currency": "USD",
"current_subtotal_price": "222.00",
"current_subtotal_price_set": {
"shop_money": {
"amount": "222.00",
"currency_code": "USD"
},
"presentment_money": {
"amount": "222.00",
"currency_code": "USD"
}
},
"current_total_discounts": "0.00",
"current_total_discounts_set": {
"shop_money": {
"amount": "0.00",
"currency_code": "USD"
},
"presentment_money": {
"amount": "0.00",
"currency_code": "USD"
}
},
"current_total_duties_set": null,
"current_total_price": "222.00",
"current_total_price_set": {
"shop_money": {
"amount": "222.00",
"currency_code": "USD"
},
"presentment_money": {
"amount": "222.00",
"currency_code": "USD"
}
},
"current_total_tax": "0.00",
"current_total_tax_set": {
"shop_money": {
"amount": "0.00",
"currency_code": "USD"
},
"presentment_money": {
"amount": "0.00",
"currency_code": "USD"
}
},
"customer_locale": null,
"device_id": null,
"discount_codes": [],
"email": "shivam@gmail.com",
"financial_status": "paid",
"fulfillment_status": null,
"gateway": "CARD",
"landing_site": null,
"landing_site_ref": null,
"location_id": null,
"name": "#1005",
"note": null,
"note_attributes": [],
"number": 5,
"order_number": 1005,
"order_status_url": "https://ankur-staging-new.myshopify.com/55296458817/orders/8cafedb0ba3b9deaffe6ea9ccd4cced5/authenti...",
"original_total_duties_set": null,
"payment_gateway_names": [
"CARD"
],
"phone": null,
"presentment_currency": "USD",
"processed_at": "2022-01-19T14:08:55+05:30",
"processing_method": "",
"reference": null,
"referring_site": null,
"source_identifier": null,
"source_name": "6362413",
"source_url": null,
"subtotal_price": "222.00",
"subtotal_price_set": {
"shop_money": {
"amount": "222.00",
"currency_code": "USD"
},
"presentment_money": {
"amount": "222.00",
"currency_code": "USD"
}
},
"tags": "ank-local",
"tax_lines": [],
"taxes_included": false,
"test": false,
"token": "8cafedb0ba3b9deaffe6ea9ccd4cced5",
"total_discounts": "0.00",
"total_discounts_set": {
"shop_money": {
"amount": "0.00",
"currency_code": "USD"
},
"presentment_money": {
"amount": "0.00",
"currency_code": "USD"
}
},
"total_line_items_price": "222.00",
"total_line_items_price_set": {
"shop_money": {
"amount": "222.00",
"currency_code": "USD"
},
"presentment_money": {
"amount": "222.00",
"currency_code": "USD"
}
},
"total_outstanding": "0.00",
"total_price": "222.00",
"total_price_set": {
"shop_money": {
"amount": "222.00",
"currency_code": "USD"
},
"presentment_money": {
"amount": "222.00",
"currency_code": "USD"
}
},
"total_price_usd": "222.00",
"total_shipping_price_set": {
"shop_money": {
"amount": "0.00",
"currency_code": "USD"
},
"presentment_money": {
"amount": "0.00",
"currency_code": "USD"
}
},
"total_tax": "0.00",
"total_tax_set": {
"shop_money": {
"amount": "0.00",
"currency_code": "USD"
},
"presentment_money": {
"amount": "0.00",
"currency_code": "USD"
}
},
"total_tip_received": "0.00",
"total_weight": 0,
"updated_at": "2022-01-19T14:08:55+05:30",
"user_id": null,
"billing_address": {
"first_name": "Rahul",
"address1": "S11",
"phone": "7867564534",
"city": "Indore",
"zip": "452001",
"province": "Madhya Pradesh",
"country": "India",
"last_name": "Jain",
"address2": "S22, S33",
"company": "DFG",
"latitude": null,
"longitude": null,
"name": "Rahul Jain",
"country_code": "IN",
"province_code": "MP"
},
"customer": {
"id": 5508244111425,
"email": "shivam@gmail.com",
"accepts_marketing": false,
"created_at": "2022-01-19T14:06:33+05:30",
"updated_at": "2022-01-19T14:08:55+05:30",
"first_name": "Rahul",
"last_name": "Jain",
"orders_count": 1,
"state": "disabled",
"total_spent": "16484.01",
"last_order_id": 4149357871169,
"note": null,
"verified_email": true,
"multipass_identifier": null,
"tax_exempt": false,
"phone": null,
"tags": "ank-loc",
"last_order_name": "#1005",
"currency": "USD",
"accepts_marketing_updated_at": "2022-01-19T14:06:33+05:30",
"marketing_opt_in_level": null,
"tax_exemptions": [],
"admin_graphql_api_id": "gid://shopify/Customer/5508244111425",
"default_address": {
"id": 6701157089345,
"customer_id": 5508244111425,
"first_name": "Rahul",
"last_name": "Jain",
"company": "DFG",
"address1": "S11",
"address2": "S22, S33",
"city": "Indore",
"province": "Madhya Pradesh",
"country": "India",
"zip": "452001",
"phone": "7867564534",
"name": "Rahul Jain",
"province_code": "MP",
"country_code": "IN",
"country_name": "India",
"default": true
}
},
"discount_applications": [],
"fulfillments": [],
"line_items": [
{
"id": 10662175408193,
"admin_graphql_api_id": "gid://shopify/LineItem/10662175408193",
"fulfillable_quantity": 1,
"fulfillment_service": "manual",
"fulfillment_status": null,
"gift_card": false,
"grams": 0,
"name": "2-month-plan",
"price": "222.00",
"price_set": {
"shop_money": {
"amount": "222.00",
"currency_code": "USD"
},
"presentment_money": {
"amount": "222.00",
"currency_code": "USD"
}
},
"product_exists": false,
"product_id": null,
"properties": [],
"quantity": 1,
"requires_shipping": true,
"sku": null,
"taxable": true,
"title": "2-month-plan",
"total_discount": "0.00",
"total_discount_set": {
"shop_money": {
"amount": "0.00",
"currency_code": "USD"
},
"presentment_money": {
"amount": "0.00",
"currency_code": "USD"
}
},
"variant_id": null,
"variant_inventory_management": null,
"variant_title": null,
"vendor": null,
"tax_lines": [],
"duties": [],
"discount_allocations": []
}
],
"refunds": [],
"shipping_address": {
"first_name": "Rahul",
"address1": "S11",
"phone": "7867564534",
"city": "Indore",
"zip": "452001",
"province": "Madhya Pradesh",
"country": "India",
"last_name": "Jain",
"address2": "S22, S33",
"company": "DFG",
"latitude": null,
"longitude": null,
"name": "Rahul Jain",
"country_code": "IN",
"province_code": "MP"
},
"shipping_lines": []
}
} Request 3: Second Order for above customer:
API : https://ankur-staging-new.myshopify.com/admin/api/2019-04/orders.json
Request : {
"order":{
"email":"shivam@gmail.com",
"shipping_address":{
"first_name":"Rahul",
"last_name":"Jain",
"name":"Rahul Jain",
"address1":"S11",
"address2":"S22, S33",
"company":"DFG",
"phone":"7867564534",
"city":"Indore",
"zip":"452001",
"province":"Madhya Pradesh",
"country":"IN",
"country_code":null,
"province_code":"MP"
},
"billing_address":{
"first_name":"Rahul",
"last_name":"Jain",
"name":"Rahul Jain",
"address1":"S11",
"address2":"S22, S33",
"company":"DFG",
"phone":"7867564534",
"city":"Indore",
"zip":"452001",
"province":"Madhya Pradesh",
"country":"IN",
"country_code":null,
"province_code":"MP"
},
"line_items":[
{
"variant_id":null,
"quantity":1,
"price":"222.00",
"title":"2-month-plan",
"taxable":true,
"tax_lines":null
}
],
"total_tax":"0.00",
"total_discounts":"0.00",
"taxes_included":false,
"transactions":[
{
"amount":"222.00",
"authorization":null,
"currency":"USD",
"test":false,
"kind":"sale",
"id":null,
"status":null,
"gateway":"CARD",
"parent_id":null,
"orderId":null
}
],
"tags":"ank-local",
"customer":{
"id":5508244111425,
"email":"shivam@gmail.com",
"accepts_marketing":"false",
"first_name":"Shivam",
"last_name":"Soni",
"tags":"ank-loc"
},
"metafields":[
{
"id":null,
"namespace":"chargebee",
"key":"order_id",
"value":"302",
"value_type":"String",
"description":"Test Order"
}
],
"currency":"USD",
"inventory_behaviour":"decrement_obeying_policy"
}
}
Response : {
"order": {
"id": 4149358723137,
"admin_graphql_api_id": "gid://shopify/Order/4149358723137",
"app_id": 6362413,
"browser_ip": null,
"buyer_accepts_marketing": false,
"cancel_reason": null,
"cancelled_at": null,
"cart_token": null,
"checkout_id": null,
"checkout_token": null,
"closed_at": null,
"confirmed": true,
"contact_email": "shivam@gmail.com",
"created_at": "2022-01-19T14:10:29+05:30",
"currency": "USD",
"current_subtotal_price": "222.00",
"current_subtotal_price_set": {
"shop_money": {
"amount": "222.00",
"currency_code": "USD"
},
"presentment_money": {
"amount": "222.00",
"currency_code": "USD"
}
},
"current_total_discounts": "0.00",
"current_total_discounts_set": {
"shop_money": {
"amount": "0.00",
"currency_code": "USD"
},
"presentment_money": {
"amount": "0.00",
"currency_code": "USD"
}
},
"current_total_duties_set": null,
"current_total_price": "222.00",
"current_total_price_set": {
"shop_money": {
"amount": "222.00",
"currency_code": "USD"
},
"presentment_money": {
"amount": "222.00",
"currency_code": "USD"
}
},
"current_total_tax": "0.00",
"current_total_tax_set": {
"shop_money": {
"amount": "0.00",
"currency_code": "USD"
},
"presentment_money": {
"amount": "0.00",
"currency_code": "USD"
}
},
"customer_locale": null,
"device_id": null,
"discount_codes": [],
"email": "shivam@gmail.com",
"financial_status": "paid",
"fulfillment_status": null,
"gateway": "CARD",
"landing_site": null,
"landing_site_ref": null,
"location_id": null,
"name": "#1006",
"note": null,
"note_attributes": [],
"number": 6,
"order_number": 1006,
"order_status_url": "https://ankur-staging-new.myshopify.com/55296458817/orders/49ff15e6c64b9a241d66616b905bc4cc/authenti...",
"original_total_duties_set": null,
"payment_gateway_names": [
"CARD"
],
"phone": null,
"presentment_currency": "USD",
"processed_at": "2022-01-19T14:10:29+05:30",
"processing_method": "",
"reference": null,
"referring_site": null,
"source_identifier": null,
"source_name": "6362413",
"source_url": null,
"subtotal_price": "222.00",
"subtotal_price_set": {
"shop_money": {
"amount": "222.00",
"currency_code": "USD"
},
"presentment_money": {
"amount": "222.00",
"currency_code": "USD"
}
},
"tags": "ank-local",
"tax_lines": [],
"taxes_included": false,
"test": false,
"token": "49ff15e6c64b9a241d66616b905bc4cc",
"total_discounts": "0.00",
"total_discounts_set": {
"shop_money": {
"amount": "0.00",
"currency_code": "USD"
},
"presentment_money": {
"amount": "0.00",
"currency_code": "USD"
}
},
"total_line_items_price": "222.00",
"total_line_items_price_set": {
"shop_money": {
"amount": "222.00",
"currency_code": "USD"
},
"presentment_money": {
"amount": "222.00",
"currency_code": "USD"
}
},
"total_outstanding": "0.00",
"total_price": "222.00",
"total_price_set": {
"shop_money": {
"amount": "222.00",
"currency_code": "USD"
},
"presentment_money": {
"amount": "222.00",
"currency_code": "USD"
}
},
"total_price_usd": "222.00",
"total_shipping_price_set": {
"shop_money": {
"amount": "0.00",
"currency_code": "USD"
},
"presentment_money": {
"amount": "0.00",
"currency_code": "USD"
}
},
"total_tax": "0.00",
"total_tax_set": {
"shop_money": {
"amount": "0.00",
"currency_code": "USD"
},
"presentment_money": {
"amount": "0.00",
"currency_code": "USD"
}
},
"total_tip_received": "0.00",
"total_weight": 0,
"updated_at": "2022-01-19T14:10:30+05:30",
"user_id": null,
"billing_address": {
"first_name": "Rahul",
"address1": "S11",
"phone": "7867564534",
"city": "Indore",
"zip": "452001",
"province": "Madhya Pradesh",
"country": "India",
"last_name": "Jain",
"address2": "S22, S33",
"company": "DFG",
"latitude": 22.725765,
"longitude": 75.8837169,
"name": "Rahul Jain",
"country_code": "IN",
"province_code": "MP"
},
"customer": {
"id": 5508244111425,
"email": "shivam@gmail.com",
"accepts_marketing": false,
"created_at": "2022-01-19T14:06:33+05:30",
"updated_at": "2022-01-19T14:10:30+05:30",
"first_name": "Shivam",
"last_name": "Soni",
"orders_count": 2,
"state": "disabled",
"total_spent": "32968.01",
"last_order_id": 4149358723137,
"note": null,
"verified_email": true,
"multipass_identifier": null,
"tax_exempt": false,
"phone": null,
"tags": "ank-loc",
"last_order_name": "#1006",
"currency": "USD",
"accepts_marketing_updated_at": "2022-01-19T14:06:33+05:30",
"marketing_opt_in_level": null,
"tax_exemptions": [],
"admin_graphql_api_id": "gid://shopify/Customer/5508244111425",
"default_address": {
"id": 6701157089345,
"customer_id": 5508244111425,
"first_name": "Rahul",
"last_name": "Jain",
"company": "DFG",
"address1": "S11",
"address2": "S22, S33",
"city": "Indore",
"province": "Madhya Pradesh",
"country": "India",
"zip": "452001",
"phone": "7867564534",
"name": "Rahul Jain",
"province_code": "MP",
"country_code": "IN",
"country_name": "India",
"default": true
}
},
"discount_applications": [],
"fulfillments": [],
"line_items": [
{
"id": 10662178029633,
"admin_graphql_api_id": "gid://shopify/LineItem/10662178029633",
"fulfillable_quantity": 1,
"fulfillment_service": "manual",
"fulfillment_status": null,
"gift_card": false,
"grams": 0,
"name": "2-month-plan",
"price": "222.00",
"price_set": {
"shop_money": {
"amount": "222.00",
"currency_code": "USD"
},
"presentment_money": {
"amount": "222.00",
"currency_code": "USD"
}
},
"product_exists": false,
"product_id": null,
"properties": [],
"quantity": 1,
"requires_shipping": true,
"sku": null,
"taxable": true,
"title": "2-month-plan",
"total_discount": "0.00",
"total_discount_set": {
"shop_money": {
"amount": "0.00",
"currency_code": "USD"
},
"presentment_money": {
"amount": "0.00",
"currency_code": "USD"
}
},
"variant_id": null,
"variant_inventory_management": null,
"variant_title": null,
"vendor": null,
"tax_lines": [],
"duties": [],
"discount_allocations": []
}
],
"refunds": [],
"shipping_address": {
"first_name": "Rahul",
"address1": "S11",
"phone": "7867564534",
"city": "Indore",
"zip": "452001",
"province": "Madhya Pradesh",
"country": "India",
"last_name": "Jain",
"address2": "S22, S33",
"company": "DFG",
"latitude": 22.725765,
"longitude": 75.8837169,
"name": "Rahul Jain",
"country_code": "IN",
"province_code": "MP"
},
"shipping_lines": []
}
}