Zarządzaj zleceniami klientów za pomocą Orders API. Twórz nowe zlecenia, pobieraj istniejące i aktualizuj statusy.
/api/vendor/ordersZwraca ostatnie 100 zleceń usługodawcy posortowanych według daty ostatniej aktualizacji.
curl -s https://brutlers.com/api/vendor/orders \
-H "X-Api-Key: brut_your_api_key_here"Odpowiedź
{
"orders": [
{
"id": "cm...",
"type": "BRIDAL_DRESS",
"status": "ORDERED",
"model": "Valentina A-Line",
"size": "38",
"color": "Ivory",
"description": "Custom bridal dress",
"specialRequests": "Extra lace on sleeves",
"customer": {
"name": "Anna Müller",
"email": "anna@example.com"
},
"updates": [
{
"status": "ORDERED",
"message": "Order created via API",
"createdAt": "2026-03-10T14:30:00.000Z"
}
],
"createdAt": "2026-03-10T14:30:00.000Z",
"updatedAt": "2026-03-10T14:30:00.000Z"
}
]
}/api/vendor/ordersTworzy nowe zlecenie klienta. Jeśli klient z podanym adresem e-mail już istnieje, zostanie automatycznie powiązany.
Treść żądania
| Field | Type | Description | |
|---|---|---|---|
| customerName | string | Wymagane | Imię i nazwisko klienta |
| type | enum | Wymagane | Typ zlecenia: BRIDAL_DRESS, SUIT, RENTAL |
| customerEmail | string | Opcjonalne | Adres e-mail klienta |
| customerPhone | string | Opcjonalne | Numer telefonu klienta |
| weddingDate | string | Opcjonalne | Data ślubu (ISO 8601) |
| model | string | Opcjonalne | Oznaczenie modelu |
| description | string | Opcjonalne | Opis zlecenia |
| size | string | Opcjonalne | Rozmiar |
| color | string | Opcjonalne | Kolor |
| specialRequests | string | Opcjonalne | Specjalne życzenia |
curl -X POST https://brutlers.com/api/vendor/orders \
-H "X-Api-Key: brut_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"customerName": "Anna Müller",
"customerEmail": "anna@example.com",
"type": "BRIDAL_DRESS",
"model": "Valentina A-Line",
"size": "38",
"color": "Ivory"
}'Odpowiedź (201)
{ "id": "cm...", "status": "ORDERED" }/api/vendor/orders/{id}/statusAktualizuje status istniejącego zlecenia. Opcjonalnie można dołączyć wiadomość i zdjęcie.
Treść żądania
| Field | Type | Description | |
|---|---|---|---|
| status | enum | Wymagane | Nowy status |
| message | string | Opcjonalne | Wiadomość o statusie dla klienta |
| imageUrl | string | Opcjonalne | URL do zdjęcia (np. zdjęcia postępu prac) |
curl -X PUT https://brutlers.com/api/vendor/orders/ORDER_ID/status \
-H "X-Api-Key: brut_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"status": "IN_PRODUCTION",
"message": "Fabric has been cut, starting assembly."
}'Odpowiedź
{ "id": "cm...", "status": "IN_PRODUCTION" }