Bu endpoint, sisteme sevkiyat evrakı (consignment document) yüklemek için kullanılır.
{{BASE_URL}}/api/v1/consignment-documentsPOSTapplication/jsonAPIKEY| Parametre | Tip | Zorunlu | Açıklama |
|---|---|---|---|
| document_file | File | Evet | Yüklenecek dosya (örn. PDF) |
| document_type | Integer | Evet | Evrak tipi ID (örneğin: 5) |
| consignment_id | Integer | Hazır | Eğer sevkiyat oluşturulduysa id'si |
Aşağıda, API isteği için bir örnek JSON verisi bulunmaktadır.
curl --location '{{BASE_URL}}/api/v1/consignment-documents' \
--header 'APIKEY: ••••••' \
--header 'Cookie:' \
--form 'document_file=@"/download.pdf"' \
--form 'document_type="5"'
Başarılı bir istekte, API aşağıdaki gibi bir yanıt döndürecektir:
{
"status": true,
"message": "Consignment document created successfully",
"data": {
"id": 4618,
"documentType": 5,
"consignment": null,
"fileName": "download.pdf",
"fileSize": "49585",
"mimeType": "application/pdf",
"status": 0
}
}
API isteği başarısız olursa, API aşağıdaki gibi bir hata yanıtı döndürecektir:
{
"status": false,
"errors": [
{
"message": "documentFile:This value should not be null.",
"code": 400
},
{
"message": "fileName:This variable is automated fill , please set documentFile",
"code": 400
},
{
"message": "fileSize:This variable is automated fill , please set documentFile",
"code": 400
},
{
"message": "mimeType:This variable is automated fill , please set documentFile",
"code": 400
}
]
}
document_type alanında geçerli evrak tipi ID'si kullanılması zorunludur.document_file alanı PDF, JPG, PNG gibi formatlarda olabilir (detaylı format kısıtlamaları için API yöneticisine danışın).document_id ile diğer işlemler yapılabilir.