shipink-logo-vector-svgDökümantasyon

Shipments

Gönderi oluşturma, listeleme ve silme işlemleri.

Gönderileri listele

Oluşturmuş olduğunuz gönderileri sayfalanmış olarak getirir.

GET
/shipments
AuthorizationBearer <token>

Authenticate using the access_token obtained from POST /token.

Format: Authorization: Bearer {access_token}

In: header

Query Parameters

page?integer

Page number

Default1
Range1 <= value
limit?integer

Number of items per page

Default10
Range1 <= value <= 100

Response Body

application/json

curl -X GET "https://api.shipink.io/shipments"
{
  "success": true,
  "meta": {
    "status": 200,
    "code": "NOT_FOUND",
    "message": "orders successfully received",
    "total": 100,
    "details": [
      {
        "field": "name",
        "error": "cannot be blank"
      }
    ]
  },
  "data": [
    {
      "id": "17ebb574-f53f-43c2-bcf6-8984f7fc100b",
      "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5",
      "order_id": "Nc220IyHvpV_",
      "carrier": {
        "shipment_id": "507855220681824288",
        "tracking_url": "https://kargo.aras.com.tr/track/507855220681824288",
        "invoice_id": "",
        "waybill_id": "",
        "carrier_id": "aras",
        "carrier_service_id": "aras_standart",
        "carrier_account_id": "efd4158f-75ca-4922-b8cc-c27e209db7e1",
        "shipment_type": "outgoing",
        "language": "tr",
        "settings": {
          "system_account": true,
          "denominator": 0,
          "is_marketplace": true,
          "label_id_range": "string",
          "label_support": true,
          "return_support": true,
          "payment_type": {
            "sender": true,
            "recipient": true,
            "cod_cash": true,
            "cod_credit": true
          }
        }
      },
      "content": "",
      "language": "tr",
      "note": "",
      "packages": [
        {
          "weight": 1,
          "weight_unit": "kg",
          "length": 20,
          "width": 15,
          "height": 10,
          "dimension_unit": "cm"
        }
      ],
      "sender": {
        "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
        "name": "Ahmet Yılmaz",
        "tax_id": "",
        "tax_office": "",
        "company": "",
        "email": {
          "main": "user@example.com",
          "work": ""
        },
        "phone": {
          "main": "905321234567",
          "work": "",
          "cell": "",
          "code": ""
        },
        "address": {
          "street": "Example Street No:1",
          "city": "Maltepe",
          "city_code": "TR-34-108146",
          "state": "İstanbul",
          "state_code": "TR-34",
          "zip": "34857",
          "country": "Turkey",
          "country_code": "TR",
          "tax_id": "",
          "external_id": null,
          "status": ""
        },
        "return_address": {
          "street": "Example Street No:1",
          "city": "Maltepe",
          "city_code": "TR-34-108146",
          "state": "İstanbul",
          "state_code": "TR-34",
          "zip": "34857",
          "country": "Turkey",
          "country_code": "TR",
          "tax_id": "",
          "external_id": null,
          "status": ""
        }
      },
      "recipient": {
        "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
        "name": "Ahmet Yılmaz",
        "tax_id": "",
        "tax_office": "",
        "company": "",
        "email": {
          "main": "user@example.com",
          "work": ""
        },
        "phone": {
          "main": "905321234567",
          "work": "",
          "cell": "",
          "code": ""
        },
        "address": {
          "street": "Example Street No:1",
          "city": "Maltepe",
          "city_code": "TR-34-108146",
          "state": "İstanbul",
          "state_code": "TR-34",
          "zip": "34857",
          "country": "Turkey",
          "country_code": "TR",
          "tax_id": "",
          "external_id": null,
          "status": ""
        },
        "return_address": {
          "street": "Example Street No:1",
          "city": "Maltepe",
          "city_code": "TR-34-108146",
          "state": "İstanbul",
          "state_code": "TR-34",
          "zip": "34857",
          "country": "Turkey",
          "country_code": "TR",
          "tax_id": "",
          "external_id": null,
          "status": ""
        }
      },
      "items": [
        {
          "id": "string",
          "name": "Product Name",
          "category": "gadget",
          "quantity": 1,
          "unit_price": 500.9,
          "origin": "TR",
          "hs_code": "",
          "sku": "",
          "weight": 0.5,
          "dimensions": {
            "length": 0,
            "width": 0,
            "height": 0
          }
        }
      ],
      "payment": {
        "currency": "TRY",
        "amount": 599.8,
        "type": "CODCash"
      },
      "customs": {},
      "extras": {
        "signature_confirmation": "",
        "just_document": false,
        "address_validation": false,
        "night_delivery": false,
        "saturday_delivery": false,
        "has_alcohol": false,
        "carbon_neutral": false
      },
      "document": {
        "labels": [
          {
            "id": "string",
            "process": "ready",
            "ready_at": "2019-08-24T14:15:22Z",
            "pdf": "https://access.shipink.io/document/label-7290012345678-normalA4.pdf?token=a0b1c2d3-0000-0000-0000-000011112222",
            "png": "http://example.com",
            "zpl": "http://example.com"
          }
        ],
        "customs_declaration": {
          "url": "http://example.com"
        },
        "sales_invoice": {
          "id": "inv_abc123",
          "no": "EFA2024001",
          "date": "2024-03-15T13:21:08Z",
          "url": "https://example.com/invoice.pdf"
        },
        "proforma": {}
      },
      "tracking": {
        "id": "track_abc123",
        "url": "https://kargo.aras.com.tr/track/507855220681824288",
        "estimated_delivery_at": "2019-08-24T14:15:22Z",
        "updated_at": "2019-08-24T14:15:22Z",
        "status": "in_transit"
      },
      "rate": {
        "estimated_price": 45,
        "estimated_weight": 1,
        "estimated_at": "2019-08-24T14:15:22Z",
        "actual_price": 45,
        "actual_weight": 1,
        "heavy_load_fee": 150
      },
      "direction": "outgoing",
      "source": "api",
      "async": false,
      "create_invoice": false,
      "shipped_at": "2019-08-24T14:15:22Z",
      "delivered_at": "2019-08-24T14:15:22Z",
      "created_at": "2019-08-24T14:15:22Z",
      "updated_at": "2019-08-24T14:15:22Z",
      "deleted_at": "2019-08-24T14:15:22Z"
    }
  ]
}

Gönderi oluştur

ID'si belirtilen sipariş için gönderi oluşturur.

direction alanı:

  • outgoing — normal gönderi
  • incoming — iade gönderisi. Oluşturulduktan 7 gün sonra hâlâ beklemede olan (koli teslim edilmemiş) iade kodu otomatik silinir: etiket kargo firmasında iptal edilir, Shipink anlaşmalarında ücret iade edilir.

Not: Shipink kargo anlaşmaları kullanıldığında card_id alanı zorunludur. Kart ID'lerinizi GET /cards endpoint'inden veya Shipink panelindeki ödeme ayarlarından alabilirsiniz.

Kapıda ödeme (COD)

Kapıda ödemeli gönderi oluşturmak için istek gövdesine payment nesnesini ekleyin ve type alanını aşağıdakilerden biri olarak belirtin:

  • CODCash — kargo tutarı alıcıdan nakit olarak tahsil edilir.
  • CODCredit — kargo tutarı alıcıdan kredi kartı ile tahsil edilir.

amount alanına alıcıdan tahsil edilecek tutarı, isteğe bağlı olarak currency alanına para birimini (boş bırakılırsa sipariş para birimi kullanılır) yazın. Kapıda ödeme desteği seçilen kargo servisine bağlıdır — gönderi oluşturmadan önce GET /carrier-accounts yanıtındaki carrier_services[].payment_type.cod_cash / cod_credit alanlarını kontrol edin ya da POST /rates isteğinde payment_type ile yalnızca kapıda ödeme destekleyen servisleri listeleyin. payment nesnesi gönderilmezse varsayılan olarak gönderici ödemeli bir gönderi oluşturulur.

Kargo hataları ve zaman aşımı

İstek kargo firmasının yanıtını bekler ve 45 saniyeye kadar sürebilir; istemcinizin zaman aşımını bunun üzerinde tutun. Kargo firması zamanında yanıt vermezse API 504 ve meta.code olarak SHIPMENT_CARRIER_REQUEST_TIMEOUT döner; firmaya ulaşılamıyorsa veya geçici olarak hizmet veremiyorsa 503 ve CARRIER_UNAVAILABLE döner. 503 ve 504 durumunda gönderi oluşturulmaz ve alınan ücret iade edilir; isteği yeniden deneyebilirsiniz. Kendi kargo hesaplarınızdan birinin kimlik bilgileri geçersizse 400 ve CREDENTIALS_INVALID döner, mesajda kargo firması belirtilir; hesabı güncelleyip yeniden deneyin.

POST
/shipments
AuthorizationBearer <token>

Authenticate using the access_token obtained from POST /token.

Format: Authorization: Bearer {access_token}

In: header

Header Parameters

X-Language?string

Dil kodu

Value in"tr" | "en"
order_idstring
carrier_service_idstring
carrier_account_idstring
Formatuuid
warehouse_idstring
Formatuuid
direction?string

outgoing: standard delivery, incoming: return shipment

Value in"outgoing" | "incoming"
card_id?string

Shipink kargo anlaşmaları kullanıldığında zorunludur. Hesabınıza tanımlı ödeme kartının ID'si.

Formatuuid
packages
payment?

Gönderi ödeme bilgileri. Kapıda ödemeli (COD) bir gönderi oluşturmak için bu nesneyi gönderin.

Kapıda ödemeli gönderi için type alanını CODCash (nakit tahsilat) veya CODCredit (teslimat sırasında kredi kartı ile tahsilat) olarak ayarlayın ve amount alanına alıcıdan tahsil edilecek tutarı yazın. Bu nesne gönderilmezse gönderi varsayılan olarak Sender (ücret göndericiye ait) şeklinde oluşturulur.

create_invoice?boolean
extras?

Response Body

application/json

application/json

application/json

application/json

curl -X POST "https://api.shipink.io/shipments" \  -H "Content-Type: application/json" \  -d '{    "direction": "outgoing",    "order_id": "Nc220IyHvpV_",    "carrier_service_id": "sendeo_standart",    "carrier_account_id": "efd4158f-75ca-4922-b8cc-c27e209db7e1",    "warehouse_id": "b4213a03-d4c3-41f8-8090-886e273de746",    "card_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",    "sales_invoice": {      "no": "EFA2024001",      "date": "2024-03-15T13:21:08Z",      "url": "https://example.com/invoice.pdf"    },    "packages": [      {        "dimension_unit": "cm",        "height": 10,        "length": 20,        "width": 15,        "weight": 1,        "weight_unit": "kg"      }    ]  }'
{
  "id": "17ebb574-f53f-43c2-bcf6-8984f7fc100b",
  "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5",
  "order_id": "Nc220IyHvpV_",
  "carrier": {
    "shipment_id": "507855220681824288",
    "tracking_url": "https://kargo.aras.com.tr/track/507855220681824288",
    "invoice_id": "",
    "waybill_id": "",
    "carrier_id": "aras",
    "carrier_service_id": "aras_standart",
    "carrier_account_id": "efd4158f-75ca-4922-b8cc-c27e209db7e1",
    "shipment_type": "outgoing",
    "language": "tr",
    "settings": {
      "system_account": true,
      "denominator": 0,
      "is_marketplace": true,
      "label_id_range": "string",
      "label_support": true,
      "return_support": true,
      "payment_type": {
        "sender": true,
        "recipient": true,
        "cod_cash": true,
        "cod_credit": true
      }
    }
  },
  "content": "",
  "language": "tr",
  "note": "",
  "packages": [
    {
      "weight": 1,
      "weight_unit": "kg",
      "length": 20,
      "width": 15,
      "height": 10,
      "dimension_unit": "cm"
    }
  ],
  "sender": {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "name": "Ahmet Yılmaz",
    "tax_id": "",
    "tax_office": "",
    "company": "",
    "email": {
      "main": "user@example.com",
      "work": ""
    },
    "phone": {
      "main": "905321234567",
      "work": "",
      "cell": "",
      "code": ""
    },
    "address": {
      "street": "Example Street No:1",
      "city": "Maltepe",
      "city_code": "TR-34-108146",
      "state": "İstanbul",
      "state_code": "TR-34",
      "zip": "34857",
      "country": "Turkey",
      "country_code": "TR",
      "tax_id": "",
      "external_id": null,
      "status": ""
    },
    "return_address": {
      "street": "Example Street No:1",
      "city": "Maltepe",
      "city_code": "TR-34-108146",
      "state": "İstanbul",
      "state_code": "TR-34",
      "zip": "34857",
      "country": "Turkey",
      "country_code": "TR",
      "tax_id": "",
      "external_id": null,
      "status": ""
    }
  },
  "recipient": {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "name": "Ahmet Yılmaz",
    "tax_id": "",
    "tax_office": "",
    "company": "",
    "email": {
      "main": "user@example.com",
      "work": ""
    },
    "phone": {
      "main": "905321234567",
      "work": "",
      "cell": "",
      "code": ""
    },
    "address": {
      "street": "Example Street No:1",
      "city": "Maltepe",
      "city_code": "TR-34-108146",
      "state": "İstanbul",
      "state_code": "TR-34",
      "zip": "34857",
      "country": "Turkey",
      "country_code": "TR",
      "tax_id": "",
      "external_id": null,
      "status": ""
    },
    "return_address": {
      "street": "Example Street No:1",
      "city": "Maltepe",
      "city_code": "TR-34-108146",
      "state": "İstanbul",
      "state_code": "TR-34",
      "zip": "34857",
      "country": "Turkey",
      "country_code": "TR",
      "tax_id": "",
      "external_id": null,
      "status": ""
    }
  },
  "items": [
    {
      "id": "string",
      "name": "Product Name",
      "category": "gadget",
      "quantity": 1,
      "unit_price": 500.9,
      "origin": "TR",
      "hs_code": "",
      "sku": "",
      "weight": 0.5,
      "dimensions": {
        "length": 0,
        "width": 0,
        "height": 0
      }
    }
  ],
  "payment": {
    "currency": "TRY",
    "amount": 599.8,
    "type": "CODCash"
  },
  "customs": {},
  "extras": {
    "signature_confirmation": "",
    "just_document": false,
    "address_validation": false,
    "night_delivery": false,
    "saturday_delivery": false,
    "has_alcohol": false,
    "carbon_neutral": false
  },
  "document": {
    "labels": [
      {
        "id": "string",
        "process": "ready",
        "ready_at": "2019-08-24T14:15:22Z",
        "pdf": "https://access.shipink.io/document/label-7290012345678-normalA4.pdf?token=a0b1c2d3-0000-0000-0000-000011112222",
        "png": "http://example.com",
        "zpl": "http://example.com"
      }
    ],
    "customs_declaration": {
      "url": "http://example.com"
    },
    "sales_invoice": {
      "id": "inv_abc123",
      "no": "EFA2024001",
      "date": "2024-03-15T13:21:08Z",
      "url": "https://example.com/invoice.pdf"
    },
    "proforma": {}
  },
  "tracking": {
    "id": "track_abc123",
    "url": "https://kargo.aras.com.tr/track/507855220681824288",
    "estimated_delivery_at": "2019-08-24T14:15:22Z",
    "updated_at": "2019-08-24T14:15:22Z",
    "status": "in_transit"
  },
  "rate": {
    "estimated_price": 45,
    "estimated_weight": 1,
    "estimated_at": "2019-08-24T14:15:22Z",
    "actual_price": 45,
    "actual_weight": 1,
    "heavy_load_fee": 150
  },
  "direction": "outgoing",
  "source": "api",
  "async": false,
  "create_invoice": false,
  "shipped_at": "2019-08-24T14:15:22Z",
  "delivered_at": "2019-08-24T14:15:22Z",
  "created_at": "2019-08-24T14:15:22Z",
  "updated_at": "2019-08-24T14:15:22Z",
  "deleted_at": "2019-08-24T14:15:22Z"
}

{
  "success": false,
  "meta": {
    "status": 400,
    "code": "INVALID_INPUT",
    "message": "Gönderdiğiniz verilerde bir sorun var.",
    "details": [
      {
        "field": "name",
        "error": "cannot be blank"
      }
    ]
  }
}
{
  "success": true,
  "meta": {
    "status": 200,
    "code": "NOT_FOUND",
    "message": "orders successfully received",
    "total": 100,
    "details": [
      {
        "field": "name",
        "error": "cannot be blank"
      }
    ]
  }
}
{
  "success": true,
  "meta": {
    "status": 200,
    "code": "NOT_FOUND",
    "message": "orders successfully received",
    "total": 100,
    "details": [
      {
        "field": "name",
        "error": "cannot be blank"
      }
    ]
  }
}

Gönderi getir

ID'si verilen gönderi bilgilerini getirir.

GET
/shipments/{shipment_id}
AuthorizationBearer <token>

Authenticate using the access_token obtained from POST /token.

Format: Authorization: Bearer {access_token}

In: header

Path Parameters

shipment_idstring

Shipment ID

Formatuuid

Response Body

application/json

curl -X GET "https://api.shipink.io/shipments/17ebb574-f53f-43c2-bcf6-8984f7fc100b"
{
  "id": "17ebb574-f53f-43c2-bcf6-8984f7fc100b",
  "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5",
  "order_id": "Nc220IyHvpV_",
  "carrier": {
    "shipment_id": "507855220681824288",
    "tracking_url": "https://kargo.aras.com.tr/track/507855220681824288",
    "invoice_id": "",
    "waybill_id": "",
    "carrier_id": "aras",
    "carrier_service_id": "aras_standart",
    "carrier_account_id": "efd4158f-75ca-4922-b8cc-c27e209db7e1",
    "shipment_type": "outgoing",
    "language": "tr",
    "settings": {
      "system_account": true,
      "denominator": 0,
      "is_marketplace": true,
      "label_id_range": "string",
      "label_support": true,
      "return_support": true,
      "payment_type": {
        "sender": true,
        "recipient": true,
        "cod_cash": true,
        "cod_credit": true
      }
    }
  },
  "content": "",
  "language": "tr",
  "note": "",
  "packages": [
    {
      "weight": 1,
      "weight_unit": "kg",
      "length": 20,
      "width": 15,
      "height": 10,
      "dimension_unit": "cm"
    }
  ],
  "sender": {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "name": "Ahmet Yılmaz",
    "tax_id": "",
    "tax_office": "",
    "company": "",
    "email": {
      "main": "user@example.com",
      "work": ""
    },
    "phone": {
      "main": "905321234567",
      "work": "",
      "cell": "",
      "code": ""
    },
    "address": {
      "street": "Example Street No:1",
      "city": "Maltepe",
      "city_code": "TR-34-108146",
      "state": "İstanbul",
      "state_code": "TR-34",
      "zip": "34857",
      "country": "Turkey",
      "country_code": "TR",
      "tax_id": "",
      "external_id": null,
      "status": ""
    },
    "return_address": {
      "street": "Example Street No:1",
      "city": "Maltepe",
      "city_code": "TR-34-108146",
      "state": "İstanbul",
      "state_code": "TR-34",
      "zip": "34857",
      "country": "Turkey",
      "country_code": "TR",
      "tax_id": "",
      "external_id": null,
      "status": ""
    }
  },
  "recipient": {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "name": "Ahmet Yılmaz",
    "tax_id": "",
    "tax_office": "",
    "company": "",
    "email": {
      "main": "user@example.com",
      "work": ""
    },
    "phone": {
      "main": "905321234567",
      "work": "",
      "cell": "",
      "code": ""
    },
    "address": {
      "street": "Example Street No:1",
      "city": "Maltepe",
      "city_code": "TR-34-108146",
      "state": "İstanbul",
      "state_code": "TR-34",
      "zip": "34857",
      "country": "Turkey",
      "country_code": "TR",
      "tax_id": "",
      "external_id": null,
      "status": ""
    },
    "return_address": {
      "street": "Example Street No:1",
      "city": "Maltepe",
      "city_code": "TR-34-108146",
      "state": "İstanbul",
      "state_code": "TR-34",
      "zip": "34857",
      "country": "Turkey",
      "country_code": "TR",
      "tax_id": "",
      "external_id": null,
      "status": ""
    }
  },
  "items": [
    {
      "id": "string",
      "name": "Product Name",
      "category": "gadget",
      "quantity": 1,
      "unit_price": 500.9,
      "origin": "TR",
      "hs_code": "",
      "sku": "",
      "weight": 0.5,
      "dimensions": {
        "length": 0,
        "width": 0,
        "height": 0
      }
    }
  ],
  "payment": {
    "currency": "TRY",
    "amount": 599.8,
    "type": "CODCash"
  },
  "customs": {},
  "extras": {
    "signature_confirmation": "",
    "just_document": false,
    "address_validation": false,
    "night_delivery": false,
    "saturday_delivery": false,
    "has_alcohol": false,
    "carbon_neutral": false
  },
  "document": {
    "labels": [
      {
        "id": "string",
        "process": "ready",
        "ready_at": "2019-08-24T14:15:22Z",
        "pdf": "https://access.shipink.io/document/label-7290012345678-normalA4.pdf?token=a0b1c2d3-0000-0000-0000-000011112222",
        "png": "http://example.com",
        "zpl": "http://example.com"
      }
    ],
    "customs_declaration": {
      "url": "http://example.com"
    },
    "sales_invoice": {
      "id": "inv_abc123",
      "no": "EFA2024001",
      "date": "2024-03-15T13:21:08Z",
      "url": "https://example.com/invoice.pdf"
    },
    "proforma": {}
  },
  "tracking": {
    "id": "track_abc123",
    "url": "https://kargo.aras.com.tr/track/507855220681824288",
    "estimated_delivery_at": "2019-08-24T14:15:22Z",
    "updated_at": "2019-08-24T14:15:22Z",
    "status": "in_transit"
  },
  "rate": {
    "estimated_price": 45,
    "estimated_weight": 1,
    "estimated_at": "2019-08-24T14:15:22Z",
    "actual_price": 45,
    "actual_weight": 1,
    "heavy_load_fee": 150
  },
  "direction": "outgoing",
  "source": "api",
  "async": false,
  "create_invoice": false,
  "shipped_at": "2019-08-24T14:15:22Z",
  "delivered_at": "2019-08-24T14:15:22Z",
  "created_at": "2019-08-24T14:15:22Z",
  "updated_at": "2019-08-24T14:15:22Z",
  "deleted_at": "2019-08-24T14:15:22Z"
}
Empty

Gönderi sil

Verilen ID'ye sahip gönderiyi siler.

DELETE
/shipments/{shipment_id}
AuthorizationBearer <token>

Authenticate using the access_token obtained from POST /token.

Format: Authorization: Bearer {access_token}

In: header

Path Parameters

shipment_idstring

Shipment ID

Formatuuid

Response Body

application/json

curl -X DELETE "https://api.shipink.io/shipments/17ebb574-f53f-43c2-bcf6-8984f7fc100b"
{
  "success": true,
  "meta": {
    "status": 200,
    "code": "NOT_FOUND",
    "message": "orders successfully received",
    "total": 100,
    "details": [
      {
        "field": "name",
        "error": "cannot be blank"
      }
    ]
  }
}

Bu içerik nasıl?