Yurtdışı Gönderi Oluştur
Yurtdışı Gönderi Oluştur
Bu API, Yurt dışı kargo ve lojistik gönderileri oluşturmak için kullanılır.
Endpoint Bilgileri
- URL:
{{BASE_URL}}/api/v1/consignments
- HTTP Metodu:
POST
- İçerik Türü:
application/json
- Kimlik Doğrulama Tipi:
APIKEY
İstek Parametreleri
Temel Parametreler
| Parametre Adı |
Parametre Tipi |
Zorunluluk |
Açıklama |
preference |
Integer |
ZORUNLU |
Tercih edilen gönderi yöntemi |
provider_id |
Integer |
PREFERENCE 0 İSE ZORUNLU |
Kargo sağlayıcı ID'si |
invoice_number |
String (MAX 255) |
ZORUNLU |
Fatura numarası |
address_resolver_type |
Integer |
ZORUNLU |
Adres çözümleme türü |
incoterms_type |
Integer |
ZORUNLU |
Gümrük Teslim Koşulu |
reference_no |
String (MAX 255) |
İSTEĞE BAĞLI |
Referans numarası |
specific_shipping_method |
String (MAX 255) |
İSTEĞE BAĞLI |
Sağlayıcı Gönderim Methodu |
Gönderen Bilgileri
| Parametre Adı |
Parametre Tipi |
Zorunluluk |
Açıklama |
consignor.name |
String (MAX 255) |
ZORUNLU |
Gönderen adı |
consignor.attention_name |
String (MAX 255) |
İSTEĞE BAĞLI |
Gönderici diğer ad |
consignor.country |
String (2-3 KARAKTER) |
ZORUNLU |
Ülke kodu (ISO2 veya ISO3 formatında) |
consignor.state |
String (MAX 100) |
ZORUNLU |
İl/Eyalet |
consignor.city |
String (MAX 100) |
ZORUNLU |
İlçe |
consignor.postal_code |
String (MAX 30) |
ZORUNLU |
Posta kodu |
consignor.address |
String (MAX 1000) |
ZORUNLU |
Tam adres |
consignor.phone_number |
String (MAX 20) |
ZORUNLU |
Telefon numarası |
consignor.email |
String (MAX 255) |
İSTEĞE BAĞLI |
E-posta adresi |
Alıcı Bilgileri
| Parametre Adı |
Parametre Tipi |
Zorunluluk |
Açıklama |
consignee.name |
String (MAX 255) |
ZORUNLU |
Alıcı adı |
consignee.attention_name |
String (MAX 255) |
İSTEĞE BAĞLI |
Alıcı diğer ad |
consignee.country |
String (2-3 KARAKTER) |
ZORUNLU |
Ülke kodu (ISO2 veya ISO3 formatında) |
consignee.state |
String (MAX 100) |
ZORUNLU |
İl/Eyalet |
consignee.city |
String (MAX 100) |
ZORUNLU |
İlçe |
consignee.postal_code |
String (MAX 30) |
ZORUNLU |
Posta kodu |
consignee.address |
String (MAX 1000) |
ZORUNLU |
Tam adres |
consignee.phone_number |
String (MAX 20) |
ZORUNLU |
Telefon numarası |
consignee.email |
String (MAX 255) |
İSTEĞE BAĞLI |
E-posta adresi |
Fatura Bilgileri
| Parametre Adı |
Parametre Tipi |
Zorunluluk |
Açıklama |
invoice.name |
String (MAX 255) |
ZORUNLU |
Fatura sahibi adı |
invoice.tax_number |
String (MAX 255) |
ZORUNLU |
Vergi numarası |
invoice.tax_office |
String (MAX 255) |
ZORUNLU |
Vergi dairesi |
invoice.email |
String (MAX 255) |
ZORUNLU |
E-posta adresi |
invoice.country |
String (2-3 KARAKTER) |
ZORUNLU |
Ülke kodu (ISO2 veya ISO3 formatında) |
invoice.state |
String (MAX 100) |
ZORUNLU |
İl/Eyalet |
invoice.city |
String (MAX 100) |
ZORUNLU |
İlçe |
invoice.address |
String (MAX 1000) |
ZORUNLU |
Tam adres |
invoice.phone_number |
String (MAX 20) |
ZORUNLU |
Telefon numarası |
Paket Bilgileri
| Parametre Adı |
Parametre Tipi |
Zorunluluk |
Açıklama |
packages.package_type |
Integer |
ZORUNLU |
Paket türü |
packages.post_type |
Integer |
ZORUNLU |
Gönderi türü |
packages.quantity |
Integer |
ZORUNLU |
Paket adedi |
packages.weight |
Float |
ZORUNLU |
Paket ağırlığı (kg) |
packages.length |
Float |
ZORUNLU |
Paket uzunluğu (cm) |
packages.width |
Float |
ZORUNLU |
Paket genişliği (cm) |
packages.height |
Float |
ZORUNLU |
Paket yüksekliği (cm) |
packages.dangerous_goods |
Boolean |
ZORUNLU |
Tehlikeli mal var mı? |
Paket İçerik Bilgileri
| Parametre Adı |
Parametre Tipi |
Zorunluluk |
Açıklama |
packages.items.description |
String (MAX 255) |
ZORUNLU |
Ürün açıklaması |
packages.items.gtip |
String (MAX 16) |
ZORUNLU |
Gümrük tarife numarası |
packages.items.origin |
String (2-3 KARAKTER) |
ZORUNLU |
Menşei ülke |
packages.items.currency_code |
String (3 KARAKTER) |
ZORUNLU |
Para birimi ISO2 kodu (örn. USD) |
packages.items.unit_price |
Float |
ZORUNLU |
Birim fiyat |
packages.items.quantity |
Integer |
ZORUNLU |
Miktar |
packages.items.category |
String (MAX 255) |
İSTEĞE BAĞLI |
Kategori |
Örnek Kullanım
API İsteği
Aşağıda, API isteği için bir örnek JSON verisi bulunmaktadır.
POST {{BASE_URL}}/api/v1/consignments
Content-Type: application/json
Authorization: APIKEY {{APIKEY}}
{
"provider_id": 7,
"preference": 0,
"invoice_number": "IHR2024000001641",
"incoterms_type": 1,
"address_resolver_type": 0,
"reference_no": "XYZ128",
"consignor": {
"name": "Ali Veli",
"attention_name": "Ali Veli",
"country": "TR",
"state": "İstanbul",
"city": "Kadıköy",
"postal_code": "34700",
"address": "Moda Caddesi 123/A",
"phone_number": "+905321234567",
"email": "ali@veli.com"
},
"consignee": {
"name": "John Doe",
"attention_name": "John Doe",
"country": "US",
"state": "California",
"city": "Los Angeles",
"postal_code": "90001",
"address": "123 Street",
"phone_number": "+12345678901",
"email": "johndoe@example.com"
},
"invoice": {
"name": "Jane Smith",
"tax_number": "12345678910",
"tax_office": "California",
"email": "janesmith@example.com",
"country": "US",
"state": "California",
"city": "Los Angeles",
"address": "456 Avenue",
"phone_number": "+12345678902"
},
"packages": [
{
"package_type": 1,
"post_type": 4,
"quantity": 1,
"weight": 2,
"length": 15,
"width": 15,
"height": 15,
"dangerous_goods": true,
"items": [
{
"description": "FOOD",
"gtip": "170490999019",
"origin": "TR",
"currency_code": "USD",
"unit_price": 8.03,
"quantity": 1,
"category": "FOOD"
}
]
}
]
}
API Cevabı
Başarılı bir istekte, API aşağıdaki gibi bir yanıt döndürecektir:
{
"status": true,
"message": "Consignment created successfully",
"data": {
"consignment": 632279,
"barcode": "C2H46282802942",
"c2hBarcode": "C2H46282802942",
"providerTrackingCode": "C2H46282802942",
"contentType": "application\/pdf",
"base64label": "...base64data",
"detail": {
"total_cost": 120.96,
"currency_code": "TRY",
"currency_rate": 1,
"reference_no": null,
"packages": {
"desi": 1.13,
"weight": 5.4,
"quantity": 1
}
}
}
}
Hata Cevapları
API isteği başarısız olursa, API aşağıdaki gibi bir hata yanıtı döndürecektir:
{
"status": false,
"errors": [
{
"message": "reference_no:Reference number \"XYZ123\" has already been used. Please provide a unique reference number."
}
]
}