POST | /SupplierClient/SupplierClientUpdate | Inserts a
supplier/client or updates an existing one. | Uses your API Key and applies a mvRecordAction
value on an mvSupplierClient object. We can insert the mvSupplierClient we specified using "Insert"
as our mvRecordAction. We can update a current one using "Update", we can insert it if it doesn't already
exist, update it if it does using "InsertOrUpdate" and we can insert new fields or update non-empty
fields of the object using "InsertOrUpdateNonEmptyFields". Optionally, you can use
mvInsertUpdateDeleteSourceApplication when an external application ( eg WooCommerce )
is the one that triggers the SupplierClientUpdate call. SupplierClientId cannot be updated.
A. Insert a new supplier who has 2 contacts. The SupplierClientUpdate call was triggered by Magento.
Value: {
"mvSupplierClient": {
"SupplierClientType": "Supplier",
"SupplierClientName": "A4 Paper Supplier",
"mvContacts": [
{
"ContactName": "Andrew Stevens",
"ContactDepartment": "A4 Papers/Printing",
"ContactEmail": "andrew@a4printing.jp",
"ContantIsPrimary": "true"
},
{
"ContactName": "Maria Weems",
"ContactDepartment": "A4 Papers/Pictures"
}
],
"SupplierClientBillingAddress": "41st Trueroad , Inglewood CA",
"SupplierClientShippingAddress": "93rd Kiwi Street, Las Vegas, Nevada"
},
"mvGrantPermissionsToAllUser": "true",
"mvRecordAction": "Insert",
"mvInsertUpdateDeleteSourceApplication": "Magento"
}
Response: {
"mvSupplierClient": {
"SupplierClientID": 23,
"SupplierClientType": "Supplier",
"SupplierClientName": "A4 Paper Supplier",
"mvContacts": [
{
"ContactName": "Andrew Stevens",
"ContactDepartment": "A4 Papers/Printing",
"ContactEmail": "andrew@a4printing.jp",
"ContactIsPrimary": false
},
{
"ContactName": "Maria Weems",
"ContactDepartment": "A4 Papers/Pictures",
"ContactIsPrimary": false
}
],
"SupplierClientBillingAddress": "41st Trueroad , Inglewood CA",
"SupplierClientShippingAddress1": "",
"SupplierClientShippingAddress2": "",
"SupplierClientPhone1": "",
"SupplierClientPhone2": "",
"SupplierClientFax": "",
"SupplierClientIM": "",
"SupplierClientEmail": "",
"SupplierClientTaxID": "",
"SupplierClientComments": "",
"SupplierClientCustomField1": "",
"SupplierClientCustomField2": "",
"SupplierClientCustomField3": "",
"SupplierClientCustomField4": "",
"SupplierClientCustomField5": "",
"SupplierClientCustomField6": "",
"SupplierClientCustomField7": "",
"SupplierClientCustomField8": "",
"SupplierClientCustomField9": "",
"SupplierClientCustomField10": "",
"SupplierClientOption1": "",
"SupplierClientOption2": "",
"SupplierClientOption3": "",
"SupplierClientOption4": "",
"SupplierClientOption5": "",
"SupplierClientOption6": "",
"SupplierClientOption7": "",
"SupplierClientOption8": "",
"SupplierClientOption9": "",
"SupplierClientOption10": "",
"SupplierClientCreationDate": "/Date(1507628895856+0300)/"
},
"ResponseStatus": {
"ErrorCode": "0"
},
"entityID": 23
}
B.
Updates the above supplier by changing his billing address, adding a second shipping address, a phone and an IM contact.
Value: {
"mvSupplierClient": {
"SupplierClientId": "23",
"SupplierClientName": "A4 Paper Supplier",
"SupplierClientBillingAddress": "47th Trueroad , Inglewood CA",
"SupplierClientShippingAddress2": "11th Trueside Boulevard, Jacksonville, FL",
"SupplierClientPhone1": "+113236237323232",
"SupplierClientIM": "@andrewstevens2017"
},
"mvRecordAction": "Update"
}
Response: {
"mvSupplierClient": {
"SupplierClientID": 23,
"SupplierClientType": "Supplier",
"SupplierClientName": "A4 Paper Supplier",
"mvContacts": [],
"SupplierClientBillingAddress": "47th Trueroad , Inglewood CA",
"SupplierClientShippingAddress1": "",
"SupplierClientShippingAddress2": "11th Trueside Boulevard, Jacksonville, FL",
"SupplierClientPhone1": "+113236237323232",
"SupplierClientPhone2": "",
"SupplierClientFax": "",
"SupplierClientIM": "@andrewstevens2017",
"SupplierClientEmail": "",
"SupplierClientTaxID": "",
"SupplierClientCustomField1": "",
"SupplierClientCustomField2": "",
"SupplierClientCustomField3": "",
"SupplierClientCustomField4": "",
"SupplierClientCustomField5": "",
"SupplierClientCustomField6": "",
"SupplierClientCustomField7": "",
"SupplierClientCustomField8": "",
"SupplierClientCustomField9": "",
"SupplierClientCustomField10": "",
"SupplierClientOption1": "",
"SupplierClientOption2": "",
"SupplierClientOption3": "",
"SupplierClientOption4": "",
"SupplierClientOption5": "",
"SupplierClientOption6": "",
"SupplierClientOption7": "",
"SupplierClientOption8": "",
"SupplierClientOption9": "",
"SupplierClientOption10": "",
"SupplierClientCreationDate": "/Date(1507628895857-0000)/"
},
"ResponseStatus": {
"ErrorCode": "0"
},
"entityID": 23
}
|
---|