Documentazione API
Quoparts mette a disposizione un servizio REST API, per integrazioni da sistemi esterni.
Questa documentazione fornisce informazioni sugli endpoint disponibili e su come interagire con essi.
API Endpoint Base
https://dev.quoparts.it/ws_quoparts.php
1. Autenticazione
L'API Login consente di autenticarsi al sistema QuoParts e ottenere un token necessario per le chiamate successive.
GET
https://dev.quoparts.it/ws_quoparts.php?login=&username={USER}&password={PWD}
Parametri URL
| Parametro | Tipo | Obbligatorio | Descrizione |
|---|---|---|---|
login | string | SÌ | Nome metodo. |
username | string | SÌ | Username per l'autenticazione. |
password | string | SÌ | Password per l'autenticazione. |
Esempio cURL
curl -X GET "https://dev.quoparts.it/ws_quoparts.php?login=&username=CODICE_UTENTE&password=PASSWORD_UTENTE"
Esempio Risposta (Successo)
{
"errorCode": "0",
"error": "",
"data": [
{
"TOKEN": "40919716769452007349723.39576135"
}
]
}
Esempio Risposta (Errore)
{
"errorCode": "101",
"error": "Utente non Accreditato",
"data": []
}
Note Tecniche
- In caso di token scaduto, è necessario effettuare nuovamente il login.
2. Import Clienti
L'API consente di trasmettere anagrafiche cliente al sistema QuoParts e generare le relative credenziali.
POST
https://dev.quoparts.it/ws_quoparts.php?importCli=&token={TOKEN}
Parametri URL
| Parametro | Tipo | Obbligatorio | Descrizione |
|---|---|---|---|
importCli | string | SÌ | Nome metodo. |
token | string | SÌ | Token di autenticazione ottenuto tramite API Login. |
Struttura Payload (JSON)
Inviare un oggetto JSON con proprietà data contenente un array di clienti.
| Campo | Tipo | Obbligatorio | Descrizione |
|---|---|---|---|
DES_NOM | string | SÌ | Ragione Sociale. |
DES_IND | string | No | Indirizzo. |
DES_CTA | string | No | Città. |
COD_PRN | string | No | Provincia (es: MI). |
COD_CAP | string | No | CAP. |
COD_EML | string | No | Email. |
COD_PTA_IVA | string | SÌ | Partita IVA. |
FLG_ATV | string | No | Stato (1=attivo). Default: 1. |
COD_CLI_ERP | string | SÌ | Codice Cliente Procar univoco. |
Esempio cURL
curl -X POST "https://dev.quoparts.it/ws_quoparts.php?importCli=&token=TOKEN" \
-H "Content-Type: application/json" \
-d '{
"data": [
{
"DES_NOM": "Rossi S.r.l.",
"DES_IND": "Via Roma 123",
"DES_CTA": "Milano",
"COD_PRN": "MI",
"COD_CAP": "20121",
"COD_EML": "info@rossisrl.it",
"COD_PTA_IVA": "12345678901",
"FLG_ATV": "1",
"COD_CLI_ERP": "CLI001"
}
]
}'
Esempio Risposta (Successo)
{
"errorCode": "0",
"error": "",
"data": [
{
"errorCode": "0",
"error": "",
"COD_CLI_ERP": "CLI001",
"COD_CLI": "000015",
"COD_USR": "M00015",
"COD_PWD": "O8HMER"
}
]
}
Note Tecniche
- Il campo
FLG_ATV, se omesso, viene automaticamente impostato a 1 (attivo).
3. Import Preventivi
Consente di trasmettere richieste di preventivo al portale QuoParts.
POST
https://dev.quoparts.it/ws_quoparts.php?importPvt=&token={TOKEN}
Parametri URL
| Parametro | Tipo | Obbligatorio | Descrizione |
|---|---|---|---|
importPvt | string | SÌ | Nome metodo. |
token | string | SÌ | Token di autenticazione ottenuto tramite API Login. |
Struttura Payload (JSON)
Il body deve contenere un oggetto data diviso in testata e articoli.
Campi Testata
| Campo | Tipo | Obbligatorio | Descrizione |
|---|---|---|---|
COD_CLI | string | SÌ* | Codice Cliente QuoParts. *Alternativo a COD_CLI_ERP |
COD_CLI_ERP | string | SÌ* | Codice Cliente Procar. *Alternativo a COD_CLI |
COD_TGA | string | SÌ | Targa veicolo. |
DES_VCL | string | SÌ | Descrizione Veicolo. |
COD_TLO | string | No | Telaio. |
DES_NOM_SPD | string | No | Cliente di spedizione. |
DES_IND_SPD | string | No | Indirizzo di spedizione. |
DES_CTA_SPD | string | No | Città di spedizione. |
COD_PRN_SPD | string | No | Provincia di spedizione. (es: MI, RM) |
COD_CAP_SPD | string | No | CAP di spedizione. |
Campi Articoli (Array)
| Campo | Tipo | Obbligatorio | Descrizione |
|---|---|---|---|
DES_RGR | string | SÌ | Descrizione generica ricambio. |
COD_ART_PVT | string | SÌ | Codice OE articolo. |
DES_ART_PVT | string | No | Descrizione specifica. |
IMP_LST_PVT | number | No | Importo Listino. |
QTA_DET_PVT | number | No | Quantità. |
Esempio cURL
curl -X POST "https://dev.quoparts.it/ws_quoparts.php?importPvt=&token=YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"data": {
"testata": {
"COD_CLI": "000015",
"COD_CLI_ERP": "CLI001",
"COD_TGA": "TE001ST",
"DES_VCL": "FORD B-Max 1.6 Ti-VCT Benzina"
},
"articoli": [
{
"DES_RGR": "Filtro olio",
"COD_ART_PVT": "1883037",
"DES_ART_PVT": "Filtro olio motore",
"IMP_LST_PVT": 14.57,
"QTA_DET_PVT": 1
}
]
}
}'
Esempio Risposta (Successo)
{
"errorCode": "0",
"error": "",
"data": [
{
"COD_DOC": "000001"
}
]
}
Esempio Risposta (Errore)
{
"errorCode": "107",
"error": "Errore durante la creazione del preventivo",
"data": []
}
Note Tecniche
- È necessario valorizzare almeno uno tra
COD_CLIeCOD_CLI_ERPper identificare il cliente. - Se
COD_CLIeCOD_CLI_ERPsono entrambi valorizzati, il sistema utilizza prioritariamenteCOD_CLI. - L'array
articolideve contenere almeno un elemento. - I campi numerici (IMP_LST_PVT, QTA_DET_PVT) devono essere in formato numerico.