Page tree
Skip to end of metadata
Go to start of metadata

Webhook wysyła użytkownikowi informacje o zmianach statusów w przesyłce.


Aby dodać adres webhook do organizacji skorzystaj z formularza dostępnego pod linkiem: https://inpost.pl/formularz-wsparcie


Struktura

Przykładowa struktura adresu

Przekazany adres musi spełniać 2 postawowe warunki

  • poprawna budowa adresu URL
  • dostęp do zasobu, do którego kieruje wprowadzony adres URL

Przykładowa struktura adresu:

http://www.jakis-serwer.pl:8080/katalog1/katalog2/plik.xxx


gdzie:

  • http (protokół)
  • www.jakis-serwer.pl (adres)

  • 8080 (port)

  • /katalog1/katalog2/plik.xxx (ścieżka do pliku)


Zasób powinien odpowiedzieć kodem HTTP 200


Dane wysyłane w przypadku gdy przesyłka zostanie utworzona:

{
  "event_ts": "2020-03-20 15:08:06 +0100",
  "event": "shipment_confirmed",
  "organization_id": 1,
  "payload": {
    "shipment_id": 49,
    "tracking_number": null
  }
}


Dane wysłane w przypadku gdy status przesyłki uległ zmianie:

{
  "event_ts": "2020-03-20 15:08:42 +0100",
  "event": "shipment_status_changed",
  "organization_id": 1,
  "payload": {
    "shipment_id": 49,
    "status": "delivered",
    "tracking_number": null
  }
}


Dane wysyłane w przypadku gdy przesyłka zostanie utworzona w statusie offers_prepared:

{
    "event_ts": "2020-03-13 10:48:01 +0100",
    "event": "offers_prepared",
    "organization_id": 1,
    "payload": {
        "shipment_id": 349,
        "offers": [
            {
                "id": 481,
                "status": "unavailable",
                "expires_at": null,
                "rate": null,
                "currency": null,
                "additional_services": [],
                "carrier": {
                    "id": "inpost_locker",
                    "name": "InPost Paczkomaty",
                    "description": "InPost Paczkomaty - Przesyłki paczkomatowe"
                },
                "service": {
                    "id": "inpost_locker_standard_smart",
                    "name": "Paczkomatowa standardowa",
                    "description": "Przesyłka paczkomatowa standardowa"
                },
                "unavailability_reasons": [
                    {
                        "key": "allegro_email_invalid",
                        "message": "allegro_email_invalid"
                    }
                ]
            },
            {
                "id": 480,
                "status": "unavailable",
                "expires_at": null,
                "rate": null,
                "currency": null,
                "additional_services": [],
                "carrier": {
                    "id": "inpost_locker",
                    "name": "InPost Paczkomaty",
                    "description": "InPost Paczkomaty - Przesyłki paczkomatowe"
                },
                "service": {
                    "id": "inpost_locker_allegro_smart",
                    "name": "Allegro Paczkomaty24/7 InPost",
                    "description": "Przesyłka paczkomatowa Allegro Paczkomaty24/7 InPost"
                },
                "unavailability_reasons": [
                    {
                        "key": "invalid_target_point_function",
                        "message": "Invalid target point function."
                    },
                    {
                        "message": "allegro_email_invalid"
                    }
                ]
            },
            {
                "id": 479,
                "status": "available",
                "expires_at": "2020-03-13T10:53:01.852+01:00",
                "rate": null,
                "currency": "PLN",
                "additional_services": [],
                "carrier": {
                    "id": "inpost_courier",
                    "name": "InPost Kurier",
                    "description": "InPost Express - Przesyłki kurierskie"
                },
                "service": {
                    "id": "inpost_courier_c2c",
                    "name": "Kurier standard",
                    "description": "Przesyłka kurierska standardowa"
                },
                "unavailability_reasons": null
            },
            {
                "id": 478,
                "status": "available",
                "expires_at": "2020-03-13T10:53:01.674+01:00",
                "rate": null,
                "currency": "PLN",
                "additional_services": [],
                "carrier": {
                    "id": "inpost_courier",
                    "name": "InPost Kurier",
                    "description": "InPost Express - Przesyłki kurierskie"
                },
                "key": "allegro_email_invalid",
                "service": {
                    "id": "inpost_courier_local_super_express",
                    "name": "Kurier lokalny SuperExpress",
                    "description": "Przesyłka kurierska lokalna super expresowa"
                },
                "unavailability_reasons": null
            },
            {
                "id": 477,
                "status": "available",
                "expires_at": "2020-03-13T10:53:00.941+01:00",
                "rate": null,
                "currency": "PLN",
                "additional_services": [],
                "carrier": {
                    "id": "inpost_courier",
                    "name": "InPost Kurier",
                    "description": "InPost Express - Przesyłki kurierskie"
                },
                "service": {
                    "id": "inpost_courier_local_express",
                    "name": "Kurier lokalny Express",
                    "description": "Przesyłka kurierska lokalna expresowa"
                },
                "unavailability_reasons": null
            },
            {
                "id": 476,
                "status": "available",
                "expires_at": "2020-03-13T10:53:00.344+01:00",
                "rate": null,
                "currency": "PLN",
                "additional_services": [],
                "carrier": {
                    "id": "inpost_courier",
                    "name": "InPost Kurier",
                    "description": "InPost Express - Przesyłki kurierskie"
                },
                "service": {
                    "id": "inpost_courier_local_standard",
                    "name": "Kurier lokalny Standard",
                    "description": "Przesyłka kurierska lokalna standardowa"
                },
                "unavailability_reasons": null
            },
            {
                "id": 475,
                "status": "available",
                "expires_at": "2020-03-13T10:52:59.408+01:00",
                "rate": null,
                "currency": "PLN",
                "additional_services": [],
                "carrier": {
                    "id": "inpost_courier",
                    "name": "InPost Kurier",
                    "description": "InPost Express - Przesyłki kurierskie"
                },
                "service": {
                    "id": "inpost_courier_express_1700",
                    "name": "Kurier doręczenie 17:00",
                    "description": "Przesyłka kurierska z doręczeniem do godziny 17:00 następnego dnia"
                },
                "unavailability_reasons": null
            },
            {
                "id": 474,
                "status": "available",
                "expires_at": "2020-03-13T10:52:59.054+01:00",
                "rate": null,
                "currency": "PLN",
                "additional_services": [],
                "carrier": {
                    "id": "inpost_courier",
                    "name": "InPost Kurier",
                    "description": "InPost Express - Przesyłki kurierskie"
                },
                "service": {
                    "id": "inpost_courier_express_1200",
                    "name": "Kurier doręczenie 12:00",
                    "description": "Przesyłka kurierska z doręczeniem do godziny 12:00 następnego dnia"
                },
                "unavailability_reasons": null
            },
            {
                "id": 473,
                "status": "available",
                "expires_at": "2020-03-13T10:52:57.679+01:00",
                "rate": null,
                "currency": "PLN",
                "additional_services": [],
                "carrier": {
                    "id": "inpost_courier",
                    "name": "InPost Kurier",
                    "description": "InPost Express - Przesyłki kurierskie"
                },
                "service": {
                    "id": "inpost_courier_express_1000",
                    "name": "Kurier doręczenie 10:00",
                    "description": "Przesyłka kurierska z doręczeniem do godziny 10:00 następnego dnia"
                },
                "unavailability_reasons": null
            },
            {
                "id": 472,
                "status": "unavailable",
                "expires_at": null,
                "rate": null,
                "currency": null,
                "additional_services": [],
                "carrier": {
                    "id": "inpost_courier",
                    "name": "InPost Kurier",
                    "description": "InPost Express - Przesyłki kurierskie"
                },
                "service": {
                    "id": "inpost_courier_allegro",
                    "name": "Allegro Kurier24 InPost",
                    "description": "Przesyłka kurierska Allegro Kurier24 InPost"
                },
                "unavailability_reasons": [
                    {
                        "key": "parcels_size_invalid",
                        "message": "Parcel is too large or too heavy."
                    },
                    {
                        "message": "allegro_email_invalid"
                    }
                ]
            },
            {
                "id": 471,
                "status": "available",
                "expires_at": "2020-03-13T10:52:57.115+01:00",
                "rate": null,
                "currency": "PLN",
                "additional_services": [],
                "carrier": {
                    "key": "allegro_email_invalid",
                    "id": "inpost_courier",
                    "name": "InPost Kurier",
                    "description": "InPost Express - Przesyłki kurierskie"
                },
                "service": {
                    "id": "inpost_courier_standard",
                    "name": "Kurier standard",
                    "description": "Przesyłka kurierska standardowa"
                },
                "unavailability_reasons": null
            },
            {
                "id": 470,
                "status": "unavailable",
                "expires_at": null,
                "rate": null,
                "currency": null,
                "additional_services": [],
                "carrier": {
                    "id": "inpost_letter",
                    "name": "InPost Listy",
                    "description": "Inpost Letter - Przesyłki listowe"
                },
                "service": {
                    "id": "inpost_letter_allegro",
                    "name": "Allegro miniKurier24 InPost",
                    "description": "Przesyłka listowa Allegro miniKurier24 InPost"
                },
                "unavailability_reasons": [
                    {
                        "key": "parcels_size_invalid",
                        "message": "Parcel is too large or too heavy."
                    },
                    {
                        "message": "allegro_email_invalid"
                    }
                ]
            },
            {
                "id": 469,
                "status": "unavailable",
                "expires_at": null,
                "rate": null,
                "currency": null,
                "additional_services": [],
                "key": "allegro_email_invalid",
                "carrier": {
                    "id": "inpost_locker",
                    "name": "InPost Paczkomaty",
                    "description": "InPost Paczkomaty - Przesyłki paczkomatowe"
                },
                "service": {
                    "id": "inpost_locker_pass_thru",
                    "name": "Podaj dalej",
                    "description": "Przesyłka paczkomatowa Podaj Dalej"
                },
                "unavailability_reasons": [
                    {
                        "key": "dropoff_and_target_points_must_be_equal",
                        "message": "Dropoff point and target point must be equal for selected service."
                    }
                ]
            },
            {
                "id": 468,
                "status": "unavailable",
                "expires_at": null,
                "rate": null,
                "currency": null,
                "additional_services": [],
                "carrier": {
                    "id": "inpost_locker",
                    "name": "InPost Paczkomaty",
                    "description": "InPost Paczkomaty - Przesyłki paczkomatowe"
                },
                "service": {
                    "id": "inpost_locker_allegro",
                    "name": "Allegro Paczkomaty24/7 InPost",
                    "description": "Przesyłka paczkomatowa Allegro Paczkomaty24/7 InPost"
                },
                "unavailability_reasons": [
                    {
                        "key": "invalid_target_point_function",
                        "message": "Invalid target point function."
                    },
                    {
                        "message": "allegro_email_invalid"
                    }
                ]
            },
            {
                "key": "allegro_email_invalid",
                "id": 467,
                "status": "unavailable",
                "expires_at": null,
                "rate": null,
                "currency": null,
                "additional_services": [],
                "carrier": {
                    "id": "inpost_locker",
                    "name": "InPost Paczkomaty",
                    "description": "InPost Paczkomaty - Przesyłki paczkomatowe"
                },
                "service": {
                    "id": "inpost_locker_standard",
                    "name": "Paczkomatowa standardowa",
                    "description": "Przesyłka paczkomatowa standardowa"
                },
                "unavailability_reasons": [
                    {
                        "target_point": "translation missing: keys.errors.attributes.target_point.invalid"
                    }
                ]
            }
        ]
    }
}
  • No labels