Gönderi (Kargo) İptal Et
Açıklama
Section titled “Açıklama” DELETE
/v1/shipments/0 Sistemdeki mevcut bir kargo kaydını iptal eder.
Parametreler
Section titled “Parametreler”| Parametre | Konum | Tip | Açıklama | Varsayılan | Örnek |
|---|---|---|---|---|---|
| Authorization * | header | string | Bearer Yetkilendirme Tokeni (Örn: Bearer eyJhb...) | - | Bearer <TOKEN> |
| USER_ID * | path | string | Kullanıcı IDsi | - | 670e6898c80f0c095a27db10 |
Örnek Kod
Section titled “Örnek Kod”fetch('https://api.kargomucuz.com/v1/shipments/0', { method: 'DELETE', 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/0');curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE');
$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": "Kargo iptali başarılı ve ödemeler iade edildi.", "code": 500}