Firmaya Göre Desi/Kg Hesaplama
Açıklama
Section titled “Açıklama” GET
/v1/shipments/desi-or-kgs/0 Belirli bir kargo firması için desi/kg hesaplar.
Parametreler
Section titled “Parametreler”| Parametre | Konum | Tip | Açıklama | Varsayılan | Örnek |
|---|---|---|---|---|---|
| Authorization * | header | string | Bearer Yetkilendirme Tokeni (Örn: Bearer eyJhb...) | - | Bearer <TOKEN> |
| providerId * | path | string | Firma ID'si | - | - |
Örnek Kod
Section titled “Örnek Kod”fetch('https://api.kargomucuz.com/v1/shipments/desi-or-kgs/0', { method: 'GET', headers: { 'Content-Type': 'application/json', 'Authorization': 'Bearer <YOUR_TOKEN>' }}).then(response => response.json()).then(data => console.log(data));$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.kargomucuz.com/v1/shipments/desi-or-kgs/0');curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
$headers = array();$headers[] = 'Content-Type: application/json';$headers[] = 'Authorization: Bearer <YOUR_TOKEN>';curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$result = curl_exec($ch);if (curl_errno($ch)) { echo 'Error:' . curl_error($ch);}curl_close($ch);echo $result;Yanıtlar
Section titled “Yanıtlar”200: Başarılı kimlik doğrulaması ve geçerli ID parametresiyle istek gönderildiğinde dönen yanıt.
{ "status": true, "message": "Desi or kgs getirildi.", "payload": { "data": { "others": { "updated": "2025-02-21T12:36:52.268Z", "created": "2025-02-21T12:36:52.268Z" }, "_id": "67b8736421fe979c1c8d27c4", "providerServiceCode": "ptt_fixed_price", "matchId": null, "desiOrKg": 0.5, "amount": 139, "currency": "try", "__v": 0, "cost": 139, "profit": 0 }, "totalCount": 1 }, "code": 500}200 - Başarılı kimlik doğrulaması ve geçerli ID parametresiyle istek gönderildiğinde dönen yanıt.: Başarılı kimlik doğrulaması ve geçerli ID parametresiyle istek gönderildiğinde dönen yanıt.
{ "status": false, "message": "Id parametresi geçersiz.", "code": 500}