It allows you:
to create new locations for an existing customer
to read the locations for an existing customer
Prerequisites:
In order to use this API Method for PUT there must be accomplished the following requirements in SocrateCloud:
to have the customer defined in SocrateCloud
Columns that can be used as filters:
Organization
BPartner
Name
Address1
Active
LastModified (UTC time format ISO 8601: yyyy-MM-dd HH:mm:ss Z, max date from Customer Location tab). Use this filter to get the newest locations.
Mandatory Parameters when inserting customer locations:
BPartner Value
Actions can be done:
list
create
update
delete
URL: https://api.socratecloud.com/webapi/rest/customer/location/list/0?startRow={0}&endRow={100}&accessToken={access_token}&BPartner={bp_value}
Method: GET
Return: JSON object with next format:
{
"data": [
{
"Organization": "Demo SRL",
"Created": "2007-08-22 08:30:18",
"CreatedBy": "System",
"Updated": "2014-02-04 14:40:58",
"UpdatedBy": "SuperUser",
"Active": true,
"Name": "City1",
"Address1": "some_str",
"Country": "RO",
"Region": "Bacau",
"City": "Onesti",
"CityDistrict": null,
"PostalZipp": "7895",
"IsInEU": true,
"BankName": "Carpatica",
"BankAccountNo": "1566599665588",
"IsShippAddress": true,
"IsInvoiceAddress": true,
"IsPayFromAddress": true,
"IsRemitToAddress": true,
"GlobalLocationNumber": null,
"Phone": null,
"Fax": null,
"Description": null,
"C_BPartner_Location_ID": 1000697
}
],
"totalRows": 1
}
URL: https://api.socratecloud.com/webapi/rest/customer/location/create/{version}?accessToken={access_token}&BPartner={bp_value}
Method: POST
Return: location name for success or error message (start with "ERROR: ")
Data format:
{
"Organization": "Demo SRL",
"Active": true,
"Name": "City2",
"Address1": "some_new_str",
"Country": "RO",
"Region": "Bacau",
"City": "ONESTI",
"CityDistrict": null,
"PostalZipp": "5685",
"IsInEU": true,
"BankName": "Unicredit",
"BankAccountNo": "78852578822",
"IsShippAddress": true,
"IsInvoiceAddress": true,
"IsPayFromAddress": true,
"IsRemitToAddress": true,
"GlobalLocationNumber": null,
"Phone": null,
"Fax": null,
"Description": null
}
URL: https://api.socratecloud.com/webapi/rest/customer/location/update/{version}?accessToken={access_token}&BPartner={bp_value}&Name={customer_location_name}
Method: POST
Return: location name for success or error message (start with "ERROR: ")
Data format:
{
"Organization": "Demo SRL",
"Active": true,
"Name": "new_city",
"Address1": "some_new_str",
"Country": "RO",
"Region": "Bacau",
"City": "ONESTI",
"CityDistrict": null,
"PostalZipp": "5685",
"IsInEU": true,
"BankName": "Unicredit",
"BankAccountNo": "78852578822",
"IsShippAddress": true,
"IsInvoiceAddress": true,
"IsPayFromAddress": true,
"IsRemitToAddress": true,
"GlobalLocationNumber": null,
"Phone": null,
"Fax": null,
"Description": null
}
URL: https://api.socratecloud.com/webapi/rest/customer/location/delete/{version}?accessToken={access_token}&BPartner={bp_value}&Name={customer_location_name}
Method: POST
Return: 'Deleted' for success or error message (start with "ERROR: ")