Sipariş bilgileri ile otomatik teklif seçerek gönderi oluşturma:

  • Tek bir api isteği ile teklif arama ve gönderi oluşturma işlemlerini birlikte, peş peşe yapar.
  • Belli bir teklif kodu ön tanımlı olarak verilirse o kodla eşleşen teklifi seçer.
  • Teklif kodunun belirtilmediği durumda, teklif stratejisi (offer_strategy) olarak MIN_PRICE gönderilerek fiyatı en düşük teklifin otomatik seçilmesi sağlanabilir.
  • Sipariş id'si ve sipariş satır id'leri yerine sipariş numarası ve sipariş satır barkodları kullanılabilir.

Endpoint: /api/v1/shipping/pts/shipment/create_with_auto_selected_offer/?offer_strategy=MIN_PRICE&send_shipment=true&send_cargo_info=true (pts kısmı kullanılacak olan kargo platformuna göre güncellenecek)

Method: POST

Url Parametreleri:

  • offer_code: Önceden belirlenmiş bir offer kodu olması durumunda, api isteğinde url parametresi olarak eklendiğinde, provider'dan getirilecek teklifler içinde teklif kodu bu paramatrede verilen değerle eşit olan teklif kullanılacaktır.
  • offer_strategy: 'MIN_PRICE' gönderilirse en düşük fiyatlı teklif otomatik olarak seçilecektir. ('offer_code' gönderildiğinde 'offer_strategy' işleme alınmayacaktır.)
  • send_shipment: true gönderilirse Propars sisteminde oluşturulan shipment senkron olarak kargo platformuna aynı request içinde iletilir. true gönderilmediği durumlarda shipment Propars'ta oluştuktan sonra bu shipment'ın platforma iletilebilmesi için ikinci bir api isteği gerekecektir.
  • send_cargo_info : true gönderilirse ve send_shipment da true gönderilmiş ise; kargo platformundan takip bilgilerini senkron şekilde alabildiğimiz durumlarda takip bilgileri pazar yerine hemen iletilir, kargo platformundan takip bilgilerini asenkron olarak alabildiğimiz durumlarda ise takip bilgileri alınır alınmaz otomatik olarak pazaryerine iletilmesini sağlar. true gönderilmezse bu işlemler için bazı api istekleri yapmak gerekecektir.


Request Data:

{
"account_id":1,
"provider_key":"pts",
"destination_country":"DE",
"sale":353,
"order_number": "order-123",
"parcel":"1",
"currency":3,
"sale_items":[677],
"sale_item_barcodes": ["868123456789", "868123456791"],
"ddp":"1",
"eori_number":"12345",
"payment_type":"1",
"doc_type":"3",
"ioss_number":"IM2760000742",
"custom_invoice_number": "ABC2024012345678",
"custom_invoice_date": "2024-07-01",
"custom_invoice_pdf_url": "https://ornek.com/fatura.pdf"
}
  • account_id: Kargoyu gönderimek için kullanılacak olan kargo hesabının id'si
  • provider_key: Kargoyu gönderimek için kullanılacak olan kargo platformunun kodu
  • destination_country: Kargonun gönderileceği hedef ülke iso kodu
  • sale: Sipariş ID (boş bırakılabilir ya da sale field'i hiç gönderilmeyebilir)
  • order_number: Sipariş numarası ('sale' belirtilmediğinde zorunlu olacaktır, sipariş tespiti bu bilgi ile yapılacaktır)
  • currency: Kargo ücreti dövizinin id'si (offer'da dönülen değer kullanılabilir ya da statik kullanılabilir)
  • sale_items: Oluşturulacak olan gönderide gönderilmesi planlanan sipariş satırlarının id'lerinin listesi (boş bırakılabilir)
  • sale_item_barcodes: Oluşturulacak olan gönderide gönderilmesi planlanan sipariş satırlarının barkodlarını listesidir. 'sale_items' verilmediğinde zorunludur.
  • custom_invoice_number: Harici fatura numarası
  • custom_invoice_date: Harici fatura tarihi
  • custom_invoice_pdf_url: Harici fatura pdf url
  • ddp: Gümrük ödemesi ('0': alıcı öder, '1': satıcı öder)
  • eori_number: EORI numarası
  • payment_type: Kargo ödemesi ('1': Gönderici öder, '2': Alıcı öder, '3': Kapıda ödeme)
  • doc_type: Kargo tipi ('1': Döküman, '2': Döküman harici, '3': Mikro ihracat)
  • ioss_number: Pazaryeri IOSS numarası



Response (shipment):

{
    "id": 14,
    "mp_cargo_info_support": true,
    "can_send_mp_cargo_info": false,
    "can_send_shipment_data": true,
    "order_number": "order-123",
    "customer_name": null,
    "sale_items_detail": [
        {
            "product_name": "Sipariş satırı ürün adı",
            "product_code": "889-22-7697-665-11-9593",
            "barcode": "727-09-9954-796-85-1898",
            "quantity": 3.0,
            "price": 6700.194939
        }
    ],
    "offer_name": "PTS Flex",
    "offer_code": "L",
    "origin_country": "TR",
    "parcel": "1",
    "price": "8.2377",
    "ddp": "1",
    "eori_number": "12345",
    "ioss_number": "IM2760000742",
    "vat_number": null,
    "payment_type": "1",
    "doc_type": "3",
    "auto_send_mp_cargo_info": false,
    "create_time": "2024-07-25T17:38:00.607977Z",
    "update_time": "2024-07-25T17:38:00.607989Z",
    "uuid": "c8e9ff98-ce24-4609-a9c7-b7504e96863f",
    "shipment_provider_code": null,
    "destination_country": "DE",
    "tracking_code": null,
    "tracking_url": null,
    "carrier_name": null,
    "ticket_url": null,
    "waybill_url": null,
    "ticket_printed": false,
    "waybill_printed": false,
    "shipping_status": "PENDING",
    "sending_time": null,
    "error_message": null,
    "ticket_status": "PENDING",
    "ticket_error_message": null,
    "mp_cargo_info_id": null,
    "mp_cargo_info_status": "PENDING",
    "mp_error_message": null,
    "custom_invoice_number": "ABC2024012345678",
    "custom_invoice_date": "2024-07-01",
    "custom_invoice_pdf_url": "https://ornek.com/fatura.pdf"
    "currency": 3,
    "sale": 353,
    "mp_cargo_info_model": null,
    "account": 1,
    "warehouse": null,
    "sale_items": [
        677
    ]
}











Örnek:

En düşük fiyatlı teklif stratejisi ve sipariş numarası ve ürün barkodları kullanarak gönderi oluşturma örnek isteği:

Endpoint: /api/v1/shipping/pts/shipment/create_with_auto_selected_offer/?offer_strategy=MIN_PRICE&send_shipment=true&send_cargo_info=true

Request Data:

{
    "account_id":1,
    "provider_key":"pts",
    "destination_country":"DE",
    "order_number": "order-123",
    "parcel":"1",
    "currency":3,
    "sale_item_barcodes": ["868123456789", "868123456791"],
    "ddp":"1",
    "eori_number":"12345",
    "payment_type":"1",
    "doc_type":"3",
    "ioss_number":"IM2760000742",
    "custom_invoice_number": "ABC2024012345678",
    "custom_invoice_date": "2024-07-01",
    "custom_invoice_pdf_url": "https://ornek.com/fatura.pdf"
}