Sucrine Backend
v1.173.5https://app.sucrine.club/apiServeur principal de productionhttps://preview.app.sucrine.club/apiServeur de test (données répliquées depuis la production à J-1)API privée Sucrine Backend
Authentication
APIKeyapiKeyExemple : Authorization: ApiKey ABCDEFGHI
API Key: API Key in header
Contacts
Lister les contacts
Parameters
pageintegerqueryPage à récupérer
limitintegerqueryElements par page
Response
Successful response
Authorization
APIKeyapiKey in headerExemple : Authorization: ApiKey ABCDEFGHI
curl -X GET 'https://app.sucrine.club/api/professional/contacts'const response = await fetch('https://app.sucrine.club/api/professional/contacts', {
method: 'GET',
});
const data = await response.json();import requests
response = requests.get('https://app.sucrine.club/api/professional/contacts')
data = response.json(){
"paging": {
"total": 0,
"currentPage": 0,
"pageCount": 0,
"itemsPerPage": 0
},
"items": [
{
"_id": "string",
"name": "string",
"email": "string",
"phone": "string",
"phoneStatus": "string",
"status": "string",
"company": "string",
"groups": [
"string"
]
}
]
}Orders
Lister les commandes
Response
Successful response
Authorization
APIKeyapiKey in headerExemple : Authorization: ApiKey ABCDEFGHI
curl -X GET 'https://app.sucrine.club/api/professional/orders'const response = await fetch('https://app.sucrine.club/api/professional/orders', {
method: 'GET',
});
const data = await response.json();import requests
response = requests.get('https://app.sucrine.club/api/professional/orders')
data = response.json()Voir une commande
Parameters
orderIdstringrequiredpathIdentifiant de la commande
Response
Successful response
Authorization
APIKeyapiKey in headerExemple : Authorization: ApiKey ABCDEFGHI
curl -X GET 'https://app.sucrine.club/api/professional/orders/{orderId}'const response = await fetch('https://app.sucrine.club/api/professional/orders/{orderId}', {
method: 'GET',
});
const data = await response.json();import requests
response = requests.get('https://app.sucrine.club/api/professional/orders/{orderId}')
data = response.json()Créer une commande
Body
orderTypestringorderreturncustomerOrderReferencestring | nullRéférence de commande externe
orderSourcestring | nullSource de commande
catalogueItemsobjectObsolète
advancedCatalogueItemsobjectListe des produits commandés
skipPreciseSupplyCheckbooleanIgnorer l'état des stocks
deliveryPointstringrequiredMode de distribution
deliveryobjectLivraison
discountsArray<object>Remises
deliveryAddressobject | objectAdresse de livraison
invoicingAddressobject | objectAdresse de facturation
messagestringMessage associé à la commande
saleIdstring | nullIdentifiant de vente ponctuelle
orderedBystringIdentifiant du contact de commande
newContactobjectCréation d'un nouveau contact lors de la commande, si pas de orderedBy défini
customTimeSlotbooleanUtiliser une date de distribution personnalisée
timeSlotstring<date-time>Date de début de distribution
timeSlotEndstring<date-time>Date de fin de distribution
Response
Successful response
Authorization
APIKeyapiKey in headerExemple : Authorization: ApiKey ABCDEFGHI
curl -X POST 'https://app.sucrine.club/api/professional/customerOrders/order' \
-H 'Content-Type: application/json' \
-d '{
"orderType": "order",
"customerOrderReference": "string",
"orderSource": "string",
"catalogueItems": {},
"advancedCatalogueItems": {},
"skipPreciseSupplyCheck": true,
"deliveryPoint": "string",
"delivery": {
"description": "string",
"amount": 0,
"dfAmount": 0,
"vatRate": 0,
"vatAmount": 0
},
"discounts": [
{
"rawValue": 0,
"type": "amount",
"vatRate": 0,
"comment": "string",
"dfAmount": 0,
"vatAmount": 0,
"amount": 0
}
],
"deliveryAddress": {
"address": "string",
"addressExtra": "string",
"city": "string",
"company": "string",
"name": "string",
"country": "FR",
"zipcode": "string"
},
"invoicingAddress": {
"address": "string",
"addressExtra": "string",
"city": "string",
"company": "string",
"name": "string",
"country": "FR",
"zipcode": "string"
},
"message": "string",
"saleId": "string",
"orderedBy": "string",
"newContact": {
"name": "string",
"email": "user@example.com",
"phone": "string"
},
"customTimeSlot": true,
"timeSlot": "2024-01-15T09:30:00Z",
"timeSlotEnd": "2024-01-15T09:30:00Z"
}'const response = await fetch('https://app.sucrine.club/api/professional/customerOrders/order', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
"orderType": "order",
"customerOrderReference": "string",
"orderSource": "string",
"catalogueItems": {},
"advancedCatalogueItems": {},
"skipPreciseSupplyCheck": true,
"deliveryPoint": "string",
"delivery": {
"description": "string",
"amount": 0,
"dfAmount": 0,
"vatRate": 0,
"vatAmount": 0
},
"discounts": [
{
"rawValue": 0,
"type": "amount",
"vatRate": 0,
"comment": "string",
"dfAmount": 0,
"vatAmount": 0,
"amount": 0
}
],
"deliveryAddress": {
"address": "string",
"addressExtra": "string",
"city": "string",
"company": "string",
"name": "string",
"country": "FR",
"zipcode": "string"
},
"invoicingAddress": {
"address": "string",
"addressExtra": "string",
"city": "string",
"company": "string",
"name": "string",
"country": "FR",
"zipcode": "string"
},
"message": "string",
"saleId": "string",
"orderedBy": "string",
"newContact": {
"name": "string",
"email": "user@example.com",
"phone": "string"
},
"customTimeSlot": true,
"timeSlot": "2024-01-15T09:30:00Z",
"timeSlotEnd": "2024-01-15T09:30:00Z"
}),
});
const data = await response.json();import requests
payload = {
"orderType": "order",
"customerOrderReference": "string",
"orderSource": "string",
"catalogueItems": {},
"advancedCatalogueItems": {},
"skipPreciseSupplyCheck": True,
"deliveryPoint": "string",
"delivery": {
"description": "string",
"amount": 0,
"dfAmount": 0,
"vatRate": 0,
"vatAmount": 0
},
"discounts": [
{
"rawValue": 0,
"type": "amount",
"vatRate": 0,
"comment": "string",
"dfAmount": 0,
"vatAmount": 0,
"amount": 0
}
],
"deliveryAddress": {
"address": "string",
"addressExtra": "string",
"city": "string",
"company": "string",
"name": "string",
"country": "FR",
"zipcode": "string"
},
"invoicingAddress": {
"address": "string",
"addressExtra": "string",
"city": "string",
"company": "string",
"name": "string",
"country": "FR",
"zipcode": "string"
},
"message": "string",
"saleId": "string",
"orderedBy": "string",
"newContact": {
"name": "string",
"email": "user@example.com",
"phone": "string"
},
"customTimeSlot": True,
"timeSlot": "2024-01-15T09:30:00Z",
"timeSlotEnd": "2024-01-15T09:30:00Z"
}
response = requests.post('https://app.sucrine.club/api/professional/customerOrders/order', json=payload)
data = response.json(){
"orderType": "order",
"customerOrderReference": "string",
"orderSource": "string",
"catalogueItems": {},
"advancedCatalogueItems": {},
"skipPreciseSupplyCheck": true,
"deliveryPoint": "string",
"delivery": {
"description": "string",
"amount": 0,
"dfAmount": 0,
"vatRate": 0,
"vatAmount": 0
},
"discounts": [
{
"rawValue": 0,
"type": "amount",
"vatRate": 0,
"comment": "string",
"dfAmount": 0,
"vatAmount": 0,
"amount": 0
}
],
"deliveryAddress": {
"address": "string",
"addressExtra": "string",
"city": "string",
"company": "string",
"name": "string",
"country": "FR",
"zipcode": "string"
},
"invoicingAddress": {
"address": "string",
"addressExtra": "string",
"city": "string",
"company": "string",
"name": "string",
"country": "FR",
"zipcode": "string"
},
"message": "string",
"saleId": "string",
"orderedBy": "string",
"newContact": {
"name": "string",
"email": "user@example.com",
"phone": "string"
},
"customTimeSlot": true,
"timeSlot": "2024-01-15T09:30:00Z",
"timeSlotEnd": "2024-01-15T09:30:00Z"
}{
"internalId": "string",
"orderId": "string",
"status": true,
"sentMessages": [
{
"type": "email",
"dest": "string"
}
]
}Valider une commande
Parameters
orderIdstringrequiredpathIdentifiant de la commande
Response
Successful response
Authorization
APIKeyapiKey in headerExemple : Authorization: ApiKey ABCDEFGHI
curl -X POST 'https://app.sucrine.club/api/professional/orders/{orderId}/validate'const response = await fetch('https://app.sucrine.club/api/professional/orders/{orderId}/validate', {
method: 'POST',
});
const data = await response.json();import requests
response = requests.post('https://app.sucrine.club/api/professional/orders/{orderId}/validate')
data = response.json(){
"status": true
}Marquer une commande comme préparée
Parameters
orderIdstringrequiredpathIdentifiant de la commande
Response
Successful response
Authorization
APIKeyapiKey in headerExemple : Authorization: ApiKey ABCDEFGHI
curl -X POST 'https://app.sucrine.club/api/professional/orders/{orderId}/endPreparation'const response = await fetch('https://app.sucrine.club/api/professional/orders/{orderId}/endPreparation', {
method: 'POST',
});
const data = await response.json();import requests
response = requests.post('https://app.sucrine.club/api/professional/orders/{orderId}/endPreparation')
data = response.json(){
"status": true
}Annuler une commande
Parameters
orderIdstringrequiredpathIdentifiant de la commande
Response
Successful response
Authorization
APIKeyapiKey in headerExemple : Authorization: ApiKey ABCDEFGHI
curl -X POST 'https://app.sucrine.club/api/professional/orders/{orderId}/cancel'const response = await fetch('https://app.sucrine.club/api/professional/orders/{orderId}/cancel', {
method: 'POST',
});
const data = await response.json();import requests
response = requests.post('https://app.sucrine.club/api/professional/orders/{orderId}/cancel')
data = response.json(){
"status": true
}DeliveryPoints
Lister les mode de distribution
Parameters
catalogueIdstringrequiredpathIdentifiant du catalogue
Response
Successful response
Authorization
APIKeyapiKey in headerExemple : Authorization: ApiKey ABCDEFGHI
curl -X GET 'https://app.sucrine.club/api/professional/catalogues/{catalogueId}/deliveryPoints'const response = await fetch('https://app.sucrine.club/api/professional/catalogues/{catalogueId}/deliveryPoints', {
method: 'GET',
});
const data = await response.json();import requests
response = requests.get('https://app.sucrine.club/api/professional/catalogues/{catalogueId}/deliveryPoints')
data = response.json()[
{
"_id": "string",
"collectInstructions": "string",
"state": "available",
"timeSlots": [
{
"dayOfWeek": "string",
"timeSlotMode": "string",
"fromTime": 0,
"toTime": 0,
"dayBeforeOrder": 0,
"maxTime": 0
}
],
"type": "string",
"groups": [
"string"
],
"privateName": "string",
"saleSite": {},
"pickupAddress": {}
}
]