Gönderi oluşturmak için gönderici adresi oluşturmanız gerekiyor. Aşağıda örnek adres oluşturma isteği ve cevabını görebilirsiniz.
Örnek İstek #
curl --request POST \
--url http://localhost:9011/api/v1/addresses \
--header 'Authorization: Bearer 13741b22-6a91-40cc-a50d-75dbcfa7d5b0' \
--header 'Content-Type: application/json' \
--data '{
"name": "My Company",
"email": "aa@gmail.com",
"phone": "+905052128687",
"address1": "Address Test Json 2-1",
"address2": "Address Test Json 2-2",
"cityName": "Manisa",
"cityCode": "45",
"districtName": "Yunusemre",
"districtID":108600,
"countryCode": "TR",
"countryName": "Turkey",
"state": "",
"zip": "45020"
}'
Parametreler | Açıklama |
---|---|
name | Gönderici adı / Şirket adı |
Gönderici eposta adresi | |
address1 | Tam adresi içerir. Ülke/Şehir/İlçe içermez |
cityCode | Şehir kodu. Türkiye için plaka kodudur. /cities endpointinden herhangi bir ülke içerisindeki şehirlerin kodları alınabilir |
districtID | İlçe kodu. /districts endpointinden herhangi bir ülke ve şehrin ilçe kodları alınabilir |
countryCode | Ülke kodu |
zip | Posta kodu |
Cevap #
Adres oluşturmadan sonra gelen başarılı istek cevabı aşağıdaki gibidir.
{
"result": true,
"data": {
"id": "76225e42-9436-4643-b691-25c4c9f61dae",
"createdAt": "2021-12-20T09:18:59.925689+03:00",
"updatedAt": "2021-12-20T09:18:59.925689+03:00",
"name": "My Company",
"email": "aa@gmail.com",
"phone": "+905052128687",
"address1": "Address Test Json 2-1",
"address2": "Address Test Json 2-2",
"cityCode": "45",
"cityName": "Manisa",
"city": null,
"state": "",
"zip": "45020",
"districtID": 108600,
"districtName": "Yunusemre",
"district": null,
"streetID": null,
"streetName": "",
"countryCode": "TR",
"countryName": "Turkey",
"source": null,
"isDefaultSenderAddress": false,
"isDefaultReturnAddress": false,
"isActive": true
}
}
Parametreler | Açıklama |
---|---|
result | Başarılı olup olmadığı. true ise başarılıdır. |
data | Oluşturulan adres kaydı. |
code | Eğer istek başarısız ise burada hata kodu bulunur |
message | Eğer istek başarısız ise burada hata mesajı bulunur |
additionalMessage | Sadece test ortamı için geçerli olan detaylı hata mesajı |