Hi Experts,
While creating DEAL via eCommerce Bridge API, LINE_ITEMS are not creating every time. sometimes it works 1 out of 5 times. Why it’s behaving this way?
Please see the process I’m following and suggest me the solution.
Step # 1: creating Contact with externalObjectID
{
"storeId": "ecommercebridge-deviceb2b-store",
"objectType": "CONTACT",
"messages": [
{
"action": "UPSERT",
"changedAt": 1575522058436,
"externalObjectId": "test@test.com",
"properties": {
"email": "test@test.com"
}
}
]
}
Step #2: Creating DEAL & associate with CONTACT
{
"storeId": "ecommercebridge-deviceb2b-store",
"objectType": "DEAL",
"messages": [
{
"action": "UPSERT",
"changedAt": 1575522058736,
"externalObjectId": "deal_0000735706",
"properties": {
"dealname": "Deal 0000735706",
"dealstage": "processed",
"closedate": 1575522058736,
"amount": 18,
"sapordernumber": "0000735706",
"companyname": "xxxx xxx xx xxxx",
"createdate": 1575522058736
},
"associations": {
"CONTACT": [
"test@test.com"
]
}
}
]
}
Step #3: Creating PRODUCT with externalObjectID
{
"storeId": "ecommercebridge-deviceb2b-store",
"objectType": "PRODUCT",
"messages": [
{
"action": "UPSERT",
"changedAt": 1575522059010,
"externalObjectId": "xx-SM-060",
"properties": {
"product_name": "Koo Air Cushion Anaesthetic Masks - Size 0",
"product_description": "xxxx"
}
},
{
"action": "UPSERT",
"changedAt": 1575522059010,
"externalObjectId": "xx-SM-062B",
"properties": {
"product_name": "xxxx"
}
},
{
"action": "UPSERT",
"changedAt": 1575522059010,
"externalObjectId": "xx-AM03",
"properties": {
"product_name": "xxxx"
}
}
]
}
Step #4: Creating LINE_ITEM and associate with PRODUCT & DEAL
{
"storeId": "ecommercebridge-deviceb2b-store",
"objectType": "LINE_ITEM",
"messages": [
{
"action": "UPSERT",
"changedAt": 1575522059307,
"externalObjectId": "lineItem_xx-SM-060",
"properties": {
"product_name": "Koo Air Cushion Anaesthetic Masks - Size 0",
"product_description": "xxxx",
"quantity": 1,
"price": 3,
"amount": 3,
"createdate": 1575522059307
},
"associations": {
"DEAL": [
"deal_0000735706"
],
"PRODUCT": [
"xx-SM-060"
]
}
},
{
"action": "UPSERT",
"changedAt": 1575522059307,
"externalObjectId": "lineItem_xx-SM-062B",
"properties": {
"product_name": "Koo Air Cushion Anaesthetic Masks - Size 2 - Bubblegum",
"product_description": "xxxx",
"quantity": 2,
"price": 3,
"amount": 6,
"createdate": 1575522059307
},
"associations": {
"DEAL": [
"deal_0000735706"
],
"PRODUCT": [
"xx-SM-062B"
]
}
},
{
"action": "UPSERT",
"changedAt": 1575522059307,
"externalObjectId": "lineItem_xx-AM03",
"properties": {
"product_name": "Well Lead Air Cushion Disposable Anaesthesia Mask - Size 3",
"product_description": "xxxx",
"quantity": 3,
"price": 3,
"amount": 9,
"createdate": 1575522059307
},
"associations": {
"DEAL": [
"deal_0000735706"
],
"PRODUCT": [
"xx-AM03"
]
}
}
]
}
With the above code, DEAL got created with empty LINE_ITEMS. Please suggest me what’s going wrong.
Thanks,
Mahesh.S
