Companies
3 min
Companies are the firms you work with: suppliers and business customers. Use them to sync your partners with the ERP.
Query
query GetCompanies($fiscalCode: String, $first: Int, $after: String) {
companies {
companies(fiscalCode: $fiscalCode, first: $first, after: $after) {
totalCount
pageInfo {
hasNextPage
endCursor
}
items {
key
name
fiscalCode
fiscalAttribute
registrationCode
externalCode
bankName1
bankAccount1
bankName2
bankAccount2
defaultAddress {
key
streetName
streetNumber
postalCode
eMail
city { key name }
county { key name code }
country { key name code }
}
}
}
companyCategories {
key
name
}
}
}Variables
{
"fiscalCode": "87654321",
"first": 30,
"after": null
}cURL
curl --location 'https://sandbox.expressoft.eu/connect/api/interopgql' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <token>' \
--data '{"query": "query GetCompanies($fiscalCode: String, $first: Int, $after: String) { companies { companies(fiscalCode: $fiscalCode, first: $first, after: $after) { totalCount pageInfo { hasNextPage endCursor } items { key name fiscalCode fiscalAttribute registrationCode externalCode bankName1 bankAccount1 bankName2 bankAccount2 defaultAddress { key streetName streetNumber postalCode eMail city { key name } county { key name code } country { key name code } } } } companyCategories { key name } } }", "variables": {"fiscalCode": "87654321", "first": 30, "after": null}}'Response
{
"data": {
"companies": {
"companies": {
"totalCount": 1,
"pageInfo": {
"hasNextPage": false,
"endCursor": "MQ=="
},
"items": [
{
"key": "00000000-0000-0000-0000-000000000002",
"name": "Example Supplier SRL",
"fiscalCode": "87654321",
"fiscalAttribute": "RO",
"registrationCode": "J40/4321/2018",
"externalCode": "SUP1",
"bankName1": "Example Bank",
"bankAccount1": "RO00EXAM0000000000000001",
"bankName2": null,
"bankAccount2": null,
"defaultAddress": {
"key": "00000000-0000-0000-0000-000000000007",
"streetName": "Sample Street",
"streetNumber": "12",
"postalCode": "010101",
"eMail": "[email protected]",
"city": {
"key": "00000000-0000-0000-0000-000000000008",
"name": "Sector 1"
},
"county": {
"key": "00000000-0000-0000-0000-000000000009",
"name": "Bucuresti",
"code": "B"
},
"country": {
"key": "00000000-0000-0000-0000-000000000010",
"name": "Romania",
"code": "RO"
}
}
}
]
},
"companyCategories": [
{
"key": "00000000-0000-0000-0000-000000000011",
"name": "Suppliers"
}
]
}
}
}You can filter by fiscalCode or by key (one company). The list is paged. addresses returns all the addresses of a company, defaultAddress the main one.
💡 TIP
Match a company with your ERP by fiscalCode. You need the key of a company to create a purchase invoice.