Vous pouvez obtenir les informations nécessaires à une souscription depuis cette route.
Requête d'obtention des informations :
const fetch = require('node-fetch');
const url = 'https://api.staging.neat.eu/sales-channels/v1/:salesChannelId/contracts/:contractId/subscribe-fields';
const options = {
method: 'GET',
headers: {accept: 'application/json', 'content-type': 'application/json'},
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error('error:' + err));
Réponse :
Vous obtiendriez toutes les informations de champs de services afin de réaliser une nouvelle souscription.
{
"contract": {
"id": "98e168e6-726c-4836-a2c7-52c8pda0e2f6",
"status": "Active"
},
"product": {
"id": "4c9e2f3d-4447-4086-bea1-b4323321ddf6",
"name": "Audioprotect Inclusion",
"description": " Audioprotect Inclusion",
"coverArea": null,
"compensationArea": null,
"exclusionArea": null,
"uncoveredArea": null
},
"serviceFields": [
{
"id": "3c064a25-b807-495d-8bcf-8af801cd2760",
"name": "marque",
"type": "string",
"description": "Marque de l'appareil",
"options": [],
"required": true,
"title": "Marque de l'appareil",
"rank": 0
},
{
"id": "40a997aa-f234-4343-9fae-395a165bfbc6",
"name": "modele",
"type": "string",
"description": "Modèle de l'appareil",
"options": [],
"required": true,
"title": "Modèle de l'appareil",
"rank": 1
},
{
"id": "6b13cfbe-7632-4169-a343-91abb54c0ff6",
"name": "serial",
"type": "string",
"description": "Numéro de série",
"options": [],
"required": true,
"title": "Numéro de série",
"rank": 2
},
{
"id": "b13dc680-7c63-438f-a4cc-e555bbade7f8",
"name": "Prix HT",
"type": "number",
"description": "Prix de revente (TTC)",
"options": [],
"required": true,
"title": "Prix de revente (TTC)",
"rank": 3
},
{
"id": "e7d32c73-1168-472d-a472-ac3fae50cbd4",
"name": "Oreille",
"type": "dropdown",
"description": "Oreille",
"options": [
"gauche",
"droite"
],
"required": true,
"title": "Oreille",
"rank": 4
},
{
"id": "b67c0635-c61c-4733-90cb-4f51b7b597b8",
"name": "date facturation",
"type": "datetime",
"description": "Date de facturation",
"options": [],
"required": true,
"title": "Date de facturation",
"rank": 5
},
{
"id": "42f9bef9-ee66-4330-841d-b3df153586e5",
"name": "essai",
"type": "checkbox",
"description": "Période d'essai",
"options": [],
"required": true,
"title": "Période d'essai",
"rank": 6
},
{
"id": "97ce2238-8aa7-45e2-9864-a56216a87c91",
"name": "prix_achat",
"type": "string",
"description": "Ne pas remplir",
"options": [],
"required": false,
"title": "Prix d'achat (optionnel)",
"rank": 7
}
],
"salesChannel": {
"id": "2f6d8535-126a-4253-8e2b-4743d197c9bd"
},
"files": []
}