Package: cloudspot-erp-api
Cloudspot API wrapperBasic wrapper for the Cloudspot ERP API.Use casesThis wrapper has two use cases:1. Authenticate and authorize users on an external app, linked to Cloudspot ERP2. Get data (products, clients,...) from a company that is present on the Cloudspot ERP:warning:WarningThe authentication and authorization for external apps is migrated to Cloudspot License server as of 2023-03-14.You can find the new wrapper here.Getting startedInstallInstall with pip.pipinstallcloudspot-erp-apiImportDepending on your use case, you'll need to import eitherCloudspotERP_UserAPIorCloudspotERP_CompanyAPI.# Use case 1fromcloudspot.apiimportCloudspotERP_UserAPI# Use case 2fromcloudspot.apiimportCloudspotERP_CompanyAPIFunctionalitiesCloudspotERP_UserAPI:warning:WarningThe authentication and authorization for external apps is migrated to Cloudspot License server as of 2023-03-14.You can find the new wrapper here.CloudspotERP_CompanyAPIThis class is used to retrieve data from a company.SetupWhen setting up the class, one parameter is expected: the generated API token of the company.
This token can be generated by an ERP administrator for a specific company.
A token can have the right to:See all productsSee all clientsfromcloudspot.apiimportCloudspotERP_CompanyAPIapi=CloudspotERP_CompanyAPI('[TOKEN]')After setting up the connection, you can use theapito send requests to the Cloudspot ERP.All productsBelow method will allow you to retrieve all the products that are available inside the ERP and are linked to the company by the token.
The.list()method will return oneArtikelsobject, which is a list containing one or multipleArtikelobjects.artikels=api.artikels.list()forartikelinartikels.items():print('naam: ',artikel.naam)Available attributesFollowing attributes are available for theArtikelobject:AttributeTypeRemarksnaamstringName of the productbeschrijvingtextLong description of the productSKUstringStock Keeping Unitvoorraad_bijhoudenstringCan only contain one of these three values: "NIET" / "FYSIEK" / "DIGITAAL"op_voorraadfloatHow many units are currently in stock, only applicable of voorraad_bijhouden is "FYSIEK"product_urlurlExternal URL with the product informationverkoopprijs_exclfloatSales price, excl. VATverkoopprijs_inclfloatSales price, incl. VATinkoopprijs_exclfloatPurchase price, excl. VATinkoopprijs_inclfloatPurchase price, incl. VATBTWfloatPercentage of VAT applicable to the productbestellingtypestringCan only contain one of these two values: "IDEAAL" / "BESTELLING"units_per_bestellingfloatMinimum amount of units needed for an order to the vendorstatusstringCan only contain one of these three values: "ZICHTBAAR" / "NIET_VERKOOPBAAR" / "GEDEACTIVEERD"Specific productBelow method will allow you to retrieve a specific product by ID. Will only return the article if the article is in the company that is linked to the token.
The.get(id)method will return oneArtikelobject.artikel=api.artikels.get(125)# Retrieve artikel with ID 125print('naam: ',artikel.naam)All clientsBelow method will allow you to retrieve all the clients that are available inside the ERP and are linked to the company by the token.
The.list()method will return oneKlantenobject, which is a list containing one or multipleKlantobjects.klanten=api.klanten.list()forklantinklanten.items():print('voornaam: ',klant.voornaam)Available attributesFollowing attributes are available for theKlantobject:AttributeTypeRemarksklantennummerintegerClient number/referenceaanspreektitelstringCan only contain one of these two values: "Mijnh." / "Mevr."voornaamstringFirst name of clientachternaamstringLast name of clientstraatstringStreethuisnummerstringHouse numberbusnummerstringBox numberpostcodestringZipcodeplaatsstringPlace/regionlandstringTwo letter country code (ex. BE/NL/FR/...)geboortedatumdateBirthday of clientgeboorteplaatsstringPlace of birthis_bedrijfbooleanIndicates wether the client is a company or not. True = client is a company, False = client is not a companybedrijfsnaamstringName of the company. Only applicable if is_bedrijf is TrueBTW_nummerstringVAT number of the company. Only applicable if is_bedrijf is TrueondernemingsnummerstringKBO number of the company. Only applicable if is_bedrijf is TrueError handlingBasic error handling has been added.
You can check if an error has occured during a call by checking the hasError attribute on the object.
If the hasError attribute has been set to True, an Error object will be attached to the error attribute of the same object.
The Error object contains one attribute: message. This will contain the error message.artikels=api.artikels.list()ifartikels.hasError:print('error: ',artikels.error.message)