Sucrine Backend
v1.177.8https://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()Modifier une commande
Body
addedItemsArray<object>updatedItemsobjecttimeSlotstring<date-time>timeSlotEndstring<date-time>Parameters
orderIdstringrequiredpathIdentifiant de la commande
Response
Successful response
Authorization
APIKeyapiKey in headerExemple : Authorization: ApiKey ABCDEFGHI
curl -X PATCH 'https://app.sucrine.club/api/professional/orders/{orderId}' \
-H 'Content-Type: application/json' \
-d '{
"addedItems": [
{
"catalogueItemPrice": "string",
"ordered": 0,
"orderOptions": {},
"adjustedUnitsPerLot": [
0
]
}
],
"updatedItems": {},
"timeSlot": "2024-01-15T09:30:00Z",
"timeSlotEnd": "2024-01-15T09:30:00Z"
}'const response = await fetch('https://app.sucrine.club/api/professional/orders/{orderId}', {
method: 'PATCH',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
"addedItems": [
{
"catalogueItemPrice": "string",
"ordered": 0,
"orderOptions": {},
"adjustedUnitsPerLot": [
0
]
}
],
"updatedItems": {},
"timeSlot": "2024-01-15T09:30:00Z",
"timeSlotEnd": "2024-01-15T09:30:00Z"
}),
});
const data = await response.json();import requests
payload = {
"addedItems": [
{
"catalogueItemPrice": "string",
"ordered": 0,
"orderOptions": {},
"adjustedUnitsPerLot": [
0
]
}
],
"updatedItems": {},
"timeSlot": "2024-01-15T09:30:00Z",
"timeSlotEnd": "2024-01-15T09:30:00Z"
}
response = requests.patch('https://app.sucrine.club/api/professional/orders/{orderId}', json=payload)
data = response.json(){
"addedItems": [
{
"catalogueItemPrice": "string",
"ordered": 0,
"orderOptions": {},
"adjustedUnitsPerLot": [
0
]
}
],
"updatedItems": {},
"timeSlot": "2024-01-15T09:30:00Z",
"timeSlotEnd": "2024-01-15T09:30:00Z"
}Créer une commande
Body
orderTypestringorderreturncustomerOrderReferencestring | nullRéférence de commande externe
orderSourcestring | nullSource de commande
advancedCatalogueItemsArray<object>Liste des produits commandés
skipPreciseSupplyCheckbooleanIgnorer l'état des stocks
deliveryPointstringrequiredMode de distribution
deliveryobjectLivraison
discountsArray<object>Remises
deliveryAddressobject | objectAdresse de livraison
invoicingAddressobject | objectAdresse de facturation
defaultOrderStatestring | nullStatut de commande par défaut : new, prevalidated, validated, preparing, prepared, terminated
nonBillablebooleanIndique si la commande est facturable ou non
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",
"advancedCatalogueItems": [
{
"quantity": 0,
"ePrice": {
"amount": 0,
"amountType": "unitPrice"
},
"message": "string",
"adjustedUnitsPerLot": [
0
],
"preparationOptions": [
{
"expirationDate": "2024-01-15T09:30:00Z",
"batchNumber": "string",
"stock": "string",
"quantity": 0
}
],
"options": {
"sameOptionsApplied": true,
"common": {},
"items": [
{}
]
}
}
],
"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"
},
"defaultOrderState": "string",
"nonBillable": true,
"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",
"advancedCatalogueItems": [
{
"quantity": 0,
"ePrice": {
"amount": 0,
"amountType": "unitPrice"
},
"message": "string",
"adjustedUnitsPerLot": [
0
],
"preparationOptions": [
{
"expirationDate": "2024-01-15T09:30:00Z",
"batchNumber": "string",
"stock": "string",
"quantity": 0
}
],
"options": {
"sameOptionsApplied": true,
"common": {},
"items": [
{}
]
}
}
],
"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"
},
"defaultOrderState": "string",
"nonBillable": true,
"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",
"advancedCatalogueItems": [
{
"quantity": 0,
"ePrice": {
"amount": 0,
"amountType": "unitPrice"
},
"message": "string",
"adjustedUnitsPerLot": [
0
],
"preparationOptions": [
{
"expirationDate": "2024-01-15T09:30:00Z",
"batchNumber": "string",
"stock": "string",
"quantity": 0
}
],
"options": {
"sameOptionsApplied": True,
"common": {},
"items": [
{}
]
}
}
],
"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"
},
"defaultOrderState": "string",
"nonBillable": True,
"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",
"advancedCatalogueItems": [
{
"quantity": 0,
"ePrice": {
"amount": 0,
"amountType": "unitPrice"
},
"message": "string",
"adjustedUnitsPerLot": [
0
],
"preparationOptions": [
{
"expirationDate": "2024-01-15T09:30:00Z",
"batchNumber": "string",
"stock": "string",
"quantity": 0
}
],
"options": {
"sameOptionsApplied": true,
"common": {},
"items": [
{}
]
}
}
],
"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"
},
"defaultOrderState": "string",
"nonBillable": true,
"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
}Enregistrer un règlement sur une commande
Body
amountnumber<float>requiredpaidbooleanpaymentMeanstringpayloadobjectParameters
orderIdstringrequiredpathIdentifiant de la commande
Response
Successful response
Authorization
APIKeyapiKey in headerExemple : Authorization: ApiKey ABCDEFGHI
curl -X POST 'https://app.sucrine.club/api/professional/payments/orders/{orderId}/payment/registerPayment' \
-H 'Content-Type: application/json' \
-d '{
"amount": 0,
"paid": true,
"paymentMean": "string",
"payload": {}
}'const response = await fetch('https://app.sucrine.club/api/professional/payments/orders/{orderId}/payment/registerPayment', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
"amount": 0,
"paid": true,
"paymentMean": "string",
"payload": {}
}),
});
const data = await response.json();import requests
payload = {
"amount": 0,
"paid": True,
"paymentMean": "string",
"payload": {}
}
response = requests.post('https://app.sucrine.club/api/professional/payments/orders/{orderId}/payment/registerPayment', json=payload)
data = response.json(){
"amount": 0,
"paid": true,
"paymentMean": "string",
"payload": {}
}{
"status": true
}Lister les règlements sur 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/payments/orders/{orderId}'const response = await fetch('https://app.sucrine.club/api/professional/payments/orders/{orderId}', {
method: 'GET',
});
const data = await response.json();import requests
response = requests.get('https://app.sucrine.club/api/professional/payments/orders/{orderId}')
data = response.json(){
"payments": [
{
"_id": "string",
"amount": 0,
"currency": "string",
"paidAt": "2024-01-15T09:30:00Z",
"paidByUser": "string",
"payload": {},
"paymentMean": "string",
"paymentType": "string",
"state": "string"
}
],
"remainingAmount": {
"authorized": 0,
"opened": 0,
"posted": 0,
"remainingToCapture": 0,
"remainingToOpen": 0,
"remainingToPay": 0,
"totalAmount": 0
}
}OrderPreparations
Lister les commandes et leurs contenus, elligibles à la préparation.
Parameters
oneTimeSaleIdstringqueryIdentifiant de la vente pontuelle, le cas échéant
Response
Successful response
Authorization
APIKeyapiKey in headerExemple : Authorization: ApiKey ABCDEFGHI
curl -X GET 'https://app.sucrine.club/api/professional/preparations/orderProductList'const response = await fetch('https://app.sucrine.club/api/professional/preparations/orderProductList', {
method: 'GET',
});
const data = await response.json();import requests
response = requests.get('https://app.sucrine.club/api/professional/preparations/orderProductList')
data = response.json()Lister les préparations
Response
Successful response
Authorization
APIKeyapiKey in headerExemple : Authorization: ApiKey ABCDEFGHI
curl -X GET 'https://app.sucrine.club/api/professional/preparations'const response = await fetch('https://app.sucrine.club/api/professional/preparations', {
method: 'GET',
});
const data = await response.json();import requests
response = requests.get('https://app.sucrine.club/api/professional/preparations')
data = response.json()Créer une préparation
Body
oneTimeSalestring | nullIdentifiant de la vente ponctuelle
ordersArray<string>requireddeliveryCollectIdsArray<string>Response
Successful response
Authorization
APIKeyapiKey in headerExemple : Authorization: ApiKey ABCDEFGHI
curl -X POST 'https://app.sucrine.club/api/professional/preparations' \
-H 'Content-Type: application/json' \
-d '{
"oneTimeSale": "string",
"orders": [
"string"
],
"deliveryCollectIds": [
"string"
]
}'const response = await fetch('https://app.sucrine.club/api/professional/preparations', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
"oneTimeSale": "string",
"orders": [
"string"
],
"deliveryCollectIds": [
"string"
]
}),
});
const data = await response.json();import requests
payload = {
"oneTimeSale": "string",
"orders": [
"string"
],
"deliveryCollectIds": [
"string"
]
}
response = requests.post('https://app.sucrine.club/api/professional/preparations', json=payload)
data = response.json(){
"oneTimeSale": "string",
"orders": [
"string"
],
"deliveryCollectIds": [
"string"
]
}Afficher une préparation
Parameters
preparationIdstringrequiredpathIdentifiant de la préparation
Response
Successful response
Authorization
APIKeyapiKey in headerExemple : Authorization: ApiKey ABCDEFGHI
curl -X GET 'https://app.sucrine.club/api/professional/preparations/{preparationId}'const response = await fetch('https://app.sucrine.club/api/professional/preparations/{preparationId}', {
method: 'GET',
});
const data = await response.json();import requests
response = requests.get('https://app.sucrine.club/api/professional/preparations/{preparationId}')
data = response.json()Mettre à jour les commandes d'une préparation
Body
ordersobjectParameters
preparationIdstringrequiredpathIdentifiant de la préparation
Response
Successful response
Authorization
APIKeyapiKey in headerExemple : Authorization: ApiKey ABCDEFGHI
curl -X POST 'https://app.sucrine.club/api/professional/preparations/{preparationId}/updateOrders' \
-H 'Content-Type: application/json' \
-d '{
"orders": {}
}'const response = await fetch('https://app.sucrine.club/api/professional/preparations/{preparationId}/updateOrders', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
"orders": {}
}),
});
const data = await response.json();import requests
payload = {
"orders": {}
}
response = requests.post('https://app.sucrine.club/api/professional/preparations/{preparationId}/updateOrders', json=payload)
data = response.json(){
"orders": {}
}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": {}
}
]Payments
Enregistrer un règlement sur une commande
Body
amountnumber<float>requiredpaidbooleanpaymentMeanstringpayloadobjectParameters
orderIdstringrequiredpathIdentifiant de la commande
Response
Successful response
Authorization
APIKeyapiKey in headerExemple : Authorization: ApiKey ABCDEFGHI
curl -X POST 'https://app.sucrine.club/api/professional/payments/orders/{orderId}/payment/registerPayment' \
-H 'Content-Type: application/json' \
-d '{
"amount": 0,
"paid": true,
"paymentMean": "string",
"payload": {}
}'const response = await fetch('https://app.sucrine.club/api/professional/payments/orders/{orderId}/payment/registerPayment', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
"amount": 0,
"paid": true,
"paymentMean": "string",
"payload": {}
}),
});
const data = await response.json();import requests
payload = {
"amount": 0,
"paid": True,
"paymentMean": "string",
"payload": {}
}
response = requests.post('https://app.sucrine.club/api/professional/payments/orders/{orderId}/payment/registerPayment', json=payload)
data = response.json(){
"amount": 0,
"paid": true,
"paymentMean": "string",
"payload": {}
}{
"status": true
}Lister les règlements sur 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/payments/orders/{orderId}'const response = await fetch('https://app.sucrine.club/api/professional/payments/orders/{orderId}', {
method: 'GET',
});
const data = await response.json();import requests
response = requests.get('https://app.sucrine.club/api/professional/payments/orders/{orderId}')
data = response.json(){
"payments": [
{
"_id": "string",
"amount": 0,
"currency": "string",
"paidAt": "2024-01-15T09:30:00Z",
"paidByUser": "string",
"payload": {},
"paymentMean": "string",
"paymentType": "string",
"state": "string"
}
],
"remainingAmount": {
"authorized": 0,
"opened": 0,
"posted": 0,
"remainingToCapture": 0,
"remainingToOpen": 0,
"remainingToPay": 0,
"totalAmount": 0
}
}