It allows you:
to get the partners relations
to create partners relations
This API Method is recommended when the 'Delivery' Customer (ex. Mr. John Popesco) is different from the 'Invoice to' Customer (OpenTrust Ltd). This situation is often seen in e-commerce on Sales Orders.
Usually the Delivery Customer is the customer (login, a person) which order and will receive the products and the 'Invoice to' Customer is the company which receives and pays the invoice.
This relation between Delivery Customer and Invoice to Customer is required when entering an Sales Order with these two different customers.
The relation will be automatically generated by SocrateCloud when creating a Sales Order and the BPartner is different of BillBPartner.
See the rules in table below:
Prerequisites:
In order to use this API Method for PUT there must be accomplished the following requirements in SocrateCloud:
to have an Organization active
to have created both Delivery and 'Invoice to' Customer as two different Customers (see section 02. Customers)
Columns that can be used as filters:
Organization
Name
BPartner (mandatory if BPartnerRelation is null *)
BPartnerRelation (mandatory if BPartner is null *)
Active
* you must send one of this: BPartner or BPartnerRelation, or both.
Actions can be done:
list
create
update
delete
URL: https://api.socratecloud.com/webapi/rest/bpartner/relation/list/{version}?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": "some_relation",
"BPartnerLocation": "Brasov",
"BPartnerRelation": "some_bp",
"BPartnerRelationLocation": "Brasov",
"IsBillTo": false,
"IsPayFrom": false
}
],
"totalRows": 1
}
URL: https://api.socratecloud.com/webapi/rest/bpartner/relation/create/{version}?accessToken={access_token}&BPartner={bp_value}
Method: POST
Return: relation name for success or error message (start with "ERROR: ")
Data format:
{
"Organization": "Demo SRL",
"Active": true,
"Name": "new_relation",
"BPartnerLocation": "Brasov",
"BPartnerRelation": "new_bp",
"BPartnerRelationLocation": "Brasov",
"IsBillTo": false,
"IsPayFrom": false
}
URL: https://api.socratecloud.com/webapi/rest/bpartner/relation/update/{version}?accessToken={access_token}&BPartner={bp_value}&Name={relation_name}
Method: POST
Return: relation name for success or error message (start with "ERROR: ")
{
"Organization": "Demo SRL",
"Active": true,
"Name": "new_relation",
"BPartnerLocation": "Brasov",
"BPartnerRelation": "new_bp",
"BPartnerRelationLocation": "Brasov",
"IsBillTo": false,
"IsPayFrom": false
}
URL: https://api.socratecloud.com/webapi/rest/bpartner/relation/delete/{version}?accessToken={access_token}&BPartner={bp_value}&Name={relation_name}
Method: POST
Return: 'Deleted' for success or error message (start with "ERROR: ")