Documente Academic
Documente Profesional
Documente Cultură
API VENDORS
Versions
1.0.0 01.04.2021
Modulul API al Doraly Marketplace este destinat tuturor comerciantilor ce doresc integrarea cu
platforma Doraly Marketplace.
Conditii de integrare:
1.1. Request-uri
1.2. Paginatia
1.3. Raspunsul
Cand se face un raspuns catre server, acesta intoarce un raspuns. Raspunsul este in toate cazurile un
JSON.
Headerul raspunsului va contine application/json; charset=utf-8.
2. Autentificare
Mediu de test
https://ylarod.ro/api/vendors
email: extern@extern.ro
password: $2a$08$OhB8ZPJumLWOBqyVMYetuOeH3aLga76vLb21FElr7k0MpzUbgknQi
Mediul de live
https://doraly.ro/api/vendors
Metoda
POST
URL
/users/login
Body:
{
"email": "{{email}}",
"password": "{{password}}"
}
Exemplu raspuns
Raspunsul acestui request este un token de autentificare
Ex:
{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoiby5tdXJhcml1QHRvb2xzd29
ybGQucm8iLCJlbWFpbCI6Im8ubXVyYXJpdUB0b29sc3dvcmxkLnJvIiwiaWF0IjoxNjE3MDExMTUyLCJleHAiO
jE2MTcwMzI3NTJ9.NSPw3DUGrD705Iu7jEUyO5r60-kDBULc21ZiIunaT_g"
}
Acest token trebuie folosit in header pentru toate request-urile ulterioare ca si cheie de autorizare.
Authorization cu cheia:
Bearer
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoiby5tdXJhcml1QHRvb2xzd29ybGQucm8iLCJlbWFpbCI
6Im8ubXVyYXJpdUB0b29sc3dvcmxkLnJvIiwiaWF0IjoxNjE3MDExMTUyLCJleHAiOjE2MTcwMzI3NTJ9.NSP
w3DUGrD705Iu7jEUyO5r60-kDBULc21ZiIunaT_g
3. Gestionare produse si oferte
Metoda
GET
URL
/api/vendors/products
Metoda
GET
URL
/api/vendors/products/id
Pentru a putea adauga produse noi in platforma Doraly trebuie sa aveti categorii atribuite.
Pentru a putea vedea categoriile atribuite trebuie facut request-ul de mai jos:
Metoda
GET
URL
/categories
Raspuns
[
{
"id": "da5733781dcd656f90000189",
"displayName": "Electronice si Electrocasnice \\ Electronice \\ Automatizari c
asnice si sisteme de securitate \\ Microfoane sisteme",
"nameCategory": "Microfoane sisteme",
"allowProducts": true,
"groups": [
{
"name": "CARACTERISTICI GENERALE",
"specifications": [
{
"name": "Tip produs",
"filter": false,
"priority": 1,
},
{
"name": "Utilizare",
"filter": false,
"priority": 2,
},
{
"name": "Material",
"filter": false,
"priority": 3,
},
{
"name": "Culoare",
"filter": false,
"priority": 4,
},
{
"name": "Raza de actiune",
"filter": false,
"priority": 5,
}
],
"priority": 1
}
]
}
]
Acesta returneaza:
Camp Camp Camp Tip Exemplu Descriere
Exemplu:
{
"id": "da5733781dcd656f90003363",
"displayName": "Auto Velo \\ Auto \\ Anvelope",
"nameCategory": "Anvelope",
"groups": [
{
"name": "DIMENSIUNI",
"specifications": [
{
"name": "Latime",
"filter": true,
},
{
"name": "Inaltime",
"filter": true,
},
{
"name": "Diametru",
"filter": true,
}
]
},
{
"name": "CARACTERISTICI TEHNICE",
"specifications": [
{
"name": "Brand",
"filter": true,
},
{
"name": "Sezon",
"filter": true,
},
{
"name": "Indice sarcina",
"filter": true,
},
{
"name": "Indice viteza",
"filter": true,
},
{
"name": "Clasa eficienta consum",
"filter": true,
},
{
"name": "Clasa aderenta pe suprafete umede",
"filter": true,
},
{
"name": "Nivel de zgomot (dB)",
"filter": true,
}
]
}
]
}c
Metoda
GET
URL
/products/stockStatus
Raspuns
[
{
"_id": "da5733781dcd656f90000020",
"isDeleted": false,
"availablestock": "In stoc magazin"
},
{
"_id": "da5733781dcd656f90000024",
"isDeleted": false,
"availablestock": "Stoc epuizat"
}
]
3.5. POST products
Metoda
POST
URL
/products
Campuri
Camp Camp Camp Tip Exemplu Obligatoriu Descriere
productSpecifications Array
offers array Da
Din call-ul
http://ylarod.ro/api/vendors
/products/stockStatus
Model request:
[
"productName":"string",
"brand":"string",
"productCode":"string",
"weight":0,
"categoryId":"string",
"greenTax":0,
"shortDescription":"string",
"longDescription":"string",
"images":[
"string"
],
"productSpecifications":[
"name":"string",
"specifications":[
"name":"string",
"value":"string"
],
"offers":[
"stock":0,
"stockStatus":"string",
"deliveryTime":0,
"maximumDeliveryTime":0,
"guarantee":0,
"offerType":0,
"price1":0,
"quantity1":0,
"promoPrice1":0,
"price2":0,
"quantity2":0,
"promoPrice2":0,
"price3":0,
"quantity3":0,
"promoPrice3":0 }
Exemplu
3.6. PUT products
Este metoda de editare produse pe baza id-ului de produs din aplicatia Doraly.
Se pot edita unul, mai multe sau toate campurile unui produs.
ATENTIE!!!
Odata cu editarea unui produs, statusul acestuia se midifica in Cerere Validare si nu mai este disponibil
pentru client pana la validarea acestuia de catre category managerul assignat.
Metoda
PUT
URL
/products
Campuri
Camp Camp Camp Tip Exemplu Obligatoriu Descriere
productSpecifications Array
Din call-ul
http://ylarod.ro/api/vendors
/products/stockStatus
Motoda prin care se pot sterge produsele adaugate in contul de comerciant de pe Doraly.ro.
Metoda
DELETE
URL
/products
Campuri
Camp Tip Exemplu Obligatoriu Descriere
Exemplu request
3.8. PUT Offers
Metoda de editare a ofertelor produselor. Se pot edita una sau mai multe oferte intr-un request.
Metoda
PUT
URL
/offers
Campuri
Camp Tip Exemplu Obligatoriu Descriere
Din call-ul
http://ylarod.ro/api/vendors/pr
oducts/stockStatus
Exemplu Request
3.9. PUT Offers Stock
Folosind aceata metoda pentru update-ul stocului, produsle vor ramane publicate, nu vor intra in status-
ul cerere validare.
Metoda
PUT
URL
/offers/stock
Campuri
Camp Tip Exemplu Obligatoriu Descriere
Exemplu request
Folosind aceata metoda pentru update-ul stocului, produsle vor ramane publicate, nu vor intra in status-
ul cerere validare.
Metoda
PUT
URL
/offers/stockByproductCode
Campuri
Camp Tip Exemplu Obligatoriu Descriere
Model Request
[
{
"productCode": "string",
"stock": 0
}
]
Exemplu request
4. Gestionare comenzi
Orice comeerciant cu access la API isi poate gestiona comenzile de pe Doraly Marketplace prin API.
Metoda
GET
URL
/orders
Filtre
- Numar comanda
ex: {"no": "40652"}
- Status comanda
- Metoda de plata
Model
[
{
"_id": "string",
"orderId": "string",
"email": "string",
"client": "string",
"oldID": "string",
"no": "string",
"placingDate": "2021-04-10T09:58:41.029Z",
"status": "string",
"opensParcel": true,
"paymentMethod": "string",
"reasonCancelOrder": "string",
"totalClient": 0,
"totalVendor": 0,
"difference": 0,
"totalTransport": 0,
"total": 0,
"createdAt": "2021-04-10T09:58:41.029Z",
"updatedAt": "2021-04-10T09:58:41.029Z",
"orderClient": {
"fullName": "string",
"email": "string",
"phoneNumber": "string",
"deliveryAddress": {
"address": "string",
"city": "string",
"county": "string",
"phoneNumber": "string",
"contactPerson": "string",
"deliveryMethod": "string",
"fiscalCode": "string",
"regCom": "string",
"bank": "string",
"iBan": "string"
},
"billingAddress": {
"address": "string",
"city": "string",
"county": "string",
"phoneNumber": "string",
"contactPerson": "string",
"deliveryMethod": "string",
"fiscalCode": "string",
"regCom": "string",
"bank": "string",
"iBan": "string"
}
},
"products": [
{
"name": "string",
"id": "string",
"productId": "string",
"productName": "string",
"productSlug": "string",
"productImage": "string",
"productCode": "string",
"doralyCode": "string",
"productCategory": "string",
"productWeight": 0,
"measuringUnit": "string",
"measuringUnitVendor": "string",
"clientQuantity": 0,
"vendorQuantity": 0,
"categoryTva": 0,
"clientTotalNoTVA": 0,
"vendorTotalNoTVA": 0,
"clientTVA": 0,
"vendorTVA": 0,
"totalClient": 0,
"totalVendor": 0,
"comission": 0
}
],
"voucher": {
"name": "string",
"typeVoucher": 0,
"valueCustomer": 0,
"valueVendor": 0,
"valueTransport": 0,
"valueTransportTva": 0,
"valueTransportWithOutTva": 0,
"valueCustomerTva": 0,
"valueVendorTva": 0,
"valueCustomerWithoutTva": 0,
"valueVendorWithoutTva": 0
},
"transport": [
{
"weightBrut": 0,
"weightNet": 0,
"totalNoTva": 0,
"totalWithTva": 0,
"tva": 0
}
],
"refundsIds": [
"string"
],
"refunds": [
{
"id": "string",
"nrRefund": 0,
"status": "string",
"city": "string",
"county": "string",
"contactPerson": "string",
"email": "string",
"phoneNumber": "string",
"refundProducts": [
{
"cod": "string",
"name": "string",
"orderId": "string",
"orderQuantity": 0,
"orderSum": 0,
"refundQunatity": 0,
"refundQuantity": 0,
"refundSum": 0,
"productWeight": 0,
"refundReason": "string",
"mainRefundReason": "string"
}
],
"invoicesIds": [
"string"
],
"invoices": [
{
"id": "string",
"file": "string",
"file_p": {
"id": "string",
"name": "string",
"contentType": "string",
"selfLink": "string",
"link": "string",
"fileType": "string",
"createdAt": "2021-04-10T09:58:41.030Z",
"updatedAt": "2021-04-10T09:58:41.030Z"
},
"invoiceId": "string",
"type": 0,
"category": 0,
"state": 0,
"fromRefund": true,
"isDeleted": true,
"invoiceDate": "2021-04-10T09:58:41.030Z",
"orderId": "string"
}
],
"images": [
"string"
]
}
],
"invoicesIds": [
"string"
],
"invoices": [
{
"id": "string",
"file": "string",
"file_p": {
"id": "string",
"name": "string",
"contentType": "string",
"selfLink": "string",
"link": "string",
"fileType": "string",
"createdAt": "2021-04-10T09:58:41.030Z",
"updatedAt": "2021-04-10T09:58:41.030Z"
},
"invoiceId": "string",
"type": 0,
"category": 0,
"state": 0,
"fromRefund": true,
"isDeleted": true,
"invoiceDate": "2021-04-10T09:58:41.030Z",
"orderId": "string"
}
],
"awbsIds": [
"string"
],
"awbs": [
{
"id": "string",
"orderId": "string",
"responseAwb": {},
"courier": "string",
"number": "string",
"ramburs": 0,
"isRequested": true,
"historyAwb": [
{
"dateTime": "string",
"operationCode": "string",
"description": "string"
}
],
"createdAt": "2021-04-10T09:58:41.030Z",
"updatedAt": "2021-04-10T09:58:41.030Z"
}
],
"documentsIds": [
"string"
],
"documents": [
{
"id": "string",
"name": "string",
"contentType": "string",
"selfLink": "string",
"link": "string",
"fileType": "string",
"createdAt": "2021-04-10T09:58:41.030Z",
"updatedAt": "2021-04-10T09:58:41.030Z"
}
],
"vendor": {
"id": "string",
"email": "string",
"phoneContactPerson": "string",
"companyName": "string",
"password": "string",
"oldID": "string",
"doralyInvoices": true,
"uploadOneInvoice": true,
"vendorType": 0,
"startTaxInvoices": 0,
"stopTaxInvoices": 0,
"statTransportBills": 0,
"stopTransportBills": 0,
"categories": [
{
"id": "string",
"displayName": "string",
"nameCategory": "string",
"allowProducts": true,
"groups": [
{
"name": "string",
"specifications": [
{
"name": "string",
"filter": true,
"value": [
"string"
],
"priority": 0,
"filterType": "string",
"filterH1": "string",
"filterMetaTitle": "string",
"filterMetaDescription": "string",
"filterDescription": "string",
"parentId": "string"
}
],
"priority": 0
}
]
}
]
},
"parentOrder": "string",
"history": [
{
"id": "string",
"entityId": "string",
"action": "string",
"diff": "string",
"createdBy": {
"username": "string",
"fullName": "string"
},
"createdAt": "2021-04-10T09:58:41.030Z",
"updatedAt": "2021-04-10T09:58:41.030Z"
}
]
}
]
4.2. GET available status by order ID
Este metoda prin care gasiti urmatorul status disponibil pentru o comanda anume.
Diagrama stari
Ambalata In curs de livrare Livrata
[Scanare curier] [Scanare curier]
[Prin API
[PUT
order/statuses]] Nereceptionata
Comanda cu probleme
Anulata
Metoda
GET
URL
/orders/statuses/{id}
Exemplu reqest
/orders/statuses/6071779516ff12000ced4bdb
Model
{
"name": "string",
"isAvailable": true
}
Exemplu raspuns
[
{
"name": "Nepreluata",
"isAvailable": false
},
{
"name": "Preluata",
"isAvailable": true
},
{
"name": "Confirmata",
"isAvailable": false
},
{
"name": "Ambalata",
"isAvailable": false
},
{
"name": "In curs de livrare",
"isAvailable": false
},
{
"name": "Livrata",
"isAvailable": false
},
{
"name": "Anulata",
"isAvailable": false
},
{
"name": "Nereceptionat",
"isAvailable": false
},
{
"name": "Comanda cu probleme",
"isAvailable": false
},
{
"name": "Asteptare confirmare plata",
"isAvailable": false
}
]
4.3. PUT status
Metoda prin care se updateaza status-ul unei comenzi
Singurul status cu care se poate updata o comanda este cel care are in raspunsul de la request-ul
/orders/statuses/{id}, isAvailable: true
ATENTIE:
Metoda
PUT
URL
/orders/statuses/{id}/{status}
Exemplu request
/orders/statuses/6071779516ff12000ced4bdb/Preluata
Exemplu raspuns
{
"orderId": "6071779516ff12000ced4bdb",
"no": "40652",
"placingDate": "2021-04-10T10:01:57.668Z",
"status": "Preluata",
"opensParcel": false,
"paymentMethod": "Numerar la curier (Ramburs)",
"totalClient": 246.22,
"totalVendor": 246.22,
"difference": 0,
"totalTransport": 15.05,
"total": 261.27,
"createdAt": "2021-04-10T10:01:57.730Z",
"updatedAt": "2021-04-10T11:26:01.829Z",
"orderClient": {
"fullName": "test",
"email": "test@gmail.com",
"phoneNumber": "0786470434",
"deliveryAddress": {
"address": "test nr 4",
"city": "CUSUIUS",
"county": "BIHOR",
"phoneNumber": "0788000000",
"contactPerson": "Test
"deliveryMethod": "Livrare prin curier"
},
"billingAddress": {
"address": "test nr 4",
"city": "CUSUIUS",
"county": "BIHOR",
"phoneNumber": "0786470434",
"contactPerson": "test",
"deliveryMethod": "Livrare prin curier",
"fiscalCode": null,
"regCom": null,
"bank": null,
"iBan": null
}
},
"products": [
{
"productId": "60716c0b73ecf6000e37ff83",
"productName": "Blender Philips Avance Collection HR3664/90, 1400 W, 2.2 L
tritan, viteza variabila, 1 recipient 2go, progam smoohie, ProBlend 6, Gri",
"productSlug": "blender-philips-avance-collection-hr3664-90-1400-w-2-2-l-
tritan-viteza-variabila-1-recipient-2go-progam-smoohie-problend-6-gri-
d13jnlbbm111.html",
"productImage": "https://storage.googleapis.com:443/doraly-assets-images/
images/2021-04-10T09-12-43.963Z-imageFromUrl-1.jpeg",
"productCode": "D13JNLBBM111",
"doralyCode": "02-03-01-01-00213",
"productCategory": "da5733781dcd656f90000220",
"productWeight": 5.5,
"measuringUnit": "[ Interval 1 ] 1 x 246.22 = 246.22",
"measuringUnitVendor": "[ Interval 1 ] 1 x 246.22 = 246.22",
"clientQuantity": 1,
"vendorQuantity": 1,
"categoryTva": 19,
"clientTotalNoTVA": 246.22,
"vendorTotalNoTVA": 246.22,
"clientTVA": 0,
"vendorTVA": 0,
"totalClient": 246.22,
"totalVendor": 246.22,
"comission": 29.36
}
],
"transport": [
{
"weightBrut": 6.05,
"weightNet": 5.5,
"totalNoTva": 15.05,
"totalWithTva": 15.05,
"tva": 0
}
],
"refunds": [],
"invoices": [],
"awbs": [],
"documents": [],
"history": [
{
"action": "Create",
"diff": "Creare",
"createdBy": {
"username": "Sistem"
},
"createdAt": "2021-04-10T10:01:57.812Z",
"updatedAt": "2021-04-10T10:01:57.812Z"
},
{
"action": "Update",
"diff": "Nepreluata - Preluata",
"createdBy": {
"username": "extern@extern.ro",
"fullName": "Comerciant extern test"
},
"createdAt": "2021-04-10T11:26:01.845Z",
"updatedAt": "2021-04-10T11:26:01.845Z"
}
]
}
4.4. PUT vendor quantity
Metoda prin care se poate updata cantitatea disponibila in stoc din produsele comandate de client.
Se foloseste in momentul in care stocul fizic din deposit este mai mic decat cantitatea comandata de un
client pe un produs.
ATENTIE:
Pentru a schimba cantiteatea disponibila pentru un produs, comanda trebuie sa fie in status-ul PReluata
sau Comanda cu probleme
In momentul in care o comanda este in status-ul comanda cu probleme, doar reprezentantii Doraly ii
mai pot schimba status-ul, dup ace i-au comunicat clientului noua cantitate disponibila.
METODA
PUT
URL
/orders/quantities/{{orderId}}
Exemplu request
[
{
"productId": "60716c0b73ecf6000e37ff83",
"quantity": 2
}
]
Exemplu raspuns
{
"orderId": "60740516e8762600130cbd3c",
"no": "40661",
"placingDate": "2021-04-12T08:30:14.696Z",
"status": "Comanda cu probleme",
"opensParcel": false,
"paymentMethod": "Numerar la curier (Ramburs)",
"totalClient": 1211.28,
"totalVendor": 440.92,
"difference": 0,
"totalTransport": 21.1,
"total": 1211.28,
"createdAt": "2021-04-12T08:30:14.721Z",
"updatedAt": "2021-04-12T08:32:03.983Z",
"orderClient": {
"fullName": "TEST",
"email": "TEst@gmail.com",
"phoneNumber": "0786888888",
"deliveryAddress": {
"address": "TEST",
"city": "HALALIS",
"county": "ARAD",
"phoneNumber": "0786888888",
"contactPerson": "TEST",
"deliveryMethod": "Livrare prin curier"
},
"billingAddress": {
"address": "TEST",
"city": "HALALIS",
"county": "ARAD",
"phoneNumber": "0786888888",
"contactPerson": "TEST",
"deliveryMethod": "Livrare prin curier",
"fiscalCode": null,
"regCom": null,
"bank": null,
"iBan": null
}
},
"products": [
{
"productId": "60716c0b73ecf6000e37ff83",
"productName": "Blender Philips Avance Collection HR3664/90, 1400 W, 2.2 L
tritan, viteza variabila, 1 recipient 2go, progam smoohie, ProBlend 6, Gri",
"productSlug": "blender-philips-avance-collection-hr3664-90-1400-w-2-2-l-
tritan-viteza-variabila-1-recipient-2go-progam-smoohie-problend-6-gri-
d13jnlbbm111.html",
"productImage": "https://storage.googleapis.com:443/doraly-assets-images/
images/2021-04-10T09-12-43.963Z-imageFromUrl-1.jpeg",
"productCode": "D13JNLBBM111",
"doralyCode": "02-03-01-01-00213",
"productCategory": "da5733781dcd656f90000220",
"productWeight": 5.5,
"measuringUnit": "[ Interval 2 ] 6 x 201.88 = 1211.28",
"measuringUnitVendor": "[ Interval 2 ] 2 x 220.46 = 440.92",
"clientQuantity": 6,
"vendorQuantity": 2,
"categoryTva": 19,
"clientTotalNoTVA": 1211.28,
"vendorTotalNoTVA": 440.92,
"clientTVA": 0,
"vendorTVA": 0,
"totalClient": 1211.28,
"totalVendor": 440.92,
"comission": 113.9
}
],
"transport": [
{
"weightBrut": 12.1,
"weightNet": 11,
"totalNoTva": 21.1,
"totalWithTva": 21.1,
"tva": 0
}
],
"refunds": [],
"invoices": [],
"awbs": [],
"documents": [],
"history": [
{
"action": "Create",
"diff": "Creare",
"createdBy": {
"username": "Sistem"
},
"createdAt": "2021-04-12T08:30:14.824Z",
"updatedAt": "2021-04-12T08:30:14.824Z"
},
{
"action": "Update",
"diff": "Nepreluata - Preluata",
"createdBy": {
"username": "extern@extern.ro",
"fullName": "Comerciant extern test"
},
"createdAt": "2021-04-12T08:31:59.143Z",
"updatedAt": "2021-04-12T08:31:59.143Z"
},
{
"action": "Update",
"diff": "Blender Philips Avance Collection HR3664/90, 1400 W, 2.2 L tritan
, viteza variabila, 1 recipient 2go, progam smoohie, ProBlend 6, Gri 6 - 2",
"createdBy": {
"username": "extern@extern.ro",
"fullName": "Comerciant extern test"
},
"createdAt": "2021-04-12T08:32:03.926Z",
"updatedAt": "2021-04-12T08:32:03.926Z"
}
]
}
Metoda
GET
URL
/orders/invoicing-details/{orderId}
Exemplu request
/orders/invoicing-details/{{orderId}}
Exemplu raspuns
1. Daca la crearea contului ati ales sa atasati facturile pe comanda – cate o factura pentru
produsule din comanda si alta pentru transport, raspunsul va fi:
"creationMethod": "Attach",
"type": 1,
"category": 1,
"available": true
},
"creationMethod": "Attach",
"type": 1,
"category": 2,
"available": true
},
"creationMethod": "Attach",
"type": 2,
"category": 1,
"available": false
},
"creationMethod": "Attach",
"type": 2,
"category": 2,
"available": false
Explicatii:
type:
1- Factura vanzare
2- Factura storno
category:
1 – Factura produse
2 – Factura transport
Available:
Pentru a atasa factura, comanda trebuie sa fie in starea Confirmata, sau daca ati sers-o, o mai puteti
adauga in starea Ambalata
2. Daca la crearea contului ati ales sa atasati o singura factura pe comanda, aceeasi si pentru taxa
de transport si pentru produse, raspunsul va fi:
{
"creationMethod": "Attach",
"type": 1,
"category": 3,
"available": true
},
"creationMethod": "Attach",
"type": 2,
"category": 3,
"available": false
Explicatii:
type:
3- Factura vanzare
4- Factura storno
category:
Available:
3. Daca la crearea contului ati ales sa generate facturile din aplicatia Doraly, atunci raspunsi va
arata:
"creationMethod": "Generate",
"type": 1,
"category": 1,
"available": true
},
"creationMethod": "Generate",
"type": 1,
"category": 2,
"available": true
},
"creationMethod": "Generate",
"type": 2,
"category": 1,
"available": false
},
"creationMethod": "Generate",
"type": 2,
"category": 2,
"available": false
Explicatii:
type:
1- Factura vanzare
2- Factura storno
category:
1 – Factura produse
2 – Factura transport
Available:
Metoda
POST
URL
/orders/invoices/{{orderId}}
Exemplu request
1. Atasare doua facturi pe comanda , una pentru produse, una pentru transport
a. Atasare vanzare produse
"creationMethod": "Attach",
"type": 1,
"category": 1,
"available": true
/orders/invoices/{{orderId}}?type=1&category=1
- file si fisierul in format .pdf, .png, .jpeg, .jpg – daca ai un fisier cu factura stocat local
sau
- fileUrl si link-ul fisierului in format .pdf, .png, .jpeg, .jpg – daca ai un fisier cu factura stocat pe
internet
"creationMethod": "Attach",
"type": 1,
"category": 2,
"available": true
/orders/invoices/{{orderId}}?type=1&category=2
- file si fisierul in format .pdf, .png, .jpeg, .jpg – daca ai un fisier cu factura stocat local
sau
- fileUrl si link-ul fisierului in format .pdf, .png, .jpeg, .jpg – daca ai un fisier cu factura stocat pe
internet
"creationMethod": "Attach",
"type": 2,
"category": 1,
"available": true
Inseamna ca trebuie sa atasezi factura storno de produse, se poate atasa numai cand comanda este in
status-ul Nereceptionata
- file si fisierul in format .pdf, .png, .jpeg, .jpg – daca ai un fisier cu factura stocat local
sau
- fileUrl si link-ul fisierului in format .pdf, .png, .jpeg, .jpg – daca ai un fisier cu factura stocat pe
internet
"creationMethod": "Attach",
"type": 2,
"category": 2,
"available": true
Inseamna ca trebuie sa atasezi factura storno de produse, se poate atasa numai cand comanda este in
status-ul Nereceptionata
/orders/invoices/{{orderId}}?type=2&category=2
- file si fisierul in format .pdf, .png, .jpeg, .jpg – daca ai un fisier cu factura stocat local
sau
- fileUrl si link-ul fisierului in format .pdf, .png, .jpeg, .jpg – daca ai un fisier cu factura stocat pe
internet
{
"creationMethod": "Attach",
"type": 1,
"category": 3,
"available": true
/orders/invoices/{{orderId}}?type=1&category=3
- file si fisierul in format .pdf, .png, .jpeg, .jpg – daca ai un fisier cu factura stocat local
sau
- fileUrl si link-ul fisierului in format .pdf, .png, .jpeg, .jpg – daca ai un fisier cu factura stocat pe
internet
"creationMethod": "Attach",
"type": 2,
"category": 3,
"available": true
Request-ul tau va fi
/orders/invoices/{{orderId}}?type=1&category=3
sau
- fileUrl si link-ul fisierului in format .pdf, .png, .jpeg, .jpg – daca ai un fisier cu factura stocat pe
internet
3. Generare facturi
a. Generare factura produse
"creationMethod": "Generate",
"type": 1,
"category": 1,
"available": true
/orders/invoices/{{orderId}}?type=1&category=1
"creationMethod": "Generate",
"type": 1,
"category": 2,
"available": true
Metoda
PUT
URL
/orders/invoices/cancel/{orderId}/{invoiceId}
Exemplu request
/orders/invoices/cancel/60741b434f75f8000d3fecbe/60745354b82ab6000d51da98
Exemplu raspuns
{
"id": "60745354b82ab6000d51da98",
"file": "https://storage.googleapis.com:443/doraly-assets-invoices/commands/
60741b434f75f8000d3fecbe/invoice_cancelled_2021-04-12T14%3A05%3A29.108Z.pdf?
GoogleAccessId=GOOGRC5HNY4ORVWAWKOHD46U&Expires=1618236630&Signature=tD5lChfsOcY70C45J
hYkxiATYn4%3D",
"invoiceId": "AA 1",
"type": 1,
"category": 1,
"state": 2,
"fromRefund": false,
"isDeleted": false,
"invoiceDate": "2021-04-12T14:04:04.476Z"
}
State:
1- Generata
2- Anulata
invoiceId:
Metoda
PUT
URL
/orders/invoices/delete/{{orderId}}/{{invoiceId}}
Exemplu request
/orders/invoices/delete/607435c5d2717d000da00e42/60745b5c1f53f0000c4553df
Exemplu raspuns
Invoice deleted.
Metoda prin care sunt listate toate adresele de ridicare setate de un comerciant in platforma Doraly
Marketplace.
Metoda:
GET
URL:
/orders/awb/pickUpAddresses
Exemplu raspuns:
[
{
"_id": "61f3e89ab18dc2342c24ec44",
"logisticsAddress": "Str. Caragiale, nr. 12",
"logisticsCity": "PLOIESTI",
"logisticsCounty": "PRAHOVA",
"default": true
}
]
Metoda prin care sunt listate toate lockerele disponibile din sistemul Sameday.
Metoda:
GET
URL:
/lockers
Exemplu raspuns:
[
{
"id": "62cec60bf261f00389fa9979",
"name": "easybox Petrom Brancoveanu",
"country": "Romania",
"countryId": 187,
"county": "Bucuresti",
"countyId": 1,
"city": "Sectorul 4",
"cityId": 4,
"address": "Bd. Constantin Brancoveanu Nr. 97A",
"postalCode": "041441",
"lat": "44.383502",
"lng": "26.110221",
"lockerId": 49,
"supportedPayment": true,
"clientVisible": true,
"schedule": [
{
"day": 1,
"openingHour": "00:00",
"closingHour": "23:59"
},
{
"day": 2,
"openingHour": "00:00",
"closingHour": "23:59"
},
{
"day": 3,
"openingHour": "00:00",
"closingHour": "23:59"
},
{
"day": 4,
"openingHour": "00:00",
"closingHour": "23:59"
},
{
"day": 5,
"openingHour": "00:00",
"closingHour": "23:59"
},
{
"day": 6,
"openingHour": "00:00",
"closingHour": "23:59"
},
{
"day": 7,
"openingHour": "00:00",
"closingHour": "23:59"
}
]
}
]
Metoda
GET
URL
/orders/details-for-awb/{{orderId}}
Exemplu request
/orders/details-for-awb/607435c5d2717d000da00e42
Exemplu raspuns
{
"recipient": "Test",
"contactPerson": "Test",
"phone": "0788888888",
"mail": "test@gmail.com",
"county": "ARGES",
"city": "CRUCISOARA",
"address": "test nr 5",
"streetNumber": "",
"buildingNumber": "",
"stairNumber": "",
"floor": "",
"apartment": "",
"postalCode": "",
"senderPhone": "0788888888",
"senderEmail": "extern@extern.ro",
"bank": "",
"account": "",
"contains": "Order Comerciant extern test srl - Comanda 40873",
"cashOnDelivery": 688.53,
"weight": 18.15,
"noParcels": 1,
"opensParcel": false,
"clientComment": "-",
"pickUpAddress": "61f3e89ab18dc2342c24ec21"
Este metoda prin care gasiti curierii disponibili si costurile estimate pentru livrarea cu acestia.
Metoda
POST
URL
/orders/awb/available-couriers/{{orderId}}
Exemplu request
/orders/awb/available-couriers/607435c5d2717d000da00e42
Iar in body se de la punctul 4.9. Get details for AWB si se completeaza capul "streetNumber":
{
"recipient": "Test",
"contactPerson": "Test",
"phone": "0788888888",
"mail": "test@gmail.com",
"county": "ARGES",
"city": "CRUCISOARA",
"address": "test nr 5",
"streetNumber": "",
"buildingNumber": "",
"stairNumber": "",
"floor": "",
"apartment": "",
"postalCode": "",
"senderPhone": "0788888888",
"senderEmail": "extern@extern.ro",
"bank": "",
"account": "",
"contains": "Order Comerciant extern test srl - Comanda 40873",
"cashOnDelivery": 688.53,
"weight": 18.15,
"noParcels": 1,
"opensParcel": false,
"clientComment": "-",
"pickUpAddress": "61f3e89ab18dc2342c24ec21"
}
Exemplu raspuns
[
{
"courierName": "Fan Courier - 49.40 lei",
"estimatedPrice": 49.4,
"value": "fan"
},
{
"courierName": "Sameday Courier - 51.17 lei",
"estimatedPrice": 51.17,
"value": "sameday"
}
]
Metoda
POST
URL
/orders/awb/{{orderId}}?courier={{value_from_available_couriers_response}}
Exemplu request
/orders/awb/607435c5d2717d000da00e42courier=fan
In body se pune raspunsul de le punctul 4.9. Get details for AWB si se completeaza campul
"streetNumber":
{
"recipient": "Test",
"contactPerson": "Test",
"phone": "0788888888",
"mail": "test@gmail.com",
"county": "ARGES",
"city": "CRUCISOARA",
"address": "test nr 5",
"streetNumber": "4",
"buildingNumber": "",
"stairNumber": "",
"floor": "",
"apartment": "",
"postalCode": "",
"senderPhone": "0788888888",
"senderEmail": "extern@extern.ro",
"bank": "",
"account": "",
"contains": "Order Comerciant extern test srl - Comanda 40873",
"cashOnDelivery": 688.53,
"weight": 18.15,
"noParcels": 1,
"opensParcel": false,
"clientComment": "-",
"pickUpAddress": "61f3e89ab18dc2342c24ec21"
}
Exemplu raspuns
Sistemul raspunde cu acelasi continut, plus numarul AWB-ului
{
"recipient": "Test",
"contactPerson": "Test",
"phone": "0788888888",
"mail": "test@gmail.com",
"county": "ARGES",
"city": "CRUCISOARA",
"address": "test nr 5",
"streetNumber": "4",
"buildingNumber": "",
"stairNumber": "",
"floor": "",
"apartment": "",
"postalCode": "",
"senderPhone": "0788888888",
"senderEmail": "extern@extern.ro",
"bank": "",
"account": "",
"contains": "Order Comerciant extern test srl - Comanda 40873",
"cashOnDelivery": 688.53,
"weight": 18.15,
"noParcels": 1,
"opensParcel": false,
"clientComment": "-",
"orderId": "607435c5d2717d000da00e42",
"courier": "fan",
"awb": "2103100120177"
}
4.14. Print AWB
Metoda
GET
URL
/orders/printAwb/{{orderId}}/{{awb_number}}
Exemplu request
/orders/printAwb/607435c5d2717d000da00e422103100120177
Exemplu raspuns
Raspunsul este un blob de fisier pdf. Ce trebuie salvat pentru a putea fi vizualizat.