Skip to main content

BusinessPartner Endpoints

The entity BusinessPartner includes relevant information about the business partners of a particular company.

Common Business Partner Characteristics​

  1. Unique Identifier: The BusinessPartner entity consists of a unique identifier that serves to distinguish it from others and reference it easily. It also has a field idRemote, which refers to the ID that may be stored in the customer's ERP database.

  2. Business Partner Data: The business partner entity stores information such as contact name, trade name, TIN, notes, etc.

  3. Company: Each business partner must be associated with a company.

  4. Roles: Each business partner has a role that identifies their function in the B2B environment.

  5. Status: The entity's status determines the activities that a business partner can perform in the B2B environment.

  6. Locations: Each business partner has one or more assigned locations. These are used to define billing or shipping addresses.

  7. Contacts: We store contact information for business partners. Each one can have several contact methods assigned.

Endpoints​

GET/BusinessPartner/getBPartner​

Retrieve a list of existing business partners from the database.

Description​

This endpoint retrieves a paginated list of business partners from the system. It allows clients to obtain business partner data based on pagination parameters such as the page number (page) and the number of items per page (pageSize). The response includes detailed information about each business partner, the company they belong to, their registered locations, and their contact information. In addition, you can use the id (id), or the local id, to get the Business partner data.

Parameters​
NameDescriptionTypeDefault Value
idID of the businessPartnerString optionalid
pagePage numberInteger1
pageSizeNumber of items per pageInteger10
Responses​
JSON​
{
"data": [
{
"id": "string",
"idRemote": "string",
"role": "string",
"status": "string",
"company": {
"id": "string",
"idRemote": "string",
"companyName": "string",
"commercialName": "string",
"tin": "string"
},
"companies": [
{
"id": "string",
"idRemote": "string",
"companyName": "string",
"commercialName": "string",
"tin": "string"
}
],
"locations": [
{
"id": "string",
"idRemote": "string",
"name": "string",
"address": "string",
"city": "string",
"state": {
"id": "string",
"description": "string",
"iso": "string"
},
"postalCode": "string",
"shippingAddress": true,
"billingAddress": true,
"country": {
"id": "string",
"description": "string",
"iso": "string"
},
"default": true,
"active": true,
"createdAt": "string",
"updatedAt": "string"
}
],
"contacts": [
{
"id": "string",
"idRemote": "string",
"name": "string",
"position": "string",
"default": true,
"active": true,
"contactMethods": [
{
"id": "string",
"idRemote": "string",
"contactType": "string",
"value": "string"
}
]
}
],
"billData": {
"rate": {
"id": "string",
"idRemote": "string",
"description": "string"
},
"currency": {
"id": "string",
"idRemote": "string",
"description": "string"
},
"paymentMethod": {
"id": "string",
"idRemote": "string",
"description": "string"
},
"iban": "string",
"bank": "string",
"swift": "string",
"tax": "string",
"taxRec": "string"
},
"discounts": [
{
"id": "string",
"idRemote": "string",
"discountType": {
"id": "string",
"name": "string",
"code": "string",
"description": "string"
},
"percentage": 0,
"sequence": 0,
"active": "string"
}
],
"contactName": "string",
"commercialName": "string",
"tin": "string",
"observation": "string",
"origin": "string",
"updatedAt": "string",
"active": true
}
],
"pagination": {
"totalItems": 0,
"itemsPerPage": 0,
"currentPage": 0,
"totalPages": 0,
"nextPageUrl": "string"
}
}
XML​
<?xml version="1.0" encoding="UTF-8"?>
<export>
<data>
<item>
<id>string</id>
<idRemote>string</idRemote>
<role>string</role>
<status>string</status>
<company>
<id>string</id>
<idRemote>string</idRemote>
<companyName>string</companyName>
<commercialName>string</commercialName>
<tin>string</tin>
</company>
<companies>
<company>
<id>string</id>
<idRemote>string</idRemote>
<companyName>string</companyName>
<commercialName>string</commercialName>
<tin>string</tin>
</company>
</companies>
<locations>
<location>
<id>string</id>
<idRemote>string</idRemote>
<name>string</name>
<address>string</address>
<city>string</city>
<state>
<id>string</id>
<description>string</description>
<iso>string</iso>
</state>
<postalCode>string</postalCode>
<shippingAddress>true</shippingAddress>
<billingAddress>true</billingAddress>
<country>
<id>string</id>
<description>string</description>
<iso>string</iso>
</country>
<default>true</default>
<active>true</active>
<createdAt>string</createdAt>
<updatedAt>string</updatedAt>
</location>
</locations>
<contacts>
<contact>
<id>string</id>
<idRemote>string</idRemote>
<name>string</name>
<position>string</position>
<default>true</default>
<active>true</active>
<contactMethods>
<method>
<id>string</id>
<idRemote>string</idRemote>
<contactType>string</contactType>
<value>string</value>
</method>
</contactMethods>
</contact>
</contacts>
<billData>
<rate>
<id>string</id>
<idRemote>string</idRemote>
<description>string</description>
</rate>
<currency>
<id>string</id>
<idRemote>string</idRemote>
<description>string</description>
</currency>
<paymentMethod>
<id>string</id>
<idRemote>string</idRemote>
<description>string</description>
</paymentMethod>
<iban>string</iban>
<bank>string</bank>
<swift>string</swift>
<tax>string</tax>
<taxRec>string</taxRec>
</billData>
<discounts>
<discount>
<id>string</id>
<idRemote>string</idRemote>
<discountType>
<id>string</id>
<name>string</name>
<code>string</code>
<description>string</description>
</discountType>
<percentage>0</percentage>
<sequence>0</sequence>
<active>string</active>
</discount>
</discounts>
<contactName>string</contactName>
<commercialName>string</commercialName>
<tin>string</tin>
<observation>string</observation>
<origin>string</origin>
<updatedAt>string</updatedAt>
<active>true</active>
</item>
</data>
<pagination>
<totalItems>0</totalItems>
<itemsPerPage>0</itemsPerPage>
<currentPage>0</currentPage>
<totalPages>0</totalPages>
<nextPageUrl>string</nextPageUrl>
</pagination>
</export>

πŸ‘‰Try it out🌱

GET/BusinessPartner/updatedFrom​

Retrieve business partners based on the provided modification date.

Description​

Return a paginated list of business partners whose last modification (date) is greater than the one provided in the parameters. The (status) parameter can be null or may have some of these values:

  • Modified
  • Blocked
  • New
  • Synchronized
Parameters​
NameDescriptionTypeDefault Value
NameDescriptionTypeDefault Value
-------------------------------------------------------------------------------------
dateLast updated date
String required1999-01-01 01:00:00
statusFilter orders by status (e.g., Disabled, Modified). Accepts multiple values.[String]--
pagePage numberInteger1
pageSizeItems per pageInteger10
Required Parameters​
Responses​
JSON​
{
"data": [
{
"id": "string",
"idRemote": "string",
"role": "string",
"status": "string",
"company": {
"id": "string",
"idRemote": "string",
"companyName": "string",
"commercialName": "string",
"tin": "string"
},
"companies": [
{
"id": "string",
"idRemote": "string",
"companyName": "string",
"commercialName": "string",
"tin": "string"
}
],
"locations": [
{
"id": "string",
"idRemote": "string",
"name": "string",
"address": "string",
"city": "string",
"state": {
"id": "string",
"description": "string",
"iso": "string"
},
"postalCode": "string",
"shippingAddress": true,
"billingAddress": true,
"country": {
"id": "string",
"description": "string",
"iso": "string"
},
"default": true,
"active": true,
"createdAt": "string",
"updatedAt": "string"
}
],
"contacts": [
{
"id": "string",
"idRemote": "string",
"name": "string",
"position": "string",
"default": true,
"active": true,
"contactMethods": [
{
"id": "string",
"idRemote": "string",
"contactType": "string",
"value": "string"
}
]
}
],
"billData": {
"rate": {
"id": "string",
"idRemote": "string",
"description": "string"
},
"currency": {
"id": "string",
"idRemote": "string",
"description": "string"
},
"paymentMethod": {
"id": "string",
"idRemote": "string",
"description": "string"
},
"iban": "string",
"bank": "string",
"swift": "string",
"tax": "string",
"taxRec": "string"
},
"discounts": [
{
"id": "string",
"idRemote": "string",
"discountType": {
"id": "string",
"name": "string",
"code": "string",
"description": "string"
},
"percentage": 0,
"sequence": 0,
"active": "string"
}
],
"contactName": "string",
"commercialName": "string",
"tin": "string",
"observation": "string",
"origin": "string",
"updatedAt": "string",
"active": true
}
],
"pagination": {
"totalItems": 0,
"itemsPerPage": 0,
"currentPage": 0,
"totalPages": 0,
"nextPageUrl": "string"
}
}
XML​
<?xml version="1.0" encoding="UTF-8"?>
<export>
<data>
<item>
<id>string</id>
<idRemote>string</idRemote>
<role>string</role>
<status>string</status>
<company>
<id>string</id>
<idRemote>string</idRemote>
<companyName>string</companyName>
<commercialName>string</commercialName>
<tin>string</tin>
</company>
<companies>
<company>
<id>string</id>
<idRemote>string</idRemote>
<companyName>string</companyName>
<commercialName>string</commercialName>
<tin>string</tin>
</company>
</companies>
<locations>
<id>string</id>
<idRemote>string</idRemote>
<name>string</name>
<address>string</address>
<city>string</city>
<state>
<id>string</id>
<description>string</description>
<iso>string</iso>
</state>
<postalCode>string</postalCode>
<shippingAddress>true</shippingAddress>
<billingAddress>true</billingAddress>
<country>
<id>string</id>
<description>string</description>
<iso>string</iso>
</country>
<default>true</default>
<active>true</active>
<createdAt>string</createdAt>
<updatedAt>string</updatedAt>
</locations>
<contacts>
<id>string</id>
<idRemote>string</idRemote>
<name>string</name>
<position>string</position>
<default>true</default>
<active>true</active>
<contactMethods>
<id>string</id>
<idRemote>string</idRemote>
<contactType>string</contactType>
<value>string</value>
</contactMethods>
</contacts>
<billData>
<rate>
<id>string</id>
<idRemote>string</idRemote>
<description>string</description>
</rate>
<currency>
<id>string</id>
<idRemote>string</idRemote>
<description>string</description>
</currency>
<paymentMethod>
<id>string</id>
<idRemote>string</idRemote>
<description>string</description>
</paymentMethod>
<iban>string</iban>
<bank>string</bank>
<swift>string</swift>
<tax>string</tax>
<taxRec>string</taxRec>
</billData>
<discounts>
<discount>
<id>string</id>
<idRemote>string</idRemote>
<discountType>
<id>string</id>
<name>string</name>
<code>string</code>
<description>string</description>
</discountType>
<percentage>0</percentage>
<sequence>0</sequence>
<active>string</active>
</discount>
</discounts>
<contactName>string</contactName>
<commercialName>string</commercialName>
<tin>string</tin>
<observation>string</observation>
<origin>string</origin>
<updatedAt>string</updatedAt>
<active>true</active>
</item>
</data>
<pagination>
<totalItems>0</totalItems>
<itemsPerPage>0</itemsPerPage>
<currentPage>0</currentPage>
<totalPages>0</totalPages>
<nextPageUrl>string</nextPageUrl>
</pagination>
</export>

πŸ‘‰Try it out🌱

GET/BusinessPartner/getBPartnerStatus​

Description​

Returns a paginated list of statuses that a BusinessPartner can have within the app In the response the nextPageUrl could be null if all goes well If NO PARAMETERS are attached, all Partner Status will be returned

Parameters​
NameDescriptionTypeDefault Value
pagePage numberInteger1
pageSizeItems per pageInteger10
Response​
JSON​
{
"data": [
{
"id": "string",
"idRemote": "string",
"description": "string"
}
],
"pagination": {
"totalItems": 0,
"itemsPerPage": 0,
"currentPage": 0,
"totalPages": 0,
"nextPageUrl": "string"
}
}
XML​
<?xml version="1.0" encoding="UTF-8"?>
<export>
<data>
<item>
<id>string</id>
<idRemote>string</idRemote>
<description>string</description>
</item>
</data>
<pagination>
<totalItems>0</totalItems>
<itemsPerPage>0</itemsPerPage>
<currentPage>0</currentPage>
<totalPages>0</totalPages>
<nextPageUrl>string</nextPageUrl>
</pagination>
</export>

πŸ‘‰Try it out🌱

GET/BusinessPartner/getClients​

Retrieve business partners whose role is "customer"

Description​

Returns a paginated list of business partners whose role is "customer." The response format follows the same schema as the previous endpoints. If NO ENTITIES are found, it returns a 204 "no content" code. If NO PARAMETERS are attached, it will return all the customers.

Parameters​
NameDescriptionTypeDefault Value
idID of the businessPartner (optional)Stringid optional
pagePage numberInteger1
pageSizeItems per pageInteger10
Responses​
JSON​
{
"data": [
{
"id": "string",
"idRemote": "string",
"role": "string",
"status": "string",
"agentId": [
"string"
],
"company": {
"id": "string",
"idRemote": "string",
"companyName": "string",
"commercialName": "string",
"tin": "string"
},
"companies": [
{
"id": "string",
"idRemote": "string",
"companyName": "string",
"commercialName": "string",
"tin": "string"
}
],
"locations": [
{
"id": "string",
"idRemote": "string",
"name": "string",
"address": "string",
"city": "string",
"state": {
"id": "string",
"description": "string",
"iso": "string"
},
"postalCode": "string",
"shippingAddress": true,
"billingAddress": true,
"country": {
"id": "string",
"description": "string",
"iso": "string"
},
"default": true,
"active": true,
"createdAt": "string",
"updatedAt": "string"
}
],
"contacts": [
{
"id": "string",
"idRemote": "string",
"name": "string",
"position": "string",
"default": true,
"active": true,
"contactMethods": [
{
"id": "string",
"idRemote": "string",
"contactType": "string",
"value": "string"
}
]
}
],
"billData": {
"rate": {
"id": "string",
"idRemote": "string",
"description": "string"
},
"currency": {
"id": "string",
"idRemote": "string",
"description": "string"
},
"paymentMethod": {
"id": "string",
"idRemote": "string",
"description": "string"
},
"iban": "string",
"bank": "string",
"swift": "string",
"tax": "string",
"taxRec": "string"
},
"discounts": [
{
"id": "string",
"idRemote": "string",
"discountType": {
"id": "string",
"name": "string",
"code": "string",
"description": "string"
},
"percentage": 0,
"sequence": 0,
"active": "string"
}
],
"contactName": "string",
"commercialName": "string",
"tin": "string",
"observation": "string",
"origin": "string",
"updatedAt": "string",
"active": true
}
],
"pagination": {
"totalItems": 0,
"itemsPerPage": 0,
"currentPage": 0,
"totalPages": 0,
"nextPageUrl": "string"
}
}
XML​
<?xml version="1.0" encoding="UTF-8"?>
<export>
<data>
<item>
<id>string</id>
<idRemote>string</idRemote>
<role>string</role>
<status>string</status>
<company>
<id>string</id>
<idRemote>string</idRemote>
<companyName>string</companyName>
<commercialName>string</commercialName>
<tin>string</tin>
</company>
<companies>
<company>
<id>string</id>
<idRemote>string</idRemote>
<companyName>string</companyName>
<commercialName>string</commercialName>
<tin>string</tin>
</company>
</companies>
<locations>
<id>string</id>
<idRemote>string</idRemote>
<name>string</name>
<address>string</address>
<city>string</city>
<state>
<id>string</id>
<description>string</description>
<iso>string</iso>
</state>
<postalCode>string</postalCode>
<shippingAddress>true</shippingAddress>
<billingAddress>true</billingAddress>
<country>
<id>string</id>
<description>string</description>
<iso>string</iso>
</country>
<default>true</default>
<active>true</active>
<createdAt>string</createdAt>
<updatedAt>string</updatedAt>
</locations>
<contacts>
<id>string</id>
<idRemote>string</idRemote>
<name>string</name>
<position>string</position>
<default>true</default>
<active>true</active>
<contactMethods>
<id>string</id>
<idRemote>string</idRemote>
<contactType>string</contactType>
<value>string</value>
</contactMethods>
</contacts>
<billData>
<rate>
<id>string</id>
<idRemote>string</idRemote>
<description>string</description>
</rate>
<currency>
<id>string</id>
<idRemote>string</idRemote>
<description>string</description>
</currency>
<paymentMethod>
<id>string</id>
<idRemote>string</idRemote>
<description>string</description>
</paymentMethod>
<iban>string</iban>
<bank>string</bank>
<swift>string</swift>
<tax>string</tax>
<taxRec>string</taxRec>
</billData>
<discounts>
<discount>
<id>string</id>
<idRemote>string</idRemote>
<discountType>
<id>string</id>
<name>string</name>
<code>string</code>
<description>string</description>
</discountType>
<percentage>0</percentage>
<sequence>0</sequence>
<active>string</active>
</discount>
</discounts>
<contactName>string</contactName>
<commercialName>string</commercialName>
<tin>string</tin>
<observation>string</observation>
<origin>string</origin>
<updatedAt>string</updatedAt>
<active>true</active>
</item>
</data>
<pagination>
<totalItems>0</totalItems>
<itemsPerPage>0</itemsPerPage>
<currentPage>0</currentPage>
<totalPages>0</totalPages>
<nextPageUrl>string</nextPageUrl>
</pagination>
</export>

πŸ‘‰Try it out🌱

GET/BusinessPartner/getAgents​

Retrieve business partners whose role is "agent"

Description​

Returns a paginated list of business partners whose role is "representative." The response format follows the schema of the previous endpoints. If no entities are found, it returns a 204 "empty" code.

Parameters​
NameDescriptionTypeDefault Value
pagePage numberInteger1
pageSizeItems per pageInteger10
Responses​
JSON​
{
"data": [
{
"id": "string",
"idRemote": "string",
"role": "string",
"status": "string",
"company": {
"id": "string",
"idRemote": "string",
"companyName": "string",
"commercialName": "string",
"tin": "string"
},
"companies": [
{
"id": "string",
"idRemote": "string",
"companyName": "string",
"commercialName": "string",
"tin": "string"
}
],
"locations": [
{
"id": "string",
"idRemote": "string",
"name": "string",
"address": "string",
"city": "string",
"state": {
"id": "string",
"description": "string",
"iso": "string"
},
"postalCode": "string",
"shippingAddress": true,
"billingAddress": true,
"country": {
"id": "string",
"description": "string",
"iso": "string"
},
"default": true,
"active": true,
"createdAt": "string",
"updatedAt": "string"
}
],
"contacts": [
{
"id": "string",
"idRemote": "string",
"name": "string",
"position": "string",
"default": true,
"active": true,
"contactMethods": [
{
"id": "string",
"idRemote": "string",
"contactType": "string",
"value": "string"
}
]
}
],
"billData": {
"rate": {
"id": "string",
"idRemote": "string",
"description": "string"
},
"currency": {
"id": "string",
"idRemote": "string",
"description": "string"
},
"paymentMethod": {
"id": "string",
"idRemote": "string",
"description": "string"
},
"iban": "string",
"bank": "string",
"swift": "string",
"tax": "string",
"taxRec": "string"
},
"discounts": [
{
"id": "string",
"idRemote": "string",
"discountType": {
"id": "string",
"name": "string",
"code": "string",
"description": "string"
},
"percentage": 0,
"sequence": 0,
"active": "string"
}
],
"contactName": "string",
"commercialName": "string",
"tin": "string",
"observation": "string",
"origin": "string",
"updatedAt": "string",
"active": true
}
],
"pagination": {
"totalItems": 0,
"itemsPerPage": 0,
"currentPage": 0,
"totalPages": 0,
"nextPageUrl": "string"
}
}
XML​
<?xml version="1.0" encoding="UTF-8"?>
<export>
<data>
<item>
<id>string</id>
<idRemote>string</idRemote>
<role>string</role>
<status>string</status>
<company>
<id>string</id>
<idRemote>string</idRemote>
<companyName>string</companyName>
<commercialName>string</commercialName>
<tin>string</tin>
</company>
<companies>
<company>
<id>string</id>
<idRemote>string</idRemote>
<companyName>string</companyName>
<commercialName>string</commercialName>
<tin>string</tin>
</company>
</companies>
<locations>
<id>string</id>
<idRemote>string</idRemote>
<name>string</name>
<address>string</address>
<city>string</city>
<state>
<id>string</id>
<description>string</description>
<iso>string</iso>
</state>
<postalCode>string</postalCode>
<shippingAddress>true</shippingAddress>
<billingAddress>true</billingAddress>
<country>
<id>string</id>
<description>string</description>
<iso>string</iso>
</country>
<default>true</default>
<active>true</active>
<createdAt>string</createdAt>
<updatedAt>string</updatedAt>
</locations>
<contacts>
<id>string</id>
<idRemote>string</idRemote>
<name>string</name>
<position>string</position>
<default>true</default>
<active>true</active>
<contactMethods>
<id>string</id>
<idRemote>string</idRemote>
<contactType>string</contactType>
<value>string</value>
</contactMethods>
</contacts>
<billData>
<rate>
<id>string</id>
<idRemote>string</idRemote>
<description>string</description>
</rate>
<currency>
<id>string</id>
<idRemote>string</idRemote>
<description>string</description>
</currency>
<paymentMethod>
<id>string</id>
<idRemote>string</idRemote>
<description>string</description>
</paymentMethod>
<iban>string</iban>
<bank>string</bank>
<swift>string</swift>
<tax>string</tax>
<taxRec>string</taxRec>
</billData>
<discounts>
<discount>
<id>string</id>
<idRemote>string</idRemote>
<discountType>
<id>string</id>
<name>string</name>
<code>string</code>
<description>string</description>
</discountType>
<percentage>0</percentage>
<sequence>0</sequence>
<active>string</active>
</discount>
</discounts>
<contactName>string</contactName>
<commercialName>string</commercialName>
<tin>string</tin>
<observation>string</observation>
<origin>string</origin>
<updatedAt>string</updatedAt>
<active>true</active>
</item>
</data>
<pagination>
<totalItems>0</totalItems>
<itemsPerPage>0</itemsPerPage>
<currentPage>0</currentPage>
<totalPages>0</totalPages>
<nextPageUrl>string</nextPageUrl>
</pagination>
</export>

πŸ‘‰Try it out🌱

GET/BusinessPartner/getClientsAssignedToAgent​

Retrieve business partners whose role is "client" and have an "agent" assigned.

Description​

Returns a paginated list of business partners whose role is "customer" and are assigned to another partner with the role "representative." If no entities are found, it returns a 204 "empty" code.

Parameters​
NameDescriptionTypeDefault Value
pagePage numberInteger1
pageSizeItems per pageInteger10
Responses​
JSON​
{
"data": [
{
"companyId": "string",
"agentId": "string",
"clients": [
{
"id": "string"
}
]
}
],
"pagination": {
"totalItems": 0,
"itemsPerPage": 0,
"currentPage": 0,
"totalPages": 0,
"nextPageUrl": "string"
}
}
XML​
<?xml version="1.0" encoding="UTF-8"?>
<export>
<data>
<item>
<companyId>string</companyId>
<agentId>string</agentId>
<clients>
<id>string</id>
</clients>
</item>
</data>
<pagination>
<totalItems>0</totalItems>
<itemsPerPage>0</itemsPerPage>
<currentPage>0</currentPage>
<totalPages>0</totalPages>
<nextPageUrl>string</nextPageUrl>
</pagination>
</export>

πŸ‘‰Try it out🌱

GET/BusinessPartner/getContacts​

Get a paginated list with the contact information assigned to each business partner.

Description​

Returns a paginated list that includes contact information for each business partner registered in the system.

Parameters​
NameDescriptionTypeDefault Value
pagePage numberInteger1
pageSizeNumber of items per pageInteger10
Responses​
JSON​
{
"data": [
{
"id": "string",
"idRemote": "string",
"businessPartner": {
"id": "string",
"contactName": "string"
},
"name": "string",
"position": "string",
"default": true,
"active": true,
"contactMethods": [
{
"contactType": {
"id": "string",
"value": "string"
},
"value": "string"
}
]
}
],
"pagination": {
"totalItems": 0,
"itemsPerPage": 0,
"currentPage": 0,
"totalPages": 0,
"nextPageUrl": "string"
}
}
XML​
<?xml version="1.0" encoding="UTF-8"?>
<export>
<data>
<item>
<id>string</id>
<idRemote>string</idRemote>
<businessPartner>
<id>string</id>
<contactName>string</contactName>
</businessPartner>
<name>string</name>
<position>string</position>
<default>true</default>
<active>true</active>
<contactMethods>
<item>
<contactType>
<id>string</id>
<value>string</value>
</contactType>
<value>string</value>
</item>
</contactMethods>
</item>
</data>
<pagination>
<totalItems>0</totalItems>
<itemsPerPage>0</itemsPerPage>
<currentPage>0</currentPage>
<totalPages>0</totalPages>
<nextPageUrl>string</nextPageUrl>
</pagination>
</export>

πŸ‘‰Try it out🌱

GET/BusinessPartner/getContactTypes​

Get a list of all contact types existing in the B2B context.

Description​

Returns a paginated list of all available contact types. This is useful for understanding the available types and assigning them correctly to a business partner.

Parameters​
NameDescriptionTypeDefault Value
pagePage numberInteger1
pageSizeNumber of items per pageInteger10
Responses​
JSON​
{
"data": [
{
"id": "string",
"value": "string"
}
],
"pagination": {
"totalItems": 0,
"itemsPerPage": 0,
"currentPage": 0,
"totalPages": 0,
"nextPageUrl": "string"
}
}
XML​
<?xml version="1.0" encoding="UTF-8"?>
<export>
<data>
<item>
<id>string</id>
<value>string</value>
</item>
</data>
<pagination>
<totalItems>0</totalItems>
<itemsPerPage>0</itemsPerPage>
<currentPage>0</currentPage>
<totalPages>0</totalPages>
<nextPageUrl>string</nextPageUrl>
</pagination>
</export>

πŸ‘‰Try it out🌱

POST/BusinessPartner/create​

Create a new business partner in the database.

POST Method Details:​

Creates a new record based on the data provided in the request body. To register a new business partner in the system, you must ensure that the following entities exist:

  1. Creation of Role: Each business partner must be associated with a role. Therefore, the role you assign to the new business partner must exist in the system. πŸ‘‰Register Role🌱

  2. Creation of Status: Similarly, a business partner is assigned a status. The status assigned to the new business partner must exist in the system.

  3. Creation of Company: It is crucial that the company related to the new business partner exists in the system.
    πŸ‘‰Register Company🌱

The contacts assigned when creating a business partner are created instantly and do not need to reference existing fields. However, for locations we have two options:

  • Create a new location: If the location that we want to associate with the business partner does not exist, we can attach the necessary data to the locations field to create a new location. We see this option in the JSON of this method.
  • Reference a location: If the location that we want to associate with the business partner exists, we can reference it with the locationId parameter within the locations field. The field layout is as follows:
{
"locations": [
{
"locationId": "string"
}
]
}

The idRemote fields provided when creating a new entity correspond to the remote idRemote that the user wants to give it. The system will automatically create a local id. As for the agentId field, it is optional since we can decide whether to associate an agent or not.

Required Parameters​
NameDescriptionType
idRemoteNew Business Partner IDString
roleIdNew Business Partner Role IDString
statusIdNew Business Partner Status IDString
companyIdNew Business Partner Company IDString
contactNameNew Business Partner Contact NameString
commercialNameNew Business Partner Commercial NameString
tinNew Business Partner Identity CardString
observationBusiness Partner ObservationString
originNew Business Partner origin CardString
activeWhether the business partner is active or notBoolean
Mandatory parameters for Companies.​

To assign a new related Company to the Business Partner you must take into account that the following parameters are mandatory:

NameDescriptionType
idRemoteCompany IDString
Mandatory parameters for Locations​

If you want to assign a new Location to the Business Partner you must take into account that the following parameters are mandatory:

NameDescriptionType
idRemoteIdentifier of the new LocationString
nameName of the new LocationString
addressFull address of the new LocationString
cityCity/Town of the new LocationString
stateIdValid identifier of the State of the new LocationString
postalCodePostal Code of the new LocationString
shippingAddressIf it is the default shipping addressBoolean
billingAddressIf it is the default billing addressBoolean
countryIdValid identifier of the Country of the new LocationString
defaultIf the new Location is the default LocationBoolean
activeIf the new Location is activeBoolean
Mandatory parameters for Contacts.​

To assign a new Contact to the Business Partner you must take into account that the following parameters are mandatory:

NameDescriptionType
idRemoteRemote IDString
nameName of the new ContactString
positionPosition of the new ContactString
defaultIf the new Contact is the default contactBoolean
activeIf the new Contact is activeBoolean
Mandatory parameters for Contact/ContactMethods.​

To assign a new contact method to the Business Partner you must take into account that the following mandatory parameters :

| Name | Description | Type | |------------------|------------ | idRemote | Remote ID | String |
| contactTypeId| Type of contact | String |
| value | Value of the contact field | String |

Mandatory parameters for BillData.​

To assign a new Bill to the Business Partner you must take into account that the following mandatory parameters :

NameDescriptionType
rateIdID billString
currencyIsoISO currency codeString
paymentMethodIdPayment method IDString
ibanIBAN numberString
bankBank nameString
swiftSWIFT codeString
taxTaxString
taxRecTax receivableString
Mandatory parameters for Discounts.​

To assign a new Discounts to the Business Partner you must take into account that the following mandatory parameters :

NameDescriptionType
idRemoteRemote discount IDString
discountTypeIdDiscount type IDString
sequenceDiscount sequenceNumber
percentageDiscount percentageNumber
activeActive statusString

All contactMethods parameters are mandatory.


Complete request body​
[
{
"idRemote": "string",
"roleId": "string",
"statusId": "string",
"companyId": "string",
"agentId": "string",
"companies": [
{
"idRemote": "string"
}
],
"locations": [
{
"idRemote": "string",
"name": "string",
"address": "string",
"city": "string",
"stateId": "string",
"postalCode": "string",
"shippingAddress": true,
"billingAddress": true,
"countryId": "string",
"default": true,
"active": true
}
],
"contacts": [
{
"idRemote": "string",
"name": "string",
"position": "string",
"default": true,
"active": true,
"contactMethods": [
{
"idRemote" : "string",
"contactTypeId": "string",
"value": "string"
}
]
}
],
"billData": {
"rateId": "string",
"currencyIso": "string",
"paymentMethodId": "string",
"iban": "string",
"bank": "string",
"swift": "string",
"tax": "string",
"taxRec": "string"
},
"discounts": [
{
"idRemote": "string",
"discountTypeId": "string",
"sequence": 0,
"percentage": 0,
"active": "string"
}
],
"contactName": "string",
"commercialName": "string",
"tin": "string",
"observation": "string",
"origin": "string",
"active": true
}
]

It is possible to add multiple business partners through the same request by separating them with commas within the array in the body of the request.

Responses​

To avoid overloading the server, this endpoint sends a message to a consumer responsible for processing the request. To check the status of the submitted request, you need to access the URL provided in the response. A successfully sent message to the consumer should look like this:

{
"code": 201,
"message": "BusinessPartner message created successfully and dispatched to the queue.",
"statusUrl": "http://host/api/database/v1/message/status/66bf382938941"
}

The statusUrl field redirects us to a more detailed response about the request's status. A request successfully processed by the consumer will look like this:

{
"data": [
{
"status": "completed",
"errorMessage": null
}
],
"pagination": {
"totalItems": 1,
"itemsPerPage": 10,
"currentPage": 1,
"totalPages": 1,
"nextPageUrl": null
}
}

If any error occurs during message processing, the response will look something like this:

{
"code": 400,
"error": "Invalid business partner data format, a required parameter is missing"
}

πŸ‘‰Try it out🌱

POST/BusinessPartner/assignClientsToAgent​

Assigns the client list attached in the body of the request to the agent and company.

POST Method Details​

To perform the operation, you must ensure that the business partners you are assigning to the agent have the role of client. Likewise, the agent must have the role of representative. It is important to ensure that both the customers and the agent belong to the same company. You can assign many customers to the same agent in a single operation.


All body parameters are required.


The request body must follow the following schema in JSON format:

[
{
"agentId": "string",
"clients": [
{
"idRemote": "string"
}
]
}
]

πŸ‘‰Try it out🌱

PUT/BusinessPartner/update/{id}​

Update an existing business partner.

Description​

This endpoint allows clients to update business partner data using the id parameter. This idRemote field can either be the idRemote from the company using this B2B or the local id created by the system. Through this endpoint, it is possible to update the locations and contacts associated with the business partner.

Required Parameters​
NameDescriptionType
idBusiness Partner identifierString required

You don't need to include the entire JSON structure, just include the attributes you want to modify.


Request body​

The request body must include the data to update for the business partner, following this schema:

{
"roleId": "string",
"statusId": "string",
"companyId": "string",
"companies": [
{
"idRemote": "string"
}
],
"locations": [
{
"idRemote": "string",
"name": "string",
"address": "string",
"city": "string",
"stateId": "string",
"postalCode": "string",
"shippingAddress": true,
"billingAddress": true,
"country": {
"id": "string",
"description": "string",
"iso": "string"
},
"default": true,
"active": true
}
],
"contacts": [
{
"idRemote": "string",
"name": "string",
"position": "string",
"default": true,
"active": true,
"contactMethods": [
{
"idRemote": "string",
"contactTypeId": "string",
"value": "string"
}
]
}
],
"billData": {
"rateId": "string",
"currencyIso": "string",
"paymentMethodId": "string",
"iban": "string",
"bank": "string",
"swift": "string",
"tax": "string",
"taxRec": "string"
},
"discounts": [
{
"idRemote": "string",
"discountTypeId": "string",
"sequence": 0,
"percentage": 0,
"active": "string"
}
],
"contactName": "string",
"commercialName": "string",
"tin": "string",
"observation": "string",
"origin": "string",
"active": true
}

πŸ‘‰Try it out🌱

DELETEBusinessPartner/delete/{id}​

Remove an existing business partner. The id parameter can be either the remote id or the local id.

Description​

Deletes a business partner and all associated locations and contacts. The id parameter can be either the remote id or the local id. Once deleted, the business partner is logged in the Deleted History.


⚠️A Business Partner cannot be deleted if it is related to an Invoice, Delivery Note or Order.

Parameters​
NameDescriptionType
idUnique identifierString required

πŸ‘‰Try it out🌱

DELETEBusinessPartner/BPartnerContact/{bPartnerId}​

Remove an existing business partner. The bPartnerId parameter can be either the remote id or the local id.

Description​

Deletes a business partner and all associated locations and contacts. The bPartnerId parameter can be either the remote id or the local id. Once deleted, the business partner is logged in the Deleted History.


⚠️A Business Partner cannot be deleted if it is related to an Invoice, Delivery Note or Order.

Parameters​
NameDescriptionType
bPartnerIdUnique identifierString required
contactIdUnique, or remote, identifier of the contact IdString

πŸ‘‰Try it out🌱

DELETEBusinessPartner/BPartnerDiscount/{bPartnerId}​

Remove an existing business partner. The bPartnerId parameter can be either the remote id or the local id.

Description​

Deletes a business partner and all associated locations and contacts. The bPartnerId parameter can be either the remote id or the local id. Once deleted, the business partner is logged in the Deleted History.


⚠️A Business Partner cannot be deleted if it is related to an Invoice, Delivery Note or Order.

Parameters​
NameDescriptionType
bPartnerIdUnique identifierString required
discountIdUnique, or remote, identifier of the discount IdString

πŸ‘‰Try it out🌱

Possible Response Errors​

ErrorResponse StatusResponse Body
This error occurs when a connection to the database cannot be established. It is an internal server problem.500{"code": 500,"error": "Database connection failed."}
This error occurs when you cannot insert or update items into the database.500{"code": 500,"error": "Invalid connection name, you cannot insert in default"}
This error occurs when a parameter is missing.400{"code": 400,"error": "Parameter $parameter is required"}
This error occurs when you are not authorized.401{"code": 401,"error": "Unauthorized."}
This error occurs when the BusinessPartner could not be found.404{"code": 404,"error": "No entity found for Characteristic."}
This error occurs when you try to insert an Characteristic that already exists.409{"code": 409,"error": "Duplicate entry"}
This error occurs when you try to send too many requests in a short period of time.429{"code": 429,"error": "Too Many Requests"}