Allegro REST API

gdzie?

Polska | polski | PLN
  • Pierwsze kroki
  • Informacje podstawowe
  • Główne procesy
  • Uwierzytelnianie i autoryzacja
  • Wzorzec Command
  • Glosariusz
  • Lista metod
  • Wystawianie oferty produktu
  • Serwisy zagraniczne Allegro
  • Zarządzanie ofertami
  • Oferty wielowariantowe
  • Pasuje do
  • Zarządzanie zgłoszeniami ofert do kampanii
  • Rabaty i promocje
  • Zamówienia
  • Wysyłam z Allegro
  • One Fulfillment by Allegro
  • Dyskusje
  • Konto i dane użytkownika
  • Centrum wiadomości
  • Sprawdzanie opłat
  • Wystawianie ogłoszeń
  • Publiczne oferty
FAQ
  • Aktualności
  • Changelog
Dokumentacja
Regulamin
Kontakt
  • Moje aplikacje
  • Moje aplikacje (sandbox)
  • Newsletter
  • API Status
  1. Allegro REST API
  2. Aktualności
  3. Nowe zasoby - Zarządzaj cennikami dostawy

14 sierpnia 2018

Nowe zasoby - Zarządzaj cennikami dostawy

Udostępniliśmy zasoby, dzięki którym możesz zarządzać cennikami dostawy na koncie zautoryzowanego sprzedawcy i w jego ofertach.

Ważne!

  • Wymagamy cennika dostawy, gdy wystawiasz nową ofertę przez REST API
  • Nie wymagamy cennika dostawy, gdy wznawiasz lub modyfikujesz ofertę przez REST API. Jest to rozwiązanie tymczasowe - w pierwszej połowie przyszłego roku będziemy wymagać cennika dostawy również przy wznawianiu i edycji oferty.

Dodaliśmy odpowiednie informacje w naszym poradniku.

Dla cenników dostawy przygotowaliśmy następujące zasoby:

  • GET /sale/delivery-methods - chcę pobrać identyfikatory i nazwy metod dostawy, które są dostępne w Allegro.
  • GET /sale/shipping-rates?seller.id={Seller_ID} - chcę pobrać listę cenników dostawy danego sprzedawcy.
  • GET /sale/shipping-rates/{shippingRatesId} - chcę pobrać szczegółowe informacje o danym cenniku dostawy.
  • POST /sale/shipping-rates - chcę utworzyć nowy cennik dostawy.
  • PUT /sale/shipping-rates/{shippingRatesId} - chcę zmodyfikować istniejący cennik dostawy.

GET /sale/delivery-methods

Ten zasób pozwoli ci pobrać identyfikatory i nazwy metod dostawy, które są dostępne w Allegro.

Przykładowy request:

curl -X GET \
https://api.allegro.pl/sale/delivery-methods \
-H 'Authorization: Bearer {token}' \
-H 'accept: application/vnd.allegro.public.v1+json'

Przykładowy response:

{"deliveryMethods": [{
"id": "7203cb90-864c-4cda-bf08-dc883f0c78ad",   -- ogólny identyfikator danej metody dostawy
"name": "Przesyłka kurierska"                    -- ogólna nazwa danej metody dostawy
},{
"id": "758fcd59-fbfa-4453-ae07-4800d72c2ca5",
"name": "List polecony priorytetowy"
},
.
.
.
{
"id": "1fa56f79-4b6a-4821-a6f2-ca9c16d5c925",
"name": "Inny sposób dostawy"
}]}

GET /sale/shipping-rates?seller.id={Seller_ID}

Ten zasób pozwoli ci, jako zalogowanemu sprzedawcy, pobrać listę cenników dostawy tego sprzedawcy.

Przykładowy request:

curl -X GET \
'https://api.allegro.pl/sale/shipping-rates?seller.id={Seller_ID}' \
-H 'Accept: application/vnd.allegro.public.v1+json' \
-H 'Authorization: Bearer {token}' \
-H 'content-type: application/vnd.allegro.public.v1+json'

Przykładowy response:

{"shippingRates":[{
"id": "fde5853c-01ce-4991-a4b3-994c1a4a408e",    -- identyfikator danego cennika dostaw
"name": "Cennik dostawy dla elektroniki"        -- nazwa danego cennika dostaw
},{
"id": "64d7218b-cb3b-448a-9cdd-760a1eb76eb8",
"name": "Cennik dostawy dla małegro AGD"
},{
"id": "41b8e54f-dddd-4e48-ab17-dd941ade2116",
"name": "Cennik dostawy dla promocji świątecznej"
}]}

GET /sale/shipping-rates/{shippingRatesId}

Ten zasób pozwoli ci, jako zalogowanemu sprzedawcy, pobrać szczegółowe informacje o cenniku dostawy o danym identyfikatorze {shippingRatesId}.

Przykładowy request:

curl -X GET \
https://api.allegro.pl/sale/shipping-rates/fde5853c-01ce-4991-a4b3-994c1a4a408e\
-H 'Accept: application/vnd.allegro.beta.v1+json' \
-H 'Authorization: Bearer {token}' \
-H 'content-type: application/vnd.allegro.beta.v1+json'

Przykładowy response:

{
"id": "fde5853c-01ce-4991-a4b3-994c1a4a408e",                    -- identyfikator 
                                                                danego cennika dostaw
"name": "Cennik dostawy dla elektroniki",                        -- nazwa 
                                                                danego cennika dostaw
{
    "id": "ed1645ab-0895-4010-bd85-bb5d92ab0d83",
    "name": "Cennik dostawy test API 1",
    "rates": [
        {
            "deliveryMethod": {
                "id": "9081532b-5ad3-467d-80bc-9252982e9dd8"    -- identyfikator 
                                                                danej metody dostawy
            },
            "maxQuantityPerPackage": 1,                            -- liczba w paczce
            "firstItemRate": {                                    -- cena przesyłki
                "amount": "10.95",
                "currency": "PLN"
            },
            "nextItemRate": {                                    -- cena kolejnej sztuki
                "amount": "0.00",
                "currency": "PLN"
            },
            "shippingTime": {                                    -- czas dostawy, 
                "from": "PT72H",                                wielokrotność 24H, 
                "to": "PT120H"                                    zgodnie z formatem [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601#Durations)
            }                                

        },
        {
            "deliveryMethod": {
                "id": "574d1c9e-9903-4626-903f-f72441d520d5"
            },
            "maxQuantityPerPackage": 1,
            "firstItemRate": {
                "amount": "8.60",
                "currency": "PLN"
            },
            "nextItemRate": {
                "amount": "0.00",
                "currency": "PLN"
            },
            "shippingTime": null
        }
    ],
    "lastModified": "2018-08-08T08:24:56.086Z"                    -- data ostatniej 
                                                                modyfikacji danego cennika
}

POST /sale/shipping-rates

Ten zasób pozwoli ci, jako zalogowanemu sprzedawcy, utworzyć nowy cennik dostawy.

Ważne! na jednym koncie możesz mieć maksymalnie 250 cenników dostawy.

Przykładowy request:

curl -X POST \
  https://api.allegro.pl/sale/shipping-rates \
  -H 'Accept: application/vnd.allegro.public.v1+json' \
  -H 'Authorization: {token}' \
  -H 'content-type: application/vnd.allegro.public.v1+json' \
  -d '{
    "name": "Nowy cennik dostawy",                                -- wymagane, nazwa 
                                                                danego cennika dostaw
    "rates": [
        {
            "deliveryMethod": {
                "id": "2488f7b7-5d1c-4d65-b85c-4cbcf253fd93"    -- wymagane, identyfikator 
                                                                danej metody dostawy
            },
            "maxQuantityPerPackage": 1,                            -- wymagane, liczba w paczce
            "firstItemRate": {                                    -- wymagane, cena przesyłki
                "amount": "7.99",
                "currency": "PLN"
            },
            "nextItemRate": {                                    -- wymagane, cena 
                                                                kolejnej sztuki
                "amount": "0.00",
                "currency": "PLN"
            },
            "shippingTime": {                                    -- wymagane, czas dostawy, 
                "from": "PT72H",                                podaj wielokrotność 24H, 
                "to": "PT120H"                                    zgodnie z formatem [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601#Durations)
            }
        },
        {
            "deliveryMethod": {
                "id": "845efe05-0c96-47c3-a8cb-aa4699c158ce"
            },
            "maxQuantityPerPackage": 10,
            "firstItemRate": {
                "amount": "12.58",
                "currency": "PLN"
            },
            "nextItemRate": {
                "amount": "12.58",
                "currency": "PLN"
            },
            "shippingTime": null
        }
    ]
}'

Przykładowy response:

{
     "id": "73491425-dea3-420b-b2bb-680310d764e4",
    "name": "Nowy cennik dostawy",                                
    "rates": [
        {
            "deliveryMethod": {
                "id": "2488f7b7-5d1c-4d65-b85c-4cbcf253fd93"
            },
            "maxQuantityPerPackage": 1,
            "firstItemRate": {
                "amount": "7.99",
                "currency": "PLN"
            },
            "nextItemRate": {
                "amount": "0.00",
                "currency": "PLN"
            },
            "shippingTime": {
                "from": "PT72H",
                "to": "PT120H"
            }
        },
        {
            "deliveryMethod": {
                "id": "845efe05-0c96-47c3-a8cb-aa4699c158ce"
            },
            "maxQuantityPerPackage": 10,
            "firstItemRate": {
                "amount": "12.58",
                "currency": "PLN"
            },
            "nextItemRate": {
                "amount": "12.58",
                "currency": "PLN"
            },
            "shippingTime": null
        }
    ],
    "lastModified": "2018-04-03T13:46:54.722Z"
}

PUT /sale/shipping-rates/{shippingRatesId}

Ten zasób pozwoli ci, jako zalogowanemu sprzedawcy, zmodyfikować cennik dostawy o danym identyfikatorze {shippingRatesId}.

Ważne! Gdy modyfikujesz cennik dostawy przekaż informacje o wszystkich metodach dostawy, które udostępniasz w danym cenniku - również o tych metodach, których nie zmieniasz. Usuniemy z cennika metody dostawy, których nie przekażesz w wywołaniu.

Przykładowy request:

curl -X PUT \
  https://api.allegro.pl/sale/shipping-rates/8f4ce5fd-13a9-484e-92cd-2365c7e0e64e \
  -H 'Accept: application/vnd.allegro.public.v1+json' \
  -H 'Authorization: Bearer {token}' \
  -H 'content-type: application/vnd.allegro.public.v1+json' \
  -d '{
    "id": "8f4ce5fd-13a9-484e-92cd-2365c7e0e64e",                -- wymagane, identyfikator 
                                                                edytowanego cennika dostaw
    "name": "Edytowany cennik dostawy",                            -- wymagane, nazwa 
                                                                edytowanego cennika dostaw
    "rates": [
        {
            "deliveryMethod": {
                "id": "2488f7b7-5d1c-4d65-b85c-4cbcf253fd93"    -- wymagane, identyfikator 
                                                                danej metody dostawy
            },
            "maxQuantityPerPackage": 1,                            -- wymagane, liczba w paczce
            "firstItemRate": {                                    -- wymagane, cena przesyłki
                "amount": "6.99",
                "currency": "PLN"
            },
            "nextItemRate": {                                    -- wymagane, cena kolejnej sztuki
                "amount": "0.00",
                "currency": "PLN"
            },
            "shippingTime": null                                -- czas dostawy, 
                                                                podaj wielokrotność 24H, 
                                                                zgodnie z formatem [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601#Durations)
        },
        {
            "deliveryMethod": {
                "id": "845efe05-0c96-47c3-a8cb-aa4699c158ce"
            },
            "maxQuantityPerPackage": 12,
            "firstItemRate": {
                "amount": "11.99",
                "currency": "PLN"
            },
            "nextItemRate": {
                "amount": "11.99",
                "currency": "PLN"
            },
            "shippingTime": {
                "from": "PT72H",
                "to": "PT120H"
            }
        }
    ]
}'

Przykładowy response:

{
    "id": "8f4ce5fd-13a9-484e-92cd-2365c7e0e64e",
    "name": "Edytowany cennik dostawy",
    "rates": [
        {
            "deliveryMethod": {
                "id": "2488f7b7-5d1c-4d65-b85c-4cbcf253fd93"
            },
            "maxQuantityPerPackage": 1,
            "firstItemRate": {
                "amount": "6.99",
                "currency": "PLN"
            },
            "nextItemRate": {
                "amount": "0.00",
                "currency": "PLN"
            },
            "shippingTime": null
        },
        {
            "deliveryMethod": {
                "id": "845efe05-0c96-47c3-a8cb-aa4699c158ce"
            },
            "maxQuantityPerPackage": 12,
            "firstItemRate": {
                "amount": "11.99",
                "currency": "PLN"
            },
            "nextItemRate": {
                "amount": "11.99",
                "currency": "PLN"
            },
            "shippingTime": {
                "from": "PT72H",
                "to": "PT120H"
            }
        }
    ],
    "lastModified": "2018-08-10T09:38:01.137+02:00"
}
Allegro

Serwisy Grupy Allegro

  • Allegro.cz
  • Allegro.sk
  • Allegro.hu
  • Mall.hr
  • Mimovrste.com
  • Onedelivery.cz
zamknij

Dostosuj ustawienia wyświetlania

ustawienia dotyczą tylko tej przeglądarki