Trucker - dokumentacja API

Transkrypt

Trucker - dokumentacja API
Trucker dokumentacja API
Trucker - dokumentacja API
2
Spis treści
Historia zmian w dokumentacji ............................................................................................................... 3
1
Dostęp do API – Adres URL do Web Services (SOAP/WSDL) .......................................... 3
2.1
2
4
Środowisko testowe ............................................................................................................... 3
Dostępne metody ...................................................................................................................... 4
3.1
Metoda GetAvailableServices ............................................................................................ 4
3.2
Metoda CreateShipment ..................................................................................................... 4
3.3
Metoda CancelShipment .................................................................................................... 4
3.4
Metoda GetLabel ................................................................................................................. 5
3.5
Metoda GetManifest ............................................................................................................ 5
3.6
Metoda CallPickup ............................................................................................................... 5
3.7
Metoda GetTracking ............................................................................................................ 5
Opis struktur wykorzystanych w API ....................................................................................... 7
4.1
Struktura: tns:AuthToken ....................................................................................................... 7
4.2
Struktura ShipmentRequest .................................................................................................. 7
4.3
Struktura: tns: CreateShipmentResponse ........................................................................... 7
4.4
Struktura: tns:GetAvailableServicesRequest ...................................................................... 7
4.5
Struktura: tns: Location.......................................................................................................... 8
4.6
Struktura: tns: Parcel .............................................................................................................. 8
4.7
Struktura: tns: COD ................................................................................................................ 8
4.8
Struktura: tns: AdditionalService .......................................................................................... 8
4.9
Struktura: tns: Service ............................................................................................................ 9
4.10
Struktura: tns: Label ............................................................................................................... 9
4.11
Struktura: tns: CancelShipmentRequest ............................................................................. 9
4.12
Struktura: tns: CancelShipmentResponse ........................................................................... 9
4.13
Struktura: tns: GetLabelRequest .......................................................................................... 9
4.14
Struktura: tns: GetLabelResponse ........................................................................................ 9
4.15
Struktura: tns: GetManifestRequest ..................................................................................... 9
4.16
Struktura: tns: GetManifestResponse................................................................................. 10
4.17
Struktura: tns: CallPickupRequest ...................................................................................... 10
4.18
Struktura: tns: CallPickupResponse .................................................................................... 10
4.19
Struktura: tns: Tracking ........................................................................................................ 10
4.20
Struktura: tns:OrderStatus ................................................................................................... 10
5 Kody błędów ................................................................................................................................. 11
6 Dodatkowe informacje i kontakt ............................................................................................. 12
OpenNet.pl
Trucker - dokumentacja API
3
Historia zmian w dokumentacji
Wersja
Data
1.00
11-12-2013
Opis zmiany
Utworzenie dokumentacji
1 Dostęp do API – Adres URL do Web Services (SOAP/WSDL)
2.1
Środowisko testowe
Produkcyjny Web Service SOAP jest dostępny pod adresem :

http://api.inpost.opennet.pl/
WSDL dostępny jest pod adresem:

http://api.inpost.opennet.pl/api.asmx?WSDL
Login testowy: demo
Hasło: demo
Numer klienta: 113367
Środowisko produkcyjne dostępne jest pod linkiem:
http://api-kurier.inpost.pl/api/api.asmx
OpenNet.pl
Trucker - dokumentacja API
4
2 Dostępne metody
3.1
Metoda GetAvailableServices
Metoda służy do pobrania listy dostępnych serwisów
parametr
typ parametru
opis
token
tns:AuthToken
Obiekt zawierający dane dostępowe
GetAvailableServicesRequest
tns:GetAvailableServicesRequest
Obiekt zawierający dane przesyłki
Wynik:
Typ
opis
GetAvailableServicesResponse
Obiekt zawierający informację o dostępnych usługach
3.2
Metoda CreateShipment
Metoda służy do utworzenia nowej przesyłki
parametr
typ parametru
opis
token
tns:AuthToken
Obiekt zawierający dane dostępowe
ShipmentRequest
tns:ShipmentRequest
Obiekt zawierający dane przesyłki
Wynik:
typ
opis
tns: CreateShipmentResponse
Tablica obiektów CreateShipmentResponse
3.3
Metoda CancelShipment
Metoda służy do anulowania zlecenia
parametr
typ parametru
opis
token
tns:AuthToken
Obiekt zawierający dane dostępowe
CancelShipmentRequest
Tns: CancelShipmentRequest
Obiekt zawierający tablice numerów przesyłek
Wynik:
typ
opis
tns: CancelShipmentResponse
Tablica obiektów CancelShipmentResponse
OpenNet.pl
Trucker - dokumentacja API
5
3.4
Metoda GetLabel
Metoda służy do pobrania wcześniej wygenerowanej etykiety
parametr
typ parametru
opis
token
tns:AuthToken
Obiekt zawierający dane dostępowe
GetLabelRequest
tns:GetLabelRequest
Obiekt zawierający tablice numerów przesyłek
Wynik:
typ
opis
tns: GetLabelResponse
Tablica obiektów GetLabelResponse
3.5
Metoda GetManifest
Metoda służy do pobrania manifestu nadania przesyłek
parametr
typ parametru
opis
token
tns:AuthToken
Obiekt zawierający dane dostępowe
GetManifestRequest
tns:
GetManifestRequest
Obiekt zawierający tablice numerów przesyłek dla których wygenerowany ma
zostać manifest
Wynik:
typ
opis
tns: GetManifestResponse
Tablica obiektów GetManifestResponse
3.6
Metoda CallPickup
Metoda służy do zamawiania podjazdu kuriera
parametr
typ parametru
opis
AuthToken
tns:AuthToken
Obiekt zawierający dane dostępowe
CallPickupRequest
tns: CallPickupRequest
Obiekt zawierający dane o zamawianym podjeździe kuriera
Wynik:
typ
opis
tns: CallPickupResponse
Tablica obiektów CallPickupResponse – opis struktury obiektu w rozdziale 4.18
3.7
Metoda GetTracking
Metoda służy do pobrania statusu przesyłki
parametr
typ
parametru
opis
OpenNet.pl
Trucker - dokumentacja API
6
AuthToken
tns:AuthToken
Obiekt zawierający dane dostępowe
PackageNo
s:string
Numer paczki
Wynik:
typ
opis
tns: GetTrackingResponse
Tablica obiektów Tracking
Z komentarzem [LG1]: Sam obiekt, nie tablica!!!
OpenNet.pl
Trucker - dokumentacja API
7
4 Opis struktur wykorzystanych w API
4.1
Struktura: tns:AuthToken
pole
typ
opis
Czy pole
obowiązkowe
UserName
xsd:string
Login partnera
TAK
Password
xsd:string
Hasło partnera
TAK
4.2
Struktura ShipmentRequest
pole
typ
opis
Czy pole
obowiązkowe
ServiceId
xsd:string
ID wybranej usługi
TAK
ShipFrom
tns:Location
TAK
ShipTo
tns:Location
Parcels
tns:Parcel[]
Obiekt typu Location zawierający dane
nadawcy
Obiekt typu Location zawierający dane
odbiorcy
Tablica obiektu Parcel
COD
tns:COD
TAK
InsuranceAmount
xsd:decimal
AdditionalServices
tns: AdditionalService[]
Obiekt typu COD zawierający informacje o
pobraniu
Wartość ubezpieczenia w ZŁOTÓWKI
Domyślnie: 0
Tablica obiektów AdditionalService
LabelFormat
tns:LabelImageFormat
TAK
LoyaltyCardNo
xsd:string
Format etykiety – może przyjąć
następujące wartości: GIF, EPL, PDF,
PDFA4 (etykieta w formacie A4),
PDF_DOUBLE (etykieta 10x15, podwójna)
Domyślnie: PDF
Numer karty (program lojalnościowy)
RebateCoupon
xsd:string
Kod kuponu rabatowego
NIE
ContentDescription
xsd:string
Opis zawartości
TAK
MPK
xsd:string
MPK
NIE
ReferenceNumber
xsd:string
Numer referencyjny
NIE
4.3
TAK
TAK
Z komentarzem [LG2]: Zmiana MC
NIE
NIE
Struktura: tns: CreateShipmentResponse
pole
typ
opis
PackageNo
xsd:string
Główny numer przesyłki
ParcelData
tns: Label[]
Tablica obiektów Label
responseCode
Xsd:int
Kod błedu
responseDescription
Xsd:string
Opis błedu
4.4
TAK
Struktura: tns:GetAvailableServicesRequest
pole
typ
opis
Czy pole
obowiązkowe
ReadyDate
xsd:dateTime
TAK
ShipFrom
tns:Location
ShipTo
tns:Location
Data gotowości podjęcia przesyłki przez
kuriera
Obiekt typu Location zawierający dane
nadawcy
Obiekt typu Location zawierający dane
odbiorcy
TAK
TAK
OpenNet.pl
Trucker - dokumentacja API
8
Parcels
tns:Parcel[]
Tablica obiektu Parcel
TAK
COD
tns:COD
TAK
InsuranceAmount
xsd:decimal
Obiekt typu COD zawierający informacje o
pobraniu
Wartość ubezpieczenia w ZŁOTÓWKI
AdditionalServices
tns: AdditionalService[]
Tablica obiektów AdditionalService
NIE
4.5
TAK
Z komentarzem [LG3]: Zmiana MC
Struktura: tns: Location
pole
typ
opis
Czy pole
obowiązkowe
PointId
xsd:string
ID punktu odbioru
NIE
Name
xsd:string
Nazwa
TAK
Address
xsd:string
Adres
TAK
City
xsd:string
Miasto
TAK
PostCode
xsd:string
Kod pocztowy
TAK
CountryCode
xsd:string
Kod kraju, zgodny z normą ISO 3166-2
TAK
Person
xsd:string
Imię i nazwisko
TAK
Contact
xsd:string
Telefon
TAK
Email
xsd:string
Adres email
TAK
IsPrivatePerson
xsd:boolean
Adres prywatny
TAK
4.6
Struktura: tns: Parcel
pole
typ
opis
Czy pole
obowiązkowe
Type
tns:ParcelType
TAK
Weight
xsd:decimal
Rodzaj opakowania. Możliwe wartości:
etykieta (Envelope), paczka (Package) i
paleta (Palette)
Waga przesyłki
D
xsd:decimal
Długość przesyłki
NIE
W
xsd:decimal
Wysokość przesyłki
NIE
S
xsd:decimal
Szerokość przesyłki
NIE
4.7
TAK
Struktura: tns: COD
pole
typ
opis
Czy pole
obowiązkowe
Amount
xsd:decimal
Kwota pobrania w groszach
TAK
RetAccountNo
xsd:decimal
Numer konta do zwrotu pobrania
TAK
4.8
Struktura: tns: AdditionalService
pole
typ
opis
Czy pole
obowiązkowe
Code
xsd:string
ID usługi dodatkowej
TAK
Z komentarzem [LG4]: POPRAWKA
OpenNet.pl
Trucker - dokumentacja API
9
4.9
Struktura: tns: Service
Z komentarzem [LG5]: Usunięto ceny.
pole
typ
opis
ID
xsd:int
ID dostępnego serwisu
Name
xsd:string
Nazwa dostępnego serwisu
4.10 Struktura: tns: Label
pole
typ
opis
ParcelID
xsd:string
Numer paczki
MimeFormat
tns:LabelImageFormat
MimeData
xsd: base64Binary
Format etykiety – może przyjąć następujące wartości: GIF, EPL, PDF,
PDFA4 (etykieta w formacie A4), PDF_DOUBLE (etykieta 10x15, dwie
strony)
Etykieta
4.11 Struktura: tns: CancelShipmentRequest
pole
typ
opis
Czy pole
obowiązkowe
PackageNo
xsd:string[]
Tablica numerów przesyłek
TAK
4.12 Struktura: tns: CancelShipmentResponse
pole
typ
opis
responseCode
Xsd:int
Kod błedu
responseDescription
Xsd:string
Opis błedu
4.13 Struktura: tns: GetLabelRequest
pole
typ
opis
Czy pole
obowiązkowe
PackageNo
xsd:string[]
Tablica numerów przesyłek
TAK
4.14 Struktura: tns: GetLabelResponse
pole
typ
opis
PackageNo
xsd:string
Numer przesyłki
MimeFormat
xsd:string
MimeData
xsd: base64Binary
Format etykiety – może przyjąć następujące wartości: GIF, EPL, PDF,
PDFA4 (etykieta w formacie A4), PDF_DOUBLE (etykieta 10x15,
podwójna)
Etykieta
responseCode
Xsd:int
Kod błedu
responseDescription
Xsd:string
Opis błedu
4.15 Struktura: tns: GetManifestRequest
pole
typ
opis
Czy pole
obowiązkowe
PackageNo
xsd:string[]
Tablica numerów przesyłek
TAK
OpenNet.pl
Trucker - dokumentacja API
10
4.16 Struktura: tns: GetManifestResponse
pole
typ
opis
ManifestNo
xsd:string
Numer przesyłki
MimeFormat
xsd:string
Format manifestu
MimeData
xsd: base64Binary
Manifest
responseCode
Xsd:int
Kod błedu
responseDescription
Xsd:string
Opis błedu
4.17 Struktura: tns: CallPickupRequest
pole
typ
opis
Czy pole
obowiązkowe
PickupLocation
Tns:Location
Adres miejsca odbioru przesyłek
TAK
ReadyDate
xsd: dateTime
TAK
MaxPickupDate
xsd: dateTime
PackageNo
xsd:string[]
Data i godzina początku gotowości paczki do
pojęcia
Data i godzina końca gotowości paczki do
pojęcia
Tablica numerów przesyłek
TotalWeight
Xsd:decimal
Łączna waga wszystkich przesyłek
TAK
TAK
TAK
4.18 Struktura: tns: CallPickupResponse
pole
typ
opis
responseCode
Xsd:int
Kod błedu
responseDescription
Xsd:string
Opis błedu
4.19 Struktura: tns: Tracking
Z komentarzem [LG6]: MC: usunięcie pól person
pole
typ
Opis
Status
tns:ArrayOfOrderStatus
Status
DatePicked
xsd: dateTime
Data odebrania przesyłki od nadawcy
DateDelivered
xsd: dateTime
Data odebrania przesyłki na stacji
CurrentStatus
tns:OrderStatus
Aktualny status przesyłki
responseCode
Xsd:int
Kod błędu
responseDescription
Xsd:string
Opis błędu
4.20 Struktura: tns:OrderStatus
pole
typ
Opis
PackageNo
Xsd:String
Numer paczki
Code
xsd:string
Kod statusu
Description
xsd:string
Opis statusu
DescriptionEN
xsd: string
Opis statusu w j. angielskim
EventTimestamp
xsd: dateTime
Data statusu
EventParam
tns:string
Parametr statusu (np. miasto gdzie status się wydarzył)
OpenNet.pl
Trucker - dokumentacja API
11
5 Kody błędów
Kod błedu
-1
0
500
401
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
Opis błędu
External error
Success
Unknown Error
Athentication failed
Package (s) not found
Invalid Insurance amount must be greater or equal to COD amount
Invalid Insurance amount cannot be greater than
+Validation.MAX_INSURANCE_AMOUNT
Invalid COD amount cannot be greater than +
Validation.MAX_COD_AMOUNT
Point with specified PointId was not found
The selected ServiceId is unknown/unsupported
Invalid ReadyDate date should be at least equal to Today
Field ShipTo->Name is required
Field ShipTo->Address is required
Field ShipTo->City is required
Field ShipTo->PostCode is required
Field ShipTo->CountryCode is required
Field ShipTo->Email is required
Field ShipTo->Contact is required
Field ShipTo->Person is required
ShipTo section is required
ShipTo CountryCode is invalid
Field ShipFrom->Name is required
Field ShipFrom->Address is required
Field ShipFrom->City is required
Field ShipFrom->PostCode is required
Field ShipFrom->CountryCode is required
Field ShipFrom->Email is required
Field ShipFrom->Contact is required
Field ShipFrom->Person is required
ShipFrom section is required
ShipFrom CountryCode is invalid
Missing Parcels data
Sum of Parcels must be greater that 0
Maximum weight of single Parcel (Type=Package) is 70kg
Maximum weight of single Parcel (Type=Envelope) is 1kg
Maximum weight of single Parcel (Type=Pallette) is 700kg
Requested label image format is not supported for selected ServiceId
Requested ServiceId is not available/unknown
Permission denied
Carrier denied to cancel package(s)
OpenNet.pl
Trucker - dokumentacja API
12
1036
Only one parcel is allowed per shipment
6 Dodatkowe informacje i kontakt
Odpowiedzi na wszelkie pytania oraz dodatkowe informacje uzyskać można
kontaktując się z nami:
Wsparcie techniczne:
[email protected]
OpenNet.pl

Podobne dokumenty