02. Business Partners

Interface

It allows you:

Prerequisites:

In order to use this API Method for PUT there must be accomplished the following requirements in SocrateCloud:

Columns that can  be used as filters:

It is allowed to search with "like" function on this parameter. Ex. Name=%string, in this case the system will list all Business Partners which contain Name like %string% (case insensitive).

Actions can be done:

To create a corect Business Partner (BPartner) you should fill minimum the following colums:

API Methods

List headers and details

URL: https://api.socratecloud.com/webapi/rest/bpartner/full/list/0?startRow={0}&endRow={100}&accessToken={access_token}

Method: GET

Available filter parameters:


Return: JSON object with next format:

{

    "data": [

        {

            "Organization": "Demo SRL",

            "Created": "2014-07-08 14:46:37+0300",

            "CreatedBy": "SuperUser",

            "Updated": "2014-08-13 13:31:01+0300",

            "UpdatedBy": "SuperUser",

            "Value": "bp_value",

            "Name": "bp_name",

            "Description": null,

            "Active": true,

            "TaxID": null,

            "DUNS": null,

            "BPGroup": "Customers",

            "BPStatus": null,

            "IsIndividual": true,

            "IsCustomer": true,

            "InvoiceRule": "After Delivery",

            "DeliveryRule": "Availability",

            "DeliveryViaRule": "Shipper",

            "PaymentMethod": "On Credit",

            "PaymentMode": null,

            "PaymentTerm": "Immediate",

            "CreditStatus": "No Credit Check",

            "CreditLimit": 0,

            "CreditUsed": 0,

            "PriceList": "Sales RON",

            "DiscountSchema": null,

            "FlatDiscount": null,

            "DiscountPrinted": false,

            "SalesRep": null,

            "SalesRepEmail": null,

            "SalesRepPhone": null,

            "SalesRepTitle": null,

            "InvoiceCurrency": null,

            "OrderDescription": "Order Description From Customer",

            "IsVendor": false,

            "POPaymentTerm": null,

            "POPriceList": null,

            "PORepresentative": null,

            "IsEmployee": false,

            "IsSalesRep": false,

            "Language": "ro_RO",

            "BankAccounts": [

                {

                    "Organization": "Demo SRL",

                    "BPartnerLocation_ID": 1000059,

                    "Created": "2014-07-08 14:46:37+0300",

                    "CreatedBy": "SuperUser",

                    "Updated": "2014-08-13 13:31:01+0300",

                    "UpdatedBy": "SuperUser",

                    "Active": true,

                    "BankName": "ING",

                    "IBAN": "someIBAN",

                    "AccountName": "Main",

                    "BankAccountType": null

                }

            ],

            "Locations": [

                {

                    "Organization": "Demo SRL",

                    "BPartnerLocation_ID": 1005578,

                    "Created": "2014-07-08 14:46:37+0300",

                    "CreatedBy": "SuperUser",

                    "Updated": "2014-08-13 13:31:01+0300",

                    "UpdatedBy": "SuperUser",

                    "Active": true,

                    "Name": "HQ",

                    "Address1": "some_str_address",

                    "Country": "RO",

                    "Region": "Brasov",

                    "City": "Brasov",

                    "CityDistrict": null,

                    "PostalZipp": "500123",

                    "IsInEU": true,

                    "BankName": "Unicredit",

                    "BankAccountNo": "78852578822",

                    "IsShippAddress": true,

                    "IsInvoiceAddress": true,

                    "IsPayFromAddress": true,

                    "IsRemitToAddress": true,

                    "GlobalLocationNumber": null,

                    "Phone": null,

                    "Fax": null,

                    "Description": null

                }

            ]


}

Delete Contact

URL: https://api.socratecloud.com/webapi/rest/bpartner/contact/delete/{version}?accessToken={access_token}&BPartner={bpartner_value}&Name={user_name}

Method: POST

Return: 'Deleted' for success or error message (start with "ERROR: ")

List Sales Rep

URL: https://api.socratecloud.com/webapi/rest/bpartner/salesrep/list/0?startRow={0}&endRow={100}&accessToken={access_token}

Method: GET

Available filter parameters:

Return: JSON object with next format:

  {

        "Organization": "Demo SRL",

        "Created": "2017-02-01 11:00:46+0200",

        "CreatedBy": "Ionut Ursuleanu",

        "Updated": "2018-08-13 16:30:11+0300",

        "UpdatedBy": "AdminTitular",

        "Active": true,

        "SalesRepType": "Commercial SalesRep",

        "StartDate": "2017-02-01 00:00:00+0200",

        "EndDate": "2017-02-01 00:00:00+0200",

        "Vendor": null,

        "ProductCategory": null,

        "Attribute": "Colorare",

        "AttributeValue": "Colorat 50%",

        "BPSalesRep": "*Ionut Ursuleanu",

        "SalesRep": "Ionut Ursuleanu",

        "UserID": 1000868,

        "UserEmail": null,

        "UserPhone": null,

        "UserTitle": null

   }

Update Contact

URL: https://api.socratecloud.com/webapi/rest/bpartner/contact/update/{version}?accessToken={access_token}&BPartner={bpartner_value}&Name={user_name}

Method: POST

Return: user name for success or error message (start with "ERROR: ")

Data format:

{

    "Organization": "Demo SRL",

    "Active": true,

    "Name": "User 1",

    "FirstName": null,

    "LastName": null,

    "BirthDay": null,

    "Description": null,

    "Email": "some@address",

    "Phone": null,

    "Fax": null,

    "IsAutoSendInvoice": false,

    "MailText": null,

    "BPartnerLocation_ID": 1000059

  }

List header only

URL: https://api.socratecloud.com/webapi/rest/bpartner/list/0?startRow={0}&endRow={100}&accessToken={access_token}

Method: GET

Available filter parameters:


Return: JSON object with next format:

{

    "data": [

        {

            "Organization": "Demo SRL",

            "Created": "2014-07-08 14:46:37+0300",

            "CreatedBy": "SuperUser",

            "Updated": "2014-08-13 13:31:01+0300",

            "UpdatedBy": "SuperUser",

            "Value": "bp_value",

            "Name": "bp_name",

            "Description": null,

            "Active": true,

            "TaxID": null,

            "DUNS": null,

            "BPGroup": "Customers",

            "BPStatus": null,

            "IsIndividual": true,

            "IsCustomer": true,

            "InvoiceRule": "After Delivery",

            "DeliveryRule": "Availability",

            "DeliveryViaRule": "Shipper",

            "PaymentMethod": "On Credit",

            "PaymentMode": null,

            "PaymentTerm": "Immediate",

            "CreditStatus": "No Credit Check",

            "CreditLimit": 0,

            "CreditUsed": 0,

            "PriceList": "Sales RON",

            "DiscountSchema": null,

            "FlatDiscount": null,

            "DiscountPrinted": false,

            "SalesRep": null,

            "InvoiceCurrency": null,

            "OrderDescription": "Order Description From Customer",

            "IsVendor": false,

            "POPaymentTerm": null,

            "POPriceList": null,

            "PORepresentative": null,

            "IsEmployee": false,

            "IsSalesRep": false,

            "Language": "ro_RO"

        }

    ],

    "totalRows": 1

}

Create header only

URL: https://api.socratecloud.com/webapi/rest/bpartner/create/{version}?accessToken={access_token}

Method: POST

Return: business partner value for success or error message (start with "ERROR: ")

{

     "Organization": "Demo SRL",

     "Value": "bp_value",

     "Name": "bp_name",

     "Description": null,

     "Active": true,

     "TaxID": null,

     "DUNS": null,

     "BPGroup": "Customers",

     "BPStatus": null,

     "IsIndividual": true,

     "IsCustomer": true,

     "InvoiceRule": "After Delivery",

     "DeliveryRule": "Availability",

     "DeliveryViaRule": "Shipper",

     "PaymentMethod": "On Credit",

     "PaymentMode": null,

     "PaymentTerm": "Immediate",

     "CreditLimit": 0,

     "PriceList": "Sales RON",

     "DiscountSchema": null,

     "FlatDiscount": null,

     "DiscountPrinted": false,

     "SalesRep": null,

     "InvoiceCurrency": null,   

     "OrderDescription": "Order Description From Customer",

     "IsVendor": false,

     "POPaymentTerm": null,

     "POPriceList": null,

     "PORepresentative": null,

     "IsEmployee": false,

     "IsSalesRep": false,

     "Language": "ro_RO"

}

Update header only

URL: https://api.socratecloud.com/webapi/rest/bpartner/update/{version}?accessToken={access_token}&Value={bpartner_value}

Method: POST

Return: customer value for success or error message (start with "ERROR: ")

Data format:

{

     "Organization": "Demo SRL",

     "Value": "bp_value",

     "Name": "bp_name",

     "Description": null,

     "Active": true,

     "TaxID": null,

     "DUNS": null,

     "BPGroup": "Customers",

     "BPStatus": null,

     "IsIndividual": true,

     "IsCustomer": true,

     "InvoiceRule": "After Delivery",

     "DeliveryRule": "Availability",

     "DeliveryViaRule": "Shipper",

     "PaymentMethod": "On Credit",

     "PaymentMode": null,

     "PaymentTerm": "Immediate",

     "CreditLimit": 0,

     "PriceList": "Sales RON",

     "DiscountSchema": null,

     "FlatDiscount": null,

     "DiscountPrinted": false,

     "SalesRep": null,

     "InvoiceCurrency": null,

     "OrderDescription": "Order Description From Customer",

     "IsVendor": false,

     "POPaymentTerm": null,

     "POPriceList": null,

     "PORepresentative": null,

     "IsEmployee": false,

     "IsSalesRep": false,

     "Language": "ro_RO"

}

Delete

URL: https://api.socratecloud.com/webapi/rest/bpartner/delete/{version}?accessToken={access_token}&Value={bpartner_value}

Method: POST

Return: 'Deleted' for success or error message (start with "ERROR: ")

List Bank Accounts

URL: https://api.socratecloud.com/webapi/rest/bpartner/bank_account/list/0?startRow={0}&endRow={100}&accessToken={access_token}&BPartner={bpartner_value}

Method: GET

Available filter parameters:

Return: JSON object with next format:

{

    "data": [

        {

            "Organization": "Demo SRL",

            "Created": "2014-07-08 14:46:37+0300",

            "CreatedBy": "SuperUser",

            "Updated": "2014-08-13 13:31:01+0300",

            "UpdatedBy": "SuperUser",

            "Active": true,

            "BankName": "ING",

            "IBAN": "someIBAN",

            "AccountName": "Main",

            "BankAccountType": null

        }

    ],

    "totalRows": 1

}

Create Bank Account

URL: https://api.socratecloud.com/webapi/rest/bpartner/bank_account/create/{version}?accessToken={access_token}&BPartner={bpartner_value}

Method: POST

Return: account name for success or error message (start with "ERROR: ")

Data format:

{

     "Organization": "Demo SRL",

     "Active": true,

     "BankName": "ING",

     "IBAN": "someIBAN",

     "AccountName": "Main",

     "BankAccountType": null

}

Update Bank Account

URL: https://api.socratecloud.com/webapi/rest/bpartner/bank_account/update/{version}?accessToken={access_token}&BPartner={bpartner_value}&AccountName={account_name}

Method: POST

Return: account name for success or error message (start with "ERROR: ")

Data format:

{

     "Organization": "Demo SRL",

     "Active": true,

     "BankName": "ING",

     "IBAN": "someIBAN",

     "AccountName": "Main",

     "BankAccountType": null

}

Delete Bank Account

URL: https://api.socratecloud.com/webapi/rest/bpartner/bank_account/delete/{version}?accessToken={access_token}&BPartner={bpartner_value}&AccountName={account_name}

Method: POST

Return: 'Deleted' for success or error message (start with "ERROR: ")

List Locations

URL: https://api.socratecloud.com/webapi/rest/bpartner/location/list/0?startRow={0}&endRow={100}&accessToken={access_token}&BPartner={bpartner_value}

Method: GET

Available filter parameters:

Return: JSON object with next format:

{

    "data": [

        {

            "Organization": "Demo SRL",

            "Created": "2014-07-08 14:46:37+0300",

            "CreatedBy": "SuperUser",

            "Updated": "2014-08-13 13:31:01+0300",

            "UpdatedBy": "SuperUser",

            "Active": true,

            "Name": "HQ",

            "Address1": "some_str_address",

            "Country": "RO",

            "Region": "Brasov",

            "City": "Brasov",

             "CityDistrict": null,

            "PostalZipp": "500123",

            "IsInEU": true,

            "BankName": "Unicredit",

            "BankAccountNo": "78852578822",

            "IsShippAddress": true,

            "IsInvoiceAddress": true,

            "IsPayFromAddress": true,

            "IsRemitToAddress": true,

            "GlobalLocationNumber": null,

            "Phone": null,

            "Fax": null,

            "IsDefault": true,

       "SalesRegion": "Brasov"    

        }

    ],

    "totalRows": 1

}

Create Location

URL: https://api.socratecloud.com/webapi/rest/bpartner/location/create/{version}?accessToken={access_token}&BPartner={bpartner_value}

Method: POST

Return: location name for success or error message (start with "ERROR: ")

Data format:

{

    "Organization": "Demo SRL",

    "Active": true,

    "Name": "HQ",

    "Address1": "some_str_address",

    "Country": "RO",

    "Region": "Brasov",

    "City": "Brasov",

    "CityDistrict": null,

    "PostalZipp": "500123",

    "IsInEU": true,

    "BankName": "Unicredit",

    "BankAccountNo": "78852578822",

    "IsShippAddress": true,

    "IsInvoiceAddress": true,

    "IsPayFromAddress": true,

    "IsRemitToAddress": true,

    "GlobalLocationNumber": null,

    "Phone": null,

    "Fax": null,

    "IsDefault": true

}

Update Location

URL: https://api.socratecloud.com/webapi/rest/bpartner/location/update/{version}?accessToken={access_token}&BPartner={bpartner_value}&Name={location_name}

Method: POST

Return: location name for success or error message (start with "ERROR: ")

Data format:

{

    "Organization": "Demo SRL",

    "Active": true,

    "Name": "HQ",

    "Address1": "some_str_address",

    "Country": "RO",

    "Region": "Brasov",

    "City": "Brasov",

    "CityDistrict": null,

    "PostalZipp": "500123",

    "IsInEU": true,

    "BankName": "Unicredit",

    "BankAccountNo": "78852578822",

    "IsShippAddress": true,

    "IsInvoiceAddress": true,

    "IsPayFromAddress": true,

    "IsRemitToAddress": true,

    "GlobalLocationNumber": null,

    "Phone": null,

    "Fax": null,

    "IsDefault": true

}

Delete Location

URL: https://api.socratecloud.com/webapi/rest/bpartner/location/delete/{version}?accessToken={access_token}&BPartner={bpartner_value}&Name={location_name}

Method: POST

Return: 'Deleted' for success or error message (start with "ERROR: ")

List Contacts

URL: https://api.socratecloud.com/webapi/rest/bpartner/contact/list/0?startRow={0}&endRow={100}&accessToken={access_token}&BPartner={bpartner_value}

Method: GET

Available filter parameters:

Return: JSON object with next format:

{

    "data": [

        {

            "Organization": "Demo SRL",

            "Created": "2014-07-08 14:46:37+0300",

            "CreatedBy": "SuperUser",

            "Updated": "2014-08-13 13:31:01+0300",

            "UpdatedBy": "SuperUser",

            "Active": true,

            "Name": "User 1",

            "FirstName": null,

            "LastName": null,

            "BirthDay": null,

            "Description": null,

            "Email": "some@address",

            "Phone": null,

            "Phone2": null,

            "Fax": null,

            "IsAutoSendInvoice": false,

            "MailText": null,

            "Job": "Casier",

            "ContactTitle": "Casier",

            "ContactID": 1002391,

            "BPartnerLocation_ID": 1000059

        }

    ],

    "totalRows": 1

}

Create Contact

URL: https://api.socratecloud.com/webapi/rest/bpartner/contact/create/{version}?accessToken={access_token}&BPartner={bpartner_value}

Method: POST

Return: user name for success or error message (start with "ERROR: ")

Data format:

{

    "Organization": "Demo SRL",

    "Active": true,

    "Name": "User 1",

    "FirstName": null,

    "LastName": null,

    "BirthDay": null,

    "Description": null,

    "Email": "some@address",

    "Phone": null,

    "Fax": null,

    "IsAutoSendInvoice": false,

     "MailText": null

  }

Create header and details

URL: https://api.socratecloud.com/webapi/rest/bpartner/full/create/{version}?accessToken={access_token}

Method: POST

Return: business partner value for success or error message (start with "ERROR: ")

Data format:

{

     "Organization": "Demo SRL",

     "Value": "bp_value",

     "Name": "bp_name",

     "Description": null,

     "Active": true,

     "TaxID": null,

     "DUNS": null,

     "BPGroup": "Customers",

     "BPStatus": null,

     "IsIndividual": true,

     "IsCustomer": true,

     "InvoiceRule": "After Delivery",

     "DeliveryRule": "Availability",

     "DeliveryViaRule": "Shipper",

     "PaymentMethod": "On Credit",

     "PaymentMode": null,

     "PaymentTerm": "Immediate",

     "CreditLimit": 0,

     "PriceList": "Sales RON",

     "DiscountSchema": null,

     "FlatDiscount": null,

     "DiscountPrinted": false,

     "SalesRep": null,

     "InvoiceCurrency": "RON",

     "OrderDescription": "Order Description From Customer",

     "IsVendor": false,

     "POPaymentTerm": null,

     "POPriceList": null,

     "PORepresentative": null,

     "IsEmployee": false,

     "IsSalesRep": false,

     "Language": "ro_RO",

     "BankAccounts": [

         {

              "Organization": "Demo SRL",

              "Active": true,

              "BankName": "ING",

              "IBAN": "someIBAN",

              "AccountName": "Main",

              "BankAccountType": null

         }

     ],

     "Locations": [

         {

             "Organization": "Demo SRL",

             "Active": true,

             "Name": "HQ",

             "Address1": "some_str_address",

             "Country": "RO",

             "Region": "Brasov",

             "City": "Brasov",

             "CityDistrict": null,

             "PostalZipp": "500123",

             "IsInEU": true,

             "BankName": "Unicredit",

             "BankAccountNo": "78852578822",

             "IsShippAddress": true,

             "IsInvoiceAddress": true,

             "IsPayFromAddress": true,

             "IsRemitToAddress": true,

             "GlobalLocationNumber": null,

             "Phone": null,

             "Fax": null,

             "Description": null

         }

     ],

     "Contacts": [

         {

             "Organization": "Demo SRL",

             "Active": true,

             "Name": "User 1",

             "FirstName": null,

             "LastName": null,

             "BirthDay": null,

             "Description": null,

             "Email": "some@address",

             "Phone": null,

             "Fax": null,

          }

     ]

}