diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..1ff0c42 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,63 @@ +############################################################################### +# Set default behavior to automatically normalize line endings. +############################################################################### +* text=auto + +############################################################################### +# Set default behavior for command prompt diff. +# +# This is need for earlier builds of msysgit that does not have it on by +# default for csharp files. +# Note: This is only used by command line +############################################################################### +#*.cs diff=csharp + +############################################################################### +# Set the merge driver for project and solution files +# +# Merging from the command prompt will add diff markers to the files if there +# are conflicts (Merging from VS is not affected by the settings below, in VS +# the diff markers are never inserted). Diff markers may cause the following +# file extensions to fail to load in VS. An alternative would be to treat +# these files as binary and thus will always conflict and require user +# intervention with every merge. To do so, just uncomment the entries below +############################################################################### +#*.sln merge=binary +#*.csproj merge=binary +#*.vbproj merge=binary +#*.vcxproj merge=binary +#*.vcproj merge=binary +#*.dbproj merge=binary +#*.fsproj merge=binary +#*.lsproj merge=binary +#*.wixproj merge=binary +#*.modelproj merge=binary +#*.sqlproj merge=binary +#*.wwaproj merge=binary + +############################################################################### +# behavior for image files +# +# image files are treated as binary by default. +############################################################################### +#*.jpg binary +#*.png binary +#*.gif binary + +############################################################################### +# diff behavior for common document formats +# +# Convert binary document formats to text before diffing them. This feature +# is only available from the command line. Turn it on by uncommenting the +# entries below. +############################################################################### +#*.doc diff=astextplain +#*.DOC diff=astextplain +#*.docx diff=astextplain +#*.DOCX diff=astextplain +#*.dot diff=astextplain +#*.DOT diff=astextplain +#*.pdf diff=astextplain +#*.PDF diff=astextplain +#*.rtf diff=astextplain +#*.RTF diff=astextplain diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml new file mode 100644 index 0000000..7f99b54 --- /dev/null +++ b/.github/workflows/dotnet.yml @@ -0,0 +1,61 @@ +# This workflow will build a .NET project +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net + +name: Build&Test + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +env: + PROJECT_NUNIT : 'ShippingProAPICollection.NUnitTests/ShippingProAPICollection.NUnitTests.csproj' + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Setup .NET + uses: actions/setup-dotnet@v3 + with: + dotnet-version: 8.0.x + + - name: Restore dependencies + run: dotnet restore + + - name: Build + run: dotnet build --no-restore --configuration Release + + test: + + runs-on: ubuntu-latest + needs: build + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Setup .NET + uses: actions/setup-dotnet@v3 + with: + dotnet-version: 8.0.x + + - name: Restore dependencies + run: dotnet restore + + - name: Setup Secrets + run: dotnet user-secrets init --project ${{ env.PROJECT_NUNIT }} + + - name: Add Secrets + run: dotnet user-secrets set "DHLAPIKey" ${{ secrets.DHLAPIKEY }} --project ${{ env.PROJECT_NUNIT }} + + - name: Test + run: dotnet test --no-restore + + diff --git a/.github/workflows/nuget.yml b/.github/workflows/nuget.yml new file mode 100644 index 0000000..cfc4a92 --- /dev/null +++ b/.github/workflows/nuget.yml @@ -0,0 +1,71 @@ +# This workflow will build a .NET project +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net + +name: Nuget + +on: + push: + tags: + - 'v*.*.*' + - 'v*.*.*-rc*' + - '[0-9]+.[0-9]+.[0-9]+' + - '[0-9]+.[0-9]+.[0-9]+-rc[0-9]+' + +env: + PROJECT_PATH : 'ShippingProAPICollection/ShippingProAPICollection.csproj' + PROJECT_NUNIT : 'ShippingProAPICollection.NUnitTests/ShippingProAPICollection.NUnitTests.csproj' + PACKAGE_OUTPUT_DIRECTORY: ${{ github.workspace }}/output + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Set Version Variable + if: ${{ github.ref_type == 'tag' }} + env: + TAG: ${{ github.ref_name }} + run: echo "VERSION=${TAG#v}" >> $GITHUB_ENV + + - name: Setup .NET + uses: actions/setup-dotnet@v3 + with: + dotnet-version: 8.0.x + + - name: Restore dependencies + run: dotnet restore + + - name: Build + run: dotnet build --no-restore /p:Version=$VERSION --configuration Release + + - name: Setup Secrets + run: dotnet user-secrets init --project ${{ env.PROJECT_NUNIT }} + + - name: Add Secrets + run: dotnet user-secrets set "DHLAPIKey" ${{ secrets.DHLAPIKEY }} --project ${{ env.PROJECT_NUNIT }} + + - name: Test + run: dotnet test --no-restore + + - name: Release erstellen + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref_name }} + release_name: Release ${{ github.ref_name }} + draft: false + prerelease: false + + - name: Create nuget + run: dotnet pack ${{ env.PROJECT_PATH }} --configuration Release --output ${{ env.PACKAGE_OUTPUT_DIRECTORY }} /p:Version=$VERSION + + - name: Upload nuget package + if: github.ref_type == 'tag' && startsWith(github.ref, 'refs/tags/v') + run: dotnet nuget push ${{ env.PACKAGE_OUTPUT_DIRECTORY }}/*.nupkg -k ${{ secrets.NUGETAPIKEY }} -s https://api.nuget.org/v3/index.json + + diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9491a2f --- /dev/null +++ b/.gitignore @@ -0,0 +1,363 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Ww][Ii][Nn]32/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Oo]ut/ +[Ll]og/ +[Ll]ogs/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# ASP.NET Scaffolding +ScaffoldingReadMe.txt + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Coverlet is a free, cross platform Code Coverage Tool +coverage*.json +coverage*.xml +coverage*.info + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ + +# Fody - auto-generated XML schema +FodyWeavers.xsd \ No newline at end of file diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..1f3c124 --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 Kevin Venclovas + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..df069a0 --- /dev/null +++ b/README.md @@ -0,0 +1,105 @@ +[![Build&Test](https://github.com/kevinvenclovas/ShippingProAPICollection/actions/workflows/dotnet.yml/badge.svg)](https://github.com/kevinvenclovas/ShippingProAPICollection/actions/workflows/dotnet.yml) +[![NuGet](https://img.shields.io/nuget/v/ShippingProAPICollection.svg)](https://www.nuget.org/packages/ShippingProAPICollection/) +# Shipping Pro API Collection +Welcome to our C# library, designed to integrate multiple shipping service APIs into one streamlined solution. This project provides a unified interface for GLS GLS, DHL, and DPD, simplifying the shipping process for developers and businesses. With easy integration, you can handle logistics across different carriers seamlessly. Ideal for enhancing efficiency in e-commerce and logistics operations. + + +## Provider + +- [X] GLS GLS Germany ([API Documentation](https://GLS.gls-group.eu/webservices/3_2_9/doxygen/WS-REST-API/index.html)) + - [X] Create Shipment + - [X] Cancel Shipment + +- [X] DHL Parcel Germany (2.1.8) ([API Documentation] (https://developer.dhl.com/api-reference/parcel-de-shipping-post-parcel-germany-v2#downloads-section)) + - [X] Create Shipment + - [X] Cancel Shipment + +- [X] DPD Germany (4.4) ([API Documentation] (https://esolutions.dpd.com/dokumente/ShipmentService_V4_4.pdf)) + - [X] Login (2.0) ([API Documentation] (https://esolutions.dpd.com/dokumente/LoginService_V2_0.pdf)) + - [X] Create Shipment + - [X] Cancel Shipment + +## Get Started +Before requesting shipping labels, you must first set up your specific shipping provider settings. This is achieved by injecting these settings as a singleton through dependency injection. + +To finalize the setup, register the ShippingProAPICollectionService as a scoped service in your application. + + services.AddScoped(); + ShippingProAPICollectionSettings providerSettings = new ShippingProAPICollectionSettings() + +#### GLS GLS + + GLSSettings GLSSettings = new GLSSettings() + { + // Define your desired label result format + LabelFormat = GLSLabelFormat.PDF, + + // PLEASE GET IN TOUCH WITH YOUR GLS CONTACT TO GET THE FOLLOWING INFORMATIONS + + // Api domain is the XXXXXXX part of your GLS-GLS api url => https://GLS-wbm-XXXXXXX.gls-group.eu:443/backend/rs + ApiDomain = "test01", + ContactID = "276a45fkqM", + Username = "276a45fkqM" + Password = "lXZBIF7uRccyK7Ohr64d", + }; + providerSettings.AddSettings(GLSSettings); + +#### DHL Parcel DE Shipping + + DHLSettings dhlSettings = new DHLSettings() + { + // Api domain is the XXXXXXX part of your DHL api url => https://api-XXXXXXX.dhl.com/parcel/de/shipping/v2/ + ApiDomain = "sandbox", + Password = "pass", + Username = "sandy_sandbox", + DHLShipmentProfile = "STANDARD_GRUPPENPROFIL", + InternationalAccountNumber = "33333333335301", + NationalAccountNumber = "33333333330102", + LabelPrintFormat = "910-300-410", + // Create your DHL APP here -> https://developer.dhl.com/user/apps + APIKey = "", + APILanguage = "de-DE" // en-US or de-DE + }; + providerSettings.AddSettings(dhlSettings); + +#### DPD + + DPDSettings dpdSettings = new DPDSettings() + { + // Api domain is the XXXXXXX part of your DPD api url => https://public-XXXXXXX.dpd.com/services/ShipmentService/V4_4/ + ApiDomain = "ws-stage", + APILanguage = "de_DE", // en_EN or de_DE + DepotNumber = "0191", + Username = "sandboxdpd", + Password = "xMmshh1" + }; + providerSettings.AddSettings(dpdSettings); + + +## Add multiple contract accounts +At times, you may need to utilize multiple contract accounts from the same provider. You can add multiple contracts by specifying a contract ID like this: + + // Setup first contract + DPDSettings dpdContract1Settings = new DPDSettings() + { + // Api domain is the XXXXXXX part of your DPD api url => https://public-XXXXXXX.dpd.com/services/ShipmentService/V4_4/ + ApiDomain = "ws-stage", + APILanguage = "de_DE", // en_EN or de_DE + DepotNumber = "0191", + Username = "sandboxdpd", + Password = "xMmshh1" + }; + + providerSettings.AddSettings("DPD1", dpdContract1Settings); + + // Setup second contract + DPDSettings dpdContract3Settings = new DPDSettings() + { + // Api domain is the XXXXXXX part of your DPD api url => https://public-XXXXXXX.dpd.com/services/ShipmentService/V4_4/ + ApiDomain = "ws-stage", + APILanguage = "de_DE", // en_EN or de_DE + DepotNumber = "0191", + Username = "sandboxdpd", + Password = "xMmshh1" + }; + providerSettings.AddSettings("DPD2", dpdSettings); diff --git a/ShippingProAPICollection.NUnitTests/DHLTests.cs b/ShippingProAPICollection.NUnitTests/DHLTests.cs new file mode 100644 index 0000000..c117786 --- /dev/null +++ b/ShippingProAPICollection.NUnitTests/DHLTests.cs @@ -0,0 +1,185 @@ +using Microsoft.Extensions.DependencyInjection; +using ShippingProAPICollection.Models.Entities; +using ShippingProAPICollection.Provider.DHL; +using ShippingProAPICollection.Provider.DHL.Entities; + +namespace ShippingProAPICollection.NUnitTests +{ + public class DHLTests : TestBase + { + /// + /// Create one label with 0.5 Kg + /// + /// + [Test] + public async Task CreateSingleShippingLabel() + { + ShippingProAPICollectionService shippingCollection = _serviceProvider.GetRequiredService(); + + var request = new DHLShipmentRequestModel("DHL") + { + ServiceProduct = DHLProductType.V01PAK, + Weight = 0.5f, + LabelCount = 1, + Adressline1 = "Max Mustermann", + Country = "DE", + City = "Ellwangen", + Street = "Maxstraße 10", + PostCode = "73479", + InvoiceReference = "RE-123456", + CustomerReference = "RE-123456", + Phone = "0123456789", + ServiceType = DHLServiceType.NONE, + }; + request.Validate(); + + var result = (await shippingCollection.RequestLabel(request)); + + Assert.That(result.Count() == 1); + Assert.That(result.FirstOrDefault()?.Label.Length > 0); + } + + /// + /// Create two label with each 1 Kg + /// + /// + [Test] + public async Task CreateMultipleShippingLabel() + { + ShippingProAPICollectionService shippingCollection = _serviceProvider.GetRequiredService(); + + var request = new DHLShipmentRequestModel("DHL") + { + ServiceProduct = DHLProductType.V01PAK, + Weight = 2f, + LabelCount = 2, + Adressline1 = "Max Mustermann", + Country = "DE", + City = "Ellwangen", + Street = "Maxstraße 10", + PostCode = "73479", + InvoiceReference = "RE-123456", + Phone = "0123456789", + ServiceType = DHLServiceType.NONE, + }; + request.Validate(); + + var result = (await shippingCollection.RequestLabel(request)); + + Assert.That(result.Count() == 2); + Assert.That(result.FirstOrDefault()?.Label.Length > 0); + } + + /// + /// Create label with deposit service + /// + /// + [Test] + public async Task CreateShippingLabelWithDepositService() + { + ShippingProAPICollectionService shippingCollection = _serviceProvider.GetRequiredService(); + + var request = new DHLShipmentRequestModel("DHL") + { + ServiceProduct = DHLProductType.V01PAK, + Weight = 1f, + LabelCount = 1, + Adressline1 = "Max Mustermann", + Country = "DE", + City = "Ellwangen", + Street = "Maxstraße 10", + PostCode = "73479", + InvoiceReference = "RE-123456", + Phone = "0123456789", + ServiceType = DHLServiceType.DEPOSIT, + PlaceOfDeposit = "Garden" + }; + request.Validate(); + + var result = (await shippingCollection.RequestLabel(request)); + + Assert.That(result.Count() == 1); + Assert.That(result.FirstOrDefault()?.Label.Length > 0); + } + + /// + /// Create label to postoffice + /// + /// + [Test] + public async Task CreateShippingLabelWithPostOfficeService() + { + ShippingProAPICollectionService shippingCollection = _serviceProvider.GetRequiredService(); + + var request = new DHLShipmentRequestModel("DHL") + { + ServiceProduct = DHLProductType.V01PAK, + Weight = 1f, + LabelCount = 1, + Adressline1 = "Max Mustermann", + Country = "DE", + City = "Ellwangen", + Street = "Maxstraße 10", + PostCode = "73479", + InvoiceReference = "RE-123456", + Phone = "0123456789", + ServiceType = DHLServiceType.POSTOFFICE, + PostOffice = new ShippingProAPICollection.Provider.DHL.Entities.DHLPostOfficeData() { + City = "Ellwangen", + PostCode = "73479", + PostfilialeNumber = "564", + PostNumber = "943864414", + } + }; + request.Validate(); + + var result = (await shippingCollection.RequestLabel(request)); + + Assert.That(result.Count() == 1); + Assert.That(result.FirstOrDefault()?.Label.Length > 0); + } + + /// + /// Cancel shipping label + /// + /// + [Test] + public async Task CancelShippingLabel() + { + ShippingProAPICollectionService shippingCollection = _serviceProvider.GetRequiredService(); + + var request = new DHLShipmentRequestModel("DHL") + { + ServiceProduct = DHLProductType.V01PAK, + Weight = 1f, + LabelCount = 1, + Adressline1 = "Max Mustermann", + Country = "DE", + City = "Ellwangen", + Street = "Maxstraße 10", + PostCode = "73479", + InvoiceReference = "RE-123456", + Phone = "0123456789", + ServiceType = DHLServiceType.POSTOFFICE, + PostOffice = new ShippingProAPICollection.Provider.DHL.Entities.DHLPostOfficeData() + { + City = "Ellwangen", + PostCode = "73479", + PostfilialeNumber = "564", + PostNumber = "943864414", + } + }; + request.Validate(); + + var createResult = (await shippingCollection.RequestLabel(request)); + + foreach (var label in createResult) + { + var cancelResult = (await shippingCollection.CancelLabel("DHL", label.CancelId)); + Assert.That(cancelResult == ShippingCancelResult.CANCLED); + } + + } + + } +} \ No newline at end of file diff --git a/ShippingProAPICollection.NUnitTests/DPDTests.cs b/ShippingProAPICollection.NUnitTests/DPDTests.cs new file mode 100644 index 0000000..fd6ebb4 --- /dev/null +++ b/ShippingProAPICollection.NUnitTests/DPDTests.cs @@ -0,0 +1,109 @@ +using Microsoft.Extensions.DependencyInjection; +using ShippingProAPICollection.Models.Entities; +using ShippingProAPICollection.Provider.DPD; +using ShippingProAPICollection.Provider.DPD.Entities; + +namespace ShippingProAPICollection.NUnitTests +{ + public class DPDTests : TestBase + { + + /// + /// Create one label with 0.5 Kg + /// + /// + [Test] + public async Task CreateSingleShippingLabel() + { + ShippingProAPICollectionService shippingCollection = _serviceProvider.GetRequiredService(); + + var request = new DPDShipmentRequestModel("DPD") + { + ServiceProduct = DPDProductType.CL, + Weight = 0.5f, + LabelCount = 1, + Adressline1 = "Max Mustermann", + Country = "DE", + City = "Ellwangen", + Street = "Maxstraße 10", + PostCode = "73479", + InvoiceReference = "RE-123456", + Phone = "0123456789", + ServiceType = DPDServiceType.NONE, + }; + request.Validate(); + + var result = (await shippingCollection.RequestLabel(request)); + + Assert.That(result.Count() == 1); + Assert.That(result.FirstOrDefault()?.Label.Length > 0); + } + + /// + /// Create two label with each 1 Kg + /// + /// + [Test] + public async Task CreateMultipleShippingLabel() + { + ShippingProAPICollectionService shippingCollection = _serviceProvider.GetRequiredService(); + + var request = new DPDShipmentRequestModel("DPD") + { + ServiceProduct = DPDProductType.CL, + Weight = 2f, + LabelCount = 2, + Adressline1 = "Max Mustermann", + Country = "DE", + City = "Ellwangen", + Street = "Maxstraße 10", + PostCode = "73479", + InvoiceReference = "RE-123456", + Phone = "0123456789", + ServiceType = DPDServiceType.NONE, + }; + request.Validate(); + + var result = (await shippingCollection.RequestLabel(request)); + + Assert.That(result.Count() == 2); + Assert.That(result.FirstOrDefault()?.Label.Length > 0); + } + + + /// + /// Create 2 labels with deposit service and cancel both + /// + /// + [Test] + public async Task CancelShippingLabel() + { + ShippingProAPICollectionService shippingCollection = _serviceProvider.GetRequiredService(); + + var request = new DPDShipmentRequestModel("DPD") + { + ServiceProduct = DPDProductType.CL, + Weight = 1f, + LabelCount = 1, + Adressline1 = "Max Mustermann", + Country = "DE", + City = "Ellwangen", + Street = "Maxstraße 10", + PostCode = "73479", + InvoiceReference = "RE-123456", + Phone = "0123456789", + ServiceType = DPDServiceType.NONE, + }; + request.Validate(); + + var createResult = (await shippingCollection.RequestLabel(request)); + + foreach (var label in createResult) + { + var cancelResult = (await shippingCollection.CancelLabel("DPD", label.CancelId)); + Assert.That(cancelResult == ShippingCancelResult.CANCLED); + } + + } + } +} \ No newline at end of file diff --git a/ShippingProAPICollection.NUnitTests/GLSTests.cs b/ShippingProAPICollection.NUnitTests/GLSTests.cs new file mode 100644 index 0000000..77048e7 --- /dev/null +++ b/ShippingProAPICollection.NUnitTests/GLSTests.cs @@ -0,0 +1,238 @@ +using Microsoft.Extensions.DependencyInjection; +using ShippingProAPICollection.Models.Entities; +using ShippingProAPICollection.Provider.GLS; +using ShippingProAPICollection.Provider.GLS.Entities; + +namespace ShippingProAPICollection.NUnitTests +{ + public class GLSTests : TestBase + { + /// + /// Create one label with 0.5 Kg + /// + /// + [Test] + public async Task CreateSingleShippingLabel() + { + ShippingProAPICollectionService shippingCollection = _serviceProvider.GetRequiredService(); + + var request = new GLSShipmentRequestModel("GLS") + { + ServiceProduct = GLSProductType.PARCEL, + Weight = 0.5f, + LabelCount = 1, + Adressline1 = "Max Mustermann", + Country = "DE", + City = "Ellwangen", + Street = "Maxstraße 10", + PostCode = "73479", + InvoiceReference = "RE-123456", + Phone = "0123456789", + ServiceType = GLSServiceType.NONE, + AmazonOrderId = "305-5872079-2948312", + WithEmailNotification = true, + EMail = "TEST@marketplace.amazon.de" + }; + request.Validate(); + + + var result = (await shippingCollection.RequestLabel(request)); + + Assert.That(result.Count() == 1); + Assert.That(result.FirstOrDefault()?.Label.Length > 0); + } + + /// + /// Create two label with each 1 Kg + /// + /// + [Test] + public async Task CreateMultipleShippingLabel() + { + ShippingProAPICollectionService shippingCollection = _serviceProvider.GetRequiredService(); + + var request = new GLSShipmentRequestModel("GLS") + { + ServiceProduct = GLSProductType.PARCEL, + Weight = 1f, + LabelCount = 2, + Adressline1 = "Max Mustermann", + Country = "DE", + City = "Ellwangen", + Street = "Maxstraße 10", + PostCode = "73479", + InvoiceReference = "RE-123456", + Phone = "0123456789", + ServiceType = GLSServiceType.NONE, + }; + request.Validate(); + + + var result = (await shippingCollection.RequestLabel(request)); + + Assert.That(result.Count() == 2); + Assert.That(result.FirstOrDefault()?.Label.Length > 0); + } + + /// + /// Create label with deposit service + /// + /// + [Test] + public async Task CreateShippingLabelWithDepositService() + { + ShippingProAPICollectionService shippingCollection = _serviceProvider.GetRequiredService(); + + var request = new GLSShipmentRequestModel("GLS") + { + ServiceProduct = GLSProductType.PARCEL, + Weight = 1f, + LabelCount = 1, + Adressline1 = "Max Mustermann", + Country = "DE", + City = "Ellwangen", + Street = "Maxstraße 10", + PostCode = "73479", + InvoiceReference = "RE-123456", + Phone = "0123456789", + ServiceType = GLSServiceType.DEPOSIT, + PlaceOfDeposit = "Garden" + }; + request.Validate(); + + var result = (await shippingCollection.RequestLabel(request)); + + Assert.That(result.Count() == 1); + Assert.That(result.FirstOrDefault()?.Label.Length > 0); + } + + /// + /// Create label with return service + /// + /// + [Test] + public async Task CreateShippingLabelWithReturnService() + { + ShippingProAPICollectionService shippingCollection = _serviceProvider.GetRequiredService(); + + var request = new GLSShipmentRequestModel("GLS") + { + ServiceProduct = GLSProductType.PARCEL, + Weight = 1f, + LabelCount = 1, + Adressline1 = "Max Mustermann", + Country = "DE", + City = "Ellwangen", + Street = "Maxstraße 10", + PostCode = "73479", + InvoiceReference = "RE-123456", + Phone = "0123456789", + ServiceType = GLSServiceType.SHOPRETURN, + }; + request.Validate(); + + var result = (await shippingCollection.RequestLabel(request)); + + Assert.That(result.Count() == 1); + Assert.That(result.FirstOrDefault()?.Label.Length > 0); + } + + + /// + /// Create label with return service + /// + /// + [Test] + public async Task ValidateShippingLabel() + { + ShippingProAPICollectionService shippingCollection = _serviceProvider.GetRequiredService(); + + var request = new GLSShipmentRequestModel("GLS") + { + ServiceProduct = GLSProductType.PARCEL, + Weight = 1f, + LabelCount = 1, + Adressline1 = "Max Mustermann", + Country = "DE", + City = "Ellwangen", + Street = "Maxstraße 10", + PostCode = "73479", + InvoiceReference = "RE-123456", + Phone = "0123456789", + ServiceType = GLSServiceType.SHOPRETURN, + }; + request.Validate(); + + var result = (await shippingCollection.ValidateLabel(request)); + + Assert.That(result.Success); + } + + /// + /// Create 2 labels with deposit service and cancel both + /// + /// + [Test] + public async Task CancelShippingLabel() + { + ShippingProAPICollectionService shippingCollection = _serviceProvider.GetRequiredService(); + + var request = new GLSShipmentRequestModel("GLS") + { + ServiceProduct = GLSProductType.PARCEL, + Weight = 1, + LabelCount = 2, + Adressline1 = "Max Mustermann", + Country = "DE", + City = "Ellwangen", + Street = "Maxstraße 10", + PostCode = "73479", + InvoiceReference = "RE-123456", + Phone = "0123456789", + ServiceType = GLSServiceType.DEPOSIT, + PlaceOfDeposit = "Behind the gardenhouse", + }; + request.Validate(); + + var createResult = (await shippingCollection.RequestLabel(request)); + + foreach (var label in createResult) + { + var cancelResult = (await shippingCollection.CancelLabel("GLS", label.CancelId)); + Assert.That(cancelResult == ShippingCancelResult.CANCLED); + } + + } + + /// + /// Create 2 labels with deposit service and cancel both + /// + /// + [Test] + public async Task GetEstimatedDeliveryDays() + { + ShippingProAPICollectionService shippingCollection = _serviceProvider.GetRequiredService(); + + var request = new GLSShipmentRequestModel("GLS") + { + ServiceProduct = GLSProductType.PARCEL, + Weight = 1, + LabelCount = 2, + Adressline1 = "Max Mustermann", + Country = "DE", + City = "Ellwangen", + Street = "Maxstraße 10", + PostCode = "73479", + InvoiceReference = "RE-123456", + Phone = "0123456789", + ServiceType = GLSServiceType.DEPOSIT, + PlaceOfDeposit = "Behind the gardenhouse", + }; + request.Validate(); + + var days = (await shippingCollection.GetEstimatedDeliveryDays(request)); + + } + + } +} \ No newline at end of file diff --git a/ShippingProAPICollection.NUnitTests/GlobalUsings.cs b/ShippingProAPICollection.NUnitTests/GlobalUsings.cs new file mode 100644 index 0000000..cefced4 --- /dev/null +++ b/ShippingProAPICollection.NUnitTests/GlobalUsings.cs @@ -0,0 +1 @@ +global using NUnit.Framework; \ No newline at end of file diff --git a/ShippingProAPICollection.NUnitTests/ShippingProAPICollection.NUnitTests.csproj b/ShippingProAPICollection.NUnitTests/ShippingProAPICollection.NUnitTests.csproj new file mode 100644 index 0000000..2ff1b72 --- /dev/null +++ b/ShippingProAPICollection.NUnitTests/ShippingProAPICollection.NUnitTests.csproj @@ -0,0 +1,34 @@ + + + + net8.0 + enable + enable + + false + true + afefceea-6552-4ee2-ba63-5b931fd24d78 + + + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + diff --git a/ShippingProAPICollection.NUnitTests/TestBase.cs b/ShippingProAPICollection.NUnitTests/TestBase.cs new file mode 100644 index 0000000..9c4e6e3 --- /dev/null +++ b/ShippingProAPICollection.NUnitTests/TestBase.cs @@ -0,0 +1,90 @@ +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using ShippingProAPICollection.Models; +using ShippingProAPICollection.Provider.DHL; +using ShippingProAPICollection.Provider.DPD; +using ShippingProAPICollection.Provider.GLS; +using System.Reflection; + +namespace ShippingProAPICollection.NUnitTests +{ + [TestFixture] + public class TestBase + { + protected ServiceProvider _serviceProvider; + + [OneTimeSetUp] + public void OneTimeSetUp() + { + var configuration = new ConfigurationBuilder() + .AddUserSecrets(Assembly.GetExecutingAssembly(), true) + .Build(); + + var services = new ServiceCollection(); + services.AddMemoryCache(); + + ShippingProAPIAccountSettings accountSettings = new ShippingProAPIAccountSettings() + { + Name = "Homer Simpson", + Street = "Simpsonstreet 1", + ContactName = "Maggie Simpson", + CountryIsoA2Code = "DE", + City = "Springfield", + Email = "homer@duffbeer.de", + PostCode = "73479", + Phone = "123456789" + }; + + ShippingProAPICollectionSettings providerSettings = new ShippingProAPICollectionSettings(accountSettings); + + GLSSettings GLSSettings = new GLSSettings() + { + ApiDomain = "test01", + ContactID = "276a45fkqM", + Password = "lXZBIF7uRccyK7Ohr64d", + Username = "276a45fkqM" + }; + + providerSettings.AddSettings("GLS", GLSSettings); + + DHLSettings dhlSettings = new DHLSettings() + { + ApiDomain = "sandbox", + Password = "pass", + Username = "sandy_sandbox", + DHLShipmentProfile = "STANDARD_GRUPPENPROFIL", + InternationalAccountNumber = "33333333335301", + NationalAccountNumber = "33333333330102", + LabelPrintFormat = "910-300-410", + APIKey = configuration["DHLAPIKey"], + APILanguage = "de-DE" + }; + + providerSettings.AddSettings("DHL", dhlSettings); + + DPDSettings dpdSettings = new DPDSettings() + { + ApiDomain = "ws-stage", + APILanguage = "de_DE", + DepotNumber = "0191", + Username = "sandboxdpd", + Password = "xMmshh1" + }; + + providerSettings.AddSettings("DPD", dpdSettings); + + services.AddSingleton(providerSettings); + + services.AddScoped(); + + _serviceProvider = services.BuildServiceProvider(); + } + + [OneTimeTearDown] + public void Dispose() + { + _serviceProvider.Dispose(); + } + } + +} diff --git a/ShippingProAPICollection.sln b/ShippingProAPICollection.sln new file mode 100644 index 0000000..7f71790 --- /dev/null +++ b/ShippingProAPICollection.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.7.34031.279 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ShippingProAPICollection", "ShippingProAPICollection\ShippingProAPICollection.csproj", "{AF836F6D-2E6B-48FC-A435-C4FC7B2DE812}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ShippingProAPICollection.NUnitTests", "ShippingProAPICollection.NUnitTests\ShippingProAPICollection.NUnitTests.csproj", "{60C1F811-534E-45FB-AE3F-B3E25FAD5D30}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {AF836F6D-2E6B-48FC-A435-C4FC7B2DE812}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {AF836F6D-2E6B-48FC-A435-C4FC7B2DE812}.Debug|Any CPU.Build.0 = Debug|Any CPU + {AF836F6D-2E6B-48FC-A435-C4FC7B2DE812}.Release|Any CPU.ActiveCfg = Release|Any CPU + {AF836F6D-2E6B-48FC-A435-C4FC7B2DE812}.Release|Any CPU.Build.0 = Release|Any CPU + {60C1F811-534E-45FB-AE3F-B3E25FAD5D30}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {60C1F811-534E-45FB-AE3F-B3E25FAD5D30}.Debug|Any CPU.Build.0 = Debug|Any CPU + {60C1F811-534E-45FB-AE3F-B3E25FAD5D30}.Release|Any CPU.ActiveCfg = Release|Any CPU + {60C1F811-534E-45FB-AE3F-B3E25FAD5D30}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {923632D2-5B43-46E4-B2AE-F153B44452DC} + EndGlobalSection +EndGlobal diff --git a/ShippingProAPICollection/Connected Services/DPDLoginService2_0/ConnectedService.json b/ShippingProAPICollection/Connected Services/DPDLoginService2_0/ConnectedService.json new file mode 100644 index 0000000..ad05cac --- /dev/null +++ b/ShippingProAPICollection/Connected Services/DPDLoginService2_0/ConnectedService.json @@ -0,0 +1,17 @@ +{ + "ExtendedData": { + "inputs": [ + "https://public-ws-stage.dpd.com/services/LoginService/V2_0/?wsdl" + ], + "collectionTypes": [ + "System.Array", + "System.Collections.Generic.Dictionary`2" + ], + "internalTypeAccess": true, + "namespaceMappings": [ + "*, DPDLoginService2_0" + ], + "targetFramework": "net7.0", + "typeReuseMode": "All" + } +} \ No newline at end of file diff --git a/ShippingProAPICollection/Connected Services/DPDLoginService2_0/Reference.cs b/ShippingProAPICollection/Connected Services/DPDLoginService2_0/Reference.cs new file mode 100644 index 0000000..32bad37 --- /dev/null +++ b/ShippingProAPICollection/Connected Services/DPDLoginService2_0/Reference.cs @@ -0,0 +1,299 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace DPDLoginService2_0 +{ + + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.1.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true, Namespace="http://dpd.com/common/service/types/Authentication/2.0")] + public partial class authenticationFault + { + + private string errorCodeField; + + private string errorMessageField; + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=0)] + public string errorCode + { + get + { + return this.errorCodeField; + } + set + { + this.errorCodeField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=1)] + public string errorMessage + { + get + { + return this.errorMessageField; + } + set + { + this.errorMessageField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.1.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://dpd.com/common/service/types/LoginService/2.0")] + public partial class Login + { + + private string delisIdField; + + private string customerUidField; + + private string authTokenField; + + private string depotField; + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=0)] + public string delisId + { + get + { + return this.delisIdField; + } + set + { + this.delisIdField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=1)] + public string customerUid + { + get + { + return this.customerUidField; + } + set + { + this.customerUidField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=2)] + public string authToken + { + get + { + return this.authTokenField; + } + set + { + this.authTokenField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=3)] + public string depot + { + get + { + return this.depotField; + } + set + { + this.depotField = value; + } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.1.0")] + [System.ServiceModel.ServiceContractAttribute(Namespace="http://dpd.com/common/service/LoginService/2.0", ConfigurationName="DPDLoginService2_0.LoginService")] + internal interface LoginService + { + + [System.ServiceModel.OperationContractAttribute(Action="http://dpd.com/common/service/LoginService/2.0/getAuth", ReplyAction="*")] + [System.ServiceModel.FaultContractAttribute(typeof(DPDLoginService2_0.authenticationFault), Action="http://dpd.com/common/service/LoginService/2.0/getAuth", Name="authenticationFault", Namespace="http://dpd.com/common/service/types/Authentication/2.0")] + [System.ServiceModel.XmlSerializerFormatAttribute(SupportFaults=true)] + System.Threading.Tasks.Task getAuthAsync(DPDLoginService2_0.getAuthRequest request); + } + + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.1.0")] + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] + [System.ServiceModel.MessageContractAttribute(WrapperName="getAuth", WrapperNamespace="http://dpd.com/common/service/types/LoginService/2.0", IsWrapped=true)] + internal partial class getAuthRequest + { + + [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://dpd.com/common/service/types/LoginService/2.0", Order=0)] + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] + public string delisId; + + [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://dpd.com/common/service/types/LoginService/2.0", Order=1)] + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] + public string password; + + [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://dpd.com/common/service/types/LoginService/2.0", Order=2)] + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] + public string messageLanguage; + + public getAuthRequest() + { + } + + public getAuthRequest(string delisId, string password, string messageLanguage) + { + this.delisId = delisId; + this.password = password; + this.messageLanguage = messageLanguage; + } + } + + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.1.0")] + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] + [System.ServiceModel.MessageContractAttribute(WrapperName="getAuthResponse", WrapperNamespace="http://dpd.com/common/service/types/LoginService/2.0", IsWrapped=true)] + internal partial class getAuthResponse + { + + [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://dpd.com/common/service/types/LoginService/2.0", Order=0)] + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] + public DPDLoginService2_0.Login @return; + + public getAuthResponse() + { + } + + public getAuthResponse(DPDLoginService2_0.Login @return) + { + this.@return = @return; + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.1.0")] + internal interface LoginServiceChannel : DPDLoginService2_0.LoginService, System.ServiceModel.IClientChannel + { + } + + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.1.0")] + internal partial class LoginServiceClient : System.ServiceModel.ClientBase, DPDLoginService2_0.LoginService + { + + /// + /// Implement this partial method to configure the service endpoint. + /// + /// The endpoint to configure + /// The client credentials + static partial void ConfigureEndpoint(System.ServiceModel.Description.ServiceEndpoint serviceEndpoint, System.ServiceModel.Description.ClientCredentials clientCredentials); + + public LoginServiceClient() : + base(LoginServiceClient.GetDefaultBinding(), LoginServiceClient.GetDefaultEndpointAddress()) + { + this.Endpoint.Name = EndpointConfiguration.LoginService_2_0_SOAP.ToString(); + ConfigureEndpoint(this.Endpoint, this.ClientCredentials); + } + + public LoginServiceClient(EndpointConfiguration endpointConfiguration) : + base(LoginServiceClient.GetBindingForEndpoint(endpointConfiguration), LoginServiceClient.GetEndpointAddress(endpointConfiguration)) + { + this.Endpoint.Name = endpointConfiguration.ToString(); + ConfigureEndpoint(this.Endpoint, this.ClientCredentials); + } + + public LoginServiceClient(EndpointConfiguration endpointConfiguration, string remoteAddress) : + base(LoginServiceClient.GetBindingForEndpoint(endpointConfiguration), new System.ServiceModel.EndpointAddress(remoteAddress)) + { + this.Endpoint.Name = endpointConfiguration.ToString(); + ConfigureEndpoint(this.Endpoint, this.ClientCredentials); + } + + public LoginServiceClient(EndpointConfiguration endpointConfiguration, System.ServiceModel.EndpointAddress remoteAddress) : + base(LoginServiceClient.GetBindingForEndpoint(endpointConfiguration), remoteAddress) + { + this.Endpoint.Name = endpointConfiguration.ToString(); + ConfigureEndpoint(this.Endpoint, this.ClientCredentials); + } + + public LoginServiceClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) : + base(binding, remoteAddress) + { + } + + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] + System.Threading.Tasks.Task DPDLoginService2_0.LoginService.getAuthAsync(DPDLoginService2_0.getAuthRequest request) + { + return base.Channel.getAuthAsync(request); + } + + public System.Threading.Tasks.Task getAuthAsync(string delisId, string password, string messageLanguage) + { + DPDLoginService2_0.getAuthRequest inValue = new DPDLoginService2_0.getAuthRequest(); + inValue.delisId = delisId; + inValue.password = password; + inValue.messageLanguage = messageLanguage; + return ((DPDLoginService2_0.LoginService)(this)).getAuthAsync(inValue); + } + + public virtual System.Threading.Tasks.Task OpenAsync() + { + return System.Threading.Tasks.Task.Factory.FromAsync(((System.ServiceModel.ICommunicationObject)(this)).BeginOpen(null, null), new System.Action(((System.ServiceModel.ICommunicationObject)(this)).EndOpen)); + } + + private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(EndpointConfiguration endpointConfiguration) + { + if ((endpointConfiguration == EndpointConfiguration.LoginService_2_0_SOAP)) + { + System.ServiceModel.BasicHttpBinding result = new System.ServiceModel.BasicHttpBinding(); + result.MaxBufferSize = int.MaxValue; + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.BasicHttpSecurityMode.Transport; + return result; + } + throw new System.InvalidOperationException(string.Format("Could not find endpoint with name \'{0}\'.", endpointConfiguration)); + } + + private static System.ServiceModel.EndpointAddress GetEndpointAddress(EndpointConfiguration endpointConfiguration) + { + if ((endpointConfiguration == EndpointConfiguration.LoginService_2_0_SOAP)) + { + return new System.ServiceModel.EndpointAddress("https://public-ws-stage.dpd.com/services/LoginService/V2_0/"); + } + throw new System.InvalidOperationException(string.Format("Could not find endpoint with name \'{0}\'.", endpointConfiguration)); + } + + private static System.ServiceModel.Channels.Binding GetDefaultBinding() + { + return LoginServiceClient.GetBindingForEndpoint(EndpointConfiguration.LoginService_2_0_SOAP); + } + + private static System.ServiceModel.EndpointAddress GetDefaultEndpointAddress() + { + return LoginServiceClient.GetEndpointAddress(EndpointConfiguration.LoginService_2_0_SOAP); + } + + public enum EndpointConfiguration + { + + LoginService_2_0_SOAP, + } + } +} diff --git a/ShippingProAPICollection/Connected Services/DPDShipmentService4_4/ConnectedService.json b/ShippingProAPICollection/Connected Services/DPDShipmentService4_4/ConnectedService.json new file mode 100644 index 0000000..48c0972 --- /dev/null +++ b/ShippingProAPICollection/Connected Services/DPDShipmentService4_4/ConnectedService.json @@ -0,0 +1,17 @@ +{ + "ExtendedData": { + "inputs": [ + "https://public-ws-stage.dpd.com/services/ShipmentService/V4_4/?wsdl" + ], + "collectionTypes": [ + "System.Array", + "System.Collections.Generic.Dictionary`2" + ], + "internalTypeAccess": true, + "namespaceMappings": [ + "*, DPDShipmentService4_4" + ], + "targetFramework": "net8.0", + "typeReuseMode": "All" + } +} \ No newline at end of file diff --git a/ShippingProAPICollection/Connected Services/DPDShipmentService4_4/Reference.cs b/ShippingProAPICollection/Connected Services/DPDShipmentService4_4/Reference.cs new file mode 100644 index 0000000..c1bf85d --- /dev/null +++ b/ShippingProAPICollection/Connected Services/DPDShipmentService4_4/Reference.cs @@ -0,0 +1,4606 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace DPDShipmentService4_4 +{ + + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.1.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true, Namespace="http://dpd.com/common/service/types/Authentication/2.0")] + public partial class authenticationFault + { + + private string errorCodeField; + + private string errorMessageField; + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=0)] + public string errorCode + { + get + { + return this.errorCodeField; + } + set + { + this.errorCodeField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=1)] + public string errorMessage + { + get + { + return this.errorMessageField; + } + set + { + this.errorMessageField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.1.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://dpd.com/common/service/types/ShipmentService/4.4")] + public partial class faultCodeType + { + + private string faultCodeField; + + private string messageField; + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=0)] + public string faultCode + { + get + { + return this.faultCodeField; + } + set + { + this.faultCodeField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=1)] + public string message + { + get + { + return this.messageField; + } + set + { + this.messageField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.1.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://dpd.com/common/service/types/ShipmentService/4.4")] + public partial class parcelInformationType + { + + private string parcelLabelNumberField; + + private string dpdReferenceField; + + private OutputType[] outputField; + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=0)] + public string parcelLabelNumber + { + get + { + return this.parcelLabelNumberField; + } + set + { + this.parcelLabelNumberField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=1)] + public string dpdReference + { + get + { + return this.dpdReferenceField; + } + set + { + this.dpdReferenceField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("output", Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=2)] + public OutputType[] output + { + get + { + return this.outputField; + } + set + { + this.outputField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.1.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://dpd.com/common/service/types/ShipmentService/4.4")] + public partial class OutputType + { + + private OutputFormatType formatField; + + private byte[] contentField; + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=0)] + public OutputFormatType format + { + get + { + return this.formatField; + } + set + { + this.formatField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType="base64Binary", Order=1)] + public byte[] content + { + get + { + return this.contentField; + } + set + { + this.contentField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.1.0")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://dpd.com/common/service/types/ShipmentService/4.4")] + public enum OutputFormatType + { + + /// + PDF, + + /// + ZPL, + + /// + DPL, + + /// + PDL, + + /// + BARCODE_IMAGE, + + /// + MULTIPAGE_IMAGE, + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.1.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://dpd.com/common/service/types/ShipmentService/4.4")] + public partial class shipmentResponse + { + + private string identificationNumberField; + + private string mpsIdField; + + private parcelInformationType[] parcelInformationField; + + private faultCodeType[] faultsField; + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=0)] + public string identificationNumber + { + get + { + return this.identificationNumberField; + } + set + { + this.identificationNumberField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=1)] + public string mpsId + { + get + { + return this.mpsIdField; + } + set + { + this.mpsIdField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("parcelInformation", Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=2)] + public parcelInformationType[] parcelInformation + { + get + { + return this.parcelInformationField; + } + set + { + this.parcelInformationField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("faults", Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=3)] + public faultCodeType[] faults + { + get + { + return this.faultsField; + } + set + { + this.faultsField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.1.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://dpd.com/common/service/types/ShipmentService/4.4")] + public partial class storeOrdersResponseType + { + + private OutputType outputField; + + private shipmentResponse[] shipmentResponsesField; + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=0)] + public OutputType output + { + get + { + return this.outputField; + } + set + { + this.outputField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("shipmentResponses", Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=1)] + public shipmentResponse[] shipmentResponses + { + get + { + return this.shipmentResponsesField; + } + set + { + this.shipmentResponsesField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.1.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://dpd.com/common/service/types/ShipmentService/4.4")] + public partial class storeOrdersResponse + { + + private storeOrdersResponseType orderResultField; + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=0)] + public storeOrdersResponseType orderResult + { + get + { + return this.orderResultField; + } + set + { + this.orderResultField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.1.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://dpd.com/common/service/types/ShipmentService/4.4")] + public partial class additionalInvoiceLine + { + + private int customsInvoicePositionField; + + private bool customsInvoicePositionFieldSpecified; + + private int quantityItemsField; + + private bool quantityItemsFieldSpecified; + + private string customsContentField; + + private string customsTarifField; + + private long customsAmountLineField; + + private bool customsAmountLineFieldSpecified; + + private int customsOriginField; + + private bool customsOriginFieldSpecified; + + private int customsNetWeightField; + + private bool customsNetWeightFieldSpecified; + + private int customsGrossWeightField; + + private bool customsGrossWeightFieldSpecified; + + private string productFabricCompositionField; + + private string productCodeField; + + private string productShortDescriptionField; + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=0)] + public int customsInvoicePosition + { + get + { + return this.customsInvoicePositionField; + } + set + { + this.customsInvoicePositionField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool customsInvoicePositionSpecified + { + get + { + return this.customsInvoicePositionFieldSpecified; + } + set + { + this.customsInvoicePositionFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=1)] + public int quantityItems + { + get + { + return this.quantityItemsField; + } + set + { + this.quantityItemsField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool quantityItemsSpecified + { + get + { + return this.quantityItemsFieldSpecified; + } + set + { + this.quantityItemsFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=2)] + public string customsContent + { + get + { + return this.customsContentField; + } + set + { + this.customsContentField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=3)] + public string customsTarif + { + get + { + return this.customsTarifField; + } + set + { + this.customsTarifField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=4)] + public long customsAmountLine + { + get + { + return this.customsAmountLineField; + } + set + { + this.customsAmountLineField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool customsAmountLineSpecified + { + get + { + return this.customsAmountLineFieldSpecified; + } + set + { + this.customsAmountLineFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=5)] + public int customsOrigin + { + get + { + return this.customsOriginField; + } + set + { + this.customsOriginField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool customsOriginSpecified + { + get + { + return this.customsOriginFieldSpecified; + } + set + { + this.customsOriginFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=6)] + public int customsNetWeight + { + get + { + return this.customsNetWeightField; + } + set + { + this.customsNetWeightField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool customsNetWeightSpecified + { + get + { + return this.customsNetWeightFieldSpecified; + } + set + { + this.customsNetWeightFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=7)] + public int customsGrossWeight + { + get + { + return this.customsGrossWeightField; + } + set + { + this.customsGrossWeightField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool customsGrossWeightSpecified + { + get + { + return this.customsGrossWeightFieldSpecified; + } + set + { + this.customsGrossWeightFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=8)] + public string productFabricComposition + { + get + { + return this.productFabricCompositionField; + } + set + { + this.productFabricCompositionField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=9)] + public string productCode + { + get + { + return this.productCodeField; + } + set + { + this.productCodeField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=10)] + public string productShortDescription + { + get + { + return this.productShortDescriptionField; + } + set + { + this.productShortDescriptionField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.1.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://dpd.com/common/service/types/ShipmentService/4.4")] + public partial class international + { + + private bool parcelTypeField; + + private long customsAmountField; + + private string customsCurrencyField; + + private long customsAmountExportField; + + private bool customsAmountExportFieldSpecified; + + private string customsCurrencyExportField; + + private internationalCustomsTerms customsTermsField; + + private string customsPaperField; + + private bool customsEnclosureField; + + private bool customsEnclosureFieldSpecified; + + private string customsInvoiceField; + + private int customsInvoiceDateField; + + private bool customsInvoiceDateFieldSpecified; + + private string customsOriginField; + + private string customsOrderField; + + private internationalLinehaul linehaulField; + + private bool linehaulFieldSpecified; + + private string shipMrnField; + + private bool collectiveCustomsClearanceField; + + private bool collectiveCustomsClearanceFieldSpecified; + + private int invoicePositionField; + + private bool invoicePositionFieldSpecified; + + private string comment1Field; + + private string comment2Field; + + private int numberOfArticleField; + + private bool numberOfArticleFieldSpecified; + + private string countryRegistrationNumberField; + + private string commercialInvoiceConsigneeVatNumberField; + + private addressWithBusinessUnit commercialInvoiceConsigneeField; + + private string commercialInvoiceConsignorVatNumberField; + + private address commercialInvoiceConsignorField; + + private additionalInvoiceLine[] additionalInvoiceLinesField; + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=0)] + public bool parcelType + { + get + { + return this.parcelTypeField; + } + set + { + this.parcelTypeField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=1)] + public long customsAmount + { + get + { + return this.customsAmountField; + } + set + { + this.customsAmountField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=2)] + public string customsCurrency + { + get + { + return this.customsCurrencyField; + } + set + { + this.customsCurrencyField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=3)] + public long customsAmountExport + { + get + { + return this.customsAmountExportField; + } + set + { + this.customsAmountExportField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool customsAmountExportSpecified + { + get + { + return this.customsAmountExportFieldSpecified; + } + set + { + this.customsAmountExportFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=4)] + public string customsCurrencyExport + { + get + { + return this.customsCurrencyExportField; + } + set + { + this.customsCurrencyExportField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=5)] + public internationalCustomsTerms customsTerms + { + get + { + return this.customsTermsField; + } + set + { + this.customsTermsField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=6)] + public string customsPaper + { + get + { + return this.customsPaperField; + } + set + { + this.customsPaperField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=7)] + public bool customsEnclosure + { + get + { + return this.customsEnclosureField; + } + set + { + this.customsEnclosureField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool customsEnclosureSpecified + { + get + { + return this.customsEnclosureFieldSpecified; + } + set + { + this.customsEnclosureFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=8)] + public string customsInvoice + { + get + { + return this.customsInvoiceField; + } + set + { + this.customsInvoiceField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=9)] + public int customsInvoiceDate + { + get + { + return this.customsInvoiceDateField; + } + set + { + this.customsInvoiceDateField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool customsInvoiceDateSpecified + { + get + { + return this.customsInvoiceDateFieldSpecified; + } + set + { + this.customsInvoiceDateFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=10)] + public string customsOrigin + { + get + { + return this.customsOriginField; + } + set + { + this.customsOriginField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=11)] + public string customsOrder + { + get + { + return this.customsOrderField; + } + set + { + this.customsOrderField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=12)] + public internationalLinehaul linehaul + { + get + { + return this.linehaulField; + } + set + { + this.linehaulField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool linehaulSpecified + { + get + { + return this.linehaulFieldSpecified; + } + set + { + this.linehaulFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=13)] + public string shipMrn + { + get + { + return this.shipMrnField; + } + set + { + this.shipMrnField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=14)] + public bool collectiveCustomsClearance + { + get + { + return this.collectiveCustomsClearanceField; + } + set + { + this.collectiveCustomsClearanceField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool collectiveCustomsClearanceSpecified + { + get + { + return this.collectiveCustomsClearanceFieldSpecified; + } + set + { + this.collectiveCustomsClearanceFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=15)] + public int invoicePosition + { + get + { + return this.invoicePositionField; + } + set + { + this.invoicePositionField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool invoicePositionSpecified + { + get + { + return this.invoicePositionFieldSpecified; + } + set + { + this.invoicePositionFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=16)] + public string comment1 + { + get + { + return this.comment1Field; + } + set + { + this.comment1Field = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=17)] + public string comment2 + { + get + { + return this.comment2Field; + } + set + { + this.comment2Field = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=18)] + public int numberOfArticle + { + get + { + return this.numberOfArticleField; + } + set + { + this.numberOfArticleField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool numberOfArticleSpecified + { + get + { + return this.numberOfArticleFieldSpecified; + } + set + { + this.numberOfArticleFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=19)] + public string countryRegistrationNumber + { + get + { + return this.countryRegistrationNumberField; + } + set + { + this.countryRegistrationNumberField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=20)] + public string commercialInvoiceConsigneeVatNumber + { + get + { + return this.commercialInvoiceConsigneeVatNumberField; + } + set + { + this.commercialInvoiceConsigneeVatNumberField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=21)] + public addressWithBusinessUnit commercialInvoiceConsignee + { + get + { + return this.commercialInvoiceConsigneeField; + } + set + { + this.commercialInvoiceConsigneeField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=22)] + public string commercialInvoiceConsignorVatNumber + { + get + { + return this.commercialInvoiceConsignorVatNumberField; + } + set + { + this.commercialInvoiceConsignorVatNumberField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=23)] + public address commercialInvoiceConsignor + { + get + { + return this.commercialInvoiceConsignorField; + } + set + { + this.commercialInvoiceConsignorField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("additionalInvoiceLines", Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=24)] + public additionalInvoiceLine[] additionalInvoiceLines + { + get + { + return this.additionalInvoiceLinesField; + } + set + { + this.additionalInvoiceLinesField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.1.0")] + [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true, Namespace="http://dpd.com/common/service/types/ShipmentService/4.4")] + public enum internationalCustomsTerms + { + + /// + [System.Xml.Serialization.XmlEnumAttribute("01")] + Item01, + + /// + [System.Xml.Serialization.XmlEnumAttribute("02")] + Item02, + + /// + [System.Xml.Serialization.XmlEnumAttribute("03")] + Item03, + + /// + [System.Xml.Serialization.XmlEnumAttribute("05")] + Item05, + + /// + [System.Xml.Serialization.XmlEnumAttribute("06")] + Item06, + + /// + [System.Xml.Serialization.XmlEnumAttribute("07")] + Item07, + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.1.0")] + [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true, Namespace="http://dpd.com/common/service/types/ShipmentService/4.4")] + public enum internationalLinehaul + { + + /// + AI, + + /// + RO, + } + + /// + [System.Xml.Serialization.XmlIncludeAttribute(typeof(addressWithType))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.1.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://dpd.com/common/service/types/ShipmentService/4.4")] + public partial class addressWithBusinessUnit : address + { + + private int businessUnitField; + + private bool businessUnitFieldSpecified; + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=0)] + public int businessUnit + { + get + { + return this.businessUnitField; + } + set + { + this.businessUnitField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool businessUnitSpecified + { + get + { + return this.businessUnitFieldSpecified; + } + set + { + this.businessUnitFieldSpecified = value; + } + } + } + + /// + [System.Xml.Serialization.XmlIncludeAttribute(typeof(addressWithBusinessUnit))] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(addressWithType))] + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.1.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://dpd.com/common/service/types/ShipmentService/4.4")] + public partial class address + { + + private string name1Field; + + private string name2Field; + + private string streetField; + + private string houseNoField; + + private string stateField; + + private string countryField; + + private string zipCodeField; + + private string cityField; + + private long glnField; + + private bool glnFieldSpecified; + + private string customerNumberField; + + private string contactField; + + private string phoneField; + + private string mobileField; + + private string faxField; + + private string emailField; + + private string commentField; + + private string iaccountField; + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=0)] + public string name1 + { + get + { + return this.name1Field; + } + set + { + this.name1Field = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=1)] + public string name2 + { + get + { + return this.name2Field; + } + set + { + this.name2Field = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=2)] + public string street + { + get + { + return this.streetField; + } + set + { + this.streetField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=3)] + public string houseNo + { + get + { + return this.houseNoField; + } + set + { + this.houseNoField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=4)] + public string state + { + get + { + return this.stateField; + } + set + { + this.stateField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=5)] + public string country + { + get + { + return this.countryField; + } + set + { + this.countryField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=6)] + public string zipCode + { + get + { + return this.zipCodeField; + } + set + { + this.zipCodeField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=7)] + public string city + { + get + { + return this.cityField; + } + set + { + this.cityField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=8)] + public long gln + { + get + { + return this.glnField; + } + set + { + this.glnField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool glnSpecified + { + get + { + return this.glnFieldSpecified; + } + set + { + this.glnFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=9)] + public string customerNumber + { + get + { + return this.customerNumberField; + } + set + { + this.customerNumberField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=10)] + public string contact + { + get + { + return this.contactField; + } + set + { + this.contactField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=11)] + public string phone + { + get + { + return this.phoneField; + } + set + { + this.phoneField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=12)] + public string mobile + { + get + { + return this.mobileField; + } + set + { + this.mobileField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=13)] + public string fax + { + get + { + return this.faxField; + } + set + { + this.faxField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=14)] + public string email + { + get + { + return this.emailField; + } + set + { + this.emailField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=15)] + public string comment + { + get + { + return this.commentField; + } + set + { + this.commentField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=16)] + public string iaccount + { + get + { + return this.iaccountField; + } + set + { + this.iaccountField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.1.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://dpd.com/common/service/types/ShipmentService/4.4")] + public partial class addressWithType : addressWithBusinessUnit + { + + private addressWithTypeAddressType addressTypeField; + + private bool addressTypeFieldSpecified; + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=0)] + public addressWithTypeAddressType addressType + { + get + { + return this.addressTypeField; + } + set + { + this.addressTypeField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool addressTypeSpecified + { + get + { + return this.addressTypeFieldSpecified; + } + set + { + this.addressTypeFieldSpecified = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.1.0")] + [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true, Namespace="http://dpd.com/common/service/types/ShipmentService/4.4")] + public enum addressWithTypeAddressType + { + + /// + PRV, + + /// + COM, + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.1.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://dpd.com/common/service/types/ShipmentService/4.4")] + public partial class delivery + { + + private string dayField; + + private int dateFromField; + + private bool dateFromFieldSpecified; + + private int dateToField; + + private bool dateToFieldSpecified; + + private string timeFromField; + + private string timeToField; + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=0)] + public string day + { + get + { + return this.dayField; + } + set + { + this.dayField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=1)] + public int dateFrom + { + get + { + return this.dateFromField; + } + set + { + this.dateFromField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool dateFromSpecified + { + get + { + return this.dateFromFieldSpecified; + } + set + { + this.dateFromFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=2)] + public int dateTo + { + get + { + return this.dateToField; + } + set + { + this.dateToField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool dateToSpecified + { + get + { + return this.dateToFieldSpecified; + } + set + { + this.dateToFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=3)] + public string timeFrom + { + get + { + return this.timeFromField; + } + set + { + this.timeFromField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=4)] + public string timeTo + { + get + { + return this.timeToField; + } + set + { + this.timeToField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.1.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://dpd.com/common/service/types/ShipmentService/4.4")] + public partial class proactiveNotification + { + + private int channelField; + + private string valueField; + + private int ruleField; + + private string languageField; + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=0)] + public int channel + { + get + { + return this.channelField; + } + set + { + this.channelField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=1)] + public string value + { + get + { + return this.valueField; + } + set + { + this.valueField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=2)] + public int rule + { + get + { + return this.ruleField; + } + set + { + this.ruleField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=3)] + public string language + { + get + { + return this.languageField; + } + set + { + this.languageField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.1.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://dpd.com/common/service/types/ShipmentService/4.4")] + public partial class notification + { + + private int channelField; + + private string valueField; + + private string languageField; + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=0)] + public int channel + { + get + { + return this.channelField; + } + set + { + this.channelField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=1)] + public string value + { + get + { + return this.valueField; + } + set + { + this.valueField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=2)] + public string language + { + get + { + return this.languageField; + } + set + { + this.languageField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.1.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://dpd.com/common/service/types/ShipmentService/4.4")] + public partial class parcelShopDelivery + { + + private long parcelShopIdField; + + private bool parcelShopIdFieldSpecified; + + private string parcelShopPudoIdField; + + private notification parcelShopNotificationField; + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=0)] + public long parcelShopId + { + get + { + return this.parcelShopIdField; + } + set + { + this.parcelShopIdField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool parcelShopIdSpecified + { + get + { + return this.parcelShopIdFieldSpecified; + } + set + { + this.parcelShopIdFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=1)] + public string parcelShopPudoId + { + get + { + return this.parcelShopPudoIdField; + } + set + { + this.parcelShopPudoIdField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=2)] + public notification parcelShopNotification + { + get + { + return this.parcelShopNotificationField; + } + set + { + this.parcelShopNotificationField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.1.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://dpd.com/common/service/types/ShipmentService/4.4")] + public partial class pickup + { + + private int tourField; + + private bool tourFieldSpecified; + + private int quantityField; + + private bool quantityFieldSpecified; + + private int dateField; + + private bool dateFieldSpecified; + + private string fromTime1Field; + + private string toTime1Field; + + private string fromTime2Field; + + private string toTime2Field; + + private int extraPickupField; + + private bool extraPickupFieldSpecified; + + private string boxIdField; + + private string boxTanField; + + private address collectionRequestAddressField; + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=0)] + public int tour + { + get + { + return this.tourField; + } + set + { + this.tourField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool tourSpecified + { + get + { + return this.tourFieldSpecified; + } + set + { + this.tourFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=1)] + public int quantity + { + get + { + return this.quantityField; + } + set + { + this.quantityField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool quantitySpecified + { + get + { + return this.quantityFieldSpecified; + } + set + { + this.quantityFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=2)] + public int date + { + get + { + return this.dateField; + } + set + { + this.dateField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool dateSpecified + { + get + { + return this.dateFieldSpecified; + } + set + { + this.dateFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=3)] + public string fromTime1 + { + get + { + return this.fromTime1Field; + } + set + { + this.fromTime1Field = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=4)] + public string toTime1 + { + get + { + return this.toTime1Field; + } + set + { + this.toTime1Field = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=5)] + public string fromTime2 + { + get + { + return this.fromTime2Field; + } + set + { + this.fromTime2Field = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=6)] + public string toTime2 + { + get + { + return this.toTime2Field; + } + set + { + this.toTime2Field = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=7)] + public int extraPickup + { + get + { + return this.extraPickupField; + } + set + { + this.extraPickupField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool extraPickupSpecified + { + get + { + return this.extraPickupFieldSpecified; + } + set + { + this.extraPickupFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=8)] + public string boxId + { + get + { + return this.boxIdField; + } + set + { + this.boxIdField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=9)] + public string boxTan + { + get + { + return this.boxTanField; + } + set + { + this.boxTanField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=10)] + public address collectionRequestAddress + { + get + { + return this.collectionRequestAddressField; + } + set + { + this.collectionRequestAddressField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.1.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://dpd.com/common/service/types/ShipmentService/4.4")] + public partial class personalDelivery + { + + private int typeField; + + private string floorField; + + private string buildingField; + + private string departmentField; + + private string nameField; + + private string phoneField; + + private string personIdField; + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=0)] + public int type + { + get + { + return this.typeField; + } + set + { + this.typeField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=1)] + public string floor + { + get + { + return this.floorField; + } + set + { + this.floorField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=2)] + public string building + { + get + { + return this.buildingField; + } + set + { + this.buildingField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=3)] + public string department + { + get + { + return this.departmentField; + } + set + { + this.departmentField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=4)] + public string name + { + get + { + return this.nameField; + } + set + { + this.nameField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=5)] + public string phone + { + get + { + return this.phoneField; + } + set + { + this.phoneField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=6)] + public string personId + { + get + { + return this.personIdField; + } + set + { + this.personIdField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.1.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://dpd.com/common/service/types/ShipmentService/4.4")] + public partial class productAndServiceData + { + + private productAndServiceDataOrderType orderTypeField; + + private bool saturdayDeliveryField; + + private bool saturdayDeliveryFieldSpecified; + + private bool exWorksDeliveryField; + + private bool exWorksDeliveryFieldSpecified; + + private bool guaranteeField; + + private bool guaranteeFieldSpecified; + + private bool tyresField; + + private bool tyresFieldSpecified; + + private bool foodField; + + private bool foodFieldSpecified; + + private personalDelivery personalDeliveryField; + + private pickup pickupField; + + private parcelShopDelivery parcelShopDeliveryField; + + private notification predictField; + + private notification personalDeliveryNotificationField; + + private proactiveNotification[] proactiveNotificationField; + + private delivery deliveryField; + + private address invoiceAddressField; + + private string countrySpecificServiceField; + + private international internationalField; + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=0)] + public productAndServiceDataOrderType orderType + { + get + { + return this.orderTypeField; + } + set + { + this.orderTypeField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=1)] + public bool saturdayDelivery + { + get + { + return this.saturdayDeliveryField; + } + set + { + this.saturdayDeliveryField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool saturdayDeliverySpecified + { + get + { + return this.saturdayDeliveryFieldSpecified; + } + set + { + this.saturdayDeliveryFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=2)] + public bool exWorksDelivery + { + get + { + return this.exWorksDeliveryField; + } + set + { + this.exWorksDeliveryField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool exWorksDeliverySpecified + { + get + { + return this.exWorksDeliveryFieldSpecified; + } + set + { + this.exWorksDeliveryFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=3)] + public bool guarantee + { + get + { + return this.guaranteeField; + } + set + { + this.guaranteeField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool guaranteeSpecified + { + get + { + return this.guaranteeFieldSpecified; + } + set + { + this.guaranteeFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=4)] + public bool tyres + { + get + { + return this.tyresField; + } + set + { + this.tyresField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool tyresSpecified + { + get + { + return this.tyresFieldSpecified; + } + set + { + this.tyresFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=5)] + public bool food + { + get + { + return this.foodField; + } + set + { + this.foodField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool foodSpecified + { + get + { + return this.foodFieldSpecified; + } + set + { + this.foodFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=6)] + public personalDelivery personalDelivery + { + get + { + return this.personalDeliveryField; + } + set + { + this.personalDeliveryField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=7)] + public pickup pickup + { + get + { + return this.pickupField; + } + set + { + this.pickupField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=8)] + public parcelShopDelivery parcelShopDelivery + { + get + { + return this.parcelShopDeliveryField; + } + set + { + this.parcelShopDeliveryField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=9)] + public notification predict + { + get + { + return this.predictField; + } + set + { + this.predictField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=10)] + public notification personalDeliveryNotification + { + get + { + return this.personalDeliveryNotificationField; + } + set + { + this.personalDeliveryNotificationField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("proactiveNotification", Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=11)] + public proactiveNotification[] proactiveNotification + { + get + { + return this.proactiveNotificationField; + } + set + { + this.proactiveNotificationField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=12)] + public delivery delivery + { + get + { + return this.deliveryField; + } + set + { + this.deliveryField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=13)] + public address invoiceAddress + { + get + { + return this.invoiceAddressField; + } + set + { + this.invoiceAddressField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=14)] + public string countrySpecificService + { + get + { + return this.countrySpecificServiceField; + } + set + { + this.countrySpecificServiceField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=15)] + public international international + { + get + { + return this.internationalField; + } + set + { + this.internationalField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.1.0")] + [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true, Namespace="http://dpd.com/common/service/types/ShipmentService/4.4")] + public enum productAndServiceDataOrderType + { + + /// + consignment, + + /// + [System.Xml.Serialization.XmlEnumAttribute("collection request order")] + collectionrequestorder, + + /// + [System.Xml.Serialization.XmlEnumAttribute("pickup information")] + pickupinformation, + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.1.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://dpd.com/common/service/types/ShipmentService/4.4")] + public partial class hazardous + { + + private string identificationUnNoField; + + private string identificationClassField; + + private string classificationCodeField; + + private string packingGroupField; + + private hazardousPackingCode packingCodeField; + + private string descriptionField; + + private string subsidiaryRiskField; + + private hazardousTunnelRestrictionCode tunnelRestrictionCodeField; + + private bool tunnelRestrictionCodeFieldSpecified; + + private decimal hazardousWeightField; + + private decimal netWeightField; + + private bool netWeightFieldSpecified; + + private int factorField; + + private string notOtherwiseSpecified1Field; + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=0)] + public string identificationUnNo + { + get + { + return this.identificationUnNoField; + } + set + { + this.identificationUnNoField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=1)] + public string identificationClass + { + get + { + return this.identificationClassField; + } + set + { + this.identificationClassField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=2)] + public string classificationCode + { + get + { + return this.classificationCodeField; + } + set + { + this.classificationCodeField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=3)] + public string packingGroup + { + get + { + return this.packingGroupField; + } + set + { + this.packingGroupField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=4)] + public hazardousPackingCode packingCode + { + get + { + return this.packingCodeField; + } + set + { + this.packingCodeField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=5)] + public string description + { + get + { + return this.descriptionField; + } + set + { + this.descriptionField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=6)] + public string subsidiaryRisk + { + get + { + return this.subsidiaryRiskField; + } + set + { + this.subsidiaryRiskField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=7)] + public hazardousTunnelRestrictionCode tunnelRestrictionCode + { + get + { + return this.tunnelRestrictionCodeField; + } + set + { + this.tunnelRestrictionCodeField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool tunnelRestrictionCodeSpecified + { + get + { + return this.tunnelRestrictionCodeFieldSpecified; + } + set + { + this.tunnelRestrictionCodeFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=8)] + public decimal hazardousWeight + { + get + { + return this.hazardousWeightField; + } + set + { + this.hazardousWeightField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=9)] + public decimal netWeight + { + get + { + return this.netWeightField; + } + set + { + this.netWeightField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool netWeightSpecified + { + get + { + return this.netWeightFieldSpecified; + } + set + { + this.netWeightFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=10)] + public int factor + { + get + { + return this.factorField; + } + set + { + this.factorField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("notOtherwiseSpecified", Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=11)] + public string notOtherwiseSpecified1 + { + get + { + return this.notOtherwiseSpecified1Field; + } + set + { + this.notOtherwiseSpecified1Field = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.1.0")] + [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true, Namespace="http://dpd.com/common/service/types/ShipmentService/4.4")] + public enum hazardousPackingCode + { + + /// + [System.Xml.Serialization.XmlEnumAttribute("0A")] + Item0A, + + /// + [System.Xml.Serialization.XmlEnumAttribute("0A1")] + Item0A1, + + /// + [System.Xml.Serialization.XmlEnumAttribute("0A2")] + Item0A2, + + /// + [System.Xml.Serialization.XmlEnumAttribute("1A")] + Item1A, + + /// + [System.Xml.Serialization.XmlEnumAttribute("1A1")] + Item1A1, + + /// + [System.Xml.Serialization.XmlEnumAttribute("1A2")] + Item1A2, + + /// + [System.Xml.Serialization.XmlEnumAttribute("1B")] + Item1B, + + /// + [System.Xml.Serialization.XmlEnumAttribute("1B1")] + Item1B1, + + /// + [System.Xml.Serialization.XmlEnumAttribute("1B2")] + Item1B2, + + /// + [System.Xml.Serialization.XmlEnumAttribute("1H")] + Item1H, + + /// + [System.Xml.Serialization.XmlEnumAttribute("1H1")] + Item1H1, + + /// + [System.Xml.Serialization.XmlEnumAttribute("1H2")] + Item1H2, + + /// + [System.Xml.Serialization.XmlEnumAttribute("3A")] + Item3A, + + /// + [System.Xml.Serialization.XmlEnumAttribute("3A1")] + Item3A1, + + /// + [System.Xml.Serialization.XmlEnumAttribute("3A2")] + Item3A2, + + /// + [System.Xml.Serialization.XmlEnumAttribute("3B")] + Item3B, + + /// + [System.Xml.Serialization.XmlEnumAttribute("3B1")] + Item3B1, + + /// + [System.Xml.Serialization.XmlEnumAttribute("3B2")] + Item3B2, + + /// + [System.Xml.Serialization.XmlEnumAttribute("3H")] + Item3H, + + /// + [System.Xml.Serialization.XmlEnumAttribute("3H1")] + Item3H1, + + /// + [System.Xml.Serialization.XmlEnumAttribute("3H2")] + Item3H2, + + /// + [System.Xml.Serialization.XmlEnumAttribute("4A")] + Item4A, + + /// + [System.Xml.Serialization.XmlEnumAttribute("4B")] + Item4B, + + /// + [System.Xml.Serialization.XmlEnumAttribute("4D")] + Item4D, + + /// + [System.Xml.Serialization.XmlEnumAttribute("4G")] + Item4G, + + /// + [System.Xml.Serialization.XmlEnumAttribute("4H")] + Item4H, + + /// + [System.Xml.Serialization.XmlEnumAttribute("4H1")] + Item4H1, + + /// + [System.Xml.Serialization.XmlEnumAttribute("4H2")] + Item4H2, + + /// + [System.Xml.Serialization.XmlEnumAttribute("5H")] + Item5H, + + /// + [System.Xml.Serialization.XmlEnumAttribute("5M")] + Item5M, + + /// + [System.Xml.Serialization.XmlEnumAttribute("6H")] + Item6H, + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.1.0")] + [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true, Namespace="http://dpd.com/common/service/types/ShipmentService/4.4")] + public enum hazardousTunnelRestrictionCode + { + + /// + A, + + /// + B, + + /// + C, + + /// + D, + + /// + E, + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.1.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://dpd.com/common/service/types/ShipmentService/4.4")] + public partial class higherInsurance + { + + private long amountField; + + private string currencyField; + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=0)] + public long amount + { + get + { + return this.amountField; + } + set + { + this.amountField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=1)] + public string currency + { + get + { + return this.currencyField; + } + set + { + this.currencyField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.1.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://dpd.com/common/service/types/ShipmentService/4.4")] + public partial class parcel + { + + private string parcelLabelNumberField; + + private string customerReferenceNumber1Field; + + private string customerReferenceNumber2Field; + + private string customerReferenceNumber3Field; + + private string customerReferenceNumber4Field; + + private bool swapField; + + private bool swapFieldSpecified; + + private int volumeField; + + private bool volumeFieldSpecified; + + private int weightField; + + private bool weightFieldSpecified; + + private bool hazardousLimitedQuantitiesField; + + private bool hazardousLimitedQuantitiesFieldSpecified; + + private higherInsurance higherInsuranceField; + + private string contentField; + + private int addServiceField; + + private bool addServiceFieldSpecified; + + private int messageNumberField; + + private bool messageNumberFieldSpecified; + + private parcelFunction functionField; + + private bool functionFieldSpecified; + + private string parameterField; + + private hazardous[] hazardousField; + + private bool printInfo1OnParcelLabelField; + + private bool printInfo1OnParcelLabelFieldSpecified; + + private string info1Field; + + private string info2Field; + + private bool returnsField; + + private bool returnsFieldSpecified; + + private string parcelClassField; + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=0)] + public string parcelLabelNumber + { + get + { + return this.parcelLabelNumberField; + } + set + { + this.parcelLabelNumberField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=1)] + public string customerReferenceNumber1 + { + get + { + return this.customerReferenceNumber1Field; + } + set + { + this.customerReferenceNumber1Field = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=2)] + public string customerReferenceNumber2 + { + get + { + return this.customerReferenceNumber2Field; + } + set + { + this.customerReferenceNumber2Field = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=3)] + public string customerReferenceNumber3 + { + get + { + return this.customerReferenceNumber3Field; + } + set + { + this.customerReferenceNumber3Field = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=4)] + public string customerReferenceNumber4 + { + get + { + return this.customerReferenceNumber4Field; + } + set + { + this.customerReferenceNumber4Field = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=5)] + public bool swap + { + get + { + return this.swapField; + } + set + { + this.swapField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool swapSpecified + { + get + { + return this.swapFieldSpecified; + } + set + { + this.swapFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=6)] + public int volume + { + get + { + return this.volumeField; + } + set + { + this.volumeField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool volumeSpecified + { + get + { + return this.volumeFieldSpecified; + } + set + { + this.volumeFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=7)] + public int weight + { + get + { + return this.weightField; + } + set + { + this.weightField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool weightSpecified + { + get + { + return this.weightFieldSpecified; + } + set + { + this.weightFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=8)] + public bool hazardousLimitedQuantities + { + get + { + return this.hazardousLimitedQuantitiesField; + } + set + { + this.hazardousLimitedQuantitiesField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool hazardousLimitedQuantitiesSpecified + { + get + { + return this.hazardousLimitedQuantitiesFieldSpecified; + } + set + { + this.hazardousLimitedQuantitiesFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=9)] + public higherInsurance higherInsurance + { + get + { + return this.higherInsuranceField; + } + set + { + this.higherInsuranceField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=10)] + public string content + { + get + { + return this.contentField; + } + set + { + this.contentField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=11)] + public int addService + { + get + { + return this.addServiceField; + } + set + { + this.addServiceField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool addServiceSpecified + { + get + { + return this.addServiceFieldSpecified; + } + set + { + this.addServiceFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=12)] + public int messageNumber + { + get + { + return this.messageNumberField; + } + set + { + this.messageNumberField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool messageNumberSpecified + { + get + { + return this.messageNumberFieldSpecified; + } + set + { + this.messageNumberFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=13)] + public parcelFunction function + { + get + { + return this.functionField; + } + set + { + this.functionField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool functionSpecified + { + get + { + return this.functionFieldSpecified; + } + set + { + this.functionFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=14)] + public string parameter + { + get + { + return this.parameterField; + } + set + { + this.parameterField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("hazardous", Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=15)] + public hazardous[] hazardous + { + get + { + return this.hazardousField; + } + set + { + this.hazardousField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=16)] + public bool printInfo1OnParcelLabel + { + get + { + return this.printInfo1OnParcelLabelField; + } + set + { + this.printInfo1OnParcelLabelField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool printInfo1OnParcelLabelSpecified + { + get + { + return this.printInfo1OnParcelLabelFieldSpecified; + } + set + { + this.printInfo1OnParcelLabelFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=17)] + public string info1 + { + get + { + return this.info1Field; + } + set + { + this.info1Field = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=18)] + public string info2 + { + get + { + return this.info2Field; + } + set + { + this.info2Field = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=19)] + public bool returns + { + get + { + return this.returnsField; + } + set + { + this.returnsField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool returnsSpecified + { + get + { + return this.returnsFieldSpecified; + } + set + { + this.returnsFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=20)] + public string parcelClass + { + get + { + return this.parcelClassField; + } + set + { + this.parcelClassField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.1.0")] + [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true, Namespace="http://dpd.com/common/service/types/ShipmentService/4.4")] + public enum parcelFunction + { + + /// + LOCKDZB, + + /// + LOCKASG, + + /// + LOCKEVM, + + /// + LOCKSHOP, + + /// + LOCKTV, + + /// + LOCKZBK, + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.1.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://dpd.com/common/service/types/ShipmentService/4.4")] + public partial class generalShipmentData + { + + private string mpsIdField; + + private string cUserField; + + private string mpsCustomerReferenceNumber1Field; + + private string mpsCustomerReferenceNumber2Field; + + private string mpsCustomerReferenceNumber3Field; + + private string mpsCustomerReferenceNumber4Field; + + private string identificationNumberField; + + private string sendingDepotField; + + private generalShipmentDataProduct productField; + + private bool mpsCompleteDeliveryField; + + private bool mpsCompleteDeliveryFieldSpecified; + + private bool mpsCompleteDeliveryLabelField; + + private bool mpsCompleteDeliveryLabelFieldSpecified; + + private int mpsVolumeField; + + private bool mpsVolumeFieldSpecified; + + private int mpsWeightField; + + private bool mpsWeightFieldSpecified; + + private string mpsExpectedSendingDateField; + + private string mpsExpectedSendingTimeField; + + private addressWithType senderField; + + private addressWithType recipientField; + + private addressWithType returnAddressField; + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=0)] + public string mpsId + { + get + { + return this.mpsIdField; + } + set + { + this.mpsIdField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=1)] + public string cUser + { + get + { + return this.cUserField; + } + set + { + this.cUserField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=2)] + public string mpsCustomerReferenceNumber1 + { + get + { + return this.mpsCustomerReferenceNumber1Field; + } + set + { + this.mpsCustomerReferenceNumber1Field = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=3)] + public string mpsCustomerReferenceNumber2 + { + get + { + return this.mpsCustomerReferenceNumber2Field; + } + set + { + this.mpsCustomerReferenceNumber2Field = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=4)] + public string mpsCustomerReferenceNumber3 + { + get + { + return this.mpsCustomerReferenceNumber3Field; + } + set + { + this.mpsCustomerReferenceNumber3Field = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=5)] + public string mpsCustomerReferenceNumber4 + { + get + { + return this.mpsCustomerReferenceNumber4Field; + } + set + { + this.mpsCustomerReferenceNumber4Field = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=6)] + public string identificationNumber + { + get + { + return this.identificationNumberField; + } + set + { + this.identificationNumberField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=7)] + public string sendingDepot + { + get + { + return this.sendingDepotField; + } + set + { + this.sendingDepotField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=8)] + public generalShipmentDataProduct product + { + get + { + return this.productField; + } + set + { + this.productField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=9)] + public bool mpsCompleteDelivery + { + get + { + return this.mpsCompleteDeliveryField; + } + set + { + this.mpsCompleteDeliveryField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool mpsCompleteDeliverySpecified + { + get + { + return this.mpsCompleteDeliveryFieldSpecified; + } + set + { + this.mpsCompleteDeliveryFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=10)] + public bool mpsCompleteDeliveryLabel + { + get + { + return this.mpsCompleteDeliveryLabelField; + } + set + { + this.mpsCompleteDeliveryLabelField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool mpsCompleteDeliveryLabelSpecified + { + get + { + return this.mpsCompleteDeliveryLabelFieldSpecified; + } + set + { + this.mpsCompleteDeliveryLabelFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=11)] + public int mpsVolume + { + get + { + return this.mpsVolumeField; + } + set + { + this.mpsVolumeField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool mpsVolumeSpecified + { + get + { + return this.mpsVolumeFieldSpecified; + } + set + { + this.mpsVolumeFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=12)] + public int mpsWeight + { + get + { + return this.mpsWeightField; + } + set + { + this.mpsWeightField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool mpsWeightSpecified + { + get + { + return this.mpsWeightFieldSpecified; + } + set + { + this.mpsWeightFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=13)] + public string mpsExpectedSendingDate + { + get + { + return this.mpsExpectedSendingDateField; + } + set + { + this.mpsExpectedSendingDateField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=14)] + public string mpsExpectedSendingTime + { + get + { + return this.mpsExpectedSendingTimeField; + } + set + { + this.mpsExpectedSendingTimeField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=15)] + public addressWithType sender + { + get + { + return this.senderField; + } + set + { + this.senderField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=16)] + public addressWithType recipient + { + get + { + return this.recipientField; + } + set + { + this.recipientField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=17)] + public addressWithType returnAddress + { + get + { + return this.returnAddressField; + } + set + { + this.returnAddressField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.1.0")] + [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true, Namespace="http://dpd.com/common/service/types/ShipmentService/4.4")] + public enum generalShipmentDataProduct + { + + /// + CL, + + /// + E830, + + /// + E10, + + /// + E12, + + /// + E18, + + /// + IE2, + + /// + MAIL, + + /// + MAX, + + /// + PL, + + /// + PM4, + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.1.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://dpd.com/common/service/types/ShipmentService/4.4")] + public partial class shipmentServiceData + { + + private generalShipmentData generalShipmentDataField; + + private parcel[] parcelsField; + + private productAndServiceData productAndServiceDataField; + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=0)] + public generalShipmentData generalShipmentData + { + get + { + return this.generalShipmentDataField; + } + set + { + this.generalShipmentDataField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("parcels", Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=1)] + public parcel[] parcels + { + get + { + return this.parcelsField; + } + set + { + this.parcelsField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=2)] + public productAndServiceData productAndServiceData + { + get + { + return this.productAndServiceDataField; + } + set + { + this.productAndServiceDataField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.1.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://dpd.com/common/service/types/ShipmentService/4.4")] + public partial class printer + { + + private string manufacturerField; + + private string modelField; + + private string revisionField; + + private decimal offsetXField; + + private decimal offsetYField; + + private printerConnectionType connectionTypeField; + + private bool barcodeCapable2DField; + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=0)] + public string manufacturer + { + get + { + return this.manufacturerField; + } + set + { + this.manufacturerField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=1)] + public string model + { + get + { + return this.modelField; + } + set + { + this.modelField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=2)] + public string revision + { + get + { + return this.revisionField; + } + set + { + this.revisionField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=3)] + public decimal offsetX + { + get + { + return this.offsetXField; + } + set + { + this.offsetXField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=4)] + public decimal offsetY + { + get + { + return this.offsetYField; + } + set + { + this.offsetYField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=5)] + public printerConnectionType connectionType + { + get + { + return this.connectionTypeField; + } + set + { + this.connectionTypeField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=6)] + public bool barcodeCapable2D + { + get + { + return this.barcodeCapable2DField; + } + set + { + this.barcodeCapable2DField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.1.0")] + [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true, Namespace="http://dpd.com/common/service/types/ShipmentService/4.4")] + public enum printerConnectionType + { + + /// + SERIAL, + + /// + PARALLEL, + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.1.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://dpd.com/common/service/types/ShipmentService/4.4")] + public partial class printOption + { + + private OutputFormatType outputFormatField; + + private printOptionPaperFormat paperFormatField; + + private bool paperFormatFieldSpecified; + + private printer printerField; + + private startPosition startPositionField; + + private bool startPositionFieldSpecified; + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=0)] + public OutputFormatType outputFormat + { + get + { + return this.outputFormatField; + } + set + { + this.outputFormatField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=1)] + public printOptionPaperFormat paperFormat + { + get + { + return this.paperFormatField; + } + set + { + this.paperFormatField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool paperFormatSpecified + { + get + { + return this.paperFormatFieldSpecified; + } + set + { + this.paperFormatFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=2)] + public printer printer + { + get + { + return this.printerField; + } + set + { + this.printerField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=3)] + public startPosition startPosition + { + get + { + return this.startPositionField; + } + set + { + this.startPositionField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool startPositionSpecified + { + get + { + return this.startPositionFieldSpecified; + } + set + { + this.startPositionFieldSpecified = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.1.0")] + [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true, Namespace="http://dpd.com/common/service/types/ShipmentService/4.4")] + public enum printOptionPaperFormat + { + + /// + A4, + + /// + A6, + + /// + A7, + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.1.0")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://dpd.com/common/service/types/ShipmentService/4.4")] + public enum startPosition + { + + /// + UPPER_LEFT, + + /// + UPPER_RIGHT, + + /// + LOWER_LEFT, + + /// + LOWER_RIGHT, + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.1.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://dpd.com/common/service/types/ShipmentService/4.4")] + public partial class printOptions + { + + private printOption[] printOptionField; + + private bool splitByParcelField; + + public printOptions() + { + this.splitByParcelField = false; + } + + /// + [System.Xml.Serialization.XmlElementAttribute("printOption", Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=0)] + public printOption[] printOption + { + get + { + return this.printOptionField; + } + set + { + this.printOptionField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=1)] + [System.ComponentModel.DefaultValueAttribute(false)] + public bool splitByParcel + { + get + { + return this.splitByParcelField; + } + set + { + this.splitByParcelField = value; + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.1.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://dpd.com/common/service/types/ShipmentService/4.4")] + public partial class storeOrders + { + + private printOptions printOptionsField; + + private shipmentServiceData[] orderField; + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=0)] + public printOptions printOptions + { + get + { + return this.printOptionsField; + } + set + { + this.printOptionsField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("order", Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=1)] + public shipmentServiceData[] order + { + get + { + return this.orderField; + } + set + { + this.orderField = value; + } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.1.0")] + [System.ServiceModel.ServiceContractAttribute(Namespace="http://dpd.com/common/service/ShipmentService/4.4", ConfigurationName="DPDShipmentService4_4.ShipmentService_4_4")] + internal interface ShipmentService_4_4 + { + + [System.ServiceModel.OperationContractAttribute(Action="http://dpd.com/common/service/ShipmentService/4.4/storeOrders", ReplyAction="*")] + [System.ServiceModel.FaultContractAttribute(typeof(DPDShipmentService4_4.authenticationFault), Action="http://dpd.com/common/service/ShipmentService/4.4/storeOrders", Name="authenticationFault", Namespace="http://dpd.com/common/service/types/Authentication/2.0")] + [System.ServiceModel.XmlSerializerFormatAttribute(SupportFaults=true)] + System.Threading.Tasks.Task storeOrdersAsync(DPDShipmentService4_4.storeOrdersRequest request); + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.1.0")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true, Namespace="http://dpd.com/common/service/types/Authentication/2.0")] + public partial class authentication + { + + private string delisIdField; + + private string authTokenField; + + private string messageLanguageField; + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=0)] + public string delisId + { + get + { + return this.delisIdField; + } + set + { + this.delisIdField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=1)] + public string authToken + { + get + { + return this.authTokenField; + } + set + { + this.authTokenField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=2)] + public string messageLanguage + { + get + { + return this.messageLanguageField; + } + set + { + this.messageLanguageField = value; + } + } + } + + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.1.0")] + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] + [System.ServiceModel.MessageContractAttribute(IsWrapped=false)] + internal partial class storeOrdersRequest + { + + [System.ServiceModel.MessageHeaderAttribute(Namespace="http://dpd.com/common/service/types/Authentication/2.0")] + public DPDShipmentService4_4.authentication authentication; + + [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://dpd.com/common/service/types/ShipmentService/4.4", Order=0)] + public DPDShipmentService4_4.storeOrders storeOrders; + + public storeOrdersRequest() + { + } + + public storeOrdersRequest(DPDShipmentService4_4.authentication authentication, DPDShipmentService4_4.storeOrders storeOrders) + { + this.authentication = authentication; + this.storeOrders = storeOrders; + } + } + + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.1.0")] + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] + [System.ServiceModel.MessageContractAttribute(IsWrapped=false)] + internal partial class storeOrdersResponse1 + { + + [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://dpd.com/common/service/types/ShipmentService/4.4", Order=0)] + public DPDShipmentService4_4.storeOrdersResponse storeOrdersResponse; + + public storeOrdersResponse1() + { + } + + public storeOrdersResponse1(DPDShipmentService4_4.storeOrdersResponse storeOrdersResponse) + { + this.storeOrdersResponse = storeOrdersResponse; + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.1.0")] + internal interface ShipmentService_4_4Channel : DPDShipmentService4_4.ShipmentService_4_4, System.ServiceModel.IClientChannel + { + } + + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.1.0")] + internal partial class ShipmentService_4_4Client : System.ServiceModel.ClientBase, DPDShipmentService4_4.ShipmentService_4_4 + { + + /// + /// Implement this partial method to configure the service endpoint. + /// + /// The endpoint to configure + /// The client credentials + static partial void ConfigureEndpoint(System.ServiceModel.Description.ServiceEndpoint serviceEndpoint, System.ServiceModel.Description.ClientCredentials clientCredentials); + + public ShipmentService_4_4Client() : + base(ShipmentService_4_4Client.GetDefaultBinding(), ShipmentService_4_4Client.GetDefaultEndpointAddress()) + { + this.Endpoint.Name = EndpointConfiguration.ShipmentService_Public_4_4_SOAP.ToString(); + ConfigureEndpoint(this.Endpoint, this.ClientCredentials); + } + + public ShipmentService_4_4Client(EndpointConfiguration endpointConfiguration) : + base(ShipmentService_4_4Client.GetBindingForEndpoint(endpointConfiguration), ShipmentService_4_4Client.GetEndpointAddress(endpointConfiguration)) + { + this.Endpoint.Name = endpointConfiguration.ToString(); + ConfigureEndpoint(this.Endpoint, this.ClientCredentials); + } + + public ShipmentService_4_4Client(EndpointConfiguration endpointConfiguration, string remoteAddress) : + base(ShipmentService_4_4Client.GetBindingForEndpoint(endpointConfiguration), new System.ServiceModel.EndpointAddress(remoteAddress)) + { + this.Endpoint.Name = endpointConfiguration.ToString(); + ConfigureEndpoint(this.Endpoint, this.ClientCredentials); + } + + public ShipmentService_4_4Client(EndpointConfiguration endpointConfiguration, System.ServiceModel.EndpointAddress remoteAddress) : + base(ShipmentService_4_4Client.GetBindingForEndpoint(endpointConfiguration), remoteAddress) + { + this.Endpoint.Name = endpointConfiguration.ToString(); + ConfigureEndpoint(this.Endpoint, this.ClientCredentials); + } + + public ShipmentService_4_4Client(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) : + base(binding, remoteAddress) + { + } + + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] + System.Threading.Tasks.Task DPDShipmentService4_4.ShipmentService_4_4.storeOrdersAsync(DPDShipmentService4_4.storeOrdersRequest request) + { + return base.Channel.storeOrdersAsync(request); + } + + public System.Threading.Tasks.Task storeOrdersAsync(DPDShipmentService4_4.authentication authentication, DPDShipmentService4_4.storeOrders storeOrders) + { + DPDShipmentService4_4.storeOrdersRequest inValue = new DPDShipmentService4_4.storeOrdersRequest(); + inValue.authentication = authentication; + inValue.storeOrders = storeOrders; + return ((DPDShipmentService4_4.ShipmentService_4_4)(this)).storeOrdersAsync(inValue); + } + + public virtual System.Threading.Tasks.Task OpenAsync() + { + return System.Threading.Tasks.Task.Factory.FromAsync(((System.ServiceModel.ICommunicationObject)(this)).BeginOpen(null, null), new System.Action(((System.ServiceModel.ICommunicationObject)(this)).EndOpen)); + } + + private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(EndpointConfiguration endpointConfiguration) + { + if ((endpointConfiguration == EndpointConfiguration.ShipmentService_Public_4_4_SOAP)) + { + System.ServiceModel.BasicHttpBinding result = new System.ServiceModel.BasicHttpBinding(); + result.MaxBufferSize = int.MaxValue; + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + result.Security.Mode = System.ServiceModel.BasicHttpSecurityMode.Transport; + return result; + } + throw new System.InvalidOperationException(string.Format("Could not find endpoint with name \'{0}\'.", endpointConfiguration)); + } + + private static System.ServiceModel.EndpointAddress GetEndpointAddress(EndpointConfiguration endpointConfiguration) + { + if ((endpointConfiguration == EndpointConfiguration.ShipmentService_Public_4_4_SOAP)) + { + return new System.ServiceModel.EndpointAddress("https://public-ws-stage.dpd.com/services/ShipmentService/V4_4/"); + } + throw new System.InvalidOperationException(string.Format("Could not find endpoint with name \'{0}\'.", endpointConfiguration)); + } + + private static System.ServiceModel.Channels.Binding GetDefaultBinding() + { + return ShipmentService_4_4Client.GetBindingForEndpoint(EndpointConfiguration.ShipmentService_Public_4_4_SOAP); + } + + private static System.ServiceModel.EndpointAddress GetDefaultEndpointAddress() + { + return ShipmentService_4_4Client.GetEndpointAddress(EndpointConfiguration.ShipmentService_Public_4_4_SOAP); + } + + public enum EndpointConfiguration + { + + ShipmentService_Public_4_4_SOAP, + } + } +} diff --git a/ShippingProAPICollection/Models/Entities/ShippingCancelResult.cs b/ShippingProAPICollection/Models/Entities/ShippingCancelResult.cs new file mode 100644 index 0000000..a8b6dbb --- /dev/null +++ b/ShippingProAPICollection/Models/Entities/ShippingCancelResult.cs @@ -0,0 +1,16 @@ +namespace ShippingProAPICollection.Models.Entities +{ + public enum ShippingCancelResult + { + + /// + /// Label was successfully canceled + /// + CANCLED, + + /// + /// Label already scanned or in use, cannot cancel label anymore + /// + ALREADY_IN_USE + } +} diff --git a/ShippingProAPICollection/Models/Entities/ShippingLabelType.cs b/ShippingProAPICollection/Models/Entities/ShippingLabelType.cs new file mode 100644 index 0000000..fd0debc --- /dev/null +++ b/ShippingProAPICollection/Models/Entities/ShippingLabelType.cs @@ -0,0 +1,10 @@ + +namespace ShippingProAPICollection.Models.Entities +{ + public enum ShippingLabelType + { + NORMAL, + EXPRESS, + SHOPRETURN + } +} diff --git a/ShippingProAPICollection/Models/Entities/ShippingProviderType.cs b/ShippingProAPICollection/Models/Entities/ShippingProviderType.cs new file mode 100644 index 0000000..02ac3ac --- /dev/null +++ b/ShippingProAPICollection/Models/Entities/ShippingProviderType.cs @@ -0,0 +1,10 @@ +using ShippingProAPICollection.Models; +namespace ShippingProAPICollection.Models.Entities +{ + public enum ShippingProviderType + { + GLS, + DHL, + DPD + } +} diff --git a/ShippingProAPICollection/Models/Error/ShipmentRequestLabelCountException.cs b/ShippingProAPICollection/Models/Error/ShipmentRequestLabelCountException.cs new file mode 100644 index 0000000..d5cf6a6 --- /dev/null +++ b/ShippingProAPICollection/Models/Error/ShipmentRequestLabelCountException.cs @@ -0,0 +1,15 @@ +using System.Diagnostics.CodeAnalysis; + +namespace ShippingProAPICollection.Models.Error +{ + public class ShipmentRequestLabelCountException : Exception + { + public required uint Value { get; set; } + + [SetsRequiredMembers] + public ShipmentRequestLabelCountException(uint value) + { + Value = value; + } + } +} diff --git a/ShippingProAPICollection/Models/Error/ShipmentRequestNoValidStringLengthException.cs b/ShippingProAPICollection/Models/Error/ShipmentRequestNoValidStringLengthException.cs new file mode 100644 index 0000000..d2504a2 --- /dev/null +++ b/ShippingProAPICollection/Models/Error/ShipmentRequestNoValidStringLengthException.cs @@ -0,0 +1,19 @@ +using System.Diagnostics.CodeAnalysis; + +namespace ShippingProAPICollection.Models.Error +{ + public class ShipmentRequestNoValidStringLengthException : Exception + { + public int? MinLength { get; set; } + public int? MaxLength { get; set; } + public required string Value { get; set; } + + [SetsRequiredMembers] + public ShipmentRequestNoValidStringLengthException(string value, int? min, int max) : base() + { + Value = value; + MinLength = min; + MaxLength = max; + } + } +} diff --git a/ShippingProAPICollection/Models/Error/ShipmentRequestNotNullException.cs b/ShippingProAPICollection/Models/Error/ShipmentRequestNotNullException.cs new file mode 100644 index 0000000..1a9ce4d --- /dev/null +++ b/ShippingProAPICollection/Models/Error/ShipmentRequestNotNullException.cs @@ -0,0 +1,15 @@ +using System.Diagnostics.CodeAnalysis; + +namespace ShippingProAPICollection.Models.Error +{ + public class ShipmentRequestNotNullException : Exception + { + public required string Value { get; set; } + + [SetsRequiredMembers] + public ShipmentRequestNotNullException(string value) : base() + { + Value = value; + } + } +} diff --git a/ShippingProAPICollection/Models/Error/ShipmentRequestWeightException.cs b/ShippingProAPICollection/Models/Error/ShipmentRequestWeightException.cs new file mode 100644 index 0000000..0487177 --- /dev/null +++ b/ShippingProAPICollection/Models/Error/ShipmentRequestWeightException.cs @@ -0,0 +1,19 @@ +using System.Diagnostics.CodeAnalysis; + +namespace ShippingProAPICollection.Models.Error +{ + public class ShipmentRequestWeightException : Exception + { + public required float MinWeight { get; set; } + public required float MaxWeight { get; set; } + public required float CurrentWeight { get; set; } + + [SetsRequiredMembers] + public ShipmentRequestWeightException(float minWeight, float maxWeight, float currentWeight) : base() + { + MinWeight = minWeight; + MaxWeight = maxWeight; + CurrentWeight = currentWeight; + } + } +} diff --git a/ShippingProAPICollection/Models/Error/ShippingErrorCodes.cs b/ShippingProAPICollection/Models/Error/ShippingErrorCodes.cs new file mode 100644 index 0000000..bfcb08c --- /dev/null +++ b/ShippingProAPICollection/Models/Error/ShippingErrorCodes.cs @@ -0,0 +1,25 @@ + +namespace ShippingProAPICollection.Models.Error +{ + public enum ShippingErrorCode + { + UNKNOW = 9999, + UNAUTHORIZED, + TO_MANY_REQUESTS, + INTERNAL_SERVER_ERROR, + BAD_REQUEST_ERROR, + CANNOT_CONVERT_RESPONSE, + DPD_LOGIN_ERROR, + DPD_SHIPMENT_REQUEST_ERROR, + NOT_AVAILABLE, + GLS_INCOTERM_ERROR, + GLS_PRODUCT_CANNOT_USE_ERROR, + GLS_NEXT_DAY_NOT_SATURDAY_ERROR, + GLS_ROUTING_ERROR, + GLS_POSTCODE_ERROR, + GLS_WEIGHT_ERROR, + GLS_ARTICLE_COMBINATIONS_ERROR, + GLS_COMMON_ERROR, + GLS_ARTICLE_DESTINATION_EXCLUSION_ERROR, + } +} diff --git a/ShippingProAPICollection/Models/Error/ShippingProviderException.cs b/ShippingProAPICollection/Models/Error/ShippingProviderException.cs new file mode 100644 index 0000000..0b05b39 --- /dev/null +++ b/ShippingProAPICollection/Models/Error/ShippingProviderException.cs @@ -0,0 +1,14 @@ +namespace ShippingProAPICollection.Models.Error +{ + public class ShippingProviderException : Exception + { + public ShippingErrorCode ErrorCode { get; private set; } + public object? Payload { get; private set; } + + public ShippingProviderException(ShippingErrorCode errorcode, string message, object? payload = null) : base(message) + { + ErrorCode = errorcode; + Payload = payload; + } + } +} diff --git a/ShippingProAPICollection/Models/RequestShippingLabelResponse.cs b/ShippingProAPICollection/Models/RequestShippingLabelResponse.cs new file mode 100644 index 0000000..3143081 --- /dev/null +++ b/ShippingProAPICollection/Models/RequestShippingLabelResponse.cs @@ -0,0 +1,44 @@ +using ShippingProAPICollection.Models.Entities; + +namespace ShippingProAPICollection.Models +{ + public class RequestShippingLabelResponse + { + /// + /// Id um das Label zu Löschen | + /// Id to cancel the label + /// + public required string CancelId { get; set; } + + /// + /// Trackingnummer | + /// Parcelnumber of the label + /// + public required string ParcelNumber { get; set; } + + /// + /// Label als PDF in byte[] Format | + /// Shippinglabel in byte[] format + /// + public required byte[] Label { get; set; } + + /// + /// Gewicht des Paketes in Kg + /// Weight of the package Kg + /// + public required float Weight { get; set; } + + /// + /// Art des Labels, Normaler versand, Express versand oder Retourenlabel + /// Kind of the label, normal shipment, express shipment or shop return + /// + public required ShippingLabelType LabelType { get; set; } + + /// + /// Weitere Werte über das Versandlabel + /// Additional values about the shipping label + /// + public Dictionary? AdditionalValues { get; set; } + + } +} diff --git a/ShippingProAPICollection/Models/RequiredMemberAttribute.cs b/ShippingProAPICollection/Models/RequiredMemberAttribute.cs new file mode 100644 index 0000000..6a437d7 --- /dev/null +++ b/ShippingProAPICollection/Models/RequiredMemberAttribute.cs @@ -0,0 +1,41 @@ +using System.ComponentModel; + +namespace System.Runtime.CompilerServices +{ +#if !NET5_0_OR_GREATER + + [EditorBrowsable(EditorBrowsableState.Never)] + internal static class IsExternalInit { } + +#endif // !NET5_0_OR_GREATER + +#if !NET7_0_OR_GREATER + + [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = false, Inherited = false)] + internal sealed class RequiredMemberAttribute : Attribute { } + + [AttributeUsage(AttributeTargets.All, AllowMultiple = true, Inherited = false)] + internal sealed class CompilerFeatureRequiredAttribute : Attribute + { + public CompilerFeatureRequiredAttribute(string featureName) + { + FeatureName = featureName; + } + + public string FeatureName { get; } + public bool IsOptional { get; init; } + + public const string RefStructs = nameof(RefStructs); + public const string RequiredMembers = nameof(RequiredMembers); + } + +#endif // !NET7_0_OR_GREATER +} + +namespace System.Diagnostics.CodeAnalysis +{ +#if !NET7_0_OR_GREATER + [AttributeUsage(AttributeTargets.Constructor, AllowMultiple = false, Inherited = false)] + internal sealed class SetsRequiredMembersAttribute : Attribute { } +#endif +} diff --git a/ShippingProAPICollection/Models/ShippingProAPIAccountSettings.cs b/ShippingProAPICollection/Models/ShippingProAPIAccountSettings.cs new file mode 100644 index 0000000..d88539a --- /dev/null +++ b/ShippingProAPICollection/Models/ShippingProAPIAccountSettings.cs @@ -0,0 +1,17 @@ + +namespace ShippingProAPICollection.Models +{ + public class ShippingProAPIAccountSettings + { + public required string Name { get; set; } + public string? Name2 { get; set; } + public string? Name3 { get; set; } + public required string Street { get; set; } + public required string PostCode { get; set; } + public required string City { get; set; } + public required string CountryIsoA2Code { get; set; } + public required string ContactName { get; set; } + public required string Email { get; set; } + public required string Phone { get; set; } + } +} diff --git a/ShippingProAPICollection/Models/Utils/ByteUtils.cs b/ShippingProAPICollection/Models/Utils/ByteUtils.cs new file mode 100644 index 0000000..2ec45bb --- /dev/null +++ b/ShippingProAPICollection/Models/Utils/ByteUtils.cs @@ -0,0 +1,45 @@ +using iText.Kernel.Pdf; +using iText.Kernel.Utils; + +namespace ShippingProAPICollection.Models.Utils +{ + internal static class ByteUtils + { + /// + /// Combinate multiple pdfs to one + /// + /// + /// + internal static byte[] MergePDFByteToOnePDF(List pdfs) + { + using (var writerMemoryStream = new MemoryStream()) + { + using (var writer = new PdfWriter(writerMemoryStream)) + { + using (var mergedDocument = new PdfDocument(writer)) + { + var merger = new PdfMerger(mergedDocument); + + foreach (var pdfBytes in pdfs) + { + using (var copyFromMemoryStream = new MemoryStream(pdfBytes)) + { + using (var reader = new PdfReader(copyFromMemoryStream)) + { + reader.SetUnethicalReading(true); + using (var copyFromDocument = new PdfDocument(reader)) + { + merger.Merge(copyFromDocument, 1, copyFromDocument.GetNumberOfPages()); + } + } + } + } + } + } + + return writerMemoryStream.ToArray(); + } + + } + } +} diff --git a/ShippingProAPICollection/Models/Utils/EnumUtils.cs b/ShippingProAPICollection/Models/Utils/EnumUtils.cs new file mode 100644 index 0000000..f1ee67a --- /dev/null +++ b/ShippingProAPICollection/Models/Utils/EnumUtils.cs @@ -0,0 +1,29 @@ +namespace ShippingProAPICollection.Models.Utils +{ + internal static class EnumUtils + { + /// + /// Convert string to enum, if enum not exist, return default enum + /// + /// + /// + /// + /// + internal static T ToEnum(this string value, T defaultValue) where T : struct + { + try + { + T enumValue; + if (!Enum.TryParse(value, true, out enumValue)) + { + return defaultValue; + } + return enumValue; + } + catch (Exception) + { + return defaultValue; + } + } + } +} diff --git a/ShippingProAPICollection/Models/Utils/StringUtils.cs b/ShippingProAPICollection/Models/Utils/StringUtils.cs new file mode 100644 index 0000000..bb7057e --- /dev/null +++ b/ShippingProAPICollection/Models/Utils/StringUtils.cs @@ -0,0 +1,51 @@ +namespace ShippingProAPICollection.Models.Utils +{ + internal static class StringUtils + { + /// + /// Is string between min and max length + /// + /// + /// + /// + /// + internal static bool RangeLenghtValidation(this string? value, int minLength, int maxLength) + { + if (value == null) + { + if (minLength == 0) return true; + return false; + } + + return value.Trim().Length >= minLength && value.Trim().Length <= maxLength; + } + + /// + /// Is string size not greater than max length + /// + /// + /// + /// + internal static bool MaxLenghtValidation(this string? value, int maxLength) + { + + if (value == null) return true; + return value.Length <= maxLength; + } + + /// + /// FIll the string to a specified length + /// + /// + /// + internal static string FillString(this string input, int length, char fillChar) + { + if (input.Length >= length) + return input; + + int fillCount = length - input.Length; + string filledString = input.PadRight(input.Length + fillCount, fillChar); + return filledString; + } + } +} diff --git a/ShippingProAPICollection/Provider/CustomProviderSettings.cs b/ShippingProAPICollection/Provider/CustomProviderSettings.cs new file mode 100644 index 0000000..08a98a6 --- /dev/null +++ b/ShippingProAPICollection/Provider/CustomProviderSettings.cs @@ -0,0 +1,10 @@ +using Microsoft.Extensions.Caching.Memory; +using ShippingProAPICollection.Models; + +namespace ShippingProAPICollection.Provider +{ + public abstract class CustomProviderSettings : ProviderSettings + { + public abstract IShippingProviderService CreateProviderService(ShippingProAPIAccountSettings accountSettings, IMemoryCache _cache); + } +} diff --git a/ShippingProAPICollection/Provider/DHL/Client/DHLClient.cs b/ShippingProAPICollection/Provider/DHL/Client/DHLClient.cs new file mode 100644 index 0000000..d9aadee --- /dev/null +++ b/ShippingProAPICollection/Provider/DHL/Client/DHLClient.cs @@ -0,0 +1,4651 @@ +//---------------------- +// +// Generated using the NSwag toolchain v13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v13.0.0.0)) (http://NSwag.org) +// + +/* + * ╱╲╱╲ STOP ╱╲╱╲ + * ╱╲╱╲ STOP ╱╲╱╲ + * ╱╲╱╲ STOP ╱╲╱╲ + * + * (âŒâ– _â– ) + * PLEASSSSEEEEEEEE TAKE A LOOK AT LINE 3890 + * + * ╱╲╱╲ STOP ╱╲╱╲ + * ╱╲╱╲ STOP ╱╲╱╲ + * ╱╲╱╲ STOP ╱╲╱╲ + */ + +//---------------------- + +#pragma warning disable 108 // Disable "CS0108 '{derivedDto}.ToJson()' hides inherited member '{dtoBase}.ToJson()'. Use the new keyword if hiding was intended." +#pragma warning disable 114 // Disable "CS0114 '{derivedDto}.RaisePropertyChanged(String)' hides inherited member 'dtoBase.RaisePropertyChanged(String)'. To make the current member override that implementation, add the override keyword. Otherwise add the new keyword." +#pragma warning disable 472 // Disable "CS0472 The result of the expression is always 'false' since a value of type 'Int32' is never equal to 'null' of type 'Int32?' +#pragma warning disable 1573 // Disable "CS1573 Parameter '...' has no matching param tag in the XML comment for ... +#pragma warning disable 1591 // Disable "CS1591 Missing XML comment for publicly visible type or member ..." +#pragma warning disable 8073 // Disable "CS8073 The result of the expression is always 'false' since a value of type 'T' is never equal to 'null' of type 'T?'" +#pragma warning disable 3016 // Disable "CS3016 Arrays as attribute arguments is not CLS-compliant" +#pragma warning disable 8603 // Disable "CS8603 Possible null reference return" + +namespace ShippingProAPICollection._Provider.DHL +{ + using System = global::System; + + [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v13.0.0.0))")] + internal partial class DHLClient + { + private string _baseUrl = "https://api-eu.dhl.com/parcel/de/shipping/v2"; + private System.Net.Http.HttpClient _httpClient; + private System.Lazy _settings; + + public DHLClient(System.Net.Http.HttpClient httpClient) + { + _httpClient = httpClient; + _settings = new System.Lazy(CreateSerializerSettings); + } + + private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() + { + var settings = new Newtonsoft.Json.JsonSerializerSettings(); + UpdateJsonSerializerSettings(settings); + return settings; + } + + public string BaseUrl + { + get { return _baseUrl; } + set { _baseUrl = value; } + } + + protected Newtonsoft.Json.JsonSerializerSettings JsonSerializerSettings { get { return _settings.Value; } } + + partial void UpdateJsonSerializerSettings(Newtonsoft.Json.JsonSerializerSettings settings); + + partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, string url); + partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, System.Text.StringBuilder urlBuilder); + partial void ProcessResponse(System.Net.Http.HttpClient client, System.Net.Http.HttpResponseMessage response); + + /// + /// Return API version + /// + /// + /// Returns the current version of the API as major.minor.patch. Furthermore, it will also return more details (semantic version number, revision, environment) of the API layer. + /// + /// OK + /// A server side error occurred. + public virtual System.Threading.Tasks.Task RootGetAsync() + { + return RootGetAsync(System.Threading.CancellationToken.None); + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Return API version + /// + /// + /// Returns the current version of the API as major.minor.patch. Furthermore, it will also return more details (semantic version number, revision, environment) of the API layer. + /// + /// OK + /// A server side error occurred. + public virtual async System.Threading.Tasks.Task RootGetAsync(System.Threading.CancellationToken cancellationToken) + { + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/"); + + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + request_.Method = new System.Net.Http.HttpMethod("GET"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = (int)response_.StatusCode; + if (status_ == 200) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + return objectResponse_.Object; + } + else + if (status_ == 401) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("Unauthorized", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 429) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("Too Many Requests", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("Internal Server Error", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + /// + /// Download PDF document + /// + /// + /// Public download URL for shipment labels and documents. The URL is provided in the response of the POST /orders or GET /orders resources. The document is identified via the token query parameter. There is no additional authorization, the resource URL can be shared. Please protect the URL as needed. The call returns a PDF label. + /// + /// Identifies PDF document and requested print settings for download. + /// OK + /// A server side error occurred. + public virtual System.Threading.Tasks.Task GetLabelAsync(string token) + { + return GetLabelAsync(token, System.Threading.CancellationToken.None); + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Download PDF document + /// + /// + /// Public download URL for shipment labels and documents. The URL is provided in the response of the POST /orders or GET /orders resources. The document is identified via the token query parameter. There is no additional authorization, the resource URL can be shared. Please protect the URL as needed. The call returns a PDF label. + /// + /// Identifies PDF document and requested print settings for download. + /// OK + /// A server side error occurred. + public virtual async System.Threading.Tasks.Task GetLabelAsync(string token, System.Threading.CancellationToken cancellationToken) + { + if (token == null) + throw new System.ArgumentNullException("token"); + + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/labels?"); + urlBuilder_.Append(System.Uri.EscapeDataString("token") + "=").Append(System.Uri.EscapeDataString(ConvertToString(token, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + urlBuilder_.Length--; + + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + request_.Method = new System.Net.Http.HttpMethod("GET"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/pdf")); + + PrepareRequest(client_, request_, urlBuilder_); + + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = (int)response_.StatusCode; + if (status_ == 200) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + return objectResponse_.Object; + } + else + if (status_ == 404) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("Unauthorized", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 429) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("Too Many Requests", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("Internal Server Error", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + /// + /// Retrieve daily manifest document + /// + /// + /// Return the manifest document for the specific date (abbreviated ISO8601 format YYYY-MM-DD). If no date is provided, the manifest for today will be returned. The manifest PDF document will list the shipments for your EKP, separated by billing numbers. Potentially, the document is large and response time will reflect this. <br />Additionally, the response contains a mapping of billing numbers to sheet numbers of the manifest and a mapping of shipment numbers to sheet numbers.<br />The call can be repeated as often as needed. Should a date be provided which is too old or lies within the future, HTTP 400 is returned. + /// + /// Customer billingNumber number. + /// Legacy name **labelResponseType**. Shipping labels and further shipment documents can be: + ///
* __include__: included as base64 encoded data in the response (default) + ///
* __URL__: provided as URL reference. + ///
Default is include the base64 encoded labels. + /// Control the APIs response language via locale abbreviation. English (en-US) and german (de-DE) are supported. If not specified, the default is english. + /// OK + /// A server side error occurred. + public virtual System.Threading.Tasks.Task GetManifestsAsync(string billingNumber, string date, IncludeDocs? includeDocs, string accept_Language) + { + return GetManifestsAsync(billingNumber, date, includeDocs, accept_Language, System.Threading.CancellationToken.None); + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Retrieve daily manifest document + /// + /// + /// Return the manifest document for the specific date (abbreviated ISO8601 format YYYY-MM-DD). If no date is provided, the manifest for today will be returned. The manifest PDF document will list the shipments for your EKP, separated by billing numbers. Potentially, the document is large and response time will reflect this. <br />Additionally, the response contains a mapping of billing numbers to sheet numbers of the manifest and a mapping of shipment numbers to sheet numbers.<br />The call can be repeated as often as needed. Should a date be provided which is too old or lies within the future, HTTP 400 is returned. + /// + /// Customer billingNumber number. + /// Legacy name **labelResponseType**. Shipping labels and further shipment documents can be: + ///
* __include__: included as base64 encoded data in the response (default) + ///
* __URL__: provided as URL reference. + ///
Default is include the base64 encoded labels. + /// Control the APIs response language via locale abbreviation. English (en-US) and german (de-DE) are supported. If not specified, the default is english. + /// OK + /// A server side error occurred. + public virtual async System.Threading.Tasks.Task GetManifestsAsync(string billingNumber, string date, IncludeDocs? includeDocs, string accept_Language, System.Threading.CancellationToken cancellationToken) + { + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/manifests?"); + if (billingNumber != null) + { + urlBuilder_.Append(System.Uri.EscapeDataString("billingNumber") + "=").Append(System.Uri.EscapeDataString(ConvertToString(billingNumber, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + } + if (date != null) + { + urlBuilder_.Append(System.Uri.EscapeDataString("date") + "=").Append(System.Uri.EscapeDataString(ConvertToString(date, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + } + if (includeDocs != null) + { + urlBuilder_.Append(System.Uri.EscapeDataString("includeDocs") + "=").Append(System.Uri.EscapeDataString(ConvertToString(includeDocs, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + } + urlBuilder_.Length--; + + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + + if (accept_Language != null) + request_.Headers.TryAddWithoutValidation("Accept-Language", ConvertToString(accept_Language, System.Globalization.CultureInfo.InvariantCulture)); + request_.Method = new System.Net.Http.HttpMethod("GET"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = (int)response_.StatusCode; + if (status_ == 200) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + return objectResponse_.Object; + } + else + if (status_ == 400) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("Bad Request", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 401) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("Unauthorized", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 404) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("Not Found", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 429) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("Too Many Requests", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("Internal Server Error", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + /// + /// Mark shipments as being ready for shipping + /// + /// + /// Shipments are normally ''closed out'' at a fixed time of the day (such as 6 pm, configured by EKP/account) for the date provided as shipDate in the create call. + ///
<br />This call allows forcing the closeout for sets of shipments earlier. This will also override the original shipDate. Afterwards, the shipment cannot be changed and the shipment labels cannot be queried anymore (however they may remain cached for limited duration). + ///
Calling closeout repeatedly for the same shipments will result in HTTP 400 for the second call. HTTP 400 will also be returned if the automatic closeout happened prior to the call. It is however possible to add new shipments, they will be manifested as well and be part of the day's manifest. + ///
<br />Note on billing: The manifesting step has billing implications. Some products (Warenpost, Parcel International partially) are billed based on the shipment data available to DHL at the end of the day. All other products (including DHL Paket Standard) are billed based on production data. For more details, please contact your account representative. + ///
+ ///
#### Request + ///
It's changing the status of the shipment, so parameters are provided in the body. + ///
* ''profile'' attribute - defines the user group profile. A user group is permitted to specific billing numbers. Shipments are only closed out if they belong to a billing number that the user group profile is entitled to use. This attribute is mandatory. Please use the standard user group profile ''STANDARD_GRUPPENPROFIL'' if no dedicated user group profile is available. + ///
* ''billingNumber'' attribute - defines the billing number for which shipments shall be closed out. If a billing number is set, then only the shipments of that billing number are closed out. In that case no list of specific shipment numbers needs to be passed. + ///
* ''shipmentNumbers'' attribute - lists the specific shipping numbers of the shipments that shall be closed out. + ///
If all shipments shall be closed, the query parameter ''all'' needs to be set to ''true''. In that case neither a billing number nor a list of shipment numbers need to be passed in the request body. + ///
+ ///
#### Response + ///
* Closing status for each shipment + ///
+ /// Control the APIs response language via locale abbreviation. English (en-US) and german (de-DE) are supported. If not specified, the default is english. + /// Specify if all applicable shipments shall be marked as being ready for shipping. + /// Response for manifesting request taking multiple input elements + /// A server side error occurred. + public virtual System.Threading.Tasks.Task ManifestsPostAsync(string accept_Language, bool? all, ShipmentManifestingRequest body) + { + return ManifestsPostAsync(accept_Language, all, body, System.Threading.CancellationToken.None); + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Mark shipments as being ready for shipping + /// + /// + /// Shipments are normally ''closed out'' at a fixed time of the day (such as 6 pm, configured by EKP/account) for the date provided as shipDate in the create call. + ///
<br />This call allows forcing the closeout for sets of shipments earlier. This will also override the original shipDate. Afterwards, the shipment cannot be changed and the shipment labels cannot be queried anymore (however they may remain cached for limited duration). + ///
Calling closeout repeatedly for the same shipments will result in HTTP 400 for the second call. HTTP 400 will also be returned if the automatic closeout happened prior to the call. It is however possible to add new shipments, they will be manifested as well and be part of the day's manifest. + ///
<br />Note on billing: The manifesting step has billing implications. Some products (Warenpost, Parcel International partially) are billed based on the shipment data available to DHL at the end of the day. All other products (including DHL Paket Standard) are billed based on production data. For more details, please contact your account representative. + ///
+ ///
#### Request + ///
It's changing the status of the shipment, so parameters are provided in the body. + ///
* ''profile'' attribute - defines the user group profile. A user group is permitted to specific billing numbers. Shipments are only closed out if they belong to a billing number that the user group profile is entitled to use. This attribute is mandatory. Please use the standard user group profile ''STANDARD_GRUPPENPROFIL'' if no dedicated user group profile is available. + ///
* ''billingNumber'' attribute - defines the billing number for which shipments shall be closed out. If a billing number is set, then only the shipments of that billing number are closed out. In that case no list of specific shipment numbers needs to be passed. + ///
* ''shipmentNumbers'' attribute - lists the specific shipping numbers of the shipments that shall be closed out. + ///
If all shipments shall be closed, the query parameter ''all'' needs to be set to ''true''. In that case neither a billing number nor a list of shipment numbers need to be passed in the request body. + ///
+ ///
#### Response + ///
* Closing status for each shipment + ///
+ /// Control the APIs response language via locale abbreviation. English (en-US) and german (de-DE) are supported. If not specified, the default is english. + /// Specify if all applicable shipments shall be marked as being ready for shipping. + /// Response for manifesting request taking multiple input elements + /// A server side error occurred. + public virtual async System.Threading.Tasks.Task ManifestsPostAsync(string accept_Language, bool? all, ShipmentManifestingRequest body, System.Threading.CancellationToken cancellationToken) + { + if (body == null) + throw new System.ArgumentNullException("body"); + + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/manifests?"); + if (all != null) + { + urlBuilder_.Append(System.Uri.EscapeDataString("all") + "=").Append(System.Uri.EscapeDataString(ConvertToString(all, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + } + urlBuilder_.Length--; + + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + + if (accept_Language != null) + request_.Headers.TryAddWithoutValidation("Accept-Language", ConvertToString(accept_Language, System.Globalization.CultureInfo.InvariantCulture)); + var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value); + var content_ = new System.Net.Http.StringContent(json_); + content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + request_.Content = content_; + request_.Method = new System.Net.Http.HttpMethod("POST"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = (int)response_.StatusCode; + if (status_ == 207) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + return objectResponse_.Object; + } + else + if (status_ == 400) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("Bad Request", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 401) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("Unauthorized", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 429) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("Too Many Requests", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("Internal Server Error", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + /// + /// Retrieve shipment documents - labels and customs documents + /// + /// + /// Returns documents for existing shipment(s). The call accepts multiple shipment numbers and will provide sets of documents for those. The **format (PDF,ZPL)** and **method of delivery (URL, encoded, data)** can be selected for **all** shipments and labels in that call. You cannot chose one format and delivery method for one label and different for another label within the same call. You can also specify if you want regular labels, return labels, cod labels, or customsDoc. Any combination is possible. + ///
+ ///
The call returns for each shipment number the status indicator and the selected labels and documents. If a label type (for example a cod label) does not exist for a shipment, it will not be returned. This is not an error. If you were sending multiple shipments, you will get an HTTP 207 response (multistatus) with detailed status for each shipment. Other standard HTTP response codes (200, 400, 401, 429, 500) are possible as well. Labels can be either provided as part of the response (base64 encoded for PDF, text for ZPL) or via URL link for view and download (PDF). Note that the format settings per query parameters apply to the shipping label. Retoure label paper type can be specified separately since a different printer may be used here. If requesting labels to be returned as URL for separate download, the URLs provided can be shared. + ///
+ /// This parameter identifies shipments. The parameter can be used multiple times in one request to get the labels and/or documents for up to 30 shipments maximum. Only documents and label for shipments that are not yet closed can be retrieved. + /// Control the APIs response language via locale abbreviation. English (en-US) and german (de-DE) are supported. If not specified, the default is english. + /// **Defines** the **printable** document format to be used for label and manifest documents. + /// **Defines** the print medium for the shipping label. The different option vary from standard papersizes DIN A4 and DIN A5 to specific label print formats.  + ///
+ ///
Specific laser print formats using DIN A5 blanks are: + ///
+ ///
* 910-300-600(-oz) (105 x 205mm) + ///
* 910-300-300(-oz) (105 x 148mm) + ///
+ ///
Specific laser print formats **not** using a DIN A5 blank: + ///
+ ///
* 910-300-610 (105 x 208mm) + ///
* 100x70mm + ///
+ ///
Specific thermal print formats: + ///
+ ///
* 910-300-600 (103 x 199mm) + ///
* 910-300-400 (103 x 150mm) + ///
* 100x70mm + ///
+ ///
Please use the different formats as follows. If you do not set the parameter the settings of DHL costumer portal account will be used as default. + /// **Defines** the print medium for the return shipping label. This parameter is only usable, if you do not use **combined printing**. The different option vary from standard papersizes DIN A4 and DIN A5 to specific label print formats.  + ///
+ ///
Specific laser print formats using DIN A5 blanks are: + ///
+ ///
* 910-300-600(-oz) (105 x 205mm) + ///
* 910-300-300(-oz) (105 x 148mm) + ///
+ ///
Specific laser print formats **not** using a DIN A5 blank: + ///
+ ///
* 910-300-610 (105 x 208mm) + ///
* 100x70mm + ///
+ ///
Specific thermal print formats: + ///
+ ///
* 910-300-600 (103 x 199mm) + ///
* 910-300-400 (103 x 150mm) + ///
* 100x70mm + ///
+ ///
Please use the different formats as follows. If you do not set the parameter the settings of DHL costumer portal account will be used as default. + /// Legacy name **labelResponseType**. Shipping labels and further shipment documents can be: + ///
* __include__: included as base64 encoded data in the response (default) + ///
* __URL__: provided as URL reference. + ///
Default is include the base64 encoded labels. + /// If set, label and return label for one shipment will be printed as single PDF document with possibly multiple pages. Else, those two labels come as separate documents. The option does not affect customs documents and COD labels. + /// Success response for requests with a single shipment. + /// A server side error occurred. + public virtual System.Threading.Tasks.Task GetOrderAsync(System.Collections.Generic.IEnumerable shipment, string accept_Language, DocFormat? docFormat, PrintFormat? printFormat, RetourePrintFormat? retourePrintFormat, IncludeDocs2? includeDocs, bool? combine) + { + return GetOrderAsync(shipment, accept_Language, docFormat, printFormat, retourePrintFormat, includeDocs, combine, System.Threading.CancellationToken.None); + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Retrieve shipment documents - labels and customs documents + /// + /// + /// Returns documents for existing shipment(s). The call accepts multiple shipment numbers and will provide sets of documents for those. The **format (PDF,ZPL)** and **method of delivery (URL, encoded, data)** can be selected for **all** shipments and labels in that call. You cannot chose one format and delivery method for one label and different for another label within the same call. You can also specify if you want regular labels, return labels, cod labels, or customsDoc. Any combination is possible. + ///
+ ///
The call returns for each shipment number the status indicator and the selected labels and documents. If a label type (for example a cod label) does not exist for a shipment, it will not be returned. This is not an error. If you were sending multiple shipments, you will get an HTTP 207 response (multistatus) with detailed status for each shipment. Other standard HTTP response codes (200, 400, 401, 429, 500) are possible as well. Labels can be either provided as part of the response (base64 encoded for PDF, text for ZPL) or via URL link for view and download (PDF). Note that the format settings per query parameters apply to the shipping label. Retoure label paper type can be specified separately since a different printer may be used here. If requesting labels to be returned as URL for separate download, the URLs provided can be shared. + ///
+ /// This parameter identifies shipments. The parameter can be used multiple times in one request to get the labels and/or documents for up to 30 shipments maximum. Only documents and label for shipments that are not yet closed can be retrieved. + /// Control the APIs response language via locale abbreviation. English (en-US) and german (de-DE) are supported. If not specified, the default is english. + /// **Defines** the **printable** document format to be used for label and manifest documents. + /// **Defines** the print medium for the shipping label. The different option vary from standard papersizes DIN A4 and DIN A5 to specific label print formats.  + ///
+ ///
Specific laser print formats using DIN A5 blanks are: + ///
+ ///
* 910-300-600(-oz) (105 x 205mm) + ///
* 910-300-300(-oz) (105 x 148mm) + ///
+ ///
Specific laser print formats **not** using a DIN A5 blank: + ///
+ ///
* 910-300-610 (105 x 208mm) + ///
* 100x70mm + ///
+ ///
Specific thermal print formats: + ///
+ ///
* 910-300-600 (103 x 199mm) + ///
* 910-300-400 (103 x 150mm) + ///
* 100x70mm + ///
+ ///
Please use the different formats as follows. If you do not set the parameter the settings of DHL costumer portal account will be used as default. + /// **Defines** the print medium for the return shipping label. This parameter is only usable, if you do not use **combined printing**. The different option vary from standard papersizes DIN A4 and DIN A5 to specific label print formats.  + ///
+ ///
Specific laser print formats using DIN A5 blanks are: + ///
+ ///
* 910-300-600(-oz) (105 x 205mm) + ///
* 910-300-300(-oz) (105 x 148mm) + ///
+ ///
Specific laser print formats **not** using a DIN A5 blank: + ///
+ ///
* 910-300-610 (105 x 208mm) + ///
* 100x70mm + ///
+ ///
Specific thermal print formats: + ///
+ ///
* 910-300-600 (103 x 199mm) + ///
* 910-300-400 (103 x 150mm) + ///
* 100x70mm + ///
+ ///
Please use the different formats as follows. If you do not set the parameter the settings of DHL costumer portal account will be used as default. + /// Legacy name **labelResponseType**. Shipping labels and further shipment documents can be: + ///
* __include__: included as base64 encoded data in the response (default) + ///
* __URL__: provided as URL reference. + ///
Default is include the base64 encoded labels. + /// If set, label and return label for one shipment will be printed as single PDF document with possibly multiple pages. Else, those two labels come as separate documents. The option does not affect customs documents and COD labels. + /// Success response for requests with a single shipment. + /// A server side error occurred. + public virtual async System.Threading.Tasks.Task GetOrderAsync(System.Collections.Generic.IEnumerable shipment, string accept_Language, DocFormat? docFormat, PrintFormat? printFormat, RetourePrintFormat? retourePrintFormat, IncludeDocs2? includeDocs, bool? combine, System.Threading.CancellationToken cancellationToken) + { + if (shipment == null) + throw new System.ArgumentNullException("shipment"); + + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/orders?"); + foreach (var item_ in shipment) { urlBuilder_.Append(System.Uri.EscapeDataString("shipment") + "=").Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); } + if (docFormat != null) + { + urlBuilder_.Append(System.Uri.EscapeDataString("docFormat") + "=").Append(System.Uri.EscapeDataString(ConvertToString(docFormat, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + } + if (printFormat != null) + { + urlBuilder_.Append(System.Uri.EscapeDataString("printFormat") + "=").Append(System.Uri.EscapeDataString(ConvertToString(printFormat, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + } + if (retourePrintFormat != null) + { + urlBuilder_.Append(System.Uri.EscapeDataString("retourePrintFormat") + "=").Append(System.Uri.EscapeDataString(ConvertToString(retourePrintFormat, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + } + if (includeDocs != null) + { + urlBuilder_.Append(System.Uri.EscapeDataString("includeDocs") + "=").Append(System.Uri.EscapeDataString(ConvertToString(includeDocs, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + } + if (combine != null) + { + urlBuilder_.Append(System.Uri.EscapeDataString("combine") + "=").Append(System.Uri.EscapeDataString(ConvertToString(combine, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + } + urlBuilder_.Length--; + + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + + if (accept_Language != null) + request_.Headers.TryAddWithoutValidation("Accept-Language", ConvertToString(accept_Language, System.Globalization.CultureInfo.InvariantCulture)); + request_.Method = new System.Net.Http.HttpMethod("GET"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = (int)response_.StatusCode; + if (status_ == 200) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + return objectResponse_.Object; + } + else + if (status_ == 207) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + return objectResponse_.Object; + } + else + if (status_ == 400) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("Bad Request", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 401) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("Unauthorized", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 404) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("Not Found", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 429) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("Too Many Requests", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("Internal Server Error", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + /// + /// Create one or more shipments and their documents. (This is the primary call of the API.) + /// + /// + /// This request is used to create one or more shipments and return corresponding shipment tracking numbers, labels, and documentation. Up to 30 shipments can be created in a single call. + ///
#### Request + ///
The selected products and corresponding billing numbers, as well as the desired services and package details are required to create a shipment. Each shipment can have a dedicated shipper address. The example request body contains sample values for most services. + ///
#### Response + ///
The request will return shipment tracking numbers and the applicable labels for each shipment. If multiple shipments have been included, an HTTP 207 response (multistatus) is returned and holds detailed status for each shipment. Other standard HTTP response codes (401, 500, 400, 200, 429) are possible, too. Labels can be either provided as part of the response (base64 encoded for PDF, text for ZPL) or via URL link for view and download. Note that the format settings per query parameters apply to the shipping label. It may also apply to other labels included, depending on the configuration of your account. Label paper for return shipments can be specified separately since a different printer may be used here. If requesting labels to be provided as URL for separate download, the URLs can be shared. + ///
#### Validation + ///
It is recommended to validate the request first prior to shipment creation by setting the `validate` query parameter to `true`. Especially, during development and test, it is recommended to perform this validation. This functionality supports both + ///
* JSON schema validation (against this API description). During development and test, it is recommended to do this validation. JSON schema is available for local validation + ///
* Dry run against the DHL backend + ///
+ ///
If this succeeds, actual shipment creation will also succeed. + ///
+ /// Control the APIs response language via locale abbreviation. English (en-US) and german (de-DE) are supported. If not specified, the default is english. + /// If provided and set to `true`, the input document will be: + ///
* validated against JSON schema (/orders/ endpoint) at the API layer. In case of errors, HTTP 400 and details will be returned. + ///
* validated against the DHL backend. + ///
+ ///
In that case, no state changes are happening, no data is stored, shipments neither deleted nor created, no labels being returned. The call will return a status (200, 400) for each shipment element. + /// Legacy name **printOnlyIfCodable**. If set to *true*, labels will only be created if an address is encodable. This is only relevant for German consignee addresses. If set to false or left out, addresses, that are not encodable will be printed even though you receive a warning. + /// Legacy name **labelResponseType**. Shipping labels and further shipment documents can be: + ///
* __include__: included as base64 encoded data in the response (default) + ///
* __URL__: provided as URL reference. + /// **Defines** the **printable** document format to be used for label and manifest documents. + /// **Defines** the print medium for the shipping label. The different option vary from standard paper sizes DIN A4 and DIN A5 to specific label print formats. + ///
+ ///
Specific laser print formats using DIN A5 blanks are: + ///
* 910-300-600(-oz) (105 x 205mm) + ///
* 910-300-300(-oz) (105 x 148mm) + ///
+ ///
Specific laser print formats **not** using a DIN A5 blank: + ///
* 910-300-610 (105 x 208mm) + ///
* 100x70mm + ///
+ ///
Specific thermal print formats: + ///
* 910-300-600 (103 x 199mm) + ///
* 910-300-400 (103 x 150mm) + ///
* 100x70mm + ///
+ ///
Please use the different formats as follows. If you do not set the parameter the settings of DHL costumer portal account will be used as default. + /// **Defines** the print medium for the return shipping label. This parameter is only usable, if you do not use **combined printing**. The different option vary from standard paper sizes DIN A4 and DIN A5 to specific label print formats. + ///
+ ///
Specific laser print formats using DIN A5 blanks are: + ///
* 910-300-600(-oz) (105 x 205mm) + ///
* 910-300-300(-oz) (105 x 148mm) + ///
+ ///
Specific laser print formats **not** using a DIN A5 blank: + ///
* 910-300-610 (105 x 208mm) + ///
* 100x70mm + ///
+ ///
Specific thermal print formats: + ///
* 910-300-600 (103 x 199mm) + ///
* 910-300-400 (103 x 150mm) + ///
* 100x70mm + ///
+ ///
Please use the different formats as follows. If you do not set the parameter the settings of DHL costumer portal account will be used as default. + /// If set, label and return label for one shipment will be printed as single PDF document with possibly multiple pages. Else, those two labels come as separate documents. The option does not affect customs documents and COD labels. + /// Success response for requests with a single shipment. + /// A server side error occurred. + public virtual System.Threading.Tasks.Task CreateOrdersAsync(string accept_Language, bool? validate, bool? mustEncode, IncludeDocs3? includeDocs, DocFormat2? docFormat, PrintFormat2? printFormat, RetourePrintFormat2? retourePrintFormat, bool? combine, ShipmentOrderRequest body) + { + return CreateOrdersAsync(accept_Language, validate, mustEncode, includeDocs, docFormat, printFormat, retourePrintFormat, combine, body, System.Threading.CancellationToken.None); + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Create one or more shipments and their documents. (This is the primary call of the API.) + /// + /// + /// This request is used to create one or more shipments and return corresponding shipment tracking numbers, labels, and documentation. Up to 30 shipments can be created in a single call. + ///
#### Request + ///
The selected products and corresponding billing numbers, as well as the desired services and package details are required to create a shipment. Each shipment can have a dedicated shipper address. The example request body contains sample values for most services. + ///
#### Response + ///
The request will return shipment tracking numbers and the applicable labels for each shipment. If multiple shipments have been included, an HTTP 207 response (multistatus) is returned and holds detailed status for each shipment. Other standard HTTP response codes (401, 500, 400, 200, 429) are possible, too. Labels can be either provided as part of the response (base64 encoded for PDF, text for ZPL) or via URL link for view and download. Note that the format settings per query parameters apply to the shipping label. It may also apply to other labels included, depending on the configuration of your account. Label paper for return shipments can be specified separately since a different printer may be used here. If requesting labels to be provided as URL for separate download, the URLs can be shared. + ///
#### Validation + ///
It is recommended to validate the request first prior to shipment creation by setting the `validate` query parameter to `true`. Especially, during development and test, it is recommended to perform this validation. This functionality supports both + ///
* JSON schema validation (against this API description). During development and test, it is recommended to do this validation. JSON schema is available for local validation + ///
* Dry run against the DHL backend + ///
+ ///
If this succeeds, actual shipment creation will also succeed. + ///
+ /// Control the APIs response language via locale abbreviation. English (en-US) and german (de-DE) are supported. If not specified, the default is english. + /// If provided and set to `true`, the input document will be: + ///
* validated against JSON schema (/orders/ endpoint) at the API layer. In case of errors, HTTP 400 and details will be returned. + ///
* validated against the DHL backend. + ///
+ ///
In that case, no state changes are happening, no data is stored, shipments neither deleted nor created, no labels being returned. The call will return a status (200, 400) for each shipment element. + /// Legacy name **printOnlyIfCodable**. If set to *true*, labels will only be created if an address is encodable. This is only relevant for German consignee addresses. If set to false or left out, addresses, that are not encodable will be printed even though you receive a warning. + /// Legacy name **labelResponseType**. Shipping labels and further shipment documents can be: + ///
* __include__: included as base64 encoded data in the response (default) + ///
* __URL__: provided as URL reference. + /// **Defines** the **printable** document format to be used for label and manifest documents. + /// **Defines** the print medium for the shipping label. The different option vary from standard paper sizes DIN A4 and DIN A5 to specific label print formats. + ///
+ ///
Specific laser print formats using DIN A5 blanks are: + ///
* 910-300-600(-oz) (105 x 205mm) + ///
* 910-300-300(-oz) (105 x 148mm) + ///
+ ///
Specific laser print formats **not** using a DIN A5 blank: + ///
* 910-300-610 (105 x 208mm) + ///
* 100x70mm + ///
+ ///
Specific thermal print formats: + ///
* 910-300-600 (103 x 199mm) + ///
* 910-300-400 (103 x 150mm) + ///
* 100x70mm + ///
+ ///
Please use the different formats as follows. If you do not set the parameter the settings of DHL costumer portal account will be used as default. + /// **Defines** the print medium for the return shipping label. This parameter is only usable, if you do not use **combined printing**. The different option vary from standard paper sizes DIN A4 and DIN A5 to specific label print formats. + ///
+ ///
Specific laser print formats using DIN A5 blanks are: + ///
* 910-300-600(-oz) (105 x 205mm) + ///
* 910-300-300(-oz) (105 x 148mm) + ///
+ ///
Specific laser print formats **not** using a DIN A5 blank: + ///
* 910-300-610 (105 x 208mm) + ///
* 100x70mm + ///
+ ///
Specific thermal print formats: + ///
* 910-300-600 (103 x 199mm) + ///
* 910-300-400 (103 x 150mm) + ///
* 100x70mm + ///
+ ///
Please use the different formats as follows. If you do not set the parameter the settings of DHL costumer portal account will be used as default. + /// If set, label and return label for one shipment will be printed as single PDF document with possibly multiple pages. Else, those two labels come as separate documents. The option does not affect customs documents and COD labels. + /// Success response for requests with a single shipment. + /// A server side error occurred. + public virtual async System.Threading.Tasks.Task CreateOrdersAsync(string accept_Language, bool? validate, bool? mustEncode, IncludeDocs3? includeDocs, DocFormat2? docFormat, PrintFormat2? printFormat, RetourePrintFormat2? retourePrintFormat, bool? combine, ShipmentOrderRequest body, System.Threading.CancellationToken cancellationToken) + { + if (body == null) + throw new System.ArgumentNullException("body"); + + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/orders?"); + if (validate != null) + { + urlBuilder_.Append(System.Uri.EscapeDataString("validate") + "=").Append(System.Uri.EscapeDataString(ConvertToString(validate, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + } + if (mustEncode != null) + { + urlBuilder_.Append(System.Uri.EscapeDataString("mustEncode") + "=").Append(System.Uri.EscapeDataString(ConvertToString(mustEncode, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + } + if (includeDocs != null) + { + urlBuilder_.Append(System.Uri.EscapeDataString("includeDocs") + "=").Append(System.Uri.EscapeDataString(ConvertToString(includeDocs, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + } + if (docFormat != null) + { + urlBuilder_.Append(System.Uri.EscapeDataString("docFormat") + "=").Append(System.Uri.EscapeDataString(ConvertToString(docFormat, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + } + if (printFormat != null) + { + urlBuilder_.Append(System.Uri.EscapeDataString("printFormat") + "=").Append(System.Uri.EscapeDataString(ConvertToString(printFormat, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + } + if (retourePrintFormat != null) + { + urlBuilder_.Append(System.Uri.EscapeDataString("retourePrintFormat") + "=").Append(System.Uri.EscapeDataString(ConvertToString(retourePrintFormat, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + } + if (combine != null) + { + urlBuilder_.Append(System.Uri.EscapeDataString("combine") + "=").Append(System.Uri.EscapeDataString(ConvertToString(combine, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + } + urlBuilder_.Length--; + + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + + if (accept_Language != null) + request_.Headers.TryAddWithoutValidation("Accept-Language", ConvertToString(accept_Language, System.Globalization.CultureInfo.InvariantCulture)); + var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value); + var content_ = new System.Net.Http.StringContent(json_); + content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + request_.Content = content_; + request_.Method = new System.Net.Http.HttpMethod("POST"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = (int)response_.StatusCode; + if (status_ == 200) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + return objectResponse_.Object; + } + else + if (status_ == 207) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + return objectResponse_.Object; + } + else + if (status_ == 400) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("Bad Request", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 401) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("Unauthorized", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 429) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("Too Many Requests", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("Internal Server Error", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + /// + /// Delete one or more shipments + /// + /// + /// Delete one or more shipments created earlier. Deletion of shipments is only possible prior to them being manifested (closed out, 'Tagesabschluss'). The call will return HTTP 200 (single shipment) or 207 on success, with individual status elements for each shipment. Individual status elements are HTTP 200, 400. 400 will be returned when shipment does not exist (or was already deleted). + /// + /// Control the APIs response language via locale abbreviation. English (en-US) and german (de-DE) are supported. If not specified, the default is english. + /// Defines the user group profile. A user group is permitted to specific billing numbers. Shipments are only canceled if they belong to a billing number that the user group profile is entitled to use. This attribute is mandatory. Please use the standard user group profile 'STANDARD_GRUPPENPROFIL' if no dedicated user group profile is available. + /// Shipment number that shall be canceled. If multiple shipments shall be canceled, the parameter must be added multiple times. Up to 30 shipments can be canceled at once. + /// Response for requests with a single element + /// A server side error occurred. + public virtual System.Threading.Tasks.Task OrdersAccountDeleteAsync(string accept_Language, string profile, string shipment) + { + return OrdersAccountDeleteAsync(accept_Language, profile, shipment, System.Threading.CancellationToken.None); + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Delete one or more shipments + /// + /// + /// Delete one or more shipments created earlier. Deletion of shipments is only possible prior to them being manifested (closed out, 'Tagesabschluss'). The call will return HTTP 200 (single shipment) or 207 on success, with individual status elements for each shipment. Individual status elements are HTTP 200, 400. 400 will be returned when shipment does not exist (or was already deleted). + /// + /// Control the APIs response language via locale abbreviation. English (en-US) and german (de-DE) are supported. If not specified, the default is english. + /// Defines the user group profile. A user group is permitted to specific billing numbers. Shipments are only canceled if they belong to a billing number that the user group profile is entitled to use. This attribute is mandatory. Please use the standard user group profile 'STANDARD_GRUPPENPROFIL' if no dedicated user group profile is available. + /// Shipment number that shall be canceled. If multiple shipments shall be canceled, the parameter must be added multiple times. Up to 30 shipments can be canceled at once. + /// Response for requests with a single element + /// A server side error occurred. + public virtual async System.Threading.Tasks.Task OrdersAccountDeleteAsync(string accept_Language, string profile, string shipment, System.Threading.CancellationToken cancellationToken) + { + if (profile == null) + throw new System.ArgumentNullException("profile"); + + if (shipment == null) + throw new System.ArgumentNullException("shipment"); + + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/orders?"); + urlBuilder_.Append(System.Uri.EscapeDataString("profile") + "=").Append(System.Uri.EscapeDataString(ConvertToString(profile, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + urlBuilder_.Append(System.Uri.EscapeDataString("shipment") + "=").Append(System.Uri.EscapeDataString(ConvertToString(shipment, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + urlBuilder_.Length--; + + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + + if (accept_Language != null) + request_.Headers.TryAddWithoutValidation("Accept-Language", ConvertToString(accept_Language, System.Globalization.CultureInfo.InvariantCulture)); + request_.Method = new System.Net.Http.HttpMethod("DELETE"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = (int)response_.StatusCode; + if (status_ == 200) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + return objectResponse_.Object; + } + else + if (status_ == 207) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + return objectResponse_.Object; + } + else + if (status_ == 400) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("Bad Request", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 401) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("Unauthorized", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 429) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("Too Many Requests", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new ApiException("Internal Server Error", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + protected struct ObjectResponseResult + { + public ObjectResponseResult(T responseObject, string responseText) + { + this.Object = responseObject; + this.Text = responseText; + } + + public T Object { get; } + + public string Text { get; } + } + + public bool ReadResponseAsString { get; set; } + + protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) + { + if (response == null || response.Content == null) + { + return new ObjectResponseResult(default(T), string.Empty); + } + + if (ReadResponseAsString) + { + var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + var typedBody = Newtonsoft.Json.JsonConvert.DeserializeObject(responseText, JsonSerializerSettings); + return new ObjectResponseResult(typedBody, responseText); + } + catch (Newtonsoft.Json.JsonException exception) + { + var message = "Could not deserialize the response body string as " + typeof(T).FullName + "."; + throw new ApiException(message, (int)response.StatusCode, responseText, headers, exception); + } + } + else + { + try + { + using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false)) + using (var streamReader = new System.IO.StreamReader(responseStream)) + using (var jsonTextReader = new Newtonsoft.Json.JsonTextReader(streamReader)) + { + var serializer = Newtonsoft.Json.JsonSerializer.Create(JsonSerializerSettings); + var typedBody = serializer.Deserialize(jsonTextReader); + return new ObjectResponseResult(typedBody, string.Empty); + } + } + catch (Newtonsoft.Json.JsonException exception) + { + var message = "Could not deserialize the response body stream as " + typeof(T).FullName + "."; + throw new ApiException(message, (int)response.StatusCode, string.Empty, headers, exception); + } + } + } + + private string ConvertToString(object value, System.Globalization.CultureInfo cultureInfo) + { + if (value == null) + { + return ""; + } + + if (value is System.Enum) + { + var name = System.Enum.GetName(value.GetType(), value); + if (name != null) + { + var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); + if (field != null) + { + var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) + as System.Runtime.Serialization.EnumMemberAttribute; + if (attribute != null) + { + return attribute.Value != null ? attribute.Value : name; + } + } + + var converted = System.Convert.ToString(System.Convert.ChangeType(value, System.Enum.GetUnderlyingType(value.GetType()), cultureInfo)); + return converted == null ? string.Empty : converted; + } + } + else if (value is bool) + { + return System.Convert.ToString((bool)value, cultureInfo).ToLowerInvariant(); + } + else if (value is byte[]) + { + return System.Convert.ToBase64String((byte[])value); + } + else if (value.GetType().IsArray) + { + var array = System.Linq.Enumerable.OfType((System.Array)value); + return string.Join(",", System.Linq.Enumerable.Select(array, o => ConvertToString(o, cultureInfo))); + } + + var result = System.Convert.ToString(value, cultureInfo); + return result == null ? "" : result; + } + } + + /// + /// Response for the API version endpoint detailing version information. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v13.0.0.0))")] + internal partial class ServiceInformation + { + [Newtonsoft.Json.JsonProperty("amp", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public Amp Amp { get; set; } + + [Newtonsoft.Json.JsonProperty("backend", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public Backend Backend { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// Encoded document. All types of labels and documents. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v13.0.0.0))")] + internal partial class Document + { + /// + /// The Base64 encoded byte stream + /// + [Newtonsoft.Json.JsonProperty("b64", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string B64 { get; set; } + + /// + /// The document in zpl encoding + /// + [Newtonsoft.Json.JsonProperty("zpl2", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Zpl2 { get; set; } + + /// + /// URL reference to download document + /// + [Newtonsoft.Json.JsonProperty("url", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Url { get; set; } + + /// + /// format of the encoded bytes + /// + [Newtonsoft.Json.JsonProperty("fileFormat", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public DocumentFileFormat FileFormat { get; set; } + + /// + /// The print format used. Customs documents cash on delivery documents can only be returned in format A4. + /// + [Newtonsoft.Json.JsonProperty("printFormat", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public DocumentPrintFormat PrintFormat { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// General status description for the attached response or response item. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v13.0.0.0))")] + internal partial class RequestStatus + { + [Newtonsoft.Json.JsonProperty("title", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] + public string Title { get; set; } + + /// + /// The status code of the response. Usually, but not necessarliy the HTTP status code. + /// + [Newtonsoft.Json.JsonProperty("statusCode", Required = Newtonsoft.Json.Required.Always)] + public int StatusCode { get; set; } + + /// + /// A URI reference that identifies the specific occurrence of the problem. + /// + [Newtonsoft.Json.JsonProperty("instance", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Instance { get; set; } + + [Newtonsoft.Json.JsonProperty("detail", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [System.ComponentModel.DataAnnotations.StringLength(80)] + public string Detail { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v13.0.0.0))")] + internal partial class LabelDataResponse + { + [Newtonsoft.Json.JsonProperty("status", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public RequestStatus Status { get; set; } + + /// + /// For consistency, response is a single element array. + /// + [Newtonsoft.Json.JsonProperty("items", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public System.Collections.Generic.ICollection Items { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// Response for a single shipment containing status, numbers and labels + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v13.0.0.0))")] + internal partial class ResponseItem + { + [Newtonsoft.Json.JsonProperty("shipmentNo", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [System.ComponentModel.DataAnnotations.StringLength(50)] + public string ShipmentNo { get; set; } + + [Newtonsoft.Json.JsonProperty("returnShipmentNo", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [System.ComponentModel.DataAnnotations.StringLength(50)] + public string ReturnShipmentNo { get; set; } + + [Newtonsoft.Json.JsonProperty("sstatus", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required] + public RequestStatus Sstatus { get; set; } = new RequestStatus(); + + [Newtonsoft.Json.JsonProperty("shipmentRefNo", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [System.ComponentModel.DataAnnotations.StringLength(50, MinimumLength = 6)] + public string ShipmentRefNo { get; set; } + + [Newtonsoft.Json.JsonProperty("label", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public Document Label { get; set; } + + [Newtonsoft.Json.JsonProperty("returnLabel", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public Document ReturnLabel { get; set; } + + [Newtonsoft.Json.JsonProperty("customsDoc", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public Document CustomsDoc { get; set; } + + [Newtonsoft.Json.JsonProperty("codLabel", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public Document CodLabel { get; set; } + + /// + /// Optional validation messages attached to the shipment. + /// + [Newtonsoft.Json.JsonProperty("validationMessages", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public System.Collections.Generic.ICollection ValidationMessages { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// Representation of a validation message of a shipment container containing the most important information. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v13.0.0.0))")] + internal partial class ValidationMessageItem + { + /// + /// The property that is affected by the validation message. + /// + [Newtonsoft.Json.JsonProperty("property", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Property { get; set; } + + /// + /// The validation message describing the error. + /// + [Newtonsoft.Json.JsonProperty("validationMessage", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string ValidationMessage { get; set; } + + /// + /// The validation state resulting from the error. + /// + [Newtonsoft.Json.JsonProperty("validationState", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string ValidationState { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v13.0.0.0))")] + internal partial class GetManifestData + { + /// + /// The encoded byte stream + /// + [Newtonsoft.Json.JsonProperty("b64", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public System.Collections.Generic.ICollection B64 { get; set; } + + /// + /// The document in zpl encoding + /// + [Newtonsoft.Json.JsonProperty("zpl2", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Zpl2 { get; set; } + + /// + /// URL reference to download document + /// + [Newtonsoft.Json.JsonProperty("url", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Url { get; set; } + + /// + /// format of the encoded bytes + /// + [Newtonsoft.Json.JsonProperty("fileFormat", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public GetManifestDataFileFormat FileFormat { get; set; } + + /// + /// The print format used + /// + [Newtonsoft.Json.JsonProperty("printFormat", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public GetManifestDataPrintFormat PrintFormat { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v13.0.0.0))")] + internal partial class SingleManifestResponse + { + [Newtonsoft.Json.JsonProperty("status", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public RequestStatus Status { get; set; } + + [Newtonsoft.Json.JsonProperty("manifestDate", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string ManifestDate { get; set; } + + [Newtonsoft.Json.JsonProperty("manifest", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public GetManifestData Manifest { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// Response of the POST /manifests endpoint containing an overall request status and detailed shipment status. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v13.0.0.0))")] + internal partial class MultipleManifestResponse + { + [Newtonsoft.Json.JsonProperty("status", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public RequestStatus Status { get; set; } + + [Newtonsoft.Json.JsonProperty("items", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public System.Collections.Generic.ICollection Items { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// Response for a single shipment element not containing labels. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v13.0.0.0))")] + internal partial class ShortResponseItem + { + [Newtonsoft.Json.JsonProperty("shipmentNo", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [System.ComponentModel.DataAnnotations.StringLength(50)] + public string ShipmentNo { get; set; } + + [Newtonsoft.Json.JsonProperty("sstatus", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required] + public RequestStatus Sstatus { get; set; } = new RequestStatus(); + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// List of shipments which shall be manifested. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v13.0.0.0))")] + internal partial class ShipmentManifestingRequest + { + [Newtonsoft.Json.JsonProperty("profile", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] + [System.ComponentModel.DataAnnotations.StringLength(35)] + public string Profile { get; set; } + + /// + /// List of shipment IDs for manifesting. + /// + [Newtonsoft.Json.JsonProperty("shipmentNumbers", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [System.ComponentModel.DataAnnotations.MinLength(1)] + [System.ComponentModel.DataAnnotations.MaxLength(30)] + public System.Collections.Generic.ICollection ShipmentNumbers { get; set; } + + /// + /// Customer billingNumber number. + /// + [Newtonsoft.Json.JsonProperty("billingNumber", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string BillingNumber { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// Bank account data used for CoD (Cash on Delivery). + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v13.0.0.0))")] + internal partial class BankAccount + { + [Newtonsoft.Json.JsonProperty("accountHolder", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] + [System.ComponentModel.DataAnnotations.StringLength(80)] + public string AccountHolder { get; set; } + + [Newtonsoft.Json.JsonProperty("bankName", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [System.ComponentModel.DataAnnotations.StringLength(80)] + public string BankName { get; set; } + + [Newtonsoft.Json.JsonProperty("iban", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] + [System.ComponentModel.DataAnnotations.RegularExpression(@"[A-Z]{2,2}[0-9]{2,2}[a-zA-Z0-9]{1,30}")] + public string Iban { get; set; } + + [Newtonsoft.Json.JsonProperty("bic", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [System.ComponentModel.DataAnnotations.RegularExpression(@"[a-zA-Z0-9]{8,11}")] + public string Bic { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// Commodity line item (e.g. a t-shirt) for international shipments which require individual listing of goods. Each good must contain a description of the item, the amount of the item, the net weight of one single item and the value of one single item. If you ship 5 t-shirts, you need to include the weight and value of one single shirt. The correct final weight and value will be calculated automatically. + ///
The HS Code and the country of origin are optional. + ///
+ [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v13.0.0.0))")] + internal partial class Commodity + { + /// + /// A text that describes the commodity item. Only the first 50 characters of the description text is printed on the customs declaration form CN23. + /// + [Newtonsoft.Json.JsonProperty("itemDescription", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required] + [System.ComponentModel.DataAnnotations.StringLength(256, MinimumLength = 1)] + public string ItemDescription { get; set; } + + /// + /// A valid country code consisting of three characters according to ISO 3166-1 alpha-3. + /// + [Newtonsoft.Json.JsonProperty("countryOfOrigin", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public Country CountryOfOrigin { get; set; } + + /// + /// Harmonized System Code aka Customs tariff number. + /// + [Newtonsoft.Json.JsonProperty("hsCode", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [System.ComponentModel.DataAnnotations.StringLength(11, MinimumLength = 6)] + public string HsCode { get; set; } + + /// + /// How many items of that type are in the package + /// + [Newtonsoft.Json.JsonProperty("packagedQuantity", Required = Newtonsoft.Json.Required.Always)] + public int PackagedQuantity { get; set; } + + [Newtonsoft.Json.JsonProperty("itemValue", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required] + public Value ItemValue { get; set; } = new Value(); + + [Newtonsoft.Json.JsonProperty("itemWeight", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required] + public Weight ItemWeight { get; set; } = new Weight(); + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// Consignee address information. Either a doorstep address (contact address) including contact information or a droppoint address. One of packstation (parcel locker), or post office (postfiliale/retail shop). + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v13.0.0.0))")] + internal partial class Consignee + { + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// For international shipments, this section contains information necessary for customs about the exported goods. ExportDocument can contain one or more positions as child element. This data is also transferred as electronic declaration to customs. The custom details are mandatory depending on whether the parcel will go to a country outside the European Customs Union. For DHL Parcel International (V53WPAK) CN23 will returned as a separate document, while for Warenpost International the customs information will be printed onto the shipment label (CN22). + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v13.0.0.0))")] + internal partial class CustomsDetails + { + /// + /// Invoice number + /// + [Newtonsoft.Json.JsonProperty("invoiceNo", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [System.ComponentModel.DataAnnotations.StringLength(35)] + public string InvoiceNo { get; set; } + + /// + /// This contains the category of goods contained in parcel. + /// + [Newtonsoft.Json.JsonProperty("exportType", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public CustomsDetailsExportType ExportType { get; set; } + + /// + /// Mandatory if exporttype is 'OTHER' + /// + [Newtonsoft.Json.JsonProperty("exportDescription", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [System.ComponentModel.DataAnnotations.StringLength(80)] + public string ExportDescription { get; set; } + + /// + /// Aka 'Terms of Trade' aka 'Frankatur'. The attribute is exclusively used for the product Europaket (V54EPAK). DDU is deprecated (use DAP instead). + /// + [Newtonsoft.Json.JsonProperty("shippingConditions", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public CustomsDetailsShippingConditions ShippingConditions { get; set; } + + /// + /// Permit number. Very rarely needed. Mostly relevant for higher value goods. An example use case would be an item made from crocodile leather which requires dedicated license / permit identified by that number. + /// + [Newtonsoft.Json.JsonProperty("permitNo", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [System.ComponentModel.DataAnnotations.StringLength(30)] + public string PermitNo { get; set; } + + /// + /// Attest or certification identified by this number. Very rarely needed. An example use case would be a medical shipment referring to an attestation that a certain amount of medicine may be imported within e.g. the current quarter of the year. + /// + [Newtonsoft.Json.JsonProperty("attestationNo", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [System.ComponentModel.DataAnnotations.StringLength(30)] + public string AttestationNo { get; set; } + + /// + /// flag confirming whether electronic record for export was made + /// + [Newtonsoft.Json.JsonProperty("hasElectronicExportNotification", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public bool HasElectronicExportNotification { get; set; } + + [Newtonsoft.Json.JsonProperty("MRN", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [System.ComponentModel.DataAnnotations.StringLength(18)] + public string MRN { get; set; } + + [Newtonsoft.Json.JsonProperty("postalCharges", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required] + public Value PostalCharges { get; set; } = new Value(); + + /// + /// Optional. Will appear on CN23. + /// + [Newtonsoft.Json.JsonProperty("officeOfOrigin", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [System.ComponentModel.DataAnnotations.StringLength(35)] + public string OfficeOfOrigin { get; set; } + + /// + /// Optional. The customs reference is used by customs authorities to identify economics operators an/or other persons involved. With the given reference, granted authorizations and/or relevant processes in customs clearance an/or taxation can be taken into account. Aka Zoll-Nummer or EORI-Number but dependent on destination. + /// + [Newtonsoft.Json.JsonProperty("shipperCustomsRef", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [System.ComponentModel.DataAnnotations.StringLength(35)] + public string ShipperCustomsRef { get; set; } + + /// + /// Optional. The customs reference is used by customs authorities to identify economics operators an/or other persons involved. With the given reference, granted authorizations and/or relevant processes in customs clearance an/or taxation can be taken into account. Aka Zoll-Nummer or EORI-Number but dependent on destination. + /// + [Newtonsoft.Json.JsonProperty("consigneeCustomsRef", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [System.ComponentModel.DataAnnotations.StringLength(35)] + public string ConsigneeCustomsRef { get; set; } + + /// + /// Commodity types in that package + /// + [Newtonsoft.Json.JsonProperty("items", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required] + [System.ComponentModel.DataAnnotations.MinLength(1)] + [System.ComponentModel.DataAnnotations.MaxLength(99)] + public System.Collections.Generic.ICollection Items { get; set; } = new System.Collections.ObjectModel.Collection(); + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// Physical dimensions (aka 'Gurtmass') of the parcel. If you provide the dimension information, all attributes need to be provided. You cannot provide just the height, for example. If you provide length, width, and height in millimeters, they will be rounded to full cm. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v13.0.0.0))")] + internal partial class Dimensions + { + /// + /// Unit of metric, applies to all dimensions contained. + /// + [Newtonsoft.Json.JsonProperty("uom", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public DimensionsUom Uom { get; set; } + + [Newtonsoft.Json.JsonProperty("height", Required = Newtonsoft.Json.Required.Always)] + public int Height { get; set; } + + [Newtonsoft.Json.JsonProperty("length", Required = Newtonsoft.Json.Required.Always)] + public int Length { get; set; } + + [Newtonsoft.Json.JsonProperty("width", Required = Newtonsoft.Json.Required.Always)] + public int Width { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// Only usable for German Packstation, international lockers cannot be addressed directly. If your customer wishes for international delivery to a droppoint, please use DHL Parcel International (V53WPAK) with the delivery type "Closest Droppoint". + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v13.0.0.0))")] + internal partial class Locker + { + /// + /// Name + /// + [Newtonsoft.Json.JsonProperty("name", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required] + [System.ComponentModel.DataAnnotations.StringLength(50, MinimumLength = 1)] + public string Name { get; set; } + + /// + /// Packstationnummer. Three digit number identifying the parcel locker in conjunction with city and postal code + /// + [Newtonsoft.Json.JsonProperty("lockerID", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Range(100, 999)] + public int LockerID { get; set; } + + /// + /// postNumber (Postnummer) is the official account number a private DHL Customer gets upon registration. + /// + [Newtonsoft.Json.JsonProperty("postNumber", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] + [System.ComponentModel.DataAnnotations.RegularExpression(@"^[0-9]{6,10}$")] + public string PostNumber { get; set; } + + /// + /// City where the locker is located + /// + [Newtonsoft.Json.JsonProperty("city", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] + [System.ComponentModel.DataAnnotations.StringLength(40)] + public string City { get; set; } + + /// + /// A valid country code consisting of three characters according to ISO 3166-1 alpha-3. + /// + [Newtonsoft.Json.JsonProperty("country", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public Country Country { get; set; } + + [Newtonsoft.Json.JsonProperty("postalCode", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required] + [System.ComponentModel.DataAnnotations.StringLength(10, MinimumLength = 3)] + [System.ComponentModel.DataAnnotations.RegularExpression(@"^[0-9A-Za-z]+([ -]?[0-9A-Za-z]+)*$")] + public string PostalCode { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// Only usable for German post offices or retail outlets (Paketshops), international postOffices or retail outlets cannot be addressed directly. If your customer wishes for international delivery to a droppoint, please use DHL Parcel International (V53WPAK) with the delivery type "Closest Droppoint". + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v13.0.0.0))")] + internal partial class PostOffice + { + /// + /// Name + /// + [Newtonsoft.Json.JsonProperty("name", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required] + [System.ComponentModel.DataAnnotations.StringLength(50, MinimumLength = 1)] + public string Name { get; set; } + + /// + /// Id or Number of Post office / Filiale / outlet / parcel shop + /// + [Newtonsoft.Json.JsonProperty("retailID", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Range(401, 999)] + public int RetailID { get; set; } + + /// + /// postNumber (Postnummer) is the official account number a private DHL Customer gets upon registration. To address a post office or retail outlet directly, either the post number or e-mail address of the consignee is needed. + /// + [Newtonsoft.Json.JsonProperty("postNumber", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [System.ComponentModel.DataAnnotations.StringLength(10, MinimumLength = 3)] + [System.ComponentModel.DataAnnotations.RegularExpression(@"^[0-9]{6,10}$")] + public string PostNumber { get; set; } + + /// + /// Email address of the consignee. To address a post office or retail outlet directly, either the post number or e-mail address of the consignee is needed. + /// + [Newtonsoft.Json.JsonProperty("email", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [System.ComponentModel.DataAnnotations.StringLength(80, MinimumLength = 3)] + public string Email { get; set; } + + /// + /// City where the retail location is + /// + [Newtonsoft.Json.JsonProperty("city", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] + [System.ComponentModel.DataAnnotations.StringLength(80)] + public string City { get; set; } + + /// + /// A valid country code consisting of three characters according to ISO 3166-1 alpha-3. + /// + [Newtonsoft.Json.JsonProperty("country", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public Country Country { get; set; } + + [Newtonsoft.Json.JsonProperty("postalCode", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required] + [System.ComponentModel.DataAnnotations.StringLength(10, MinimumLength = 3)] + [System.ComponentModel.DataAnnotations.RegularExpression(@"^[0-9A-Za-z]+([ -]?[0-9A-Za-z]+)*$")] + public string PostalCode { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// Alternative destination - P.O. Box (Postfach) + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v13.0.0.0))")] + internal partial class POBox + { + /// + /// Name1. Line 1 of name information + /// + [Newtonsoft.Json.JsonProperty("name1", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required] + [System.ComponentModel.DataAnnotations.StringLength(50, MinimumLength = 1)] + public string Name1 { get; set; } + + /// + /// An optional, additional line of name information + /// + [Newtonsoft.Json.JsonProperty("name2", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [System.ComponentModel.DataAnnotations.StringLength(50, MinimumLength = 1)] + public string Name2 { get; set; } + + /// + /// An optional, additional line of name information + /// + [Newtonsoft.Json.JsonProperty("name3", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [System.ComponentModel.DataAnnotations.StringLength(50, MinimumLength = 1)] + public string Name3 { get; set; } + + /// + /// Number of P.O. Box (Postfach) + /// + [Newtonsoft.Json.JsonProperty("poBoxID", Required = Newtonsoft.Json.Required.Always)] + public int PoBoxID { get; set; } + + /// + /// Email address of the consignee + /// + [Newtonsoft.Json.JsonProperty("email", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [System.ComponentModel.DataAnnotations.StringLength(80, MinimumLength = 3)] + public string Email { get; set; } + + /// + /// City of the P.O. Box (Postfach) location + /// + [Newtonsoft.Json.JsonProperty("city", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] + [System.ComponentModel.DataAnnotations.StringLength(80)] + public string City { get; set; } + + /// + /// Country of the P.O. Box (Postfach) location. A valid country code consisting of three characters according to ISO 3166-1 alpha-3. + /// + [Newtonsoft.Json.JsonProperty("country", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public Country Country { get; set; } + + /// + /// Postal code of the P.O. Box (Postfach) location + /// + [Newtonsoft.Json.JsonProperty("postalCode", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required] + [System.ComponentModel.DataAnnotations.StringLength(10, MinimumLength = 3)] + [System.ComponentModel.DataAnnotations.RegularExpression(@"^[0-9A-Za-z]+([ -]?[0-9A-Za-z]+)*$")] + public string PostalCode { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// Container for all shipments. Mixed shipment products per request are supported. Each shipment has a dedicated shipper address (or shipper reference, or both). + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v13.0.0.0))")] + internal partial class Shipment + { + /// + /// Determines the DHL Paket product to be used. + ///
+ ///
* V01PAK: DHL PAKET; + ///
* V53WPAK: DHL PAKET International; + ///
* V54EPAK: DHL Europaket; + ///
* V62WP: Warenpost; + ///
* V66WPI: Warenpost International + ///
+ [Newtonsoft.Json.JsonProperty("product", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Product { get; set; } + + /// + /// 14 digit long number that identifies the contract the shipment is booked on. Please note that in rare cases the last to characters can be letters. Digit 11 and digit 12 must correspondent to the number of the product, e.g. 333333333301tt can only be used for the product V01PAK (DHL Paket). + /// + [Newtonsoft.Json.JsonProperty("billingNumber", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [System.ComponentModel.DataAnnotations.RegularExpression(@"\w{10}\d{2}\w{2}")] + public string BillingNumber { get; set; } + + /// + /// A reference number that the user can assign for better association purposes. It appears on shipment labels. To use the reference number for tracking purposes, it should be at least 8 characters long and unique. + /// + [Newtonsoft.Json.JsonProperty("refNo", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [System.ComponentModel.DataAnnotations.StringLength(35, MinimumLength = 8)] + public string RefNo { get; set; } + + /// + /// Textfield that appears on the shipment label. It cannot be used to search for the shipment. + /// + [Newtonsoft.Json.JsonProperty("costCenter", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string CostCenter { get; set; } + + /// + /// Is only to be indicated by DHL partners. + /// + [Newtonsoft.Json.JsonProperty("creationSoftware", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string CreationSoftware { get; set; } + + /// + /// Date the shipment is transferred to DHL. The shipment date can be the current date or a date up to a few days in the future. It must not be in the past. Iso format required: yyyy-mm-dd. On the shipment date the shipment will be automatically closed at your end of day closing time. + /// + [Newtonsoft.Json.JsonProperty("shipDate", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [Newtonsoft.Json.JsonConverter(typeof(DateFormatConverter))] + public System.DateTimeOffset ShipDate { get; set; } + + /// + /// Shipper information, including contact information and address. Alternatively, a predefined shipper reference can be used. + /// + [Newtonsoft.Json.JsonProperty("shipper", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public Shipper Shipper { get; set; } + + [Newtonsoft.Json.JsonProperty("consignee", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public Consignee Consignee { get; set; } + + [Newtonsoft.Json.JsonProperty("details", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public ShipmentDetails Details { get; set; } + + [Newtonsoft.Json.JsonProperty("services", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public VAS Services { get; set; } + + [Newtonsoft.Json.JsonProperty("customs", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public CustomsDetails Customs { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// Details for the shipment, such as dimensions, content + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v13.0.0.0))")] + internal partial class ShipmentDetails + { + [Newtonsoft.Json.JsonProperty("dim", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public Dimensions Dim { get; set; } + + [Newtonsoft.Json.JsonProperty("weight", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required] + public Weight Weight { get; set; } = new Weight(); + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// Complex request structure used to create, update, and validate shipment data. Note that most elements are part of the array of shipment items. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v13.0.0.0))")] + internal partial class ShipmentOrderRequest + { + [Newtonsoft.Json.JsonProperty("profile", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] + [System.ComponentModel.DataAnnotations.StringLength(35)] + public string Profile { get; set; } + + /// + /// Shipment array having details for each shipment. + /// + [Newtonsoft.Json.JsonProperty("shipments", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required] + [System.ComponentModel.DataAnnotations.MinLength(1)] + [System.ComponentModel.DataAnnotations.MaxLength(30)] + public System.Collections.Generic.ICollection Shipments { get; set; } = new System.Collections.ObjectModel.Collection(); + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// Shipper information, including contact information and address. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v13.0.0.0))")] + internal partial class Shipper + { + /// + /// Name1. Line 1 of name information + /// + [Newtonsoft.Json.JsonProperty("name1", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required] + [System.ComponentModel.DataAnnotations.StringLength(50, MinimumLength = 1)] + public string Name1 { get; set; } + + /// + /// An optional, additional line of name information + /// + [Newtonsoft.Json.JsonProperty("name2", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [System.ComponentModel.DataAnnotations.StringLength(50, MinimumLength = 1)] + public string Name2 { get; set; } + + /// + /// An optional, additional line of name information + /// + [Newtonsoft.Json.JsonProperty("name3", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [System.ComponentModel.DataAnnotations.StringLength(50, MinimumLength = 1)] + public string Name3 { get; set; } + + /// + /// Line 1 of the street address. This is just the street name. Can also include house number. + /// + [Newtonsoft.Json.JsonProperty("addressStreet", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required] + [System.ComponentModel.DataAnnotations.StringLength(50, MinimumLength = 1)] + public string AddressStreet { get; set; } + + /// + /// Line 1 of the street address. This is just the house number. Can be added to street name instead. + /// + [Newtonsoft.Json.JsonProperty("addressHouse", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [System.ComponentModel.DataAnnotations.StringLength(10, MinimumLength = 1)] + public string AddressHouse { get; set; } + + /// + /// Mandatory for all countries but Ireland that use a postal code system. + /// + [Newtonsoft.Json.JsonProperty("postalCode", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [System.ComponentModel.DataAnnotations.StringLength(10, MinimumLength = 3)] + [System.ComponentModel.DataAnnotations.RegularExpression(@"^[0-9A-Za-z]+([ -]?[0-9A-Za-z]+)*$")] + public string PostalCode { get; set; } + + /// + /// city + /// + [Newtonsoft.Json.JsonProperty("city", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required] + [System.ComponentModel.DataAnnotations.StringLength(40, MinimumLength = 1)] + public string City { get; set; } + + /// + /// Shipper address country + /// + [Newtonsoft.Json.JsonProperty("country", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public Country Country { get; set; } + + /// + /// optional contact name. (this is not the primary name printed on label) + /// + [Newtonsoft.Json.JsonProperty("contactName", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [System.ComponentModel.DataAnnotations.StringLength(80, MinimumLength = 3)] + public string ContactName { get; set; } + + /// + /// Optional contact email address of the shipper + /// + [Newtonsoft.Json.JsonProperty("email", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [System.ComponentModel.DataAnnotations.StringLength(80, MinimumLength = 3)] + public string Email { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// Contains a reference to the Shipper data configured in GKP(Geschäftskundenportal - Business Costumer Portal). Can be used instead of a detailed shipper address. The shipper reference can be used to print a company logo which is configured in GKP onto the label. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v13.0.0.0))")] + internal partial class ShipperReference + { + /// + /// Reference string to the shipper data configured in GKP(Geschäftskundenportal - Business Costumer Portal). + /// + [Newtonsoft.Json.JsonProperty("shipperRef", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] + [System.ComponentModel.DataAnnotations.StringLength(50)] + public string ShipperRef { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// Value added services. Please note that services are specific to products and geographies and/or may require individual setup and billing numbers. Please test and contact your account representative in case of questions. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v13.0.0.0))")] + internal partial class VAS + { + /// + /// Preferred neighbour. Can be specified as text. + /// + [Newtonsoft.Json.JsonProperty("preferredNeighbour", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [System.ComponentModel.DataAnnotations.StringLength(100)] + public string PreferredNeighbour { get; set; } + + /// + /// Preferred location. Can be specified as text. + /// + [Newtonsoft.Json.JsonProperty("preferredLocation", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [System.ComponentModel.DataAnnotations.StringLength(100)] + public string PreferredLocation { get; set; } + + /// + /// if used it will trigger checking the age of recipient + /// + [Newtonsoft.Json.JsonProperty("visualCheckOfAge", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [System.ComponentModel.DataAnnotations.RegularExpression(@"A16|A18")] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public VASVisualCheckOfAge VisualCheckOfAge { get; set; } + + /// + /// Delivery can only be signed for by yourself personally. + /// + [Newtonsoft.Json.JsonProperty("namedPersonOnly", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public bool NamedPersonOnly { get; set; } + + [Newtonsoft.Json.JsonProperty("identCheck", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public VASIdentCheck IdentCheck { get; set; } + + /// + /// Delivery must be signed for by the recipient and not by DHL staff + /// + [Newtonsoft.Json.JsonProperty("signedForByRecipient", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public bool SignedForByRecipient { get; set; } + + /// + /// Instructions and endorsement how to treat international undeliverable shipment. By default, shipments are returned if undeliverable. There are country specific rules whether the shipment is returned immediately or after a grace period. + /// + [Newtonsoft.Json.JsonProperty("endorsement", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public VASEndorsement Endorsement { get; set; } + + /// + /// Preferred day of delivery in format YYYY-MM-DD. Shipper can request a preferred day of delivery. The preferred day should be between 2 and 6 working days after handover to DHL. + /// + [Newtonsoft.Json.JsonProperty("preferredDay", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [Newtonsoft.Json.JsonConverter(typeof(DateFormatConverter))] + public System.DateTimeOffset PreferredDay { get; set; } + + /// + /// Delivery can only be signed for by yourself personally or by members of your household. + /// + [Newtonsoft.Json.JsonProperty("noNeighbourDelivery", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public bool NoNeighbourDelivery { get; set; } + + [Newtonsoft.Json.JsonProperty("additionalInsurance", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public Value AdditionalInsurance { get; set; } + + /// + /// Leaving this out is same as setting to false. Sperrgut. + /// + [Newtonsoft.Json.JsonProperty("bulkyGoods", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public bool BulkyGoods { get; set; } + + [Newtonsoft.Json.JsonProperty("cashOnDelivery", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public VASCashOnDelivery CashOnDelivery { get; set; } + + /// + /// Special instructions for delivery. 2 character code, possible values agreed in contract. + /// + [Newtonsoft.Json.JsonProperty("individualSenderRequirement", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [System.ComponentModel.DataAnnotations.RegularExpression(@"[a-zA-Z0-9]{2}")] + public string IndividualSenderRequirement { get; set; } + + /// + /// Choice of premium vs economy parcel. Availability is country dependent and may be manipulated by DHL if choice is not available. Please review the label. + /// + [Newtonsoft.Json.JsonProperty("premium", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public bool Premium { get; set; } + + /// + /// Closest Droppoint Delivery to the droppoint closest to the address of the recipient of the shipment. For this kind of delivery either the phone number and/or the e-mail address of the receiver is mandatory. For shipments using DHL Paket International it is recommended that you choose one of the three delivery types: Economy, Premium, CDP. Otherwise, the current default for the receiver country will be picked. + /// + [Newtonsoft.Json.JsonProperty("closestDropPoint", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public bool ClosestDropPoint { get; set; } + + /// + /// Undeliverable domestic shipment can be forwarded and held at retail. Notification to email (fallback: consignee email) will be used. + /// + [Newtonsoft.Json.JsonProperty("parcelOutletRouting", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string ParcelOutletRouting { get; set; } + + [Newtonsoft.Json.JsonProperty("dhlRetoure", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public VASDhlRetoure DhlRetoure { get; set; } + + /// + /// All import duties are paid by the shipper. + /// + [Newtonsoft.Json.JsonProperty("postalDeliveryDutyPaid", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public bool PostalDeliveryDutyPaid { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// Cash on delivery (Nachnahme). Currency must be Euro. Either bank account information or account reference (from customer profile) must be provided. Transfernote1 + 2 are references transmitted during bank transfer. Providing account information explicitly requires elevated privileges. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v13.0.0.0))")] + internal partial class VASCashOnDelivery + { + [Newtonsoft.Json.JsonProperty("amount", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public Value Amount { get; set; } + + [Newtonsoft.Json.JsonProperty("bankAccount", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public BankAccount BankAccount { get; set; } + + /// + /// Reference to bank account details. Account references are maintained in customer settings in Post & DHL business customer portal under Ship -> Settings -> Cash on delivery. Please note, that the default account reference is used if the provided account reference does not exist in your customer settings! + /// + [Newtonsoft.Json.JsonProperty("accountReference", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [System.ComponentModel.DataAnnotations.StringLength(35)] + public string AccountReference { get; set; } + + [Newtonsoft.Json.JsonProperty("transferNote1", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [System.ComponentModel.DataAnnotations.StringLength(35)] + public string TransferNote1 { get; set; } + + [Newtonsoft.Json.JsonProperty("transferNote2", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [System.ComponentModel.DataAnnotations.StringLength(35)] + public string TransferNote2 { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// Requests return label (aka 'retoure') to be provided. Also requires returnAddress and return billing number. Neither weight nor dimension need to be specified for the retoure (flat rate service). + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v13.0.0.0))")] + internal partial class VASDhlRetoure + { + [Newtonsoft.Json.JsonProperty("billingNumber", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] + [System.ComponentModel.DataAnnotations.RegularExpression(@"\w{10}\d{2}\w{2}")] + public string BillingNumber { get; set; } + + [Newtonsoft.Json.JsonProperty("refNo", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [System.ComponentModel.DataAnnotations.StringLength(50, MinimumLength = 6)] + public string RefNo { get; set; } + + [Newtonsoft.Json.JsonProperty("returnAddress", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public Consignee ReturnAddress { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// Check the identity of the recipient via name (firstname, lastname), date of birth or age. This uses firstName and lastName as separate attributes since for identity check an automatic split of a one-line name is not considered reliable enough. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v13.0.0.0))")] + internal partial class VASIdentCheck + { + [Newtonsoft.Json.JsonProperty("firstName", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required] + [System.ComponentModel.DataAnnotations.StringLength(35, MinimumLength = 1)] + public string FirstName { get; set; } + + [Newtonsoft.Json.JsonProperty("lastName", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required] + [System.ComponentModel.DataAnnotations.StringLength(35, MinimumLength = 1)] + public string LastName { get; set; } + + /// + /// date of birth, used in conjunction with minimumAge and shipping date. Format yyyy-mm-dd is used. + /// + [Newtonsoft.Json.JsonProperty("dateOfBirth", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [Newtonsoft.Json.JsonConverter(typeof(DateFormatConverter))] + public System.DateTimeOffset DateOfBirth { get; set; } + + /// + /// Checks if recipient will have reached specified age by shipping date. + /// + [Newtonsoft.Json.JsonProperty("minimumAge", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [System.ComponentModel.DataAnnotations.RegularExpression(@"A16|A18")] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public VASIdentCheckMinimumAge MinimumAge { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// A valid country code consisting of three characters according to ISO 3166-1 alpha-3. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v13.0.0.0))")] + public enum Country + { + + [System.Runtime.Serialization.EnumMember(Value = @"ABW")] + ABW = 0, + + [System.Runtime.Serialization.EnumMember(Value = @"AFG")] + AFG = 1, + + [System.Runtime.Serialization.EnumMember(Value = @"AGO")] + AGO = 2, + + [System.Runtime.Serialization.EnumMember(Value = @"AIA")] + AIA = 3, + + [System.Runtime.Serialization.EnumMember(Value = @"ALA")] + ALA = 4, + + [System.Runtime.Serialization.EnumMember(Value = @"ALB")] + ALB = 5, + + [System.Runtime.Serialization.EnumMember(Value = @"AND")] + AND = 6, + + [System.Runtime.Serialization.EnumMember(Value = @"ARE")] + ARE = 7, + + [System.Runtime.Serialization.EnumMember(Value = @"ARG")] + ARG = 8, + + [System.Runtime.Serialization.EnumMember(Value = @"ARM")] + ARM = 9, + + [System.Runtime.Serialization.EnumMember(Value = @"ASM")] + ASM = 10, + + [System.Runtime.Serialization.EnumMember(Value = @"ATG")] + ATG = 11, + + [System.Runtime.Serialization.EnumMember(Value = @"AUS")] + AUS = 12, + + [System.Runtime.Serialization.EnumMember(Value = @"AUT")] + AUT = 13, + + [System.Runtime.Serialization.EnumMember(Value = @"AZE")] + AZE = 14, + + [System.Runtime.Serialization.EnumMember(Value = @"BDI")] + BDI = 15, + + [System.Runtime.Serialization.EnumMember(Value = @"BEL")] + BEL = 16, + + [System.Runtime.Serialization.EnumMember(Value = @"BEN")] + BEN = 17, + + [System.Runtime.Serialization.EnumMember(Value = @"BES")] + BES = 18, + + [System.Runtime.Serialization.EnumMember(Value = @"BFA")] + BFA = 19, + + [System.Runtime.Serialization.EnumMember(Value = @"BGD")] + BGD = 20, + + [System.Runtime.Serialization.EnumMember(Value = @"BGR")] + BGR = 21, + + [System.Runtime.Serialization.EnumMember(Value = @"BHR")] + BHR = 22, + + [System.Runtime.Serialization.EnumMember(Value = @"BHS")] + BHS = 23, + + [System.Runtime.Serialization.EnumMember(Value = @"BIH")] + BIH = 24, + + [System.Runtime.Serialization.EnumMember(Value = @"BLM")] + BLM = 25, + + [System.Runtime.Serialization.EnumMember(Value = @"BLR")] + BLR = 26, + + [System.Runtime.Serialization.EnumMember(Value = @"BLZ")] + BLZ = 27, + + [System.Runtime.Serialization.EnumMember(Value = @"BMU")] + BMU = 28, + + [System.Runtime.Serialization.EnumMember(Value = @"BOL")] + BOL = 29, + + [System.Runtime.Serialization.EnumMember(Value = @"BRA")] + BRA = 30, + + [System.Runtime.Serialization.EnumMember(Value = @"BRB")] + BRB = 31, + + [System.Runtime.Serialization.EnumMember(Value = @"BRN")] + BRN = 32, + + [System.Runtime.Serialization.EnumMember(Value = @"BTN")] + BTN = 33, + + [System.Runtime.Serialization.EnumMember(Value = @"BVT")] + BVT = 34, + + [System.Runtime.Serialization.EnumMember(Value = @"BWA")] + BWA = 35, + + [System.Runtime.Serialization.EnumMember(Value = @"CAF")] + CAF = 36, + + [System.Runtime.Serialization.EnumMember(Value = @"CAN")] + CAN = 37, + + [System.Runtime.Serialization.EnumMember(Value = @"CCK")] + CCK = 38, + + [System.Runtime.Serialization.EnumMember(Value = @"CHE")] + CHE = 39, + + [System.Runtime.Serialization.EnumMember(Value = @"CHL")] + CHL = 40, + + [System.Runtime.Serialization.EnumMember(Value = @"CHN")] + CHN = 41, + + [System.Runtime.Serialization.EnumMember(Value = @"CIV")] + CIV = 42, + + [System.Runtime.Serialization.EnumMember(Value = @"CMR")] + CMR = 43, + + [System.Runtime.Serialization.EnumMember(Value = @"COD")] + COD = 44, + + [System.Runtime.Serialization.EnumMember(Value = @"COG")] + COG = 45, + + [System.Runtime.Serialization.EnumMember(Value = @"COK")] + COK = 46, + + [System.Runtime.Serialization.EnumMember(Value = @"COL")] + COL = 47, + + [System.Runtime.Serialization.EnumMember(Value = @"COM")] + COM = 48, + + [System.Runtime.Serialization.EnumMember(Value = @"CPV")] + CPV = 49, + + [System.Runtime.Serialization.EnumMember(Value = @"CRI")] + CRI = 50, + + [System.Runtime.Serialization.EnumMember(Value = @"CUB")] + CUB = 51, + + [System.Runtime.Serialization.EnumMember(Value = @"CUW")] + CUW = 52, + + [System.Runtime.Serialization.EnumMember(Value = @"CXR")] + CXR = 53, + + [System.Runtime.Serialization.EnumMember(Value = @"CYM")] + CYM = 54, + + [System.Runtime.Serialization.EnumMember(Value = @"CYP")] + CYP = 55, + + [System.Runtime.Serialization.EnumMember(Value = @"CZE")] + CZE = 56, + + [System.Runtime.Serialization.EnumMember(Value = @"DEU")] + DEU = 57, + + [System.Runtime.Serialization.EnumMember(Value = @"DJI")] + DJI = 58, + + [System.Runtime.Serialization.EnumMember(Value = @"DMA")] + DMA = 59, + + [System.Runtime.Serialization.EnumMember(Value = @"DNK")] + DNK = 60, + + [System.Runtime.Serialization.EnumMember(Value = @"DOM")] + DOM = 61, + + [System.Runtime.Serialization.EnumMember(Value = @"DZA")] + DZA = 62, + + [System.Runtime.Serialization.EnumMember(Value = @"ECU")] + ECU = 63, + + [System.Runtime.Serialization.EnumMember(Value = @"EGY")] + EGY = 64, + + [System.Runtime.Serialization.EnumMember(Value = @"ERI")] + ERI = 65, + + [System.Runtime.Serialization.EnumMember(Value = @"ESP")] + ESP = 66, + + [System.Runtime.Serialization.EnumMember(Value = @"EST")] + EST = 67, + + [System.Runtime.Serialization.EnumMember(Value = @"ETH")] + ETH = 68, + + [System.Runtime.Serialization.EnumMember(Value = @"FIN")] + FIN = 69, + + [System.Runtime.Serialization.EnumMember(Value = @"FJI")] + FJI = 70, + + [System.Runtime.Serialization.EnumMember(Value = @"FLK")] + FLK = 71, + + [System.Runtime.Serialization.EnumMember(Value = @"FRA")] + FRA = 72, + + [System.Runtime.Serialization.EnumMember(Value = @"FRO")] + FRO = 73, + + [System.Runtime.Serialization.EnumMember(Value = @"FSM")] + FSM = 74, + + [System.Runtime.Serialization.EnumMember(Value = @"GAB")] + GAB = 75, + + [System.Runtime.Serialization.EnumMember(Value = @"GBR")] + GBR = 76, + + [System.Runtime.Serialization.EnumMember(Value = @"GEO")] + GEO = 77, + + [System.Runtime.Serialization.EnumMember(Value = @"GGY")] + GGY = 78, + + [System.Runtime.Serialization.EnumMember(Value = @"GHA")] + GHA = 79, + + [System.Runtime.Serialization.EnumMember(Value = @"GIB")] + GIB = 80, + + [System.Runtime.Serialization.EnumMember(Value = @"GIN")] + GIN = 81, + + [System.Runtime.Serialization.EnumMember(Value = @"GLP")] + GLP = 82, + + [System.Runtime.Serialization.EnumMember(Value = @"GMB")] + GMB = 83, + + [System.Runtime.Serialization.EnumMember(Value = @"GNB")] + GNB = 84, + + [System.Runtime.Serialization.EnumMember(Value = @"GNQ")] + GNQ = 85, + + [System.Runtime.Serialization.EnumMember(Value = @"GRC")] + GRC = 86, + + [System.Runtime.Serialization.EnumMember(Value = @"GRD")] + GRD = 87, + + [System.Runtime.Serialization.EnumMember(Value = @"GRL")] + GRL = 88, + + [System.Runtime.Serialization.EnumMember(Value = @"GTM")] + GTM = 89, + + [System.Runtime.Serialization.EnumMember(Value = @"GUF")] + GUF = 90, + + [System.Runtime.Serialization.EnumMember(Value = @"GUM")] + GUM = 91, + + [System.Runtime.Serialization.EnumMember(Value = @"GUY")] + GUY = 92, + + [System.Runtime.Serialization.EnumMember(Value = @"HKG")] + HKG = 93, + + [System.Runtime.Serialization.EnumMember(Value = @"HMD")] + HMD = 94, + + [System.Runtime.Serialization.EnumMember(Value = @"HND")] + HND = 95, + + [System.Runtime.Serialization.EnumMember(Value = @"HRV")] + HRV = 96, + + [System.Runtime.Serialization.EnumMember(Value = @"HTI")] + HTI = 97, + + [System.Runtime.Serialization.EnumMember(Value = @"HUN")] + HUN = 98, + + [System.Runtime.Serialization.EnumMember(Value = @"IDN")] + IDN = 99, + + [System.Runtime.Serialization.EnumMember(Value = @"IMN")] + IMN = 100, + + [System.Runtime.Serialization.EnumMember(Value = @"IND")] + IND = 101, + + [System.Runtime.Serialization.EnumMember(Value = @"IRL")] + IRL = 102, + + [System.Runtime.Serialization.EnumMember(Value = @"IRN")] + IRN = 103, + + [System.Runtime.Serialization.EnumMember(Value = @"IRQ")] + IRQ = 104, + + [System.Runtime.Serialization.EnumMember(Value = @"ISL")] + ISL = 105, + + [System.Runtime.Serialization.EnumMember(Value = @"ISR")] + ISR = 106, + + [System.Runtime.Serialization.EnumMember(Value = @"ITA")] + ITA = 107, + + [System.Runtime.Serialization.EnumMember(Value = @"JAM")] + JAM = 108, + + [System.Runtime.Serialization.EnumMember(Value = @"JEY")] + JEY = 109, + + [System.Runtime.Serialization.EnumMember(Value = @"JOR")] + JOR = 110, + + [System.Runtime.Serialization.EnumMember(Value = @"JPN")] + JPN = 111, + + [System.Runtime.Serialization.EnumMember(Value = @"KAZ")] + KAZ = 112, + + [System.Runtime.Serialization.EnumMember(Value = @"KEN")] + KEN = 113, + + [System.Runtime.Serialization.EnumMember(Value = @"KGZ")] + KGZ = 114, + + [System.Runtime.Serialization.EnumMember(Value = @"KHM")] + KHM = 115, + + [System.Runtime.Serialization.EnumMember(Value = @"KIR")] + KIR = 116, + + [System.Runtime.Serialization.EnumMember(Value = @"KNA")] + KNA = 117, + + [System.Runtime.Serialization.EnumMember(Value = @"KOR")] + KOR = 118, + + [System.Runtime.Serialization.EnumMember(Value = @"KWT")] + KWT = 119, + + [System.Runtime.Serialization.EnumMember(Value = @"LAO")] + LAO = 120, + + [System.Runtime.Serialization.EnumMember(Value = @"LBN")] + LBN = 121, + + [System.Runtime.Serialization.EnumMember(Value = @"LBR")] + LBR = 122, + + [System.Runtime.Serialization.EnumMember(Value = @"LBY")] + LBY = 123, + + [System.Runtime.Serialization.EnumMember(Value = @"LCA")] + LCA = 124, + + [System.Runtime.Serialization.EnumMember(Value = @"LIE")] + LIE = 125, + + [System.Runtime.Serialization.EnumMember(Value = @"LKA")] + LKA = 126, + + [System.Runtime.Serialization.EnumMember(Value = @"LSO")] + LSO = 127, + + [System.Runtime.Serialization.EnumMember(Value = @"LTU")] + LTU = 128, + + [System.Runtime.Serialization.EnumMember(Value = @"LUX")] + LUX = 129, + + [System.Runtime.Serialization.EnumMember(Value = @"LVA")] + LVA = 130, + + [System.Runtime.Serialization.EnumMember(Value = @"MAC")] + MAC = 131, + + [System.Runtime.Serialization.EnumMember(Value = @"MAF")] + MAF = 132, + + [System.Runtime.Serialization.EnumMember(Value = @"MAR")] + MAR = 133, + + [System.Runtime.Serialization.EnumMember(Value = @"MCO")] + MCO = 134, + + [System.Runtime.Serialization.EnumMember(Value = @"MDA")] + MDA = 135, + + [System.Runtime.Serialization.EnumMember(Value = @"MDG")] + MDG = 136, + + [System.Runtime.Serialization.EnumMember(Value = @"MDV")] + MDV = 137, + + [System.Runtime.Serialization.EnumMember(Value = @"MEX")] + MEX = 138, + + [System.Runtime.Serialization.EnumMember(Value = @"MHL")] + MHL = 139, + + [System.Runtime.Serialization.EnumMember(Value = @"MKD")] + MKD = 140, + + [System.Runtime.Serialization.EnumMember(Value = @"MLI")] + MLI = 141, + + [System.Runtime.Serialization.EnumMember(Value = @"MLT")] + MLT = 142, + + [System.Runtime.Serialization.EnumMember(Value = @"MMR")] + MMR = 143, + + [System.Runtime.Serialization.EnumMember(Value = @"MNE")] + MNE = 144, + + [System.Runtime.Serialization.EnumMember(Value = @"MNG")] + MNG = 145, + + [System.Runtime.Serialization.EnumMember(Value = @"MNP")] + MNP = 146, + + [System.Runtime.Serialization.EnumMember(Value = @"MOZ")] + MOZ = 147, + + [System.Runtime.Serialization.EnumMember(Value = @"MRT")] + MRT = 148, + + [System.Runtime.Serialization.EnumMember(Value = @"MSR")] + MSR = 149, + + [System.Runtime.Serialization.EnumMember(Value = @"MTQ")] + MTQ = 150, + + [System.Runtime.Serialization.EnumMember(Value = @"MUS")] + MUS = 151, + + [System.Runtime.Serialization.EnumMember(Value = @"MWI")] + MWI = 152, + + [System.Runtime.Serialization.EnumMember(Value = @"MYS")] + MYS = 153, + + [System.Runtime.Serialization.EnumMember(Value = @"MYT")] + MYT = 154, + + [System.Runtime.Serialization.EnumMember(Value = @"NAM")] + NAM = 155, + + [System.Runtime.Serialization.EnumMember(Value = @"NCL")] + NCL = 156, + + [System.Runtime.Serialization.EnumMember(Value = @"NER")] + NER = 157, + + [System.Runtime.Serialization.EnumMember(Value = @"NFK")] + NFK = 158, + + [System.Runtime.Serialization.EnumMember(Value = @"NGA")] + NGA = 159, + + [System.Runtime.Serialization.EnumMember(Value = @"NIC")] + NIC = 160, + + [System.Runtime.Serialization.EnumMember(Value = @"NIU")] + NIU = 161, + + [System.Runtime.Serialization.EnumMember(Value = @"NLD")] + NLD = 162, + + [System.Runtime.Serialization.EnumMember(Value = @"NOR")] + NOR = 163, + + [System.Runtime.Serialization.EnumMember(Value = @"NPL")] + NPL = 164, + + [System.Runtime.Serialization.EnumMember(Value = @"NRU")] + NRU = 165, + + [System.Runtime.Serialization.EnumMember(Value = @"NZL")] + NZL = 166, + + [System.Runtime.Serialization.EnumMember(Value = @"OMN")] + OMN = 167, + + [System.Runtime.Serialization.EnumMember(Value = @"PAK")] + PAK = 168, + + [System.Runtime.Serialization.EnumMember(Value = @"PAN")] + PAN = 169, + + [System.Runtime.Serialization.EnumMember(Value = @"PCN")] + PCN = 170, + + [System.Runtime.Serialization.EnumMember(Value = @"PER")] + PER = 171, + + [System.Runtime.Serialization.EnumMember(Value = @"PHL")] + PHL = 172, + + [System.Runtime.Serialization.EnumMember(Value = @"PLW")] + PLW = 173, + + [System.Runtime.Serialization.EnumMember(Value = @"PNG")] + PNG = 174, + + [System.Runtime.Serialization.EnumMember(Value = @"POL")] + POL = 175, + + [System.Runtime.Serialization.EnumMember(Value = @"PRI")] + PRI = 176, + + [System.Runtime.Serialization.EnumMember(Value = @"PRK")] + PRK = 177, + + [System.Runtime.Serialization.EnumMember(Value = @"PRT")] + PRT = 178, + + [System.Runtime.Serialization.EnumMember(Value = @"PRY")] + PRY = 179, + + [System.Runtime.Serialization.EnumMember(Value = @"PSE")] + PSE = 180, + + [System.Runtime.Serialization.EnumMember(Value = @"PYF")] + PYF = 181, + + [System.Runtime.Serialization.EnumMember(Value = @"QAT")] + QAT = 182, + + [System.Runtime.Serialization.EnumMember(Value = @"REU")] + REU = 183, + + [System.Runtime.Serialization.EnumMember(Value = @"ROU")] + ROU = 184, + + [System.Runtime.Serialization.EnumMember(Value = @"RUS")] + RUS = 185, + + [System.Runtime.Serialization.EnumMember(Value = @"RWA")] + RWA = 186, + + [System.Runtime.Serialization.EnumMember(Value = @"SAU")] + SAU = 187, + + [System.Runtime.Serialization.EnumMember(Value = @"SDN")] + SDN = 188, + + [System.Runtime.Serialization.EnumMember(Value = @"SEN")] + SEN = 189, + + [System.Runtime.Serialization.EnumMember(Value = @"SGP")] + SGP = 190, + + [System.Runtime.Serialization.EnumMember(Value = @"SHN")] + SHN = 191, + + [System.Runtime.Serialization.EnumMember(Value = @"SJM")] + SJM = 192, + + [System.Runtime.Serialization.EnumMember(Value = @"SLB")] + SLB = 193, + + [System.Runtime.Serialization.EnumMember(Value = @"SLE")] + SLE = 194, + + [System.Runtime.Serialization.EnumMember(Value = @"SLV")] + SLV = 195, + + [System.Runtime.Serialization.EnumMember(Value = @"SMR")] + SMR = 196, + + [System.Runtime.Serialization.EnumMember(Value = @"SOM")] + SOM = 197, + + [System.Runtime.Serialization.EnumMember(Value = @"SPM")] + SPM = 198, + + [System.Runtime.Serialization.EnumMember(Value = @"SRB")] + SRB = 199, + + [System.Runtime.Serialization.EnumMember(Value = @"SSD")] + SSD = 200, + + [System.Runtime.Serialization.EnumMember(Value = @"STP")] + STP = 201, + + [System.Runtime.Serialization.EnumMember(Value = @"SUR")] + SUR = 202, + + [System.Runtime.Serialization.EnumMember(Value = @"SVK")] + SVK = 203, + + [System.Runtime.Serialization.EnumMember(Value = @"SVN")] + SVN = 204, + + [System.Runtime.Serialization.EnumMember(Value = @"SWE")] + SWE = 205, + + [System.Runtime.Serialization.EnumMember(Value = @"SWZ")] + SWZ = 206, + + [System.Runtime.Serialization.EnumMember(Value = @"SXM")] + SXM = 207, + + [System.Runtime.Serialization.EnumMember(Value = @"SYC")] + SYC = 208, + + [System.Runtime.Serialization.EnumMember(Value = @"SYR")] + SYR = 209, + + [System.Runtime.Serialization.EnumMember(Value = @"TCA")] + TCA = 210, + + [System.Runtime.Serialization.EnumMember(Value = @"TCD")] + TCD = 211, + + [System.Runtime.Serialization.EnumMember(Value = @"TGO")] + TGO = 212, + + [System.Runtime.Serialization.EnumMember(Value = @"THA")] + THA = 213, + + [System.Runtime.Serialization.EnumMember(Value = @"TJK")] + TJK = 214, + + [System.Runtime.Serialization.EnumMember(Value = @"TKL")] + TKL = 215, + + [System.Runtime.Serialization.EnumMember(Value = @"TKM")] + TKM = 216, + + [System.Runtime.Serialization.EnumMember(Value = @"TLS")] + TLS = 217, + + [System.Runtime.Serialization.EnumMember(Value = @"TON")] + TON = 218, + + [System.Runtime.Serialization.EnumMember(Value = @"TTO")] + TTO = 219, + + [System.Runtime.Serialization.EnumMember(Value = @"TUN")] + TUN = 220, + + [System.Runtime.Serialization.EnumMember(Value = @"TUR")] + TUR = 221, + + [System.Runtime.Serialization.EnumMember(Value = @"TUV")] + TUV = 222, + + [System.Runtime.Serialization.EnumMember(Value = @"TWN")] + TWN = 223, + + [System.Runtime.Serialization.EnumMember(Value = @"TZA")] + TZA = 224, + + [System.Runtime.Serialization.EnumMember(Value = @"UGA")] + UGA = 225, + + [System.Runtime.Serialization.EnumMember(Value = @"UKR")] + UKR = 226, + + [System.Runtime.Serialization.EnumMember(Value = @"URY")] + URY = 227, + + [System.Runtime.Serialization.EnumMember(Value = @"USA")] + USA = 228, + + [System.Runtime.Serialization.EnumMember(Value = @"UZB")] + UZB = 229, + + [System.Runtime.Serialization.EnumMember(Value = @"VAT")] + VAT = 230, + + [System.Runtime.Serialization.EnumMember(Value = @"VCT")] + VCT = 231, + + [System.Runtime.Serialization.EnumMember(Value = @"VEN")] + VEN = 232, + + [System.Runtime.Serialization.EnumMember(Value = @"VGB")] + VGB = 233, + + [System.Runtime.Serialization.EnumMember(Value = @"VIR")] + VIR = 234, + + [System.Runtime.Serialization.EnumMember(Value = @"VNM")] + VNM = 235, + + [System.Runtime.Serialization.EnumMember(Value = @"VUT")] + VUT = 236, + + [System.Runtime.Serialization.EnumMember(Value = @"WLF")] + WLF = 237, + + [System.Runtime.Serialization.EnumMember(Value = @"WSM")] + WSM = 238, + + [System.Runtime.Serialization.EnumMember(Value = @"YEM")] + YEM = 239, + + [System.Runtime.Serialization.EnumMember(Value = @"ZAF")] + ZAF = 240, + + [System.Runtime.Serialization.EnumMember(Value = @"ZMB")] + ZMB = 241, + + [System.Runtime.Serialization.EnumMember(Value = @"ZWE")] + ZWE = 242, + + [System.Runtime.Serialization.EnumMember(Value = @"UNKNOWN")] + UNKNOWN = 243, + + } + + /// + /// Currency and numeric value. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v13.0.0.0))")] + internal partial class Value + { + /// + /// iso 4217 3 character currency code accepted. Recommended to use EUR where possible + /// + [Newtonsoft.Json.JsonProperty("currency", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public ValueCurrency Currency { get; set; } + + /// + /// Numeric value + /// + [Newtonsoft.Json.JsonProperty("value", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Range(0D, 100000D)] + public double Value1 { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// Weight of item or shipment. Both uom and value are required. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v13.0.0.0))")] + internal partial class Weight + { + /// + /// metric unit for weight + /// + [Newtonsoft.Json.JsonProperty("uom", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public WeightUom Uom { get; set; } + + [Newtonsoft.Json.JsonProperty("value", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Range(0D, 31500D)] + public double Value { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v13.0.0.0))")] + public enum IncludeDocs + { + + [System.Runtime.Serialization.EnumMember(Value = @"include")] + Include = 0, + + [System.Runtime.Serialization.EnumMember(Value = @"URL")] + URL = 1, + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v13.0.0.0))")] + public enum DocFormat + { + + [System.Runtime.Serialization.EnumMember(Value = @"ZPL2")] + ZPL2 = 0, + + [System.Runtime.Serialization.EnumMember(Value = @"PDF")] + PDF = 1, + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v13.0.0.0))")] + public enum PrintFormat + { + + [System.Runtime.Serialization.EnumMember(Value = @"A4")] + A4 = 0, + + [System.Runtime.Serialization.EnumMember(Value = @"910-300-600")] + _910300600 = 1, + + [System.Runtime.Serialization.EnumMember(Value = @"910-300-610")] + _910300610 = 2, + + [System.Runtime.Serialization.EnumMember(Value = @"910-300-700")] + _910300700 = 3, + + [System.Runtime.Serialization.EnumMember(Value = @"910-300-700-oz")] + _910300700Oz = 4, + + [System.Runtime.Serialization.EnumMember(Value = @"910-300-710")] + _910300710 = 5, + + [System.Runtime.Serialization.EnumMember(Value = @"910-300-300")] + _910300300 = 6, + + [System.Runtime.Serialization.EnumMember(Value = @"910-300-300-oz")] + _910300300Oz = 7, + + [System.Runtime.Serialization.EnumMember(Value = @"910-300-400")] + _910300400 = 8, + + [System.Runtime.Serialization.EnumMember(Value = @"910-300-410")] + _910300410 = 9, + + [System.Runtime.Serialization.EnumMember(Value = @"100x70mm")] + _100x70mm = 10, + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v13.0.0.0))")] + public enum RetourePrintFormat + { + + [System.Runtime.Serialization.EnumMember(Value = @"A4")] + A4 = 0, + + [System.Runtime.Serialization.EnumMember(Value = @"910-300-600")] + _910300600 = 1, + + [System.Runtime.Serialization.EnumMember(Value = @"910-300-610")] + _910300610 = 2, + + [System.Runtime.Serialization.EnumMember(Value = @"910-300-700")] + _910300700 = 3, + + [System.Runtime.Serialization.EnumMember(Value = @"910-300-700-oz")] + _910300700Oz = 4, + + [System.Runtime.Serialization.EnumMember(Value = @"910-300-710")] + _910300710 = 5, + + [System.Runtime.Serialization.EnumMember(Value = @"910-300-300")] + _910300300 = 6, + + [System.Runtime.Serialization.EnumMember(Value = @"910-300-300-oz")] + _910300300Oz = 7, + + [System.Runtime.Serialization.EnumMember(Value = @"910-300-400")] + _910300400 = 8, + + [System.Runtime.Serialization.EnumMember(Value = @"910-300-410")] + _910300410 = 9, + + [System.Runtime.Serialization.EnumMember(Value = @"100x70mm")] + _100x70mm = 10, + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v13.0.0.0))")] + public enum IncludeDocs2 + { + + [System.Runtime.Serialization.EnumMember(Value = @"include")] + Include = 0, + + [System.Runtime.Serialization.EnumMember(Value = @"URL")] + URL = 1, + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v13.0.0.0))")] + public enum IncludeDocs3 + { + + [System.Runtime.Serialization.EnumMember(Value = @"include")] + Include = 0, + + [System.Runtime.Serialization.EnumMember(Value = @"URL")] + URL = 1, + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v13.0.0.0))")] + public enum DocFormat2 + { + + [System.Runtime.Serialization.EnumMember(Value = @"ZPL2")] + ZPL2 = 0, + + [System.Runtime.Serialization.EnumMember(Value = @"PDF")] + PDF = 1, + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v13.0.0.0))")] + public enum PrintFormat2 + { + + [System.Runtime.Serialization.EnumMember(Value = @"A4")] + A4 = 0, + + [System.Runtime.Serialization.EnumMember(Value = @"910-300-600")] + _910300600 = 1, + + [System.Runtime.Serialization.EnumMember(Value = @"910-300-610")] + _910300610 = 2, + + [System.Runtime.Serialization.EnumMember(Value = @"910-300-700")] + _910300700 = 3, + + [System.Runtime.Serialization.EnumMember(Value = @"910-300-700-oz")] + _910300700Oz = 4, + + [System.Runtime.Serialization.EnumMember(Value = @"910-300-710")] + _910300710 = 5, + + [System.Runtime.Serialization.EnumMember(Value = @"910-300-300")] + _910300300 = 6, + + [System.Runtime.Serialization.EnumMember(Value = @"910-300-300-oz")] + _910300300Oz = 7, + + [System.Runtime.Serialization.EnumMember(Value = @"910-300-400")] + _910300400 = 8, + + [System.Runtime.Serialization.EnumMember(Value = @"910-300-410")] + _910300410 = 9, + + [System.Runtime.Serialization.EnumMember(Value = @"100x70mm")] + _100x70mm = 10, + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v13.0.0.0))")] + public enum RetourePrintFormat2 + { + + [System.Runtime.Serialization.EnumMember(Value = @"A4")] + A4 = 0, + + [System.Runtime.Serialization.EnumMember(Value = @"910-300-600")] + _910300600 = 1, + + [System.Runtime.Serialization.EnumMember(Value = @"910-300-610")] + _910300610 = 2, + + [System.Runtime.Serialization.EnumMember(Value = @"910-300-700")] + _910300700 = 3, + + [System.Runtime.Serialization.EnumMember(Value = @"910-300-700-oz")] + _910300700Oz = 4, + + [System.Runtime.Serialization.EnumMember(Value = @"910-300-710")] + _910300710 = 5, + + [System.Runtime.Serialization.EnumMember(Value = @"910-300-300")] + _910300300 = 6, + + [System.Runtime.Serialization.EnumMember(Value = @"910-300-300-oz")] + _910300300Oz = 7, + + [System.Runtime.Serialization.EnumMember(Value = @"910-300-400")] + _910300400 = 8, + + [System.Runtime.Serialization.EnumMember(Value = @"910-300-410")] + _910300410 = 9, + + [System.Runtime.Serialization.EnumMember(Value = @"100x70mm")] + _100x70mm = 10, + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v13.0.0.0))")] + internal partial class Amp + { + /// + /// name of api + /// + [Newtonsoft.Json.JsonProperty("name", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Name { get; set; } + + /// + /// environment + /// + [Newtonsoft.Json.JsonProperty("env", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Env { get; set; } + + /// + /// version of api + /// + [Newtonsoft.Json.JsonProperty("version", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Version { get; set; } + + /// + /// revision + /// + [Newtonsoft.Json.JsonProperty("rev", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Rev { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v13.0.0.0))")] + internal partial class Backend + { + /// + /// environment + /// + [Newtonsoft.Json.JsonProperty("env", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Env { get; set; } + + /// + /// version of backend + /// + [Newtonsoft.Json.JsonProperty("version", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Version { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v13.0.0.0))")] + public enum DocumentFileFormat + { + + [System.Runtime.Serialization.EnumMember(Value = @"ZPL2")] + ZPL2 = 0, + + [System.Runtime.Serialization.EnumMember(Value = @"PDF")] + PDF = 1, + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v13.0.0.0))")] + public enum DocumentPrintFormat + { + + [System.Runtime.Serialization.EnumMember(Value = @"A4")] + A4 = 0, + + [System.Runtime.Serialization.EnumMember(Value = @"A4-PT")] + A4PT = 1, + + [System.Runtime.Serialization.EnumMember(Value = @"910-300-600")] + _910300600 = 2, + + [System.Runtime.Serialization.EnumMember(Value = @"910-300-610")] + _910300610 = 3, + + [System.Runtime.Serialization.EnumMember(Value = @"910-300-700")] + _910300700 = 4, + + [System.Runtime.Serialization.EnumMember(Value = @"910-300-700-oz")] + _910300700Oz = 5, + + [System.Runtime.Serialization.EnumMember(Value = @"910-300-710")] + _910300710 = 6, + + [System.Runtime.Serialization.EnumMember(Value = @"910-300-300")] + _910300300 = 7, + + [System.Runtime.Serialization.EnumMember(Value = @"910-300-300-oz")] + _910300300Oz = 8, + + [System.Runtime.Serialization.EnumMember(Value = @"910-300-400")] + _910300400 = 9, + + [System.Runtime.Serialization.EnumMember(Value = @"910-300-410")] + _910300410 = 10, + + [System.Runtime.Serialization.EnumMember(Value = @"100x70mm")] + _100x70mm = 11, + + /* + * ADDED THIS LINE MANUALLY TO GENERATED CODE! + * + * PLEASE DO NOT TOUCH! USE VALUE 910-300-400 or 910-300-410 RESULTS IN 910-300-400/410! + * + * ADDED THIS LINE MANUALLY TO GENERATED CODE! + */ + [System.Runtime.Serialization.EnumMember(Value = @"910-300-400/410")] + _910300400410 = 12, + + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v13.0.0.0))")] + public enum GetManifestDataFileFormat + { + + [System.Runtime.Serialization.EnumMember(Value = @"ZPL2")] + ZPL2 = 0, + + [System.Runtime.Serialization.EnumMember(Value = @"PDF")] + PDF = 1, + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v13.0.0.0))")] + public enum GetManifestDataPrintFormat + { + + [System.Runtime.Serialization.EnumMember(Value = @"A4")] + A4 = 0, + + [System.Runtime.Serialization.EnumMember(Value = @"910-300-600")] + _910300600 = 1, + + [System.Runtime.Serialization.EnumMember(Value = @"910-300-610")] + _910300610 = 2, + + [System.Runtime.Serialization.EnumMember(Value = @"910-300-700")] + _910300700 = 3, + + [System.Runtime.Serialization.EnumMember(Value = @"910-300-700-oz")] + _910300700Oz = 4, + + [System.Runtime.Serialization.EnumMember(Value = @"910-300-710")] + _910300710 = 5, + + [System.Runtime.Serialization.EnumMember(Value = @"910-300-300")] + _910300300 = 6, + + [System.Runtime.Serialization.EnumMember(Value = @"910-300-300-oz")] + _910300300Oz = 7, + + [System.Runtime.Serialization.EnumMember(Value = @"910-300-400")] + _910300400 = 8, + + [System.Runtime.Serialization.EnumMember(Value = @"910-300-410")] + _910300410 = 9, + + [System.Runtime.Serialization.EnumMember(Value = @"100x70mm")] + _100x70mm = 10, + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v13.0.0.0))")] + public enum CustomsDetailsExportType + { + + [System.Runtime.Serialization.EnumMember(Value = @"OTHER")] + OTHER = 0, + + [System.Runtime.Serialization.EnumMember(Value = @"PRESENT")] + PRESENT = 1, + + [System.Runtime.Serialization.EnumMember(Value = @"COMMERCIAL_SAMPLE")] + COMMERCIAL_SAMPLE = 2, + + [System.Runtime.Serialization.EnumMember(Value = @"DOCUMENT")] + DOCUMENT = 3, + + [System.Runtime.Serialization.EnumMember(Value = @"RETURN_OF_GOODS")] + RETURN_OF_GOODS = 4, + + [System.Runtime.Serialization.EnumMember(Value = @"COMMERCIAL_GOODS")] + COMMERCIAL_GOODS = 5, + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v13.0.0.0))")] + public enum CustomsDetailsShippingConditions + { + + [System.Runtime.Serialization.EnumMember(Value = @"DDU")] + DDU = 0, + + [System.Runtime.Serialization.EnumMember(Value = @"DAP")] + DAP = 1, + + [System.Runtime.Serialization.EnumMember(Value = @"DDP")] + DDP = 2, + + [System.Runtime.Serialization.EnumMember(Value = @"DDX")] + DDX = 3, + + [System.Runtime.Serialization.EnumMember(Value = @"DXV")] + DXV = 4, + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v13.0.0.0))")] + public enum DimensionsUom + { + + [System.Runtime.Serialization.EnumMember(Value = @"cm")] + Cm = 0, + + [System.Runtime.Serialization.EnumMember(Value = @"mm")] + Mm = 1, + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v13.0.0.0))")] + public enum VASVisualCheckOfAge + { + + [System.Runtime.Serialization.EnumMember(Value = @"A16")] + A16 = 0, + + [System.Runtime.Serialization.EnumMember(Value = @"A18")] + A18 = 1, + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v13.0.0.0))")] + public enum VASEndorsement + { + + [System.Runtime.Serialization.EnumMember(Value = @"RETURN")] + RETURN = 0, + + [System.Runtime.Serialization.EnumMember(Value = @"ABANDON")] + ABANDON = 1, + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v13.0.0.0))")] + public enum VASIdentCheckMinimumAge + { + + [System.Runtime.Serialization.EnumMember(Value = @"A16")] + A16 = 0, + + [System.Runtime.Serialization.EnumMember(Value = @"A18")] + A18 = 1, + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v13.0.0.0))")] + public enum ValueCurrency + { + + [System.Runtime.Serialization.EnumMember(Value = @"AED")] + AED = 0, + + [System.Runtime.Serialization.EnumMember(Value = @"AFN")] + AFN = 1, + + [System.Runtime.Serialization.EnumMember(Value = @"ALL")] + ALL = 2, + + [System.Runtime.Serialization.EnumMember(Value = @"AMD")] + AMD = 3, + + [System.Runtime.Serialization.EnumMember(Value = @"ANG")] + ANG = 4, + + [System.Runtime.Serialization.EnumMember(Value = @"AOA")] + AOA = 5, + + [System.Runtime.Serialization.EnumMember(Value = @"ARS")] + ARS = 6, + + [System.Runtime.Serialization.EnumMember(Value = @"AUD")] + AUD = 7, + + [System.Runtime.Serialization.EnumMember(Value = @"AWG")] + AWG = 8, + + [System.Runtime.Serialization.EnumMember(Value = @"AZN")] + AZN = 9, + + [System.Runtime.Serialization.EnumMember(Value = @"BAM")] + BAM = 10, + + [System.Runtime.Serialization.EnumMember(Value = @"BBD")] + BBD = 11, + + [System.Runtime.Serialization.EnumMember(Value = @"BDT")] + BDT = 12, + + [System.Runtime.Serialization.EnumMember(Value = @"BGN")] + BGN = 13, + + [System.Runtime.Serialization.EnumMember(Value = @"BHD")] + BHD = 14, + + [System.Runtime.Serialization.EnumMember(Value = @"BIF")] + BIF = 15, + + [System.Runtime.Serialization.EnumMember(Value = @"BMD")] + BMD = 16, + + [System.Runtime.Serialization.EnumMember(Value = @"BND")] + BND = 17, + + [System.Runtime.Serialization.EnumMember(Value = @"BOB")] + BOB = 18, + + [System.Runtime.Serialization.EnumMember(Value = @"BOV")] + BOV = 19, + + [System.Runtime.Serialization.EnumMember(Value = @"BRL")] + BRL = 20, + + [System.Runtime.Serialization.EnumMember(Value = @"BSD")] + BSD = 21, + + [System.Runtime.Serialization.EnumMember(Value = @"BTN")] + BTN = 22, + + [System.Runtime.Serialization.EnumMember(Value = @"BWP")] + BWP = 23, + + [System.Runtime.Serialization.EnumMember(Value = @"BYR")] + BYR = 24, + + [System.Runtime.Serialization.EnumMember(Value = @"BZD")] + BZD = 25, + + [System.Runtime.Serialization.EnumMember(Value = @"CAD")] + CAD = 26, + + [System.Runtime.Serialization.EnumMember(Value = @"CDF")] + CDF = 27, + + [System.Runtime.Serialization.EnumMember(Value = @"CHE")] + CHE = 28, + + [System.Runtime.Serialization.EnumMember(Value = @"CHF")] + CHF = 29, + + [System.Runtime.Serialization.EnumMember(Value = @"CHW")] + CHW = 30, + + [System.Runtime.Serialization.EnumMember(Value = @"CLF")] + CLF = 31, + + [System.Runtime.Serialization.EnumMember(Value = @"CLP")] + CLP = 32, + + [System.Runtime.Serialization.EnumMember(Value = @"CNY")] + CNY = 33, + + [System.Runtime.Serialization.EnumMember(Value = @"COP")] + COP = 34, + + [System.Runtime.Serialization.EnumMember(Value = @"COU")] + COU = 35, + + [System.Runtime.Serialization.EnumMember(Value = @"CRC")] + CRC = 36, + + [System.Runtime.Serialization.EnumMember(Value = @"CUC")] + CUC = 37, + + [System.Runtime.Serialization.EnumMember(Value = @"CUP")] + CUP = 38, + + [System.Runtime.Serialization.EnumMember(Value = @"CVE")] + CVE = 39, + + [System.Runtime.Serialization.EnumMember(Value = @"CZK")] + CZK = 40, + + [System.Runtime.Serialization.EnumMember(Value = @"DJF")] + DJF = 41, + + [System.Runtime.Serialization.EnumMember(Value = @"DKK")] + DKK = 42, + + [System.Runtime.Serialization.EnumMember(Value = @"DOP")] + DOP = 43, + + [System.Runtime.Serialization.EnumMember(Value = @"DZD")] + DZD = 44, + + [System.Runtime.Serialization.EnumMember(Value = @"EGP")] + EGP = 45, + + [System.Runtime.Serialization.EnumMember(Value = @"ERN")] + ERN = 46, + + [System.Runtime.Serialization.EnumMember(Value = @"ETB")] + ETB = 47, + + [System.Runtime.Serialization.EnumMember(Value = @"EUR")] + EUR = 48, + + [System.Runtime.Serialization.EnumMember(Value = @"FJD")] + FJD = 49, + + [System.Runtime.Serialization.EnumMember(Value = @"FKP")] + FKP = 50, + + [System.Runtime.Serialization.EnumMember(Value = @"GBP")] + GBP = 51, + + [System.Runtime.Serialization.EnumMember(Value = @"GEL")] + GEL = 52, + + [System.Runtime.Serialization.EnumMember(Value = @"GHS")] + GHS = 53, + + [System.Runtime.Serialization.EnumMember(Value = @"GIP")] + GIP = 54, + + [System.Runtime.Serialization.EnumMember(Value = @"GMD")] + GMD = 55, + + [System.Runtime.Serialization.EnumMember(Value = @"GNF")] + GNF = 56, + + [System.Runtime.Serialization.EnumMember(Value = @"GTQ")] + GTQ = 57, + + [System.Runtime.Serialization.EnumMember(Value = @"GYD")] + GYD = 58, + + [System.Runtime.Serialization.EnumMember(Value = @"HKD")] + HKD = 59, + + [System.Runtime.Serialization.EnumMember(Value = @"HNL")] + HNL = 60, + + [System.Runtime.Serialization.EnumMember(Value = @"HRK")] + HRK = 61, + + [System.Runtime.Serialization.EnumMember(Value = @"HTG")] + HTG = 62, + + [System.Runtime.Serialization.EnumMember(Value = @"HUF")] + HUF = 63, + + [System.Runtime.Serialization.EnumMember(Value = @"IDR")] + IDR = 64, + + [System.Runtime.Serialization.EnumMember(Value = @"ILS")] + ILS = 65, + + [System.Runtime.Serialization.EnumMember(Value = @"INR")] + INR = 66, + + [System.Runtime.Serialization.EnumMember(Value = @"IQD")] + IQD = 67, + + [System.Runtime.Serialization.EnumMember(Value = @"IRR")] + IRR = 68, + + [System.Runtime.Serialization.EnumMember(Value = @"ISK")] + ISK = 69, + + [System.Runtime.Serialization.EnumMember(Value = @"JMD")] + JMD = 70, + + [System.Runtime.Serialization.EnumMember(Value = @"JOD")] + JOD = 71, + + [System.Runtime.Serialization.EnumMember(Value = @"JPY")] + JPY = 72, + + [System.Runtime.Serialization.EnumMember(Value = @"KES")] + KES = 73, + + [System.Runtime.Serialization.EnumMember(Value = @"KGS")] + KGS = 74, + + [System.Runtime.Serialization.EnumMember(Value = @"KHR")] + KHR = 75, + + [System.Runtime.Serialization.EnumMember(Value = @"KMF")] + KMF = 76, + + [System.Runtime.Serialization.EnumMember(Value = @"KPW")] + KPW = 77, + + [System.Runtime.Serialization.EnumMember(Value = @"KRW")] + KRW = 78, + + [System.Runtime.Serialization.EnumMember(Value = @"KWD")] + KWD = 79, + + [System.Runtime.Serialization.EnumMember(Value = @"KYD")] + KYD = 80, + + [System.Runtime.Serialization.EnumMember(Value = @"KZT")] + KZT = 81, + + [System.Runtime.Serialization.EnumMember(Value = @"LAK")] + LAK = 82, + + [System.Runtime.Serialization.EnumMember(Value = @"LBP")] + LBP = 83, + + [System.Runtime.Serialization.EnumMember(Value = @"LKR")] + LKR = 84, + + [System.Runtime.Serialization.EnumMember(Value = @"LRD")] + LRD = 85, + + [System.Runtime.Serialization.EnumMember(Value = @"LSL")] + LSL = 86, + + [System.Runtime.Serialization.EnumMember(Value = @"LTL")] + LTL = 87, + + [System.Runtime.Serialization.EnumMember(Value = @"LVL")] + LVL = 88, + + [System.Runtime.Serialization.EnumMember(Value = @"LYD")] + LYD = 89, + + [System.Runtime.Serialization.EnumMember(Value = @"MAD")] + MAD = 90, + + [System.Runtime.Serialization.EnumMember(Value = @"MDL")] + MDL = 91, + + [System.Runtime.Serialization.EnumMember(Value = @"MGA")] + MGA = 92, + + [System.Runtime.Serialization.EnumMember(Value = @"MKD")] + MKD = 93, + + [System.Runtime.Serialization.EnumMember(Value = @"MMK")] + MMK = 94, + + [System.Runtime.Serialization.EnumMember(Value = @"MNT")] + MNT = 95, + + [System.Runtime.Serialization.EnumMember(Value = @"MOP")] + MOP = 96, + + [System.Runtime.Serialization.EnumMember(Value = @"MRO")] + MRO = 97, + + [System.Runtime.Serialization.EnumMember(Value = @"MUR")] + MUR = 98, + + [System.Runtime.Serialization.EnumMember(Value = @"MVR")] + MVR = 99, + + [System.Runtime.Serialization.EnumMember(Value = @"MWK")] + MWK = 100, + + [System.Runtime.Serialization.EnumMember(Value = @"MXN")] + MXN = 101, + + [System.Runtime.Serialization.EnumMember(Value = @"MXV")] + MXV = 102, + + [System.Runtime.Serialization.EnumMember(Value = @"MYR")] + MYR = 103, + + [System.Runtime.Serialization.EnumMember(Value = @"MZN")] + MZN = 104, + + [System.Runtime.Serialization.EnumMember(Value = @"NAD")] + NAD = 105, + + [System.Runtime.Serialization.EnumMember(Value = @"NGN")] + NGN = 106, + + [System.Runtime.Serialization.EnumMember(Value = @"NIO")] + NIO = 107, + + [System.Runtime.Serialization.EnumMember(Value = @"NOK")] + NOK = 108, + + [System.Runtime.Serialization.EnumMember(Value = @"NPR")] + NPR = 109, + + [System.Runtime.Serialization.EnumMember(Value = @"NZD")] + NZD = 110, + + [System.Runtime.Serialization.EnumMember(Value = @"OMR")] + OMR = 111, + + [System.Runtime.Serialization.EnumMember(Value = @"PAB")] + PAB = 112, + + [System.Runtime.Serialization.EnumMember(Value = @"PEN")] + PEN = 113, + + [System.Runtime.Serialization.EnumMember(Value = @"PGK")] + PGK = 114, + + [System.Runtime.Serialization.EnumMember(Value = @"PHP")] + PHP = 115, + + [System.Runtime.Serialization.EnumMember(Value = @"PKR")] + PKR = 116, + + [System.Runtime.Serialization.EnumMember(Value = @"PLN")] + PLN = 117, + + [System.Runtime.Serialization.EnumMember(Value = @"PYG")] + PYG = 118, + + [System.Runtime.Serialization.EnumMember(Value = @"QAR")] + QAR = 119, + + [System.Runtime.Serialization.EnumMember(Value = @"RON")] + RON = 120, + + [System.Runtime.Serialization.EnumMember(Value = @"RSD")] + RSD = 121, + + [System.Runtime.Serialization.EnumMember(Value = @"RUB")] + RUB = 122, + + [System.Runtime.Serialization.EnumMember(Value = @"RWF")] + RWF = 123, + + [System.Runtime.Serialization.EnumMember(Value = @"SAR")] + SAR = 124, + + [System.Runtime.Serialization.EnumMember(Value = @"SBD")] + SBD = 125, + + [System.Runtime.Serialization.EnumMember(Value = @"SCR")] + SCR = 126, + + [System.Runtime.Serialization.EnumMember(Value = @"SDG")] + SDG = 127, + + [System.Runtime.Serialization.EnumMember(Value = @"SEK")] + SEK = 128, + + [System.Runtime.Serialization.EnumMember(Value = @"SGD")] + SGD = 129, + + [System.Runtime.Serialization.EnumMember(Value = @"SHP")] + SHP = 130, + + [System.Runtime.Serialization.EnumMember(Value = @"SLL")] + SLL = 131, + + [System.Runtime.Serialization.EnumMember(Value = @"SOS")] + SOS = 132, + + [System.Runtime.Serialization.EnumMember(Value = @"SRD")] + SRD = 133, + + [System.Runtime.Serialization.EnumMember(Value = @"SSP")] + SSP = 134, + + [System.Runtime.Serialization.EnumMember(Value = @"STD")] + STD = 135, + + [System.Runtime.Serialization.EnumMember(Value = @"SYP")] + SYP = 136, + + [System.Runtime.Serialization.EnumMember(Value = @"SZL")] + SZL = 137, + + [System.Runtime.Serialization.EnumMember(Value = @"THB")] + THB = 138, + + [System.Runtime.Serialization.EnumMember(Value = @"TJS")] + TJS = 139, + + [System.Runtime.Serialization.EnumMember(Value = @"TMT")] + TMT = 140, + + [System.Runtime.Serialization.EnumMember(Value = @"TND")] + TND = 141, + + [System.Runtime.Serialization.EnumMember(Value = @"TOP")] + TOP = 142, + + [System.Runtime.Serialization.EnumMember(Value = @"TRY")] + TRY = 143, + + [System.Runtime.Serialization.EnumMember(Value = @"TTD")] + TTD = 144, + + [System.Runtime.Serialization.EnumMember(Value = @"TWD")] + TWD = 145, + + [System.Runtime.Serialization.EnumMember(Value = @"TZS")] + TZS = 146, + + [System.Runtime.Serialization.EnumMember(Value = @"UAH")] + UAH = 147, + + [System.Runtime.Serialization.EnumMember(Value = @"UGX")] + UGX = 148, + + [System.Runtime.Serialization.EnumMember(Value = @"USD")] + USD = 149, + + [System.Runtime.Serialization.EnumMember(Value = @"USN")] + USN = 150, + + [System.Runtime.Serialization.EnumMember(Value = @"USS")] + USS = 151, + + [System.Runtime.Serialization.EnumMember(Value = @"UYI")] + UYI = 152, + + [System.Runtime.Serialization.EnumMember(Value = @"UYU")] + UYU = 153, + + [System.Runtime.Serialization.EnumMember(Value = @"UZS")] + UZS = 154, + + [System.Runtime.Serialization.EnumMember(Value = @"VEF")] + VEF = 155, + + [System.Runtime.Serialization.EnumMember(Value = @"VND")] + VND = 156, + + [System.Runtime.Serialization.EnumMember(Value = @"VUV")] + VUV = 157, + + [System.Runtime.Serialization.EnumMember(Value = @"WST")] + WST = 158, + + [System.Runtime.Serialization.EnumMember(Value = @"XAF")] + XAF = 159, + + [System.Runtime.Serialization.EnumMember(Value = @"XAG")] + XAG = 160, + + [System.Runtime.Serialization.EnumMember(Value = @"XAU")] + XAU = 161, + + [System.Runtime.Serialization.EnumMember(Value = @"XBA")] + XBA = 162, + + [System.Runtime.Serialization.EnumMember(Value = @"XBB")] + XBB = 163, + + [System.Runtime.Serialization.EnumMember(Value = @"XBC")] + XBC = 164, + + [System.Runtime.Serialization.EnumMember(Value = @"XBD")] + XBD = 165, + + [System.Runtime.Serialization.EnumMember(Value = @"XCD")] + XCD = 166, + + [System.Runtime.Serialization.EnumMember(Value = @"XDR")] + XDR = 167, + + [System.Runtime.Serialization.EnumMember(Value = @"XFU")] + XFU = 168, + + [System.Runtime.Serialization.EnumMember(Value = @"XOF")] + XOF = 169, + + [System.Runtime.Serialization.EnumMember(Value = @"XPD")] + XPD = 170, + + [System.Runtime.Serialization.EnumMember(Value = @"XPF")] + XPF = 171, + + [System.Runtime.Serialization.EnumMember(Value = @"XPT")] + XPT = 172, + + [System.Runtime.Serialization.EnumMember(Value = @"XXX")] + XXX = 173, + + [System.Runtime.Serialization.EnumMember(Value = @"YER")] + YER = 174, + + [System.Runtime.Serialization.EnumMember(Value = @"ZAR")] + ZAR = 175, + + [System.Runtime.Serialization.EnumMember(Value = @"ZMW")] + ZMW = 176, + + [System.Runtime.Serialization.EnumMember(Value = @"UNKNOWN")] + UNKNOWN = 177, + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v13.0.0.0))")] + public enum WeightUom + { + + [System.Runtime.Serialization.EnumMember(Value = @"g")] + G = 0, + + [System.Runtime.Serialization.EnumMember(Value = @"kg")] + Kg = 1, + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v13.0.0.0))")] + internal class DateFormatConverter : Newtonsoft.Json.Converters.IsoDateTimeConverter + { + public DateFormatConverter() + { + DateTimeFormat = "yyyy-MM-dd"; + } + } + + + + [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v13.0.0.0))")] + internal partial class ApiException : System.Exception + { + public int StatusCode { get; private set; } + + public string Response { get; private set; } + + public System.Collections.Generic.IReadOnlyDictionary> Headers { get; private set; } + + public ApiException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Exception innerException) + : base(message + "\n\nStatus: " + statusCode + "\nResponse: \n" + ((response == null) ? "(null)" : response.Substring(0, response.Length >= 512 ? 512 : response.Length)), innerException) + { + StatusCode = statusCode; + Response = response; + Headers = headers; + } + + public override string ToString() + { + return string.Format("HTTP Response: \n\n{0}\n\n{1}", Response, base.ToString()); + } + } + + [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v13.0.0.0))")] + internal partial class ApiException : ApiException + { + public TResult Result { get; private set; } + + public ApiException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, TResult result, System.Exception innerException) + : base(message, statusCode, response, headers, innerException) + { + Result = result; + } + } + +} + +#pragma warning restore 1591 +#pragma warning restore 1573 +#pragma warning restore 472 +#pragma warning restore 114 +#pragma warning restore 108 +#pragma warning restore 3016 +#pragma warning restore 8603 \ No newline at end of file diff --git a/ShippingProAPICollection/Provider/DHL/DHLSettings.cs b/ShippingProAPICollection/Provider/DHL/DHLSettings.cs new file mode 100644 index 0000000..8e578bd --- /dev/null +++ b/ShippingProAPICollection/Provider/DHL/DHLSettings.cs @@ -0,0 +1,24 @@ +using ShippingProAPICollection.Provider; +using ShippingProAPICollection._Provider.DHL; + +namespace ShippingProAPICollection.Provider.DHL +{ + public class DHLSettings : ProviderSettings + { + /// + /// Api domain is the XXXXXXX part of the api url provides by DHL => https://api-XXXXXXX.dhl.com/parcel/de/shipping/v2/ + /// + public required string ApiDomain { get; set; } + public required string NationalAccountNumber { get; set; } + public required string InternationalAccountNumber { get; set; } + public required string Username { get; set; } + public required string Password { get; set; } + public required string LabelPrintFormat { get; set; } + public required string DHLShipmentProfile { get; set; } + public required string APIKey { get; set; } + /// + /// en-US or de-DE + /// + public required string APILanguage { get; set; } + } +} diff --git a/ShippingProAPICollection/Provider/DHL/DHLShipmentRequestModel.cs b/ShippingProAPICollection/Provider/DHL/DHLShipmentRequestModel.cs new file mode 100644 index 0000000..d3b7a72 --- /dev/null +++ b/ShippingProAPICollection/Provider/DHL/DHLShipmentRequestModel.cs @@ -0,0 +1,119 @@ +using ShippingProAPICollection.Models.Utils; +using System.ComponentModel.DataAnnotations; +using ShippingProAPICollection.Models.Entities; +using ShippingProAPICollection.Models.Error; +using ShippingProAPICollection.Provider.DHL.Entities; +using Org.BouncyCastle.Asn1.Ocsp; + +namespace ShippingProAPICollection.Provider.DHL +{ + public class DHLShipmentRequestModel : RequestShipmentBase + { + public DHLShipmentRequestModel(string contractID) : base(contractID) + { + + } + + public DHLShipmentRequestModel() : base(ShippingProviderType.DHL.ToString()) + { + + } + + public override string ProviderType { get; } = ShippingProviderType.DHL.ToString(); + public override float MaxPackageWeight { get; } = 31.5f; + + /// + /// Mit Email Notification an den Kunden -> E-Mail muss dafür angegeben werden | + /// Should the shipping provider notify the customer on status changes? If TRUE the Email address musst be set + /// + /// false + public bool WithEmailNotification { get; set; } + + /// + /// Normal oder Express Versand | + /// Normal or Express shipping + /// + /// V01PAK + [Required] + public required DHLProductType ServiceProduct { get; set; } + + /// + /// Welchen Service soll für den Versand in anspruch genommen werden? Deposit-Service oder keinen? | + /// What kind of service should be used? Deposit-Service or none + /// + /// DEPOSIT + [Required] + public required DHLServiceType ServiceType { get; set; } + + //Deposit + /// + /// Ablageort des Paketes falls Servicetype == DEPOSIT | + /// Deposit location of the package if ServiceType = DEPOSIT + /// + /// Briefksten/ Hinter Blumentopf + [MaxLength(60)] + public string? PlaceOfDeposit { get; set; } + + //Packstation + /// + /// Angaben zur Packstationen falls Servicetype == PACKSTATION | + /// Packing station information if Servicetype == PACKSTATION + /// + public DHLLockerData? Locker { get; set; } + + //Postfilale + /// + /// Angaben zur Postfilale falls Servicetype == POSTFILIALE | + /// Postoffice information if Servicetype == POSTFILIALE + /// + public DHLPostOfficeData? PostOffice { get; set; } + + internal override bool IsExpress() + { + return ServiceProduct == DHLProductType.V01PRIO; + } + + /// + /// Referenc string des Versandlabels auf Rechnungsreferenze und Kundenreferenze bauen + /// Build shippinglabel ref number from invoice reference and customer reference + /// + /// + internal string? GetRefString() + { + if (!String.IsNullOrEmpty(InvoiceReference) && String.IsNullOrEmpty(CustomerReference)) + { + return InvoiceReference.FillString(8, '-'); + } + else if (String.IsNullOrEmpty(InvoiceReference) && !String.IsNullOrEmpty(CustomerReference)) + { + return CustomerReference.FillString(8, '-'); + } + else if (!String.IsNullOrEmpty(InvoiceReference) && !String.IsNullOrEmpty(CustomerReference)) + { + return (InvoiceReference + " | " + CustomerReference).FillString(8, '-'); + } + return null; + } + + public override void Validate() + { + base.Validate(); + + if (ServiceType == DHLServiceType.DEPOSIT && !PlaceOfDeposit.RangeLenghtValidation(1, 60)) throw new ShipmentRequestNoValidStringLengthException("PlaceOfDeposit", 1, 60); + if (ServiceType == DHLServiceType.LOCKER && Locker == null) throw new ShipmentRequestNotNullException("Locker"); + if (ServiceType == DHLServiceType.POSTOFFICE && PostOffice == null) throw new ShipmentRequestNotNullException("PostOffice"); + if (!Note1.RangeLenghtValidation(0, 35)) throw new ShipmentRequestNoValidStringLengthException("Note1", null, 35); + if (!Phone.RangeLenghtValidation(0, 20)) throw new ShipmentRequestNoValidStringLengthException("Phone", null, 20); + if (!StreetNumber.RangeLenghtValidation(0, 20)) throw new ShipmentRequestNoValidStringLengthException("StreetNumber", null, 20); + if (!Adressline1.RangeLenghtValidation(1, 50)) throw new ShipmentRequestNoValidStringLengthException("Adressline1", 1, 50); + if (!Adressline2.RangeLenghtValidation(0, 50)) throw new ShipmentRequestNoValidStringLengthException("Adressline2", null, 50); + if (!Adressline3.RangeLenghtValidation(0, 50)) throw new ShipmentRequestNoValidStringLengthException("Adressline3", null, 50); + if (!Street.RangeLenghtValidation(1, 50)) throw new ShipmentRequestNoValidStringLengthException("Street", 1, 50); + if (!City.RangeLenghtValidation(1, 40)) throw new ShipmentRequestNoValidStringLengthException("City", 1, 40); + if (!InvoiceReference.MaxLenghtValidation(35)) throw new ShipmentRequestNoValidStringLengthException("InvoiceReference", null, 35); + if (!CustomerReference.MaxLenghtValidation(35)) throw new ShipmentRequestNoValidStringLengthException("CustomerReference", null, 35); + if (!GetRefString().MaxLenghtValidation(35)) throw new ShipmentRequestNoValidStringLengthException("InvoiceReference + CustomerReference", null, 35); + if (WithEmailNotification && !EMail.RangeLenghtValidation(1, 80)) throw new ShipmentRequestNoValidStringLengthException("EMail", null, 80); + } + } +} diff --git a/ShippingProAPICollection/Provider/DHL/DHLShipmentService.cs b/ShippingProAPICollection/Provider/DHL/DHLShipmentService.cs new file mode 100644 index 0000000..a995798 --- /dev/null +++ b/ShippingProAPICollection/Provider/DHL/DHLShipmentService.cs @@ -0,0 +1,336 @@ +using Newtonsoft.Json; +using RestSharp; +using RestSharp.Authenticators; +using ShippingProAPICollection._Provider.DHL; +using ShippingProAPICollection.Models; +using ShippingProAPICollection.Models.Entities; +using ShippingProAPICollection.Models.Error; +using ShippingProAPICollection.Models.Utils; +using ShippingProAPICollection.Provider.DHL.Entities; +using ShippingProAPICollection.Provider.GLS.Entities.Validation; + +namespace ShippingProAPICollection.Provider.DHL +{ + public class DHLShipmentService : IShippingProviderService + { + + private DHLSettings providerSettings = null!; + private ShippingProAPIAccountSettings accountSettings = null!; + + public DHLShipmentService(ShippingProAPIAccountSettings accountSettings, DHLSettings providerSettings) + { + this.accountSettings = accountSettings; + this.providerSettings = providerSettings; + } + + public async Task> RequestLabel(RequestShipmentBase request, CancellationToken cancelToken = default) + { + var DHLRequest = request as DHLShipmentRequestModel; + + var urlBuilder_ = new System.Text.StringBuilder(); + var baseUrl = string.Format("https://api-{0}.dhl.com/parcel/de/shipping/v2/", providerSettings.ApiDomain); + + urlBuilder_.Append(baseUrl != null ? baseUrl.TrimEnd('/') : "").Append("/orders?"); + urlBuilder_.Append(Uri.EscapeDataString("docFormat") + "=").Append(DHLLabelDocFormat.PDF.ToString()).Append("&"); + urlBuilder_.Append(Uri.EscapeDataString("printFormat") + "=").Append(providerSettings.LabelPrintFormat).Append("&"); + urlBuilder_.Length--; + + var clientOptions = new RestClientOptions(new Uri(urlBuilder_.ToString(), UriKind.RelativeOrAbsolute)) + { + RemoteCertificateValidationCallback = (sender, certificate, chain, sslPolicyErrors) => true, + Authenticator = new HttpBasicAuthenticator(providerSettings.Username, providerSettings.Password) + }; + + using (RestClient client = new RestClient(clientOptions)) + { + + var clientRequest = new RestRequest() + { + Method = Method.Post + }; + + clientRequest.AddHeader("dhl-api-key", providerSettings.APIKey); + clientRequest.AddHeader("Content-Type", "application/json"); + + if (!string.IsNullOrEmpty(providerSettings.APILanguage)) + { + clientRequest.AddHeader("Accept-Language", providerSettings.APILanguage); + }; + + var requestBody = CreateRequestModel(DHLRequest); + + string requestJson = JsonConvert.SerializeObject(requestBody, Formatting.Indented, new JsonSerializerSettings + { + NullValueHandling = NullValueHandling.Ignore, + DefaultValueHandling = DefaultValueHandling.Ignore, + }); + + clientRequest.AddBody(requestJson); + + RestResponse response = await client.ExecuteAsync(clientRequest, cancelToken).ConfigureAwait(false); + + if (response.StatusCode == System.Net.HttpStatusCode.OK || response.StatusCode == System.Net.HttpStatusCode.MultiStatus) + { + var objectResponse_ = JsonConvert.DeserializeObject(response.Content); + if (objectResponse_ == null) + { + throw new DHLException(ShippingErrorCode.CANNOT_CONVERT_RESPONSE, "Cannot convert reponse to object", new { payload = requestBody, respone = response.Content }); + } + + List labels = new List(); + + foreach (ResponseItem c in objectResponse_.Items) + { + labels.Add(new RequestShippingLabelResponse() + { + Label = Convert.FromBase64String(c.Label.B64), + ParcelNumber = c.ShipmentNo, + CancelId = c.ShipmentNo, + LabelType = request.IsExpress() ? ShippingLabelType.EXPRESS : ShippingLabelType.NORMAL, + Weight = request.GetPackageWeight(), + }); + } + + return labels; + } + else if (response.StatusCode == System.Net.HttpStatusCode.BadRequest) + { + var objectResponse_ = JsonConvert.DeserializeObject(response.Content); + if (objectResponse_ == null) + { + throw new DHLException(ShippingErrorCode.CANNOT_CONVERT_RESPONSE, "Cannot convert reponse to object", new { payload = requestBody, respone = response.Content }); + } + + throw new DHLException(ShippingErrorCode.BAD_REQUEST_ERROR, objectResponse_.Items?.FirstOrDefault()?.ValidationMessages.FirstOrDefault()?.ValidationMessage ?? "Unknow message", new { payload = requestBody, respone = response.Content }); + } + else if (response.StatusCode == System.Net.HttpStatusCode.Unauthorized) + { + throw new DHLException(ShippingErrorCode.UNAUTHORIZED, $"Request reponsed with HTTP status code {(int)response.StatusCode}", new { payload = requestBody, respone = response.Content }); + } + else if (response.StatusCode == System.Net.HttpStatusCode.TooManyRequests) + { + throw new DHLException(ShippingErrorCode.TO_MANY_REQUESTS, $"Request reponsed with HTTP status code {(int)response.StatusCode}", new { payload = requestBody, respone = response.Content }); + } + else if (response.StatusCode == System.Net.HttpStatusCode.InternalServerError) + { + throw new DHLException(ShippingErrorCode.INTERNAL_SERVER_ERROR, $"Request reponsed with HTTP status code {(int)response.StatusCode}", new { payload = requestBody, respone = response.Content }); + } + else + { + throw new DHLException(ShippingErrorCode.UNKNOW, "The HTTP status code of the response was not expected (" + (int)response.StatusCode + ").", new { payload = requestBody, respone = response.Content }); + } + + } + + } + + public async Task CancelLabel(string cancelId, CancellationToken cancelToken = default) + { + var urlBuilder_ = new System.Text.StringBuilder(); + var baseUrl = string.Format("https://api-{0}.dhl.com/parcel/de/shipping/v2/", providerSettings.ApiDomain); + + urlBuilder_.Append(baseUrl != null ? baseUrl.TrimEnd('/') : "").Append("/orders?"); + urlBuilder_.Append(Uri.EscapeDataString("profile") + "=").Append(providerSettings.DHLShipmentProfile).Append("&"); + urlBuilder_.Append(Uri.EscapeDataString("shipment") + "=").Append(cancelId).Append("&"); + urlBuilder_.Length--; + + var clientOptions = new RestClientOptions(new Uri(urlBuilder_.ToString(), UriKind.RelativeOrAbsolute)) + { + RemoteCertificateValidationCallback = (sender, certificate, chain, sslPolicyErrors) => true, + Authenticator = new HttpBasicAuthenticator(providerSettings.Username, providerSettings.Password) + }; + + using (RestClient client = new RestClient(clientOptions)) + { + + var clientRequest = new RestRequest() + { + Method = Method.Delete + }; + + clientRequest.AddHeader("dhl-api-key", providerSettings.APIKey); + clientRequest.AddHeader("Content-Type", "application/json"); + + if (!string.IsNullOrEmpty(providerSettings.APILanguage)) + { + clientRequest.AddHeader("Accept-Language", providerSettings.APILanguage); + }; + + RestResponse response = await client.ExecuteAsync(clientRequest, cancelToken).ConfigureAwait(false); + + if (response.StatusCode == System.Net.HttpStatusCode.OK || response.StatusCode == System.Net.HttpStatusCode.MultiStatus) + { + var objectResponse_ = JsonConvert.DeserializeObject(response.Content); + if (objectResponse_ == null) + { + throw new DHLException(ShippingErrorCode.CANNOT_CONVERT_RESPONSE, "Cannot convert reponse to object", new { payload = cancelId, respone = response.Content }); + } + + return ShippingCancelResult.CANCLED; + } + else if (response.StatusCode == System.Net.HttpStatusCode.BadRequest) + { + var objectResponse_ = JsonConvert.DeserializeObject(response.Content); + if (objectResponse_ == null) + { + throw new DHLException(ShippingErrorCode.CANNOT_CONVERT_RESPONSE, "Cannot convert reponse to object", new { payload = cancelId, respone = response.Content }); + } + + throw new DHLException(ShippingErrorCode.BAD_REQUEST_ERROR, objectResponse_.Items?.FirstOrDefault()?.ValidationMessages.FirstOrDefault()?.ValidationMessage ?? "Unknow message", new { payload = cancelId, respone = response.Content }); + } + else if (response.StatusCode == System.Net.HttpStatusCode.Unauthorized) + { + throw new DHLException(ShippingErrorCode.UNAUTHORIZED, $"Request reponsed with HTTP status code {(int)response.StatusCode}", new { payload = cancelId, respone = response.Content }); + } + else if (response.StatusCode == System.Net.HttpStatusCode.TooManyRequests) + { + throw new DHLException(ShippingErrorCode.TO_MANY_REQUESTS, $"Request reponsed with HTTP status code {(int)response.StatusCode}", new { payload = cancelId, respone = response.Content }); + } + else if (response.StatusCode == System.Net.HttpStatusCode.InternalServerError) + { + throw new DHLException(ShippingErrorCode.INTERNAL_SERVER_ERROR, $"Request reponsed with HTTP status code {(int)response.StatusCode}", new { payload = cancelId, respone = response.Content }); + } + else + { + throw new DHLException(ShippingErrorCode.UNKNOW, "The HTTP status code of the response was not expected (" + (int)response.StatusCode + ").", new { payload = cancelId, respone = response.Content }); + } + } + + } + + public Task ValidateLabel(RequestShipmentBase request, CancellationToken cancelToken) + { + throw new DHLException(ShippingErrorCode.NOT_AVAILABLE, "Feature not available for DHL"); + } + + public Task GetEstimatedDeliveryDays(RequestShipmentBase request, CancellationToken cancelToken) + { + throw new DHLException(ShippingErrorCode.NOT_AVAILABLE, "Feature not available for DHL"); + } + + /// + /// Create the DHL request body informations + /// + /// + /// + private ShipmentOrderRequest CreateRequestModel(DHLShipmentRequestModel request) + { + + // Build shipper infos + Shipper shipper = new Shipper() + { + Name1 = accountSettings.Name, + Name2 = accountSettings.Name2, + Name3 = accountSettings.Name3, + AddressStreet = accountSettings.Street, + PostalCode = accountSettings.PostCode, + City = accountSettings.City, + Country = EnumUtils.ToEnum(ThreeLetterCountryCodeHelper.GetThreeLetterCountryCode(accountSettings.CountryIsoA2Code), Country.UNKNOWN), + ContactName = accountSettings.ContactName, + Email = accountSettings.Email, + }; + + Consignee consignee = GetConsignee(request); + + ShipmentOrderRequest shipmentOrderRequest = new ShipmentOrderRequest(); + shipmentOrderRequest.Profile = providerSettings.DHLShipmentProfile; + + // Build shipment for each requested label + for (int i = 0; i < request.LabelCount; i++) + { + Shipment shipment = new Shipment(); + + shipment.Product = request.ServiceProduct.ToString(); + shipment.BillingNumber = GetBillingNumber(request); + shipment.ShipDate = DateTimeOffset.Now; + shipment.Shipper = shipper; + shipment.Consignee = consignee; + shipment.RefNo = request.GetRefString(); + + shipment.Details = new ShipmentDetails() + { + Weight = new Weight() + { + Uom = WeightUom.Kg, + Value = request.GetPackageWeight() + } + }; + + shipment.Services = new VAS() + { + PreferredLocation = request.ServiceType == DHLServiceType.DEPOSIT ? request.PlaceOfDeposit : null, + }; + + shipmentOrderRequest.Shipments.Add(shipment); + } + + return shipmentOrderRequest; + + } + + /// + /// Build consignee informations + /// + /// + /// + private Consignee GetConsignee(DHLShipmentRequestModel request) + { + Consignee consignee = new Consignee(); + consignee.AdditionalProperties.Add("city", request.City); + consignee.AdditionalProperties.Add("postalCode", request.PostCode); + + if (request.WithEmailNotification && !string.IsNullOrEmpty(request.EMail)) + { + consignee.AdditionalProperties.Add("email", request.EMail); + } + + switch (request.ServiceType) + { + case DHLServiceType.NONE: + case DHLServiceType.DEPOSIT: + consignee.AdditionalProperties.Add("name1", request.Adressline1); + consignee.AdditionalProperties.Add("addressStreet", request.Street); + consignee.AdditionalProperties.Add("country", ThreeLetterCountryCodeHelper.GetThreeLetterCountryCode(request.Country)); + + if (!String.IsNullOrEmpty(request.Adressline2)) consignee.AdditionalProperties.Add("name2", request.Adressline2); + if (!String.IsNullOrEmpty(request.Adressline3)) consignee.AdditionalProperties.Add("name3", request.Adressline3); + if (!String.IsNullOrEmpty(request.Note1)) consignee.AdditionalProperties.Add("dispatchingInformation", request.Note1); + if (!String.IsNullOrEmpty(request.StreetNumber)) consignee.AdditionalProperties.Add("addressHouse", request.StreetNumber); + if (!String.IsNullOrEmpty(request.Phone)) consignee.AdditionalProperties.Add("phone", request.Phone); + break; + case DHLServiceType.LOCKER: + consignee.AdditionalProperties.Add("name", request.Adressline1); + consignee.AdditionalProperties.Add("lockerID", request.Locker.PackstationNumber); + consignee.AdditionalProperties.Add("postNumber", request.Locker.PostNumber); + break; + case DHLServiceType.POSTOFFICE: + consignee.AdditionalProperties.Add("name", request.Adressline1); + consignee.AdditionalProperties.Add("retailID", request.PostOffice.PostfilialeNumber); + consignee.AdditionalProperties.Add("postNumber", request.PostOffice.PostNumber); + break; + } + + return consignee; + } + + /// + /// Get DHL billing number by product type + /// + /// + /// + /// + private string GetBillingNumber(DHLShipmentRequestModel request) + { + switch (request.ServiceProduct) + { + case DHLProductType.V01PAK: + case DHLProductType.V01PRIO: + return providerSettings.NationalAccountNumber; + case DHLProductType.V53WPAK: + return providerSettings.InternationalAccountNumber; + default: + throw new Exception("Accountnumber not defined"); + } + } + } +} diff --git a/ShippingProAPICollection/Provider/DHL/Entities/DHLException.cs b/ShippingProAPICollection/Provider/DHL/Entities/DHLException.cs new file mode 100644 index 0000000..9936e02 --- /dev/null +++ b/ShippingProAPICollection/Provider/DHL/Entities/DHLException.cs @@ -0,0 +1,11 @@ +using ShippingProAPICollection.Models.Error; + +namespace ShippingProAPICollection.Provider.DHL.Entities +{ + public class DHLException : ShippingProviderException + { + public DHLException(ShippingErrorCode errorcode, string message, object? payload = null) : base(errorcode, message, payload) + { + } + } +} diff --git a/ShippingProAPICollection/Provider/DHL/Entities/DHLLabelDocFormats.cs b/ShippingProAPICollection/Provider/DHL/Entities/DHLLabelDocFormats.cs new file mode 100644 index 0000000..eaf3835 --- /dev/null +++ b/ShippingProAPICollection/Provider/DHL/Entities/DHLLabelDocFormats.cs @@ -0,0 +1,8 @@ +namespace ShippingProAPICollection.Provider.DHL.Entities +{ + public enum DHLLabelDocFormat + { + ZPL2, + PDF + } +} diff --git a/ShippingProAPICollection/Provider/DHL/Entities/DHLLockerData.cs b/ShippingProAPICollection/Provider/DHL/Entities/DHLLockerData.cs new file mode 100644 index 0000000..645b4ec --- /dev/null +++ b/ShippingProAPICollection/Provider/DHL/Entities/DHLLockerData.cs @@ -0,0 +1,37 @@ +using System.ComponentModel.DataAnnotations; + +namespace ShippingProAPICollection.Provider.DHL.Entities +{ + public class DHLLockerData + { + /// + /// Postkundennummer | + /// DHL customer id + /// + /// 1234567 + [Required] + public required string PostNumber { get; set; } + + /// + /// Packstationnummer | + /// number of the packing station + /// + /// 168 + [Required] + public required string PackstationNumber { get; set; } + /// + /// Postleitzahl | + /// postcode of the packing station + /// + /// 73479 + [Required] + public required string ZIPCode { get; set; } + /// + /// Stadt | + /// City of the packing station + /// + /// Ellwangen + [Required] + public required string City { get; set; } + } +} diff --git a/ShippingProAPICollection/Provider/DHL/Entities/DHLPostOfficeData.cs b/ShippingProAPICollection/Provider/DHL/Entities/DHLPostOfficeData.cs new file mode 100644 index 0000000..c6d91a8 --- /dev/null +++ b/ShippingProAPICollection/Provider/DHL/Entities/DHLPostOfficeData.cs @@ -0,0 +1,36 @@ +using System.ComponentModel.DataAnnotations; + +namespace ShippingProAPICollection.Provider.DHL.Entities +{ + public class DHLPostOfficeData + { + /// + /// Postfilalennummer | + /// Number of the post office + /// + /// 110 + [Required] + public required string PostfilialeNumber { get; set; } + /// + /// Postkundennummer | + /// DHL customer id + /// + /// 1234567 + [Required] + public required string PostNumber { get; set; } + /// + /// Postleitzahl | + /// Postcode of the post office + /// + /// 73479 + [Required] + public required string PostCode { get; set; } + /// + /// Stadt | + /// City of the post office + /// + /// Ellwangen + [Required] + public required string City { get; set; } + } +} diff --git a/ShippingProAPICollection/Provider/DHL/Entities/DHLProductType.cs b/ShippingProAPICollection/Provider/DHL/Entities/DHLProductType.cs new file mode 100644 index 0000000..355224c --- /dev/null +++ b/ShippingProAPICollection/Provider/DHL/Entities/DHLProductType.cs @@ -0,0 +1,21 @@ +namespace ShippingProAPICollection.Provider.DHL.Entities +{ + public enum DHLProductType + { + /// + /// Normalversand | + /// Normal shipping + /// + V01PAK, + /// + /// Expressversand | + /// Express shipping + /// + V01PRIO, + /// + /// Normalversand-International | + /// Normal international shipping + /// + V53WPAK + } +} diff --git a/ShippingProAPICollection/Provider/DHL/Entities/DHLServiceType.cs b/ShippingProAPICollection/Provider/DHL/Entities/DHLServiceType.cs new file mode 100644 index 0000000..e5ff956 --- /dev/null +++ b/ShippingProAPICollection/Provider/DHL/Entities/DHLServiceType.cs @@ -0,0 +1,25 @@ +namespace ShippingProAPICollection.Provider.DHL.Entities +{ + public enum DHLServiceType + { + /// + /// + /// + NONE, + /// + /// Deposit: Paket an einem Wunschort hinterlegen | + /// Deposit: Deposit the package at a desired location + /// + DEPOSIT, + /// + /// Lieferung an Packstation | + /// Delivery to packing station + /// + LOCKER, + /// + /// Lieferung an Postfiliale | + /// Delivery to post office + /// + POSTOFFICE, + } +} diff --git a/ShippingProAPICollection/Provider/DHL/Entities/ThreeLetterCountryCodeResolvingException.cs b/ShippingProAPICollection/Provider/DHL/Entities/ThreeLetterCountryCodeResolvingException.cs new file mode 100644 index 0000000..291d20d --- /dev/null +++ b/ShippingProAPICollection/Provider/DHL/Entities/ThreeLetterCountryCodeResolvingException.cs @@ -0,0 +1,7 @@ +namespace ShippingProAPICollection.Provider.DHL.Entities +{ + public class ThreeLetterCountryCodeResolvingException : Exception + { + public ThreeLetterCountryCodeResolvingException(string message) : base(message) { } + } +} diff --git a/ShippingProAPICollection/Provider/DHL/Resources/DHLClient.yaml b/ShippingProAPICollection/Provider/DHL/Resources/DHLClient.yaml new file mode 100644 index 0000000..116f5b0 --- /dev/null +++ b/ShippingProAPICollection/Provider/DHL/Resources/DHLClient.yaml @@ -0,0 +1,2162 @@ +openapi: 3.0.1 +info: + title: Parcel DE Shipping API (Post & Parcel Germany) + description: > + Note: This is the specification of the DPDHL Group Parcel DE Shipping API for Post & Parcel Germany. This REST web service allows business customers to create shipping labels on demand. + version: 2.1.8 +servers: + - url: https://api-eu.dhl.com/parcel/de/shipping/v2 + description: Productive Server + - url: https://api-sandbox.dhl.com/parcel/de/shipping/v2 + description: Sandbox Server + +paths: + /: + get: + tags: + - General + summary: Return API version + description: > + Returns the current version of the API as major.minor.patch. Furthermore, it will also return more details (semantic version number, revision, environment) of the API layer. + operationId: rootGet + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ServiceInformation' + '401': + $ref: '#/components/responses/Unauthorized' + '429': + $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/InternalServerError' + /labels: + get: + tags: + - Shipments and Labels + summary: Download PDF document + description: > + Public download URL for shipment labels and documents. The URL is provided in the response of the POST /orders or GET /orders resources. The document is identified via the token query parameter. There is no additional authorization, the resource URL can be shared. Please protect the URL as needed. The call returns a PDF label. + operationId: getLabel + parameters: + - name: token + in: query + description: Identifies PDF document and requested print settings for download. + required: true + schema: + type: string + responses: + '200': + description: OK + content: + application/pdf: + schema: + $ref: '#/components/schemas/LabelDataResponse' + application/json: + schema: + $ref: '#/components/schemas/LabelDataResponse' + '404': + $ref: '#/components/responses/Unauthorized' + '429': + $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/InternalServerError' + /manifests: + get: + tags: + - Manifests + summary: Retrieve daily manifest document + description: Return the manifest document for the specific date (abbreviated ISO8601 format YYYY-MM-DD). If no date is provided, the manifest for today will be returned. The manifest PDF document will list the shipments for your EKP, separated by billing numbers. Potentially, the document is large and response time will reflect this.
Additionally, the response contains a mapping of billing numbers to sheet numbers of the manifest and a mapping of shipment numbers to sheet numbers.
The call can be repeated as often as needed. Should a date be provided which is too old or lies within the future, HTTP 400 is returned. + operationId: getManifests + security: + - ApiKey: [] + - BasicAuth: [] + parameters: + - name: billingNumber + in: query + description: Customer billingNumber number. + required: false + schema: + type: string + - name: date + in: query + schema: + type: string + - name: includeDocs + in: query + description: |- + Legacy name **labelResponseType**. Shipping labels and further shipment documents can be: + * __include__: included as base64 encoded data in the response (default) + * __URL__: provided as URL reference. + Default is include the base64 encoded labels. + schema: + type: string + enum: + - include + - URL + default: include + - name: Accept-Language + in: header + description: Control the APIs response language via locale abbreviation. English (en-US) and german (de-DE) are supported. If not specified, the default is english. + schema: + type: string + example: de-DE + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/SingleManifestResponse' + application/problem+json: + schema: + $ref: '#/components/schemas/SingleManifestResponse' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '404': + $ref: '#/components/responses/NotFound' + '429': + $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/InternalServerError' + post: + tags: + - Manifests + summary: Mark shipments as being ready for shipping + description: |- + Shipments are normally ''closed out'' at a fixed time of the day (such as 6 pm, configured by EKP/account) for the date provided as shipDate in the create call. +
This call allows forcing the closeout for sets of shipments earlier. This will also override the original shipDate. Afterwards, the shipment cannot be changed and the shipment labels cannot be queried anymore (however they may remain cached for limited duration). + Calling closeout repeatedly for the same shipments will result in HTTP 400 for the second call. HTTP 400 will also be returned if the automatic closeout happened prior to the call. It is however possible to add new shipments, they will be manifested as well and be part of the day's manifest. +
Note on billing: The manifesting step has billing implications. Some products (Warenpost, Parcel International partially) are billed based on the shipment data available to DHL at the end of the day. All other products (including DHL Paket Standard) are billed based on production data. For more details, please contact your account representative. + + #### Request + It's changing the status of the shipment, so parameters are provided in the body. + * ''profile'' attribute - defines the user group profile. A user group is permitted to specific billing numbers. Shipments are only closed out if they belong to a billing number that the user group profile is entitled to use. This attribute is mandatory. Please use the standard user group profile ''STANDARD_GRUPPENPROFIL'' if no dedicated user group profile is available. + * ''billingNumber'' attribute - defines the billing number for which shipments shall be closed out. If a billing number is set, then only the shipments of that billing number are closed out. In that case no list of specific shipment numbers needs to be passed. + * ''shipmentNumbers'' attribute - lists the specific shipping numbers of the shipments that shall be closed out. + If all shipments shall be closed, the query parameter ''all'' needs to be set to ''true''. In that case neither a billing number nor a list of shipment numbers need to be passed in the request body. + + #### Response + * Closing status for each shipment + operationId: manifestsPost + security: + - ApiKey: [] + - BasicAuth: [] + parameters: + - name: Accept-Language + in: header + description: Control the APIs response language via locale abbreviation. English (en-US) and german (de-DE) are supported. If not specified, the default is english. + schema: + type: string + example: de-DE + - name: all + in: query + description: Specify if all applicable shipments shall be marked as being ready for shipping. + schema: + type: boolean + default: false + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ShipmentManifestingRequest' + required: true + responses: + '207': + description: Response for manifesting request taking multiple input elements + content: + application/json: + schema: + $ref: '#/components/schemas/MultipleManifestResponse' + application/problem+json: + schema: + $ref: '#/components/schemas/MultipleManifestResponse' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '429': + $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/InternalServerError' + /orders: + get: + tags: + - Shipments and Labels + summary: Retrieve shipment documents - labels and customs documents + description: |- + Returns documents for existing shipment(s). The call accepts multiple shipment numbers and will provide sets of documents for those. The **format (PDF,ZPL)** and **method of delivery (URL, encoded, data)** can be selected for **all** shipments and labels in that call. You cannot chose one format and delivery method for one label and different for another label within the same call. You can also specify if you want regular labels, return labels, cod labels, or customsDoc. Any combination is possible. + + The call returns for each shipment number the status indicator and the selected labels and documents. If a label type (for example a cod label) does not exist for a shipment, it will not be returned. This is not an error. If you were sending multiple shipments, you will get an HTTP 207 response (multistatus) with detailed status for each shipment. Other standard HTTP response codes (200, 400, 401, 429, 500) are possible as well. Labels can be either provided as part of the response (base64 encoded for PDF, text for ZPL) or via URL link for view and download (PDF). Note that the format settings per query parameters apply to the shipping label. Retoure label paper type can be specified separately since a different printer may be used here. If requesting labels to be returned as URL for separate download, the URLs provided can be shared. + operationId: getOrder + security: + - ApiKey: [] + - BasicAuth: [] + parameters: + - name: shipment + in: query + description: This parameter identifies shipments. The parameter can be used multiple times in one request to get the labels and/or documents for up to 30 shipments maximum. Only documents and label for shipments that are not yet closed can be retrieved. + required: true + schema: + type: array + items: + type: string + - name: Accept-Language + in: header + description: Control the APIs response language via locale abbreviation. English (en-US) and german (de-DE) are supported. If not specified, the default is english. + schema: + type: string + example: de-DE + - name: docFormat + in: query + description: '**Defines** the **printable** document format to be used for label and manifest documents.' + schema: + type: string + enum: + - ZPL2 + - PDF + default: PDF + - name: printFormat + in: query + description: "**Defines** the print medium for the shipping label. The different option vary from standard papersizes DIN A4 and DIN A5 to specific label print formats.\_\n\nSpecific laser print formats using DIN A5 blanks are:\n\n* 910-300-600(-oz) (105 x 205mm)\n* 910-300-300(-oz) (105 x 148mm)\n\nSpecific laser print formats **not** using a DIN A5 blank:\n\n* 910-300-610 (105 x 208mm)\n* 100x70mm\n\nSpecific thermal print formats:\n\n* 910-300-600 (103 x 199mm)\n* 910-300-400 (103 x 150mm)\n* 100x70mm\n\nPlease use the different formats as follows. If you do not set the parameter the settings of DHL costumer portal account will be used as default." + schema: + type: string + enum: + - A4 + - 910-300-600 + - 910-300-610 + - 910-300-700 + - 910-300-700-oz + - 910-300-710 + - 910-300-300 + - 910-300-300-oz + - 910-300-400 + - 910-300-410 + - 100x70mm + - name: retourePrintFormat + in: query + description: "**Defines** the print medium for the return shipping label. This parameter is only usable, if you do not use **combined printing**. The different option vary from standard papersizes DIN A4 and DIN A5 to specific label print formats.\_\n\nSpecific laser print formats using DIN A5 blanks are:\n\n* 910-300-600(-oz) (105 x 205mm)\n* 910-300-300(-oz) (105 x 148mm)\n\nSpecific laser print formats **not** using a DIN A5 blank:\n\n* 910-300-610 (105 x 208mm)\n* 100x70mm\n\nSpecific thermal print formats:\n\n* 910-300-600 (103 x 199mm)\n* 910-300-400 (103 x 150mm)\n* 100x70mm\n\nPlease use the different formats as follows. If you do not set the parameter the settings of DHL costumer portal account will be used as default." + schema: + type: string + enum: + - A4 + - 910-300-600 + - 910-300-610 + - 910-300-700 + - 910-300-700-oz + - 910-300-710 + - 910-300-300 + - 910-300-300-oz + - 910-300-400 + - 910-300-410 + - 100x70mm + - name: includeDocs + in: query + description: |- + Legacy name **labelResponseType**. Shipping labels and further shipment documents can be: + * __include__: included as base64 encoded data in the response (default) + * __URL__: provided as URL reference. + Default is include the base64 encoded labels. + schema: + type: string + enum: + - include + - URL + default: include + - name: combine + in: query + description: If set, label and return label for one shipment will be printed as single PDF document with possibly multiple pages. Else, those two labels come as separate documents. The option does not affect customs documents and COD labels. + schema: + type: boolean + default: true + responses: + '200': + description: Success response for requests with a single shipment. + content: + application/json: + schema: + $ref: '#/components/schemas/LabelDataResponse' + '207': + description: Response for requests taking multiple input elements + content: + application/json: + schema: + $ref: '#/components/schemas/LabelDataResponse' + application/problem+json: + schema: + $ref: '#/components/schemas/LabelDataResponse' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '404': + $ref: '#/components/responses/NotFound' + '429': + $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/InternalServerError' + post: + tags: + - Shipments and Labels + summary: 'Create one or more shipments and their documents. (This is the primary call of the API.)' + description: |- + This request is used to create one or more shipments and return corresponding shipment tracking numbers, labels, and documentation. Up to 30 shipments can be created in a single call. + #### Request + The selected products and corresponding billing numbers, as well as the desired services and package details are required to create a shipment. Each shipment can have a dedicated shipper address. The example request body contains sample values for most services. + #### Response + The request will return shipment tracking numbers and the applicable labels for each shipment. If multiple shipments have been included, an HTTP 207 response (multistatus) is returned and holds detailed status for each shipment. Other standard HTTP response codes (401, 500, 400, 200, 429) are possible, too. Labels can be either provided as part of the response (base64 encoded for PDF, text for ZPL) or via URL link for view and download. Note that the format settings per query parameters apply to the shipping label. It may also apply to other labels included, depending on the configuration of your account. Label paper for return shipments can be specified separately since a different printer may be used here. If requesting labels to be provided as URL for separate download, the URLs can be shared. + #### Validation + It is recommended to validate the request first prior to shipment creation by setting the `validate` query parameter to `true`. Especially, during development and test, it is recommended to perform this validation. This functionality supports both + * JSON schema validation (against this API description). During development and test, it is recommended to do this validation. JSON schema is available for local validation + * Dry run against the DHL backend + + If this succeeds, actual shipment creation will also succeed. + operationId: createOrders + security: + - ApiKey: [] + - BasicAuth: [] + parameters: + - name: Accept-Language + in: header + description: Control the APIs response language via locale abbreviation. English (en-US) and german (de-DE) are supported. If not specified, the default is english. + schema: + type: string + example: de-DE + - name: validate + in: query + description: |- + If provided and set to `true`, the input document will be: + * validated against JSON schema (/orders/ endpoint) at the API layer. In case of errors, HTTP 400 and details will be returned. + * validated against the DHL backend. + + In that case, no state changes are happening, no data is stored, shipments neither deleted nor created, no labels being returned. The call will return a status (200, 400) for each shipment element. + schema: + type: boolean + default: false + - name: mustEncode + in: query + description: Legacy name **printOnlyIfCodable**. If set to *true*, labels will only be created if an address is encodable. This is only relevant for German consignee addresses. If set to false or left out, addresses, that are not encodable will be printed even though you receive a warning. + schema: + type: boolean + default: false + - name: includeDocs + in: query + description: |- + Legacy name **labelResponseType**. Shipping labels and further shipment documents can be: + * __include__: included as base64 encoded data in the response (default) + * __URL__: provided as URL reference. + schema: + type: string + enum: + - include + - URL + default: include + - name: docFormat + in: query + description: |- + **Defines** the **printable** document format to be used for label and manifest documents. + schema: + type: string + enum: + - ZPL2 + - PDF + default: PDF + - name: printFormat + in: query + description: |- + **Defines** the print medium for the shipping label. The different option vary from standard paper sizes DIN A4 and DIN A5 to specific label print formats. + + Specific laser print formats using DIN A5 blanks are: + * 910-300-600(-oz) (105 x 205mm) + * 910-300-300(-oz) (105 x 148mm) + + Specific laser print formats **not** using a DIN A5 blank: + * 910-300-610 (105 x 208mm) + * 100x70mm + + Specific thermal print formats: + * 910-300-600 (103 x 199mm) + * 910-300-400 (103 x 150mm) + * 100x70mm + + Please use the different formats as follows. If you do not set the parameter the settings of DHL costumer portal account will be used as default. + schema: + type: string + enum: + - A4 + - 910-300-600 + - 910-300-610 + - 910-300-700 + - 910-300-700-oz + - 910-300-710 + - 910-300-300 + - 910-300-300-oz + - 910-300-400 + - 910-300-410 + - 100x70mm + - name: retourePrintFormat + in: query + description: |- + **Defines** the print medium for the return shipping label. This parameter is only usable, if you do not use **combined printing**. The different option vary from standard paper sizes DIN A4 and DIN A5 to specific label print formats. + + Specific laser print formats using DIN A5 blanks are: + * 910-300-600(-oz) (105 x 205mm) + * 910-300-300(-oz) (105 x 148mm) + + Specific laser print formats **not** using a DIN A5 blank: + * 910-300-610 (105 x 208mm) + * 100x70mm + + Specific thermal print formats: + * 910-300-600 (103 x 199mm) + * 910-300-400 (103 x 150mm) + * 100x70mm + + Please use the different formats as follows. If you do not set the parameter the settings of DHL costumer portal account will be used as default. + schema: + type: string + enum: + - A4 + - 910-300-600 + - 910-300-610 + - 910-300-700 + - 910-300-700-oz + - 910-300-710 + - 910-300-300 + - 910-300-300-oz + - 910-300-400 + - 910-300-410 + - 100x70mm + - name: combine + in: query + description: If set, label and return label for one shipment will be printed as single PDF document with possibly multiple pages. Else, those two labels come as separate documents. The option does not affect customs documents and COD labels. + schema: + type: boolean + default: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ShipmentOrderRequest' + examples: + DHLPaket: + $ref: '#/components/examples/DHLPaket' + DHLPaketInternational: + $ref: '#/components/examples/DHLPaketInternational' + DHLPaketInternationalWithCustoms: + $ref: '#/components/examples/DHLPaketInternationalWithCustoms' + required: true + responses: + '200': + description: Success response for requests with a single shipment. + content: + application/json: + schema: + $ref: '#/components/schemas/LabelDataResponse' + application/problem+json: + schema: + $ref: '#/components/schemas/LabelDataResponse' + '207': + description: Response for requests taking multiple input elements + content: + application/json: + schema: + $ref: '#/components/schemas/LabelDataResponse' + application/problem+json: + schema: + $ref: '#/components/schemas/LabelDataResponse' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '429': + $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/InternalServerError' + delete: + tags: + - Shipments and Labels + summary: Delete one or more shipments + description: 'Delete one or more shipments created earlier. Deletion of shipments is only possible prior to them being manifested (closed out, ''Tagesabschluss''). The call will return HTTP 200 (single shipment) or 207 on success, with individual status elements for each shipment. Individual status elements are HTTP 200, 400. 400 will be returned when shipment does not exist (or was already deleted).' + operationId: ordersAccountDelete + security: + - ApiKey: [] + - BasicAuth: [] + parameters: + - name: Accept-Language + in: header + description: Control the APIs response language via locale abbreviation. English (en-US) and german (de-DE) are supported. If not specified, the default is english. + schema: + type: string + example: de-DE + - name: profile + in: query + required: true + description: 'Defines the user group profile. A user group is permitted to specific billing numbers. Shipments are only canceled if they belong to a billing number that the user group profile is entitled to use. This attribute is mandatory. Please use the standard user group profile ''STANDARD_GRUPPENPROFIL'' if no dedicated user group profile is available.' + schema: + type: string + example: 'STANDARD_GRUPPENPROFIL' + - name: shipment + required: true + in: query + description: Shipment number that shall be canceled. If multiple shipments shall be canceled, the parameter must be added multiple times. Up to 30 shipments can be canceled at once. + schema: + type: string + example: '123456789' + responses: + '200': + description: Response for requests with a single element + content: + application/json: + schema: + $ref: '#/components/schemas/LabelDataResponse' + application/problem+json: + schema: + $ref: '#/components/schemas/LabelDataResponse' + '207': + description: Response for requests taking multiple input elements + content: + application/json: + schema: + $ref: '#/components/schemas/LabelDataResponse' + application/problem+json: + schema: + $ref: '#/components/schemas/LabelDataResponse' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '429': + $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/InternalServerError' +components: + schemas: + ServiceInformation: + type: object + description: Response for the API version endpoint detailing version information. + properties: + amp: + type: object + properties: + name: + type: string + description: name of api + example: pp-parcel-shipping-native + env: + type: string + description: environment + example: sandbox + version: + type: string + description: version of api + example: v2.0.4 + rev: + type: string + description: revision + example: 22 + backend: + type: object + properties: + env: + type: string + description: environment + example: sandbox + version: + type: string + description: version of backend + example: v2.1.0 + + Document: + type: object + properties: + b64: + type: string + description: The Base64 encoded byte stream + zpl2: + type: string + description: The document in zpl encoding + url: + type: string + description: URL reference to download document + example: www.dhl.de/download/myobscurelink?label.png + fileFormat: + type: string + description: format of the encoded bytes + example: PDF + enum: + - ZPL2 + - PDF + printFormat: + type: string + description: The print format used. Customs documents cash on delivery documents can only be returned in format A4. + example: 910-300-700 + enum: + - A4 + - A4-PT + - 910-300-600 + - 910-300-610 + - 910-300-700 + - 910-300-700-oz + - 910-300-710 + - 910-300-300 + - 910-300-300-oz + - 910-300-400 + - 910-300-410 + - 100x70mm + description: 'Encoded document. All types of labels and documents.' + RequestStatus: + type: object + description: General status description for the attached response or response item. + required: + - statusCode + - title + properties: + title: + type: string + example: ok + statusCode: + description: The status code of the response. Usually, but not necessarliy the HTTP status code. + type: integer + format: int32 + example: 200 + instance: + type: string + description: A URI reference that identifies the specific occurrence of the problem. + detail: + maxLength: 80 + minLength: 0 + type: string + example: The Webservice call ran successfully. + LabelDataResponse: + type: object + properties: + status: + $ref: '#/components/schemas/RequestStatus' + items: + type: array + description: For consistency, response is a single element array. + example: + - shipmentNo: 340434310428091700 + sstatus: + title: OK + status: 200 + label: + url: https://api-dev.dhl.com/parcel/de/shipping/v1-feature-order-endpoint/labels?token=x5xzrHE7ctmqPqk33k%2BKkBwbvIfYP4elMQsBFM%2BJOdiT2bmoaXXzris%2Ftz9jBtdVFLY5cCENit0Jnd9aXuxoNEXhP9PQ8tAVdPeXD26RZ6JZqF5NCJlrihrAv1%2FAOzuDPqWJLRVaRq461BpT4bcbzChAAHVg%2FHUaQAkeIkaZ8NqfcxWEQzK1AYJWczpy6sv6 + format: PDF + items: + $ref: '#/components/schemas/ResponseItem' + ResponseItem: + required: + - sstatus + type: object + properties: + shipmentNo: + maxLength: 50 + minLength: 0 + type: string + returnShipmentNo: + maxLength: 50 + minLength: 0 + type: string + sstatus: + $ref: '#/components/schemas/RequestStatus' + shipmentRefNo: + maxLength: 50 + minLength: 6 + type: string + label: + $ref: '#/components/schemas/Document' + returnLabel: + $ref: '#/components/schemas/Document' + customsDoc: + $ref: '#/components/schemas/Document' + codLabel: + $ref: '#/components/schemas/Document' + validationMessages: + type: array + description: Optional validation messages attached to the shipment. + items: + $ref: '#/components/schemas/ValidationMessageItem' + description: Response for a single shipment containing status, numbers and labels + example: + - shipmentNo: 340434310428091700 + sstatus: + title: OK + status: 200 + label: + url: https://api-dev.dhl.com/parcel/de/shipping/v1-feature-order-endpoint/labels?token=x5xzrHE7ctmqPqk33k%2BKkBwbvIfYP4elMQsBFM%2BJOdiT2bmoaXXzris%2Ftz9jBtdVFLY5cCENit0Jnd9aXuxoNEXhP9PQ8tAVdPeXD26RZ6JZqF5NCJlrihrAv1%2FAOzuDPqWJLRVaRq461BpT4bcbzChAAHVg%2FHUaQAkeIkaZ8NqfcxWEQzK1AYJWczpy6sv6 + format: PDF + ValidationMessageItem: + type: object + properties: + property: + type: string + description: The property that is affected by the validation message. + example: dimension.weight + validationMessage: + type: string + description: The validation message describing the error. + example: The weight is too high + validationState: + type: string + description: The validation state resulting from the error. + example: Error + description: Representation of a validation message of a shipment container containing the most important information. + GetManifestData: + type: object + properties: + b64: + type: array + description: The encoded byte stream + items: + type: string + description: The encoded byte stream + format: byte + zpl2: + type: string + description: The document in zpl encoding + url: + type: string + description: URL reference to download document + example: www.dhl.de/download/myobscurelink?label.png + fileFormat: + type: string + description: format of the encoded bytes + example: PDF + enum: + - ZPL2 + - PDF + printFormat: + type: string + description: The print format used + example: 910-300-700 + enum: + - A4 + - 910-300-600 + - 910-300-610 + - 910-300-700 + - 910-300-700-oz + - 910-300-710 + - 910-300-300 + - 910-300-300-oz + - 910-300-400 + - 910-300-410 + - 100x70mm + SingleManifestResponse: + type: object + properties: + status: + $ref: '#/components/schemas/RequestStatus' + manifestDate: + type: string + manifest: + $ref: '#/components/schemas/GetManifestData' + MultipleManifestResponse: + type: object + properties: + status: + $ref: '#/components/schemas/RequestStatus' + items: + type: array + items: + $ref: '#/components/schemas/ShortResponseItem' + description: Response of the POST /manifests endpoint containing an overall request status and detailed shipment status. + ShortResponseItem: + required: + - sstatus + type: object + properties: + shipmentNo: + maxLength: 50 + minLength: 0 + type: string + example: '340434310428091700' + sstatus: + $ref: '#/components/schemas/RequestStatus' + description: Response for a single shipment element not containing labels. + ShipmentManifestingRequest: + required: + - profile + type: object + properties: + profile: + maxLength: 35 + minLength: 0 + type: string + shipmentNumbers: + maxItems: 30 + minItems: 1 + type: array + description: List of shipment IDs for manifesting. + items: + type: string + billingNumber: + type: string + description: Customer billingNumber number. + description: List of shipments which shall be manifested. + BankAccount: + required: + - accountHolder + - iban + type: object + properties: + accountHolder: + maxLength: 80 + minLength: 0 + type: string + example: John D. Rockefeller + bankName: + maxLength: 80 + minLength: 0 + type: string + example: The Iron Bank, Braavos + iban: + pattern: '[A-Z]{2,2}[0-9]{2,2}[a-zA-Z0-9]{1,30}' + type: string + example: DE02100100100006820101 + bic: + pattern: '[a-zA-Z0-9]{8,11}' + type: string + example: DEUTDEFFXXX + description: Bank account data used for CoD (Cash on Delivery). + Commodity: + required: + - itemDescription + - itemValue + - itemWeight + - packagedQuantity + type: object + properties: + itemDescription: + maxLength: 256 + minLength: 1 + type: string + example: T-Shirt Boys size 164 yellow + description: A text that describes the commodity item. Only the first 50 characters of the description text is printed on the customs declaration form CN23. + countryOfOrigin: + $ref: '#/components/schemas/Country' + description: A valid country code consisting of three characters according to ISO 3166-1 alpha-3. + hsCode: + maxLength: 11 + minLength: 6 + type: string + description: Harmonized System Code aka Customs tariff number. + example: '61099090' + packagedQuantity: + type: integer + description: How many items of that type are in the package + format: int32 + example: 1 + itemValue: + $ref: '#/components/schemas/Value' + itemWeight: + $ref: '#/components/schemas/Weight' + description: |- + Commodity line item (e.g. a t-shirt) for international shipments which require individual listing of goods. Each good must contain a description of the item, the amount of the item, the net weight of one single item and the value of one single item. If you ship 5 t-shirts, you need to include the weight and value of one single shirt. The correct final weight and value will be calculated automatically. + The HS Code and the country of origin are optional. + example: + - itemDescription: T-Shirt + hscode: '61099090' + countryOfOrigin: DE + packagedQuantity: 3 + - itemDescription: Book + hscode: '49019900' + packagedQuantity: 1 + Consignee: + type: object + description: Consignee address information. Either a doorstep address (contact address) including contact information or a droppoint address. One of packstation (parcel locker), or post office (postfiliale/retail shop). + oneOf: + - $ref: '#/components/schemas/ContactAddress' + - $ref: '#/components/schemas/Locker' + - $ref: '#/components/schemas/PostOffice' + - $ref: '#/components/schemas/POBox' + ContactAddress: + required: + - addressStreet + - city + - country + - name1 + type: object + properties: + name1: + maxLength: 50 + minLength: 1 + type: string + description: Name1. Line 1 of name information + example: Blumen Krause + name2: + maxLength: 50 + minLength: 1 + type: string + description: An optional, additional line of name information + example: To the attention of Erna. + name3: + maxLength: 50 + minLength: 1 + type: string + description: An optional, additional line of name information + example: Backdrawer all the way back. + dispatchingInformation: + maxLength: 35 + minLength: 1 + type: string + description: An optional, additional line of address. It's only usable for a few countries, e.g. Belgium. It is positioned below name3 on the label. + example: PO Box, bpack 24/7 + addressStreet: + maxLength: 50 + minLength: 1 + type: string + description: Line 1 of the street address. This is just the street name. Can also include house number. + example: Hauptstrasse + addressHouse: + maxLength: 10 + minLength: 1 + type: string + description: Line 1 of the street address. This is just the house number. Can be added to street name instead. + example: 1a + additionalAddressInformation1: + maxLength: 60 + minLength: 1 + type: string + description: Additional information that is positioned either behind or below addressStreet on the label. If it is printed and where exactly depends on the country. + example: 3. Etage + additionalAddressInformation2: + maxLength: 60 + minLength: 1 + type: string + description: Additional information that is positioned either behind or below addressStreet on the label. If it is printed and where exactly depends on the country. + example: Apartment 12 + postalCode: + maxLength: 10 + minLength: 3 + pattern: ^[0-9A-Za-z]+([ -]?[0-9A-Za-z]+)*$ + type: string + description: Mandatory for all countries but Ireland that use a postal code system. + example: '53113' + city: + maxLength: 40 + minLength: 1 + type: string + description: city + example: Berlin + state: + maxLength: 20 + minLength: 1 + type: string + description: State, province or territory. For the USA please use the official regional ISO-Codes, e.g. US-AL. + example: NRW + country: + $ref: '#/components/schemas/Country' + description: A valid country code consisting of three characters according to ISO 3166-1 alpha-3. + contactName: + maxLength: 80 + minLength: 3 + type: string + description: optional contact name. (this is not the primary name printed on label) + example: Konrad Kontaktmann + phone: + maxLength: 20 + minLength: 1 + type: string + description: Please note that, in accordance with Art. 4 No. 11 GDPR, you must obtain the recipient's consent to forward their phone number to Deutsche Post DHL Group. For shipments within Germany, the phone number cannot be transmitted. In some countries the provision of a telephone number and/or e-mail address is mandatory for a delivery to a droppoint. If your recipient has objected to the disclosure of their telephone number and/or e-mail address, the shipment can only be delivered in these countries using the service Premium. + example: +49 170 1234567 + email: + maxLength: 80 + minLength: 3 + type: string + description: "Please note that, in accordance with Art. 4 No. 11 GDPR, you must obtain the recipient's consent to forward their e-mail address to Deutsche Post DHL Group.\_For shipments within Germany, the e-mail address is used to send a DHL Parcel Notification to the recipient. The e-mail address is not mandatory for shipments within Germany. In some countries the provision of a telephone number and/or e-mail address is mandatory for a delivery to a droppoint. If your recipient has objected to the disclosure of their telephone number and/or e-mail address, the shipment can only be delivered in these countries using the service Premium." + example: mustermann@example.com + description: Combines name, address, contact information. The recommended way is to use the mandatory attribute addressStreet and submit the streetname and housenumber together – alternatively addressHouse + addressStreet can be used. For many international addresses there is no house number, please do not set a period or any other sign to indicate that the address does not have a housenumber. + CustomsDetails: + required: + - exportType + - postalCharges + - items + type: object + properties: + invoiceNo: + maxLength: 35 + minLength: 0 + type: string + description: Invoice number + exportType: + type: string + description: This contains the category of goods contained in parcel. + enum: + - OTHER + - PRESENT + - COMMERCIAL_SAMPLE + - DOCUMENT + - RETURN_OF_GOODS + - COMMERCIAL_GOODS + exportDescription: + maxLength: 80 + minLength: 0 + type: string + description: Mandatory if exporttype is 'OTHER' + example: Detailed description for OTHER goods. + shippingConditions: + type: string + description: Aka 'Terms of Trade' aka 'Frankatur'. The attribute is exclusively used for the product Europaket (V54EPAK). DDU is deprecated (use DAP instead). + enum: + - DDU + - DAP + - DDP + - DDX + - DXV + permitNo: + maxLength: 30 + minLength: 0 + type: string + description: Permit number. Very rarely needed. Mostly relevant for higher value goods. An example use case would be an item made from crocodile leather which requires dedicated license / permit identified by that number. + attestationNo: + maxLength: 30 + minLength: 0 + type: string + description: Attest or certification identified by this number. Very rarely needed. An example use case would be a medical shipment referring to an attestation that a certain amount of medicine may be imported within e.g. the current quarter of the year. + hasElectronicExportNotification: + type: boolean + description: flag confirming whether electronic record for export was made + MRN: + type: string + maxLength: 18 + example: "abcd1234567890" + postalCharges: + $ref: '#/components/schemas/Value' + officeOfOrigin: + maxLength: 35 + minLength: 0 + type: string + description: Optional. Will appear on CN23. + shipperCustomsRef: + description: "Optional. The customs reference is used by customs authorities to identify economics operators an/or other persons involved. With the given reference, granted authorizations and/or relevant processes in customs clearance an/or taxation can be taken into account. Aka Zoll-Nummer or EORI-Number but dependent on destination." + type: string + maxLength: 35 + example: "DE73282932000074" + consigneeCustomsRef: + description: "Optional. The customs reference is used by customs authorities to identify economics operators an/or other persons involved. With the given reference, granted authorizations and/or relevant processes in customs clearance an/or taxation can be taken into account. Aka Zoll-Nummer or EORI-Number but dependent on destination." + type: string + maxLength: 35 + example: "GB73282932000074" + items: + maxItems: 99 + minItems: 1 + type: array + description: Commodity types in that package + example: + - itemDescription: T-Shirt + hscode: '61099090' + countryOfOrigin: DE + packagedQuantity: 3 + - itemDescription: Book + hscode: '49019900' + packagedQuantity: 1 + items: + $ref: '#/components/schemas/Commodity' + description: For international shipments, this section contains information necessary for customs about the exported goods. ExportDocument can contain one or more positions as child element. This data is also transferred as electronic declaration to customs. The custom details are mandatory depending on whether the parcel will go to a country outside the European Customs Union. For DHL Parcel International (V53WPAK) CN23 will returned as a separate document, while for Warenpost International the customs information will be printed onto the shipment label (CN22). + Dimensions: + required: + - height + - length + - uom + - width + type: object + properties: + uom: + type: string + description: Unit of metric, applies to all dimensions contained. + example: cm + enum: + - cm + - mm + height: + type: integer + format: int32 + example: 10 + length: + type: integer + format: int32 + example: 20 + width: + type: integer + format: int32 + example: 15 + description: Physical dimensions (aka 'Gurtmass') of the parcel. If you provide the dimension information, all attributes need to be provided. You cannot provide just the height, for example. If you provide length, width, and height in millimeters, they will be rounded to full cm. + Locker: + required: + - city + - lockerID + - name + - postNumber + - postalCode + type: object + properties: + name: + maxLength: 50 + minLength: 1 + type: string + description: Name + example: Paula Packstation + lockerID: + maximum: 999 + minimum: 100 + type: integer + description: Packstationnummer. Three digit number identifying the parcel locker in conjunction with city and postal code + format: int32 + example: 118 + postNumber: + pattern: ^[0-9]{6,10}$ + type: string + description: postNumber (Postnummer) is the official account number a private DHL Customer gets upon registration. + city: + maxLength: 40 + minLength: 0 + type: string + description: City where the locker is located + example: Berlin + country: + $ref: '#/components/schemas/Country' + description: A valid country code consisting of three characters according to ISO 3166-1 alpha-3. + postalCode: + maxLength: 10 + minLength: 3 + pattern: ^[0-9A-Za-z]+([ -]?[0-9A-Za-z]+)*$ + type: string + description: Only usable for German Packstation, international lockers cannot be addressed directly. If your customer wishes for international delivery to a droppoint, please use DHL Parcel International (V53WPAK) with the delivery type "Closest Droppoint". + PostOffice: + required: + - city + - name + - postalCode + - retailID + type: object + properties: + name: + maxLength: 50 + minLength: 1 + type: string + description: Name + example: Fritz Filialabholer + retailID: + maximum: 999 + minimum: 401 + type: integer + description: Id or Number of Post office / Filiale / outlet / parcel shop + format: int32 + example: 518 + postNumber: + maxLength: 10 + minLength: 3 + pattern: ^[0-9]{6,10}$ + type: string + description: postNumber (Postnummer) is the official account number a private DHL Customer gets upon registration. To address a post office or retail outlet directly, either the post number or e-mail address of the consignee is needed. + email: + maxLength: 80 + minLength: 3 + type: string + description: Email address of the consignee. To address a post office or retail outlet directly, either the post number or e-mail address of the consignee is needed. + example: mustermann@example.com + city: + maxLength: 80 + minLength: 0 + type: string + description: City where the retail location is + example: Berlin + country: + $ref: '#/components/schemas/Country' + description: A valid country code consisting of three characters according to ISO 3166-1 alpha-3. + postalCode: + maxLength: 10 + minLength: 3 + pattern: ^[0-9A-Za-z]+([ -]?[0-9A-Za-z]+)*$ + type: string + description: Only usable for German post offices or retail outlets (Paketshops), international postOffices or retail outlets cannot be addressed directly. If your customer wishes for international delivery to a droppoint, please use DHL Parcel International (V53WPAK) with the delivery type "Closest Droppoint". + POBox: + required: + - name1 + - poBoxID + - city + - postalCode + type: object + properties: + name1: + maxLength: 50 + minLength: 1 + type: string + description: Name1. Line 1 of name information + example: Joe Black + name2: + maxLength: 50 + minLength: 1 + type: string + description: An optional, additional line of name information + example: To the attention of Mr. Black. + name3: + maxLength: 50 + minLength: 1 + type: string + description: An optional, additional line of name information + example: Backdrawer all the way back. + poBoxID: + type: integer + format: int32 + description: Number of P.O. Box (Postfach) + email: + maxLength: 80 + minLength: 3 + type: string + description: Email address of the consignee + city: + maxLength: 80 + minLength: 0 + type: string + description: City of the P.O. Box (Postfach) location + example: Berlin + country: + $ref: '#/components/schemas/Country' + description: Country of the P.O. Box (Postfach) location. A valid country code consisting of three characters according to ISO 3166-1 alpha-3. + postalCode: + maxLength: 10 + minLength: 3 + pattern: ^[0-9A-Za-z]+([ -]?[0-9A-Za-z]+)*$ + type: string + description: Postal code of the P.O. Box (Postfach) location + description: Alternative destination - P.O. Box (Postfach) + Shipment: + type: object + properties: + product: + type: string + description: |- + Determines the DHL Paket product to be used. + + * V01PAK: DHL PAKET; + * V53WPAK: DHL PAKET International; + * V54EPAK: DHL Europaket; + * V62WP: Warenpost; + * V66WPI: Warenpost International + example: V01PAK + billingNumber: + pattern: \w{10}\d{2}\w{2} + type: string + description: 14 digit long number that identifies the contract the shipment is booked on. Please note that in rare cases the last to characters can be letters. Digit 11 and digit 12 must correspondent to the number of the product, e.g. 333333333301tt can only be used for the product V01PAK (DHL Paket). + example: 33333333330101 or 333333333362aa + refNo: + maxLength: 35 + minLength: 8 + type: string + description: A reference number that the user can assign for better association purposes. It appears on shipment labels. To use the reference number for tracking purposes, it should be at least 8 characters long and unique. + costCenter: + type: string + description: Textfield that appears on the shipment label. It cannot be used to search for the shipment. + creationSoftware: + type: string + description: Is only to be indicated by DHL partners. + shipDate: + type: string + description: 'Date the shipment is transferred to DHL. The shipment date can be the current date or a date up to a few days in the future. It must not be in the past. Iso format required: yyyy-mm-dd. On the shipment date the shipment will be automatically closed at your end of day closing time.' + format: date + shipper: + description: Shipper information, including contact information and address. Alternatively, a predefined shipper reference can be used. + oneOf: + - $ref: '#/components/schemas/Shipper' + - $ref: '#/components/schemas/ShipperReference' + consignee: + $ref: '#/components/schemas/Consignee' + details: + $ref: '#/components/schemas/ShipmentDetails' + services: + $ref: '#/components/schemas/VAS' + customs: + $ref: '#/components/schemas/CustomsDetails' + description: Container for all shipments. Mixed shipment products per request are supported. Each shipment has a dedicated shipper address (or shipper reference, or both). + ShipmentDetails: + required: + - weight + type: object + properties: + dim: + $ref: '#/components/schemas/Dimensions' + weight: + $ref: '#/components/schemas/Weight' + description: Details for the shipment, such as dimensions, content + ShipmentOrderRequest: + required: + - profile + - shipments + type: object + properties: + profile: + maxLength: 35 + minLength: 0 + type: string + shipments: + maxItems: 30 + minItems: 1 + type: array + description: Shipment array having details for each shipment. + items: + $ref: '#/components/schemas/Shipment' + description: Complex request structure used to create, update, and validate shipment data. Note that most elements are part of the array of shipment items. + Shipper: + type: object + description: Shipper information, including contact information and address. + required: + - addressStreet + - city + - country + - name1 + properties: + name1: + maxLength: 50 + minLength: 1 + type: string + description: Name1. Line 1 of name information + example: Blumen Krause + name2: + maxLength: 50 + minLength: 1 + type: string + description: An optional, additional line of name information + example: To the attention of Erna. + name3: + maxLength: 50 + minLength: 1 + type: string + description: An optional, additional line of name information + example: Backdrawer all the way back. + addressStreet: + maxLength: 50 + minLength: 1 + type: string + description: Line 1 of the street address. This is just the street name. Can also include house number. + example: Hauptstrasse + addressHouse: + maxLength: 10 + minLength: 1 + type: string + description: Line 1 of the street address. This is just the house number. Can be added to street name instead. + example: 1a + postalCode: + maxLength: 10 + minLength: 3 + pattern: ^[0-9A-Za-z]+([ -]?[0-9A-Za-z]+)*$ + type: string + description: Mandatory for all countries but Ireland that use a postal code system. + example: '53113' + city: + maxLength: 40 + minLength: 1 + type: string + description: city + example: Berlin + country: + $ref: '#/components/schemas/Country' + description: Shipper address country + contactName: + maxLength: 80 + minLength: 3 + type: string + description: optional contact name. (this is not the primary name printed on label) + example: Konrad Kontaktmann + email: + maxLength: 80 + minLength: 3 + type: string + description: Optional contact email address of the shipper + example: mustermann@example.com + ShipperReference: + type: object + description: Contains a reference to the Shipper data configured in GKP(Geschäftskundenportal - Business Costumer Portal). Can be used instead of a detailed shipper address. The shipper reference can be used to print a company logo which is configured in GKP onto the label. + required: + - shipperRef + properties: + shipperRef: + maxLength: 50 + minLength: 0 + type: string + description: Reference string to the shipper data configured in GKP(Geschäftskundenportal - Business Costumer Portal). + VAS: + type: object + properties: + preferredNeighbour: + maxLength: 100 + minLength: 0 + type: string + description: Preferred neighbour. Can be specified as text. + example: Please ring at Meier next door + preferredLocation: + maxLength: 100 + minLength: 0 + type: string + description: Preferred location. Can be specified as text. + example: Please leave in carport + visualCheckOfAge: + pattern: A16|A18 + type: string + description: if used it will trigger checking the age of recipient + example: A18 + enum: + - A16 + - A18 + namedPersonOnly: + type: boolean + description: Delivery can only be signed for by yourself personally. + example: true + identCheck: + $ref: '#/components/schemas/VASIdentCheck' + signedForByRecipient: + type: boolean + description: Delivery must be signed for by the recipient and not by DHL staff + example: true + endorsement: + type: string + description: Instructions and endorsement how to treat international undeliverable shipment. By default, shipments are returned if undeliverable. There are country specific rules whether the shipment is returned immediately or after a grace period. + example: RETURN + enum: + - RETURN + - ABANDON + preferredDay: + type: string + description: Preferred day of delivery in format YYYY-MM-DD. Shipper can request a preferred day of delivery. The preferred day should be between 2 and 6 working days after handover to DHL. + format: date + noNeighbourDelivery: + type: boolean + description: Delivery can only be signed for by yourself personally or by members of your household. + example: true + additionalInsurance: + $ref: '#/components/schemas/Value' + bulkyGoods: + type: boolean + description: Leaving this out is same as setting to false. Sperrgut. + example: true + cashOnDelivery: + $ref: '#/components/schemas/VASCashOnDelivery' + individualSenderRequirement: + pattern: '[a-zA-Z0-9]{2}' + type: string + description: Special instructions for delivery. 2 character code, possible values agreed in contract. + example: ZZ + premium: + type: boolean + description: 'Choice of premium vs economy parcel. Availability is country dependent and may be manipulated by DHL if choice is not available. Please review the label.' + example: true + closestDropPoint: + type: boolean + description: 'Closest Droppoint Delivery to the droppoint closest to the address of the recipient of the shipment. For this kind of delivery either the phone number and/or the e-mail address of the receiver is mandatory. For shipments using DHL Paket International it is recommended that you choose one of the three delivery types: Economy, Premium, CDP. Otherwise, the current default for the receiver country will be picked.' + example: true + parcelOutletRouting: + type: string + description: 'Undeliverable domestic shipment can be forwarded and held at retail. Notification to email (fallback: consignee email) will be used.' + example: max.mustermann@example.com + dhlRetoure: + $ref: '#/components/schemas/VASDhlRetoure' + postalDeliveryDutyPaid: + type: boolean + description: 'All import duties are paid by the shipper.' + example: true + description: Value added services. Please note that services are specific to products and geographies and/or may require individual setup and billing numbers. Please test and contact your account representative in case of questions. + VASCashOnDelivery: + type: object + properties: + amount: + $ref: '#/components/schemas/Value' + bankAccount: + $ref: '#/components/schemas/BankAccount' + accountReference: + maxLength: 35 + minLength: 0 + type: string + description: Reference to bank account details. Account references are maintained in customer settings in Post & DHL business customer portal under Ship -> Settings -> Cash on delivery. Please note, that the default account reference is used if the provided account reference does not exist in your customer settings! + transferNote1: + maxLength: 35 + minLength: 0 + type: string + transferNote2: + maxLength: 35 + minLength: 0 + type: string + description: Cash on delivery (Nachnahme). Currency must be Euro. Either bank account information or account reference (from customer profile) must be provided. Transfernote1 + 2 are references transmitted during bank transfer. Providing account information explicitly requires elevated privileges. + VASDhlRetoure: + required: + - billingNumber + type: object + properties: + billingNumber: + pattern: \w{10}\d{2}\w{2} + type: string + refNo: + maxLength: 50 + minLength: 6 + type: string + returnAddress: + $ref: '#/components/schemas/ContactAddress' + description: Requests return label (aka 'retoure') to be provided. Also requires returnAddress and return billing number. Neither weight nor dimension need to be specified for the retoure (flat rate service). + VASIdentCheck: + required: + - firstName + - lastName + type: object + properties: + firstName: + maxLength: 35 + minLength: 1 + type: string + example: Max + lastName: + maxLength: 35 + minLength: 1 + type: string + example: Mustermann + dateOfBirth: + type: string + description: date of birth, used in conjunction with minimumAge and shipping date. Format yyyy-mm-dd is used. + format: date + minimumAge: + pattern: A16|A18 + type: string + description: Checks if recipient will have reached specified age by shipping date. + example: A18 + enum: + - A16 + - A18 + description: Check the identity of the recipient via name (firstname, lastname), date of birth or age. This uses firstName and lastName as separate attributes since for identity check an automatic split of a one-line name is not considered reliable enough. + Country: + type: string + description: A valid country code consisting of three characters according to ISO 3166-1 alpha-3. + enum: + - ABW + - AFG + - AGO + - AIA + - ALA + - ALB + - AND + - ARE + - ARG + - ARM + - ASM + - ATG + - AUS + - AUT + - AZE + - BDI + - BEL + - BEN + - BES + - BFA + - BGD + - BGR + - BHR + - BHS + - BIH + - BLM + - BLR + - BLZ + - BMU + - BOL + - BRA + - BRB + - BRN + - BTN + - BVT + - BWA + - CAF + - CAN + - CCK + - CHE + - CHL + - CHN + - CIV + - CMR + - COD + - COG + - COK + - COL + - COM + - CPV + - CRI + - CUB + - CUW + - CXR + - CYM + - CYP + - CZE + - DEU + - DJI + - DMA + - DNK + - DOM + - DZA + - ECU + - EGY + - ERI + - ESP + - EST + - ETH + - FIN + - FJI + - FLK + - FRA + - FRO + - FSM + - GAB + - GBR + - GEO + - GGY + - GHA + - GIB + - GIN + - GLP + - GMB + - GNB + - GNQ + - GRC + - GRD + - GRL + - GTM + - GUF + - GUM + - GUY + - HKG + - HMD + - HND + - HRV + - HTI + - HUN + - IDN + - IMN + - IND + - IRL + - IRN + - IRQ + - ISL + - ISR + - ITA + - JAM + - JEY + - JOR + - JPN + - KAZ + - KEN + - KGZ + - KHM + - KIR + - KNA + - KOR + - KWT + - LAO + - LBN + - LBR + - LBY + - LCA + - LIE + - LKA + - LSO + - LTU + - LUX + - LVA + - MAC + - MAF + - MAR + - MCO + - MDA + - MDG + - MDV + - MEX + - MHL + - MKD + - MLI + - MLT + - MMR + - MNE + - MNG + - MNP + - MOZ + - MRT + - MSR + - MTQ + - MUS + - MWI + - MYS + - MYT + - NAM + - NCL + - NER + - NFK + - NGA + - NIC + - NIU + - NLD + - NOR + - NPL + - NRU + - NZL + - OMN + - PAK + - PAN + - PCN + - PER + - PHL + - PLW + - PNG + - POL + - PRI + - PRK + - PRT + - PRY + - PSE + - PYF + - QAT + - REU + - ROU + - RUS + - RWA + - SAU + - SDN + - SEN + - SGP + - SHN + - SJM + - SLB + - SLE + - SLV + - SMR + - SOM + - SPM + - SRB + - SSD + - STP + - SUR + - SVK + - SVN + - SWE + - SWZ + - SXM + - SYC + - SYR + - TCA + - TCD + - TGO + - THA + - TJK + - TKL + - TKM + - TLS + - TON + - TTO + - TUN + - TUR + - TUV + - TWN + - TZA + - UGA + - UKR + - URY + - USA + - UZB + - VAT + - VCT + - VEN + - VGB + - VIR + - VNM + - VUT + - WLF + - WSM + - YEM + - ZAF + - ZMB + - ZWE + - UNKNOWN + + Value: + required: + - currency + - value + type: object + description: Currency and numeric value. + properties: + currency: + type: string + description: iso 4217 3 character currency code accepted. Recommended to use EUR where possible + enum: + - AED + - AFN + - ALL + - AMD + - ANG + - AOA + - ARS + - AUD + - AWG + - AZN + - BAM + - BBD + - BDT + - BGN + - BHD + - BIF + - BMD + - BND + - BOB + - BOV + - BRL + - BSD + - BTN + - BWP + - BYR + - BZD + - CAD + - CDF + - CHE + - CHF + - CHW + - CLF + - CLP + - CNY + - COP + - COU + - CRC + - CUC + - CUP + - CVE + - CZK + - DJF + - DKK + - DOP + - DZD + - EGP + - ERN + - ETB + - EUR + - FJD + - FKP + - GBP + - GEL + - GHS + - GIP + - GMD + - GNF + - GTQ + - GYD + - HKD + - HNL + - HRK + - HTG + - HUF + - IDR + - ILS + - INR + - IQD + - IRR + - ISK + - JMD + - JOD + - JPY + - KES + - KGS + - KHR + - KMF + - KPW + - KRW + - KWD + - KYD + - KZT + - LAK + - LBP + - LKR + - LRD + - LSL + - LTL + - LVL + - LYD + - MAD + - MDL + - MGA + - MKD + - MMK + - MNT + - MOP + - MRO + - MUR + - MVR + - MWK + - MXN + - MXV + - MYR + - MZN + - NAD + - NGN + - NIO + - NOK + - NPR + - NZD + - OMR + - PAB + - PEN + - PGK + - PHP + - PKR + - PLN + - PYG + - QAR + - RON + - RSD + - RUB + - RWF + - SAR + - SBD + - SCR + - SDG + - SEK + - SGD + - SHP + - SLL + - SOS + - SRD + - SSP + - STD + - SYP + - SZL + - THB + - TJS + - TMT + - TND + - TOP + - TRY + - TTD + - TWD + - TZS + - UAH + - UGX + - USD + - USN + - USS + - UYI + - UYU + - UZS + - VEF + - VND + - VUV + - WST + - XAF + - XAG + - XAU + - XBA + - XBB + - XBC + - XBD + - XCD + - XDR + - XFU + - XOF + - XPD + - XPF + - XPT + - XXX + - YER + - ZAR + - ZMW + - UNKNOWN + value: + type: number + description: Numeric value + maximum: 100000 + exclusiveMaximum: false + minimum: 0 + exclusiveMinimum: false + Weight: + required: + - uom + - value + type: object + properties: + uom: + type: string + description: metric unit for weight + example: g + enum: + - g + - kg + value: + maximum: 31500 + exclusiveMaximum: false + minimum: 0 + exclusiveMinimum: false + type: number + example: 500 + description: Weight of item or shipment. Both uom and value are required. + examples: + DHLPaket: + value: + profile: STANDARD_GRUPPENPROFIL + shipments: + - product: V01PAK + billingNumber: "33333333330102" + refNo: Order No. 1234 + shipper: + name1: My Online Shop GmbH + addressStreet: Sträßchensweg 10 + additionalAddressInformation1: 2. Etage + postalCode: "53113" + city: Bonn + country: DEU + email: max@mustermann.de + phone: +49 123456789 + consignee: + name1: Maria Musterfrau + addressStreet: Kurt-Schumacher-Str. 20 + additionalAddressInformation1: Apartment 107 + postalCode: "53113" + city: Bonn + country: DEU + email: maria@musterfrau.de + phone: +49 987654321 + details: + dim: + uom: mm + height: 100 + length: 200 + width: 150 + weight: + uom: g + value: 500 + DHLPaketInternational: + value: + profile: STANDARD_GRUPPENPROFIL + shipments: + - product: V53WPAK + billingNumber: "33333333335301" + refNo: Order No. 1234 + shipper: + name1: My Online Shop GmbH + addressStreet: Sträßchensweg 10 + additionalAddressInformation1: 2. Etage + postalCode: "53113" + city: Bonn + country: DEU + email: max@mustermann.de + phone: +49 123456789 + consignee: + name1: Jan Vermeer + addressStreet: Museumstraat + addressHouse: "1" + postalCode: "1071 AA" + city: Amsterdam + country: NLD + email: jan@vermeer.com + phone: +31 888888888 + details: + dim: + uom: mm + height: 100 + length: 200 + width: 150 + weight: + uom: g + value: 500 + DHLPaketInternationalWithCustoms: + value: + profile: STANDARD_GRUPPENPROFIL + shipments: + - product: V53WPAK + billingNumber: "33333333335301" + refNo: Order No. 1234 + shipper: + name1: My Online Shop GmbH + addressStreet: Sträßchensweg 10 + additionalAddressInformation1: 2. Etage + postalCode: "53113" + city: Bonn + country: DEU + email: max@mustermann.de + phone: +49 123456789 + consignee: + name1: Joe Black + addressStreet: 10 Downing Street + postalCode: "SW1A 1AA" + city: London + country: GBR + email: joe@black.uk + phone: +44 123456789 + details: + dim: + uom: mm + height: 100 + length: 200 + width: 150 + weight: + uom: g + value: 500 + customs: + exportType: COMMERCIAL_GOODS + postalCharges: + currency: EUR + value: 1 + items: + - itemDescription: Red T-Shirt + packagedQuantity: 1 + hsCode: "123456" + countryOfOrigin: FRA + itemValue: + currency: EUR + value: 10 + itemWeight: + uom: g + value: 400 + services: + endorsement: RETURN + securitySchemes: + BasicAuth: + type: http + scheme: basic + description: Credentials provided here are username and password of the partner system. + ApiKey: + type: apiKey + description: API key to authorize requests. API key can be obtained at [DHL's development + portal](https://developer.dhl.com). + name: dhl-api-key + in: header + responses: + BadRequest: + description: Bad Request + content: + application/problem+json: + schema: + $ref: '#/components/schemas/LabelDataResponse' + Unauthorized: + description: Unauthorized + content: + application/problem+json: + schema: + $ref: '#/components/schemas/RequestStatus' + NotFound: + description: Not Found + content: + application/problem+json: + schema: + $ref: '#/components/schemas/RequestStatus' + Forbidden: + description: Forbidden + content: + application/problem+json: + schema: + $ref: '#/components/schemas/RequestStatus' + TooManyRequests: + description: Too Many Requests + content: + application/problem+json: + schema: + $ref: '#/components/schemas/RequestStatus' + InternalServerError: + description: Internal Server Error + content: + application/problem+json: + schema: + $ref: '#/components/schemas/RequestStatus' diff --git a/ShippingProAPICollection/Provider/DHL/ThreeLetterCountryCodeHelper.cs b/ShippingProAPICollection/Provider/DHL/ThreeLetterCountryCodeHelper.cs new file mode 100644 index 0000000..6e55a0a --- /dev/null +++ b/ShippingProAPICollection/Provider/DHL/ThreeLetterCountryCodeHelper.cs @@ -0,0 +1,40 @@ +using System.Globalization; +using ShippingProAPICollection.Provider.DHL.Entities; + +namespace ShippingProAPICollection.Provider.DHL +{ + internal static class ThreeLetterCountryCodeHelper + { + static Dictionary _countryCodeMatches = new Dictionary(); + + internal static string GetThreeLetterCountryCode(string isaoA2code) + { + if (_countryCodeMatches.Count == 0) buildCountryMatches(); + if (!_countryCodeMatches.ContainsKey(isaoA2code)) throw new ThreeLetterCountryCodeResolvingException($"Cannot resolve three letter country code from two letter country code {isaoA2code}"); + + return _countryCodeMatches[isaoA2code]; + } + + internal static void buildCountryMatches() + { + foreach (CultureInfo cultureInfo in CultureInfo.GetCultures(CultureTypes.SpecificCultures)) + { + RegionInfo regionInfo; + try + { + regionInfo = new RegionInfo(cultureInfo.Name); + } + catch (ArgumentException) + { + continue; + } + + if (!_countryCodeMatches.ContainsKey(regionInfo.TwoLetterISORegionName)) + { + _countryCodeMatches.Add(regionInfo.TwoLetterISORegionName, regionInfo.ThreeLetterISORegionName); + } + + } + } + } +} diff --git a/ShippingProAPICollection/Provider/DPD/DPDSettings.cs b/ShippingProAPICollection/Provider/DPD/DPDSettings.cs new file mode 100644 index 0000000..73fee59 --- /dev/null +++ b/ShippingProAPICollection/Provider/DPD/DPDSettings.cs @@ -0,0 +1,17 @@ +namespace ShippingProAPICollection.Provider.DPD +{ + public class DPDSettings : ProviderSettings + { + /// + /// Api domain is the XXXXXXX part of your DPD api url => https://public-XXXXXXX.dpd.com/services/ + /// + public required string ApiDomain { get; set; } + public required string Username { get; set; } + public required string Password { get; set; } + public required string DepotNumber { get; set; } + /// + /// en_EN , de_DE + /// + public required string APILanguage { get; set; } + } +} diff --git a/ShippingProAPICollection/Provider/DPD/DPDShipmentRequestModel.cs b/ShippingProAPICollection/Provider/DPD/DPDShipmentRequestModel.cs new file mode 100644 index 0000000..229a73a --- /dev/null +++ b/ShippingProAPICollection/Provider/DPD/DPDShipmentRequestModel.cs @@ -0,0 +1,78 @@ +using System.ComponentModel.DataAnnotations; +using ShippingProAPICollection.Models.Utils; +using ShippingProAPICollection.Models.Entities; +using ShippingProAPICollection.Models.Error; +using ShippingProAPICollection.Provider.DPD.Entities; + +namespace ShippingProAPICollection.Provider.DPD +{ + public class DPDShipmentRequestModel : RequestShipmentBase + { + public DPDShipmentRequestModel(string contractID) : base(contractID) + { + + } + + public DPDShipmentRequestModel() : base(ShippingProviderType.DPD.ToString()) + { + + } + + public override string ProviderType { get; } = ShippingProviderType.DPD.ToString(); + public override float MaxPackageWeight { get; } = 31.5f; + + /// + /// Mit Email Notification an den Kunden -> Email muss dafür angegeben werden | + /// Should the shipping provider notify the customer on status changes? If TRUE the Email address musst be set + /// + /// false + public bool WithEmailNotification { get; set; } + + /// + /// Normal oder Express Versand | + /// Normal or Express shipping + /// + /// CL + [Required] + public required DPDProductType ServiceProduct { get; set; } + + /// + /// Welchen Service soll für den Versand in anspruch genommen werden? Keiner oder Rücksendung? | + /// What kind of service should be used? Return or none + /// + /// SHOPRETURN + [Required] + public required DPDServiceType ServiceType { get; set; } + + + /// + /// Ist die Lieferadresse ein Bussiness Kunde + /// Is the delivery adress a commercial customer + /// + public bool DeliveryAdressIsCommercialCustomer { get; set; } + + + internal override bool IsExpress() + { + return ServiceProduct == DPDProductType.IE2; + } + + public override void Validate() + { + if (Weight <= 0) throw new ShipmentRequestWeightException(1, MaxPackageWeight, 0); + if (LabelCount == 1 && Weight > MaxPackageWeight) throw new ShipmentRequestWeightException(1, MaxPackageWeight, Weight); + if (Weight / LabelCount > MaxPackageWeight) throw new ShipmentRequestWeightException(1, MaxPackageWeight, Weight / LabelCount); + + if (!Note1.RangeLenghtValidation(0, 70)) throw new ShipmentRequestNoValidStringLengthException("Note1", null, 70); + if (!Adressline1.RangeLenghtValidation(1, 35)) throw new ShipmentRequestNoValidStringLengthException("Adressline1", 1, 35); + if (!Adressline2.RangeLenghtValidation(0, 35)) throw new ShipmentRequestNoValidStringLengthException("Adressline2", null, 35); + if (!Adressline3.RangeLenghtValidation(0, 35)) throw new ShipmentRequestNoValidStringLengthException("Adressline3", null, 35); + if (!InvoiceReference.MaxLenghtValidation(80)) throw new ShipmentRequestNoValidStringLengthException("InvoiceReference", null, 35); + if (!CustomerReference.MaxLenghtValidation(80)) throw new ShipmentRequestNoValidStringLengthException("CustomerReference", null, 35); + if (!Street.RangeLenghtValidation(0, 50)) throw new ShipmentRequestNoValidStringLengthException("Street", 1, 35); + if (!(Street + " " + StreetNumber).RangeLenghtValidation(1, 50)) throw new ShipmentRequestNoValidStringLengthException("Street + StreetNumber", 1, 35); + if (WithEmailNotification && !EMail.RangeLenghtValidation(5, 100)) throw new ShipmentRequestNoValidStringLengthException("EMail", 5, 100); + } + + } +} diff --git a/ShippingProAPICollection/Provider/DPD/DPDShipmentService.cs b/ShippingProAPICollection/Provider/DPD/DPDShipmentService.cs new file mode 100644 index 0000000..5ee4203 --- /dev/null +++ b/ShippingProAPICollection/Provider/DPD/DPDShipmentService.cs @@ -0,0 +1,337 @@ +using DPDLoginService2_0; +using DPDShipmentService4_4; +using Microsoft.Extensions.Caching.Memory; +using RestSharp; +using ShippingProAPICollection._Provider.DHL; +using ShippingProAPICollection.Models; +using ShippingProAPICollection.Models.Entities; +using ShippingProAPICollection.Models.Error; +using ShippingProAPICollection.Models.Utils; +using ShippingProAPICollection.Provider.DPD.Entities; +using ShippingProAPICollection.Provider.GLS.Entities.Validation; + +namespace ShippingProAPICollection.Provider.DPD +{ + public class DPDShipmentService : IShippingProviderService + { + private readonly IMemoryCache _cache; + private DPDSettings providerSettings = null!; + private ShippingProAPIAccountSettings accountSettings = null!; + + public DPDShipmentService(ShippingProAPIAccountSettings accountSettings, DPDSettings providerSettings, IMemoryCache cache) + { + this.accountSettings = accountSettings; + this.providerSettings = providerSettings; + _cache = cache; + } + + public async Task> RequestLabel(RequestShipmentBase request, CancellationToken cancelToken = default) + { + var DPDRequest = request as DPDShipmentRequestModel; + string authToken = await GetAuthToken(); + + string url = string.Format("https://public-{0}.dpd.com/services/ShipmentService/V4_4/", providerSettings.ApiDomain); + ShipmentService_4_4Client shipmentClient = new ShipmentService_4_4Client(ShipmentService_4_4Client.EndpointConfiguration.ShipmentService_Public_4_4_SOAP, url); + + storeOrders requestBody = CreateRequestModel(DPDRequest); + + authentication auth = new authentication() + { + delisId = providerSettings.Username, + authToken = authToken, + messageLanguage = providerSettings.APILanguage + }; + + storeOrdersResponse1 response; + + try + { + response = await shipmentClient.storeOrdersAsync(auth, requestBody).ConfigureAwait(false); + } + catch (Exception ex) + { + throw handleDpdErrorObject(ref ex); + } + + List labels = new List(); + string requestId = response.storeOrdersResponse.orderResult.shipmentResponses[0].mpsId; + + foreach (shipmentResponse shipment in response.storeOrdersResponse.orderResult.shipmentResponses) + { + if (shipment.faults != null) + { + string errorMessage = String.Join(" - ", shipment.faults.Select(x => x.faultCode + " " + x.message)); + throw new DPDException(ShippingErrorCode.DPD_SHIPMENT_REQUEST_ERROR, errorMessage, requestBody); + } + else + { + foreach (parcelInformationType i in shipment.parcelInformation) + { + labels.Add(new RequestShippingLabelResponse() + { + ParcelNumber = i.parcelLabelNumber, + CancelId = i.parcelLabelNumber, + Label = ByteUtils.MergePDFByteToOnePDF(i.output.Select(x => x.content).ToList()), + LabelType = DPDRequest.ServiceType == DPDServiceType.SHOPRETURN ? ShippingLabelType.SHOPRETURN : (request.IsExpress() ? ShippingLabelType.EXPRESS : ShippingLabelType.NORMAL), + Weight = request.GetPackageWeight(), + }); + } + } + } + + return labels; + + } + + public async Task CancelLabel(string cancelId, CancellationToken cancelToken = default) + { + // DPD is fucking crazy and we not need to cancel any labels :) + return ShippingCancelResult.CANCLED; + } + + public Task ValidateLabel(RequestShipmentBase request, CancellationToken cancelToken) + { + throw new DPDException(ShippingErrorCode.NOT_AVAILABLE, "Feature not available for DPD"); + } + + public Task GetEstimatedDeliveryDays(RequestShipmentBase request, CancellationToken cancelToken) + { + throw new DPDException(ShippingErrorCode.NOT_AVAILABLE, "Feature not available for DPD"); + } + + /// + /// Remove the cachen auth token + /// + public void ResetDPDAutToken() + { + _cache.Remove("DPD_AUTH_TOKEN_" + providerSettings.ContractID); + } + + private storeOrders CreateRequestModel(DPDShipmentRequestModel request) + { + var order = new storeOrders(); + + order.printOptions = new printOptions() + { + printOption = new printOption[] + { + new printOption() + { + paperFormat = printOptionPaperFormat.A6, + paperFormatSpecified = true, + startPosition = startPosition.UPPER_LEFT, + startPositionSpecified = true, + } + }, + splitByParcel = true, + }; + + + var shipmentServiceData = new shipmentServiceData(); + + shipmentServiceData.generalShipmentData = new generalShipmentData() + { + mpsCustomerReferenceNumber1 = request.InvoiceReference ?? "", + mpsCustomerReferenceNumber2 = "KNr: " + request.CustomerReference, + mpsExpectedSendingDate = request.EarliestDeliveryDate.ToString("yyyyMMdd"), + identificationNumber = "", + sendingDepot = providerSettings.DepotNumber, + product = EnumUtils.ToEnum(request.ServiceProduct.ToString(), generalShipmentDataProduct.CL), + }; + + shipmentServiceData.generalShipmentData.sender = new addressWithType() + { + addressType = addressWithTypeAddressType.COM, + name1 = accountSettings.Name, + street = accountSettings.Street, + country = accountSettings.CountryIsoA2Code, + zipCode = accountSettings.PostCode, + city = accountSettings.City, + contact = accountSettings.ContactName, + }; + + + shipmentServiceData.generalShipmentData.recipient = new addressWithType() + { + addressType = request.DeliveryAdressIsCommercialCustomer ? addressWithTypeAddressType.COM : addressWithTypeAddressType.PRV, + name1 = request.Adressline1, + name2 = request.Adressline2, + street = request.Street, + houseNo = request.StreetNumber, + country = request.Country, + zipCode = request.PostCode, + city = request.City, + customerNumber = request.CustomerReference, + phone = request.Phone, + comment = request.Note1 ?? "", + email = request.WithEmailNotification ? request.EMail : null, + }; + + shipmentServiceData.productAndServiceData = new productAndServiceData() + { + orderType = productAndServiceDataOrderType.consignment, + predict = request.WithEmailNotification ? new notification() + { + channel = 1, + language = request.Country, + value = request.EMail + } : null, + }; + + List parcels = new List(); + + float packageWeight = request.GetPackageWeight(); + + int grammfactor = 100; + int packageWeightGramm = ((int)packageWeight * grammfactor); + + for (int i = 0; i < request.LabelCount; i++) + { + parcels.Add( + + new parcel() + { + customerReferenceNumber1 = request.InvoiceReference ?? "", + customerReferenceNumber2 = "KNr: " + request.CustomerReference, + weight = request.ServiceType == DPDServiceType.SHOPRETURN ? 1 : packageWeightGramm, + weightSpecified = request.ServiceType == DPDServiceType.SHOPRETURN ? false : true, + returns = request.ServiceType == DPDServiceType.SHOPRETURN, + returnsSpecified = request.ServiceType == DPDServiceType.SHOPRETURN, + } + ); + + } + + shipmentServiceData.parcels = parcels.ToArray(); + + order.order = new shipmentServiceData[] + { + shipmentServiceData + }; + + return order; + } + + /// + /// Get auth token from cache or login into DPD service + /// + /// + /// + private async Task GetAuthToken() + { + string? dpdAuthToken = _cache.Get("DPD_AUTH_TOKEN_" + providerSettings.ContractID); + + if (dpdAuthToken == null) + { + dpdAuthToken = await LoginToDPD(); + if (dpdAuthToken != null) _cache.Set("DPD_AUTH_TOKEN_" + providerSettings.ContractID, dpdAuthToken, TimeSpan.FromSeconds(36000)); + } + + if (String.IsNullOrEmpty(dpdAuthToken)) throw new DPDException(ShippingErrorCode.UNAUTHORIZED, "Cannot find any dpd auth token"); + + return dpdAuthToken; + } + + /// + /// Login into DPD service + /// + /// + /// + /// + private async Task LoginToDPD(CancellationToken cancelToken = default) + { + + string url = string.Format("https://public-{0}.dpd.com/services/LoginService/V2_0/", providerSettings.ApiDomain); + LoginServiceClient loginClient = new LoginServiceClient(LoginServiceClient.EndpointConfiguration.LoginService_2_0_SOAP, url); + + getAuthResponse loginResponse; + + try + { + loginResponse = await loginClient.getAuthAsync(providerSettings.Username, providerSettings.Password, providerSettings.APILanguage); + } + catch (Exception ex) + { + throw handleDpdErrorObject(ref ex); + } + + if (loginResponse.@return.authToken.Length > 0) + { + return loginResponse.@return.authToken; + } + else + { + throw new ShippingProviderException(ShippingErrorCode.UNKNOW, "No auth token available after dpd login"); + } + } + + /// + /// Read DPD exception from response + /// + /// + /// + /// + /// + private Exception handleDpdErrorObject(ref Exception dpdExeption, object? request = null) + { + string getCoreErrorMessage = ""; + object? myObject = new object(); + bool FoundDetail = false; + + try + { + object? dpdExceptionDetail = dpdExeption.GetType().GetProperty("Detail")?.GetValue(dpdExeption, null); + if (dpdExceptionDetail != null) + { + FoundDetail = true; + object? errorCode = dpdExceptionDetail.GetType().GetProperty("errorCode")?.GetValue(dpdExceptionDetail, null); + object? errorMessage = dpdExceptionDetail.GetType().GetProperty("errorMessage")?.GetValue(dpdExceptionDetail, null); + } + + myObject = dpdExceptionDetail; + } + catch (Exception) + { + } + + try + { + if (FoundDetail == true && (dpdExeption.Message.ToString() == "" | dpdExeption.Message.ToString() == "Fault occured")) + { + object? dpdExceptionDetail2 = dpdExeption.GetType().GetProperty("Detail")?.GetValue(dpdExeption, null); + if (dpdExceptionDetail2 != null && dpdExceptionDetail2.GetType().GetProperty("InnerText")?.GetValue(dpdExceptionDetail2, null) != null) + { + object? myInnerText = dpdExceptionDetail2.GetType().GetProperty("InnerText")?.GetValue(dpdExceptionDetail2, null); + if (myInnerText != null && myInnerText.ToString()?.Length > 0) + myObject = dpdExceptionDetail2; + } + } + } + catch (Exception) + { + } + + if (dpdExeption.Message.ToString().Length > 0 && !dpdExeption.Message.ToString().Contains("Fault occured")) + { + getCoreErrorMessage = dpdExeption.Message.ToString(); + return new DPDException(ShippingErrorCode.DPD_LOGIN_ERROR, getCoreErrorMessage, request); + } + else + { + if (myObject != null) + { + System.Reflection.PropertyInfo? pi = myObject.GetType().GetProperty("errorMessage"); + if (pi != null) + { + object? name = (object?)(pi.GetValue(myObject, null)); + throw new DPDException(ShippingErrorCode.DPD_LOGIN_ERROR, name?.ToString() ?? "Unknow", request); + } + } + + return new DPDException(ShippingErrorCode.DPD_LOGIN_ERROR, "Unknow", request); + } + + } + + } +} diff --git a/ShippingProAPICollection/Provider/DPD/Entities/DPDException.cs b/ShippingProAPICollection/Provider/DPD/Entities/DPDException.cs new file mode 100644 index 0000000..188bab4 --- /dev/null +++ b/ShippingProAPICollection/Provider/DPD/Entities/DPDException.cs @@ -0,0 +1,11 @@ +using ShippingProAPICollection.Models.Error; + +namespace ShippingProAPICollection.Provider.DPD.Entities +{ + public class DPDException : ShippingProviderException + { + public DPDException(ShippingErrorCode errorcode, string message, object? payload = null) : base(errorcode, message, payload) + { + } + } +} diff --git a/ShippingProAPICollection/Provider/DPD/Entities/DPDProductType.cs b/ShippingProAPICollection/Provider/DPD/Entities/DPDProductType.cs new file mode 100644 index 0000000..7432cb5 --- /dev/null +++ b/ShippingProAPICollection/Provider/DPD/Entities/DPDProductType.cs @@ -0,0 +1,16 @@ +namespace ShippingProAPICollection.Provider.DPD.Entities +{ + public enum DPDProductType + { + /// + /// Normaler Versand | + /// Normal shipping + /// + CL, + /// + /// Express Versand | + /// Express shipping + /// + IE2, + } +} diff --git a/ShippingProAPICollection/Provider/DPD/Entities/DPDServiceType.cs b/ShippingProAPICollection/Provider/DPD/Entities/DPDServiceType.cs new file mode 100644 index 0000000..fe35fcf --- /dev/null +++ b/ShippingProAPICollection/Provider/DPD/Entities/DPDServiceType.cs @@ -0,0 +1,15 @@ +namespace ShippingProAPICollection.Provider.DPD.Entities +{ + public enum DPDServiceType + { + /// + /// + /// + NONE, + /// + /// Rücksendung | + /// Return + /// + SHOPRETURN + } +} diff --git a/ShippingProAPICollection/Provider/GLS/Entities/Cancel/CancelShipmentResponse.cs b/ShippingProAPICollection/Provider/GLS/Entities/Cancel/CancelShipmentResponse.cs new file mode 100644 index 0000000..20d6946 --- /dev/null +++ b/ShippingProAPICollection/Provider/GLS/Entities/Cancel/CancelShipmentResponse.cs @@ -0,0 +1,10 @@ +namespace ShippingProAPICollection.Provider.GLS.Entities.Cancel +{ + internal class CancelShipmentResponse + { + public required string TrackID { get; set; } + + [Newtonsoft.Json.JsonProperty(PropertyName = "result")] + public required string Result { get; set; } + } +} diff --git a/ShippingProAPICollection/Provider/GLS/Entities/Create/Address.cs b/ShippingProAPICollection/Provider/GLS/Entities/Create/Address.cs new file mode 100644 index 0000000..2f738fc --- /dev/null +++ b/ShippingProAPICollection/Provider/GLS/Entities/Create/Address.cs @@ -0,0 +1,35 @@ +using System.ComponentModel.DataAnnotations; + +namespace ShippingProAPICollection.Provider.GLS.Entities.Create +{ + internal class Address + { + [MaxLength(40)] + public required string Name1 { get; set; } + [MaxLength(40)] + public string? Name2 { get; set; } + [MaxLength(40)] + public string? Name3 { get; set; } + [MaxLength(2)] + public required string CountryCode { get; set; } + [MaxLength(40)] + public string? Province { get; set; } + [MaxLength(10)] + public required string ZIPCode { get; set; } + [MaxLength(40)] + public required string City { get; set; } + [MaxLength(40)] + public required string Street { get; set; } + [MaxLength(40)] + public required string StreetNumber { get; set; } + [MaxLength(80)] + [Newtonsoft.Json.JsonProperty(PropertyName = "eMail")] + public string? EMail { get; set; } + [MaxLength(40)] + public string? ContactPerson { get; set; } + [MaxLength(35)] + public string? FixedLinePhonenumber { get; set; } + [MaxLength(35)] + public string? MobilePhoneNumber { get; set; } + } +} diff --git a/ShippingProAPICollection/Provider/GLS/Entities/Create/Consignee.cs b/ShippingProAPICollection/Provider/GLS/Entities/Create/Consignee.cs new file mode 100644 index 0000000..f29579b --- /dev/null +++ b/ShippingProAPICollection/Provider/GLS/Entities/Create/Consignee.cs @@ -0,0 +1,20 @@ +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System.ComponentModel.DataAnnotations; +using ShippingProAPICollection.Provider.GLS.Entities; +using ShippingProAPICollection.Provider.GLS.Entities.Create; + +namespace ShippingProAPICollection.Provider.GLS.Entities.Create +{ + internal class Consignee + { + [MaxLength(80)] + public string? ConsigneeID { get; set; } + [MaxLength(80)] + public string? CostCenter { get; set; } + [JsonConverter(typeof(StringEnumConverter))] + public GLSConsigneeCategoryTypes Category { get; set; } + [MaxLength(80)] + public required Address Address { get; set; } + } +} diff --git a/ShippingProAPICollection/Provider/GLS/Entities/Create/DefinePrinter.cs b/ShippingProAPICollection/Provider/GLS/Entities/Create/DefinePrinter.cs new file mode 100644 index 0000000..ebdafb7 --- /dev/null +++ b/ShippingProAPICollection/Provider/GLS/Entities/Create/DefinePrinter.cs @@ -0,0 +1,8 @@ +namespace ShippingProAPICollection.Provider.GLS.Entities.Create +{ + internal class DefinePrinter + { + public string? LabelPrinter { get; set; } + public string? DocumentPrinter { get; set; } + } +} diff --git a/ShippingProAPICollection/Provider/GLS/Entities/Create/HazardousGood.cs b/ShippingProAPICollection/Provider/GLS/Entities/Create/HazardousGood.cs new file mode 100644 index 0000000..6761495 --- /dev/null +++ b/ShippingProAPICollection/Provider/GLS/Entities/Create/HazardousGood.cs @@ -0,0 +1,9 @@ +namespace ShippingProAPICollection.Provider.GLS.Entities.Create +{ + internal class HazardousGood + { + public string GLSHazNo { get; set; } + + public decimal Weight { get; set; } + } +} diff --git a/ShippingProAPICollection/Provider/GLS/Entities/Create/PrintingOptions.cs b/ShippingProAPICollection/Provider/GLS/Entities/Create/PrintingOptions.cs new file mode 100644 index 0000000..ca6e6ed --- /dev/null +++ b/ShippingProAPICollection/Provider/GLS/Entities/Create/PrintingOptions.cs @@ -0,0 +1,10 @@ +using ShippingProAPICollection.Provider.GLS.Entities.Create; + +namespace ShippingProAPICollection.Provider.GLS.Entities.Create +{ + internal class PrintingOptions + { + public ReturnLabels? ReturnLabels { get; set; } + public DefinePrinter? DefinePrinter { get; set; } + } +} diff --git a/ShippingProAPICollection/Provider/GLS/Entities/Create/Response/Barcodes.cs b/ShippingProAPICollection/Provider/GLS/Entities/Create/Response/Barcodes.cs new file mode 100644 index 0000000..f4216f2 --- /dev/null +++ b/ShippingProAPICollection/Provider/GLS/Entities/Create/Response/Barcodes.cs @@ -0,0 +1,9 @@ +namespace ShippingProAPICollection.Provider.GLS.Entities.Create.Response +{ + internal class Barcodes + { + public string? Primary2D { get; set; } + public string? Secondary2D { get; set; } + public bool Primary1DPrint { get; set; } + } +} diff --git a/ShippingProAPICollection/Provider/GLS/Entities/Create/Response/CreatedShipmentData.cs b/ShippingProAPICollection/Provider/GLS/Entities/Create/Response/CreatedShipmentData.cs new file mode 100644 index 0000000..bd894f2 --- /dev/null +++ b/ShippingProAPICollection/Provider/GLS/Entities/Create/Response/CreatedShipmentData.cs @@ -0,0 +1,12 @@ + +namespace ShippingProAPICollection.Provider.GLS.Entities.Create.Response +{ + internal class CreatedShipmentData + { + public List? ShipmentReference { get; set; } + public required List ParcelData { get; set; } + public required List PrintData { get; set; } + public string? CustomerID { get; set; } + public string? PickupLocation { get; set; } + } +} diff --git a/ShippingProAPICollection/Provider/GLS/Entities/Create/Response/CreatedShipmentResponse.cs b/ShippingProAPICollection/Provider/GLS/Entities/Create/Response/CreatedShipmentResponse.cs new file mode 100644 index 0000000..a1c9af6 --- /dev/null +++ b/ShippingProAPICollection/Provider/GLS/Entities/Create/Response/CreatedShipmentResponse.cs @@ -0,0 +1,9 @@ +using ShippingProAPICollection.Provider.GLS.Entities.Create.Response; + +namespace ShippingProAPICollection.Provider.GLS.Entities.Create.Response +{ + internal class CreatedShipmentResponse + { + public required CreatedShipmentData CreatedShipment { get; set; } + } +} diff --git a/ShippingProAPICollection/Provider/GLS/Entities/Create/Response/Document.cs b/ShippingProAPICollection/Provider/GLS/Entities/Create/Response/Document.cs new file mode 100644 index 0000000..4ba7200 --- /dev/null +++ b/ShippingProAPICollection/Provider/GLS/Entities/Create/Response/Document.cs @@ -0,0 +1,8 @@ +namespace ShippingProAPICollection.Provider.GLS.Entities.Create.Response +{ + internal class Document + { + public required byte[] Data { get; set; } + public string? LabelFormat { get; set; } + } +} diff --git a/ShippingProAPICollection/Provider/GLS/Entities/Create/Response/ParcelData.cs b/ShippingProAPICollection/Provider/GLS/Entities/Create/Response/ParcelData.cs new file mode 100644 index 0000000..0083651 --- /dev/null +++ b/ShippingProAPICollection/Provider/GLS/Entities/Create/Response/ParcelData.cs @@ -0,0 +1,11 @@ +using ShippingProAPICollection.Provider.GLS.Entities.Create.Response; + +namespace ShippingProAPICollection.Provider.GLS.Entities.Create.Response +{ + internal class ParcelData + { + public string TrackID { get; set; } + public string ParcelNumber { get; set; } + public Barcodes Barcodes { get; set; } + } +} diff --git a/ShippingProAPICollection/Provider/GLS/Entities/Create/ReturnLabels.cs b/ShippingProAPICollection/Provider/GLS/Entities/Create/ReturnLabels.cs new file mode 100644 index 0000000..49ba78b --- /dev/null +++ b/ShippingProAPICollection/Provider/GLS/Entities/Create/ReturnLabels.cs @@ -0,0 +1,14 @@ +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using ShippingProAPICollection.Provider.GLS.Entities; + +namespace ShippingProAPICollection.Provider.GLS.Entities.Create +{ + internal class ReturnLabels + { + [JsonConverter(typeof(StringEnumConverter))] + public GLSTemplateSet TemplateSet { get; set; } + [JsonConverter(typeof(StringEnumConverter))] + public GLSLabelDocFormat LabelFormat { get; set; } + } +} diff --git a/ShippingProAPICollection/Provider/GLS/Entities/Create/Services/DepositService.cs b/ShippingProAPICollection/Provider/GLS/Entities/Create/Services/DepositService.cs new file mode 100644 index 0000000..47c8dd0 --- /dev/null +++ b/ShippingProAPICollection/Provider/GLS/Entities/Create/Services/DepositService.cs @@ -0,0 +1,13 @@ +using ShippingProAPICollection.Provider.GLS.Entities.Create.Services; +namespace ShippingProAPICollection.Provider.GLS.Entities.Create.Services +{ + internal class DepositService : Service + { + public override string ServiceName { get; } = "service_deposit"; + public string PlaceOfDeposit { get; set; } + + public DepositService() + { + } + } +} diff --git a/ShippingProAPICollection/Provider/GLS/Entities/Create/Services/Guaranteed24Service.cs b/ShippingProAPICollection/Provider/GLS/Entities/Create/Services/Guaranteed24Service.cs new file mode 100644 index 0000000..f13c272 --- /dev/null +++ b/ShippingProAPICollection/Provider/GLS/Entities/Create/Services/Guaranteed24Service.cs @@ -0,0 +1,12 @@ +using ShippingProAPICollection.Provider.GLS.Entities.Create.Services; +namespace ShippingProAPICollection.Provider.GLS.Entities.Create.Services +{ + internal class Guaranteed24Service : Service + { + public override string ServiceName { get; } = "service_guaranteed24"; + + public Guaranteed24Service() + { + } + } +} diff --git a/ShippingProAPICollection/Provider/GLS/Entities/Create/Services/HazardousGoodsService.cs b/ShippingProAPICollection/Provider/GLS/Entities/Create/Services/HazardousGoodsService.cs new file mode 100644 index 0000000..c427ce8 --- /dev/null +++ b/ShippingProAPICollection/Provider/GLS/Entities/Create/Services/HazardousGoodsService.cs @@ -0,0 +1,15 @@ +using ShippingProAPICollection.Provider.GLS.Entities.Create; +using ShippingProAPICollection.Provider.GLS.Entities.Create.Services; + +namespace ShippingProAPICollection.Provider.GLS.Entities.Create.Services +{ + internal class HazardousGoodsService : Service + { + public override string ServiceName { get; } = "service_hazardousgoods"; + public HazardousGood[] HazardousGood { get; set; } + + public HazardousGoodsService() + { + } + } +} diff --git a/ShippingProAPICollection/Provider/GLS/Entities/Create/Services/Saturday1000Service.cs b/ShippingProAPICollection/Provider/GLS/Entities/Create/Services/Saturday1000Service.cs new file mode 100644 index 0000000..c4b63c9 --- /dev/null +++ b/ShippingProAPICollection/Provider/GLS/Entities/Create/Services/Saturday1000Service.cs @@ -0,0 +1,12 @@ +using ShippingProAPICollection.Provider.GLS.Entities.Create.Services; +namespace ShippingProAPICollection.Provider.GLS.Entities.Create.Services +{ + internal class Saturday1000Service : Service + { + public override string ServiceName { get; } = "service_saturday_1000"; + + public Saturday1000Service() + { + } + } +} diff --git a/ShippingProAPICollection/Provider/GLS/Entities/Create/Services/Saturday1200Service.cs b/ShippingProAPICollection/Provider/GLS/Entities/Create/Services/Saturday1200Service.cs new file mode 100644 index 0000000..6f17166 --- /dev/null +++ b/ShippingProAPICollection/Provider/GLS/Entities/Create/Services/Saturday1200Service.cs @@ -0,0 +1,12 @@ +using ShippingProAPICollection.Provider.GLS.Entities.Create.Services; +namespace ShippingProAPICollection.Provider.GLS.Entities.Create.Services +{ + internal class Saturday1200Service : Service + { + public override string ServiceName { get; } = "service_saturday_1200"; + + public Saturday1200Service() + { + } + } +} diff --git a/ShippingProAPICollection/Provider/GLS/Entities/Create/Services/Service.cs b/ShippingProAPICollection/Provider/GLS/Entities/Create/Services/Service.cs new file mode 100644 index 0000000..86f7a2c --- /dev/null +++ b/ShippingProAPICollection/Provider/GLS/Entities/Create/Services/Service.cs @@ -0,0 +1,7 @@ +namespace ShippingProAPICollection.Provider.GLS.Entities.Create.Services +{ + internal abstract class Service + { + public abstract string ServiceName { get; } + } +} diff --git a/ShippingProAPICollection/Provider/GLS/Entities/Create/Services/Service0800.cs b/ShippingProAPICollection/Provider/GLS/Entities/Create/Services/Service0800.cs new file mode 100644 index 0000000..da5a92e --- /dev/null +++ b/ShippingProAPICollection/Provider/GLS/Entities/Create/Services/Service0800.cs @@ -0,0 +1,13 @@ +using ShippingProAPICollection.Provider.GLS.Entities.Create.Services; + +namespace ShippingProAPICollection.Provider.GLS.Entities.Create.Services +{ + internal class Service0800 : Service + { + public override string ServiceName { get; } = "service_0800"; + + public Service0800() + { + } + } +} diff --git a/ShippingProAPICollection/Provider/GLS/Entities/Create/Services/Service0900.cs b/ShippingProAPICollection/Provider/GLS/Entities/Create/Services/Service0900.cs new file mode 100644 index 0000000..ef8552a --- /dev/null +++ b/ShippingProAPICollection/Provider/GLS/Entities/Create/Services/Service0900.cs @@ -0,0 +1,13 @@ +using ShippingProAPICollection.Provider.GLS.Entities.Create.Services; + +namespace ShippingProAPICollection.Provider.GLS.Entities.Create.Services +{ + internal class Service0900 : Service + { + public override string ServiceName { get; } = "service_0900"; + + public Service0900() + { + } + } +} diff --git a/ShippingProAPICollection/Provider/GLS/Entities/Create/Services/Service1000.cs b/ShippingProAPICollection/Provider/GLS/Entities/Create/Services/Service1000.cs new file mode 100644 index 0000000..6ae0daf --- /dev/null +++ b/ShippingProAPICollection/Provider/GLS/Entities/Create/Services/Service1000.cs @@ -0,0 +1,13 @@ +using ShippingProAPICollection.Provider.GLS.Entities.Create.Services; + +namespace ShippingProAPICollection.Provider.GLS.Entities.Create.Services +{ + internal class Service1000 : Service + { + public override string ServiceName { get; } = "service_1000"; + + public Service1000() + { + } + } +} diff --git a/ShippingProAPICollection/Provider/GLS/Entities/Create/Services/Service1200.cs b/ShippingProAPICollection/Provider/GLS/Entities/Create/Services/Service1200.cs new file mode 100644 index 0000000..efa4994 --- /dev/null +++ b/ShippingProAPICollection/Provider/GLS/Entities/Create/Services/Service1200.cs @@ -0,0 +1,13 @@ +using ShippingProAPICollection.Provider.GLS.Entities.Create.Services; + +namespace ShippingProAPICollection.Provider.GLS.Entities.Create.Services +{ + internal class Service1200 : Service + { + public override string ServiceName { get; } = "service_1200"; + + public Service1200() + { + } + } +} diff --git a/ShippingProAPICollection/Provider/GLS/Entities/Create/Services/ShopReturnService.cs b/ShippingProAPICollection/Provider/GLS/Entities/Create/Services/ShopReturnService.cs new file mode 100644 index 0000000..c42c169 --- /dev/null +++ b/ShippingProAPICollection/Provider/GLS/Entities/Create/Services/ShopReturnService.cs @@ -0,0 +1,14 @@ +using ShippingProAPICollection.Provider.GLS.Entities.Create.Services; + +namespace ShippingProAPICollection.Provider.GLS.Entities.Create.Services +{ + internal class ShopReturnService : Service + { + public override string ServiceName { get; } = "service_shopreturn"; + public long NumberOfLabels { get; set; } + + public ShopReturnService() + { + } + } +} diff --git a/ShippingProAPICollection/Provider/GLS/Entities/Create/Shipment.cs b/ShippingProAPICollection/Provider/GLS/Entities/Create/Shipment.cs new file mode 100644 index 0000000..2a59e71 --- /dev/null +++ b/ShippingProAPICollection/Provider/GLS/Entities/Create/Shipment.cs @@ -0,0 +1,26 @@ +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System.ComponentModel.DataAnnotations; + +namespace ShippingProAPICollection.Provider.GLS.Entities.Create +{ + internal class Shipment + { + public string[]? ShipmentReference { get; set; } + [MaxLength(10)] + public required string ShippingDate { get; set; } + [MaxLength(2)] + public string? IncotermCode { get; set; } + [MaxLength(40)] + public string? Identifier { get; set; } + [MaxLength(40)] + public string? Middleware { get; set; } + + [JsonConverter(typeof(StringEnumConverter))] + public required GLSProductType Product { get; set; } + public required Consignee Consignee { get; set; } + public required Shipper Shipper { get; set; } + public required ShipmentUnit[] ShipmentUnit { get; set; } + public ShipmentService[]? Service { get; set; } + } +} diff --git a/ShippingProAPICollection/Provider/GLS/Entities/Create/ShipmentRequestData.cs b/ShippingProAPICollection/Provider/GLS/Entities/Create/ShipmentRequestData.cs new file mode 100644 index 0000000..ca55b75 --- /dev/null +++ b/ShippingProAPICollection/Provider/GLS/Entities/Create/ShipmentRequestData.cs @@ -0,0 +1,10 @@ +using ShippingProAPICollection.Provider.GLS.Entities.Create; + +namespace ShippingProAPICollection.Provider.GLS.Entities.Create +{ + internal class ShipmentRequestData + { + public required Shipment Shipment { get; set; } + public required PrintingOptions PrintingOptions { get; set; } + } +} diff --git a/ShippingProAPICollection/Provider/GLS/Entities/Create/ShipmentService.cs b/ShippingProAPICollection/Provider/GLS/Entities/Create/ShipmentService.cs new file mode 100644 index 0000000..281c54b --- /dev/null +++ b/ShippingProAPICollection/Provider/GLS/Entities/Create/ShipmentService.cs @@ -0,0 +1,12 @@ +using ShippingProAPICollection.Provider.GLS.Entities.Create.Services; + +namespace ShippingProAPICollection.Provider.GLS.Entities.Create +{ + internal class ShipmentService + { + public Service Service { get; set; } + public ShopReturnService ShopReturn { get; set; } + public DepositService Deposit { get; set; } + public HazardousGoodsService HazardousGood { get; set; } + } +} diff --git a/ShippingProAPICollection/Provider/GLS/Entities/Create/ShipmentUnit.cs b/ShippingProAPICollection/Provider/GLS/Entities/Create/ShipmentUnit.cs new file mode 100644 index 0000000..20b16fa --- /dev/null +++ b/ShippingProAPICollection/Provider/GLS/Entities/Create/ShipmentUnit.cs @@ -0,0 +1,19 @@ +using System.ComponentModel.DataAnnotations; + +namespace ShippingProAPICollection.Provider.GLS.Entities.Create +{ + internal class ShipmentUnit + { + public string[]? ShipmentUnitReference { get; set; } + public decimal Weight { get; set; } + [MaxLength(50)] + public string? Note1 { get; set; } + [MaxLength(50)] + public string? Note2 { get; set; } + [StringLength(18, MinimumLength = 18)] + public string? FRAlphaParcelReference { get; set; } + [MaxLength(40)] + public string? TrackID { get; set; } + public string? ParcelNumber { get; set; } + } +} diff --git a/ShippingProAPICollection/Provider/GLS/Entities/Create/Shipper.cs b/ShippingProAPICollection/Provider/GLS/Entities/Create/Shipper.cs new file mode 100644 index 0000000..f950bfb --- /dev/null +++ b/ShippingProAPICollection/Provider/GLS/Entities/Create/Shipper.cs @@ -0,0 +1,14 @@ +using System.ComponentModel.DataAnnotations; +using ShippingProAPICollection.Provider.GLS.Entities.Create; + +namespace ShippingProAPICollection.Provider.GLS.Entities.Create +{ + internal class Shipper + { + [MaxLength(20)] + public required string ContactID { get; set; } + public Address? AlternativeShipperAddress { get; set; } + [StringLength(10, MinimumLength = 10)] + public string? FRAlphaCustomerReference { get; set; } + } +} diff --git a/ShippingProAPICollection/Provider/GLS/Entities/EstimatedDeliveryDays/EstimatedDeliveryDaysAddress.cs b/ShippingProAPICollection/Provider/GLS/Entities/EstimatedDeliveryDays/EstimatedDeliveryDaysAddress.cs new file mode 100644 index 0000000..4e20755 --- /dev/null +++ b/ShippingProAPICollection/Provider/GLS/Entities/EstimatedDeliveryDays/EstimatedDeliveryDaysAddress.cs @@ -0,0 +1,23 @@ +using ShippingProAPICollection.Models.Error; +using ShippingProAPICollection.Models.Utils; + +namespace ShippingProAPICollection.Provider.GLS.Entities.EstimatedDeliveryDays +{ + internal class EstimatedDeliveryDaysAddress + { + public required string Street { get; set; } + public string? StreetNumber { get; set; } + public required string CountryCode { get; set; } + public required string ZIPCode { get; set; } + public required string City { get; set; } + + public void Validate() + { + if (!Street.RangeLenghtValidation(3, 40)) throw new ShipmentRequestNoValidStringLengthException("Street", 3, 40); + if (!StreetNumber.RangeLenghtValidation(0,40)) throw new ShipmentRequestNoValidStringLengthException("StreetNumber", null, 40); + if (!CountryCode.RangeLenghtValidation(2,2)) throw new ShipmentRequestNoValidStringLengthException("Country", 2, 2); + if (!ZIPCode.RangeLenghtValidation(1, 10)) throw new ShipmentRequestNoValidStringLengthException("PostalCode", 1, 10); + if (!City.RangeLenghtValidation(1, 40)) throw new ShipmentRequestNoValidStringLengthException("City", 1, 40); + } + } +} diff --git a/ShippingProAPICollection/Provider/GLS/Entities/EstimatedDeliveryDays/EstimatedDeliveryDaysResponse.cs b/ShippingProAPICollection/Provider/GLS/Entities/EstimatedDeliveryDays/EstimatedDeliveryDaysResponse.cs new file mode 100644 index 0000000..7695e13 --- /dev/null +++ b/ShippingProAPICollection/Provider/GLS/Entities/EstimatedDeliveryDays/EstimatedDeliveryDaysResponse.cs @@ -0,0 +1,8 @@ + +namespace ShippingProAPICollection.Provider.GLS.Entities.EstimatedDeliveryDays +{ + internal class EstimatedDeliveryDaysResponse + { + public required uint NumberOfWorkDays { get; set; } + } +} diff --git a/ShippingProAPICollection/Provider/GLS/Entities/GLSConsigneeCategoryTypes.cs b/ShippingProAPICollection/Provider/GLS/Entities/GLSConsigneeCategoryTypes.cs new file mode 100644 index 0000000..27fdab2 --- /dev/null +++ b/ShippingProAPICollection/Provider/GLS/Entities/GLSConsigneeCategoryTypes.cs @@ -0,0 +1,8 @@ +namespace ShippingProAPICollection.Provider.GLS.Entities +{ + internal enum GLSConsigneeCategoryTypes + { + PRIVATE, + BUSINESS + } +} diff --git a/ShippingProAPICollection/Provider/GLS/Entities/GLSException.cs b/ShippingProAPICollection/Provider/GLS/Entities/GLSException.cs new file mode 100644 index 0000000..37b0917 --- /dev/null +++ b/ShippingProAPICollection/Provider/GLS/Entities/GLSException.cs @@ -0,0 +1,11 @@ +using ShippingProAPICollection.Models.Error; + +namespace ShippingProAPICollection.Provider.GLS.Entities +{ + public class GLSException : ShippingProviderException + { + public GLSException(ShippingErrorCode errorcode, string message, object? payload = null) : base(errorcode, message, payload) + { + } + } +} diff --git a/ShippingProAPICollection/Provider/GLS/Entities/GLSLabelDocFormats.cs b/ShippingProAPICollection/Provider/GLS/Entities/GLSLabelDocFormats.cs new file mode 100644 index 0000000..f4fae4d --- /dev/null +++ b/ShippingProAPICollection/Provider/GLS/Entities/GLSLabelDocFormats.cs @@ -0,0 +1,9 @@ +namespace ShippingProAPICollection.Provider.GLS.Entities +{ + public enum GLSLabelDocFormat + { + ZEBRA, + PDF, + PNG + } +} diff --git a/ShippingProAPICollection/Provider/GLS/Entities/GLSProductTypes.cs b/ShippingProAPICollection/Provider/GLS/Entities/GLSProductTypes.cs new file mode 100644 index 0000000..9ba520b --- /dev/null +++ b/ShippingProAPICollection/Provider/GLS/Entities/GLSProductTypes.cs @@ -0,0 +1,16 @@ +namespace ShippingProAPICollection.Provider.GLS.Entities +{ + public enum GLSProductType + { + /// + /// Normaler Versand | + /// Normal shipping + /// + PARCEL, + /// + /// Express Versand | + /// Express shipping + /// + EXPRESS + } +} diff --git a/ShippingProAPICollection/Provider/GLS/Entities/GLSServiceTypes.cs b/ShippingProAPICollection/Provider/GLS/Entities/GLSServiceTypes.cs new file mode 100644 index 0000000..493efd8 --- /dev/null +++ b/ShippingProAPICollection/Provider/GLS/Entities/GLSServiceTypes.cs @@ -0,0 +1,54 @@ +namespace ShippingProAPICollection.Provider.GLS.Entities +{ + public enum GLSServiceType + { + /// + /// + NONE, + /// + /// Deposit: Paket an einem Ort hinterlegen | + /// Deposit: Deposit the package at a desired location + /// + DEPOSIT, + /// + /// G24 Service, Lieferung in den nächsten 24Stunden | + /// G24, delivery in the next 14 hours + /// + G24, + /// + /// GLS Express Termin 8Uhr - Lieferung bis morgen 8Uhr | + /// Delivery till 8 o'clock next day + /// + G8, + /// + /// GLS Express Termin 9Uhr - Lieferung bis morgen 9Uhr | + /// Delivery till 9 o'clock next day + /// + G9, + /// + /// GLS Express Termin 10Uhr - Lieferung bis morgen 10Uhr | + /// Delivery till 10 o'clock next day + /// + G10, + /// + /// GLS Express Termin 12Uhr - Lieferung bis morgen 12Uhr | + /// Delivery till 12 o'clock next day + /// + G12, + /// + /// GLS Express Termin Samstag 10Uhr - Lieferung bis morgen 10Uhr | + /// Saturday delivery till 10 o'clock next day + /// + GSATURDAY10, + /// + /// GLS Express Termin Samstag 12Uhr - Lieferung bis morgen 12Uhr | + /// Saturday delivery till 12 o'clock next day + /// + GSATURDAY12, + /// + /// GLS Rücksendung | + /// Return + /// + SHOPRETURN + } +} diff --git a/ShippingProAPICollection/Provider/GLS/Entities/GLSTemplateSetTypes.cs b/ShippingProAPICollection/Provider/GLS/Entities/GLSTemplateSetTypes.cs new file mode 100644 index 0000000..837d050 --- /dev/null +++ b/ShippingProAPICollection/Provider/GLS/Entities/GLSTemplateSetTypes.cs @@ -0,0 +1,8 @@ +namespace ShippingProAPICollection.Provider.GLS.Entities +{ + internal enum GLSTemplateSet + { + NONE, + ZPL_200, + } +} diff --git a/ShippingProAPICollection/Provider/GLS/Entities/Validation/ShipmentValidationResult.cs b/ShippingProAPICollection/Provider/GLS/Entities/Validation/ShipmentValidationResult.cs new file mode 100644 index 0000000..4ece546 --- /dev/null +++ b/ShippingProAPICollection/Provider/GLS/Entities/Validation/ShipmentValidationResult.cs @@ -0,0 +1,8 @@ + +namespace ShippingProAPICollection.Provider.GLS.Entities.Validation +{ + internal class ShipmentValidationResult + { + public List? Issues { get; set; } + } +} diff --git a/ShippingProAPICollection/Provider/GLS/Entities/Validation/ValidateParcelsResponse.cs b/ShippingProAPICollection/Provider/GLS/Entities/Validation/ValidateParcelsResponse.cs new file mode 100644 index 0000000..cbd4ddf --- /dev/null +++ b/ShippingProAPICollection/Provider/GLS/Entities/Validation/ValidateParcelsResponse.cs @@ -0,0 +1,9 @@ + +namespace ShippingProAPICollection.Provider.GLS.Entities.Validation +{ + internal class ValidateParcelsResponse + { + public bool Success { get; set; } + public required ShipmentValidationResult ValidationResult { get; set; } + } +} diff --git a/ShippingProAPICollection/Provider/GLS/Entities/Validation/ValidateShipmentRequestData.cs b/ShippingProAPICollection/Provider/GLS/Entities/Validation/ValidateShipmentRequestData.cs new file mode 100644 index 0000000..d0240f7 --- /dev/null +++ b/ShippingProAPICollection/Provider/GLS/Entities/Validation/ValidateShipmentRequestData.cs @@ -0,0 +1,9 @@ +using ShippingProAPICollection.Provider.GLS.Entities.Create; + +namespace ShippingProAPICollection.Provider.GLS.Entities.Validation +{ + internal class ValidateShipmentRequestData + { + public required Shipment Shipment { get; set; } + } +} diff --git a/ShippingProAPICollection/Provider/GLS/Entities/Validation/ValidationIssue.cs b/ShippingProAPICollection/Provider/GLS/Entities/Validation/ValidationIssue.cs new file mode 100644 index 0000000..3315623 --- /dev/null +++ b/ShippingProAPICollection/Provider/GLS/Entities/Validation/ValidationIssue.cs @@ -0,0 +1,10 @@ + +namespace ShippingProAPICollection.Provider.GLS.Entities.Validation +{ + internal class ValidationIssue + { + public required string Rule { get; set; } + public required string Location { get; set; } + public string[]? Parameters { get; set; } + } +} diff --git a/ShippingProAPICollection/Provider/GLS/Entities/Validation/ValidationReponse.cs b/ShippingProAPICollection/Provider/GLS/Entities/Validation/ValidationReponse.cs new file mode 100644 index 0000000..e5dcad7 --- /dev/null +++ b/ShippingProAPICollection/Provider/GLS/Entities/Validation/ValidationReponse.cs @@ -0,0 +1,9 @@ + +namespace ShippingProAPICollection.Provider.GLS.Entities.Validation +{ + public class ValidationReponse + { + public required bool Success { get; set; } + public List? ValidationIssues { get; set; } + } +} diff --git a/ShippingProAPICollection/Provider/GLS/Entities/Validation/ValidationReponseIssue.cs b/ShippingProAPICollection/Provider/GLS/Entities/Validation/ValidationReponseIssue.cs new file mode 100644 index 0000000..1bab0f0 --- /dev/null +++ b/ShippingProAPICollection/Provider/GLS/Entities/Validation/ValidationReponseIssue.cs @@ -0,0 +1,10 @@ +using ShippingProAPICollection.Models.Error; + +namespace ShippingProAPICollection.Provider.GLS.Entities.Validation +{ + public class ValidationReponseIssue + { + public required string Message { get; set; } + public required ShippingErrorCode ErrorCode { get; set; } + } +} diff --git a/ShippingProAPICollection/Provider/GLS/GLSSettings.cs b/ShippingProAPICollection/Provider/GLS/GLSSettings.cs new file mode 100644 index 0000000..d3718d8 --- /dev/null +++ b/ShippingProAPICollection/Provider/GLS/GLSSettings.cs @@ -0,0 +1,14 @@ + +namespace ShippingProAPICollection.Provider.GLS +{ + public class GLSSettings : ProviderSettings + { + /// + /// Api domain is the XXXXXXX part of your GLS-GLS api url provides by ur GLS contact => https://GLS-wbm-XXXXXXX.gls-group.eu:443/backend/rs + /// + public required string ApiDomain { get; set; } + public required string Username { get; set; } + public required string Password { get; set; } + public required string ContactID { get; set; } + } +} diff --git a/ShippingProAPICollection/Provider/GLS/GLSShipmentRequestModel.cs b/ShippingProAPICollection/Provider/GLS/GLSShipmentRequestModel.cs new file mode 100644 index 0000000..50ef3bb --- /dev/null +++ b/ShippingProAPICollection/Provider/GLS/GLSShipmentRequestModel.cs @@ -0,0 +1,93 @@ +using System.ComponentModel.DataAnnotations; +using ShippingProAPICollection.Models.Utils; +using ShippingProAPICollection.Models.Entities; +using ShippingProAPICollection.Models.Error; +using ShippingProAPICollection.Provider.GLS.Entities; + +namespace ShippingProAPICollection.Provider.GLS +{ + public class GLSShipmentRequestModel : RequestShipmentBase + { + public GLSShipmentRequestModel(string contractID) : base(contractID) + { + + } + + public GLSShipmentRequestModel() : base(ShippingProviderType.GLS.ToString()) + { + + } + + public override string ProviderType { get; } = ShippingProviderType.GLS.ToString(); + public override float MaxPackageWeight { get; } = 31.5f; + + /// + /// Mit Email Notification an den Kunden -> Email muss dafür angegeben werden | + /// Should the shipping provider notify the customer on status changes? If TRUE the Email address musst be set + /// + /// false + public bool WithEmailNotification { get; set; } + + /// + /// Normal oder Express Versand | + /// Normal or Express shipping + /// + /// PARCEL + [Required] + public required GLSProductType ServiceProduct { get; set; } + + /// + /// Welchen Service soll für den Versand in anspruch genommen werden? Deposit-Service oder keinen? | + /// What kind of service should be used? Deposit-Service or none + /// + /// DEPOSIT + [Required] + public required GLSServiceType ServiceType { get; set; } + + /// + /// Ablageort des Paketes -> z.B Briefksten/ Hinter Blumentopf | + /// Deposit location of the package if ServiceType = DEPOSIT + /// + /// Briefkasten + public string? PlaceOfDeposit { get; set; } + + /// + /// Notiz 2 auf dem Label | + /// Note 2 printed on the label + /// + /// Danke für Ihre Bestellung! + public string? Note2 { get; set; } + + /// + /// AmazonOrderId, z.B Amazon Bestellnummer + /// GLS need the amazon order id to handle amazon prime orders + /// + /// 305-5872079-2948312 + public string? AmazonOrderId { get; set; } + + internal override bool IsExpress() + { + return ServiceProduct == GLSProductType.EXPRESS; + } + + public override void Validate() + { + base.Validate(); + + // Check base parameters + if (!Adressline1.RangeLenghtValidation(1, 40)) throw new ShipmentRequestNoValidStringLengthException("Adressline1", 1, 40); + if (!Adressline2.RangeLenghtValidation(0, 40)) throw new ShipmentRequestNoValidStringLengthException("Adressline2", 1, 40); + if (!Adressline3.RangeLenghtValidation(0, 40)) throw new ShipmentRequestNoValidStringLengthException("Adressline3", 1, 40); + if (!InvoiceReference.MaxLenghtValidation(80)) throw new ShipmentRequestNoValidStringLengthException("InvoiceReference", null, 80); + if (!CustomerReference.MaxLenghtValidation(80)) throw new ShipmentRequestNoValidStringLengthException("CustomerReference", null, 80); + if (!Street.RangeLenghtValidation(3, 40)) throw new ShipmentRequestNoValidStringLengthException("Street", 3, 40); + if (!AmazonOrderId.MaxLenghtValidation(80)) throw new ShipmentRequestNoValidStringLengthException("AmazonOrderId", null, 80); + + if (WithEmailNotification && !EMail.MaxLenghtValidation(40)) throw new ShipmentRequestNoValidStringLengthException("EMail", null, 40); + if (!Note1.RangeLenghtValidation(0, 60)) throw new ShipmentRequestNoValidStringLengthException("Note1", null, 60); + if (!Note2.RangeLenghtValidation(0, 60)) throw new ShipmentRequestNoValidStringLengthException("Note2", null, 60); + if (ServiceType == GLSServiceType.DEPOSIT && !PlaceOfDeposit.RangeLenghtValidation(1, 60)) throw new ShipmentRequestNoValidStringLengthException("PlaceOfDeposit", 1, 60); + } + + } +} diff --git a/ShippingProAPICollection/Provider/GLS/GLSShipmentService.cs b/ShippingProAPICollection/Provider/GLS/GLSShipmentService.cs new file mode 100644 index 0000000..f6a61f2 --- /dev/null +++ b/ShippingProAPICollection/Provider/GLS/GLSShipmentService.cs @@ -0,0 +1,418 @@ +using Newtonsoft.Json; +using RestSharp; +using RestSharp.Authenticators; +using ShippingProAPICollection.Models; +using ShippingProAPICollection.Models.Entities; +using ShippingProAPICollection.Models.Error; +using ShippingProAPICollection.Provider.GLS.Entities; +using ShippingProAPICollection.Provider.GLS.Entities.Cancel; +using ShippingProAPICollection.Provider.GLS.Entities.Create; +using ShippingProAPICollection.Provider.GLS.Entities.Create.Response; +using ShippingProAPICollection.Provider.GLS.Entities.Create.Services; +using ShippingProAPICollection.Provider.GLS.Entities.EstimatedDeliveryDays; +using ShippingProAPICollection.Provider.GLS.Entities.Validation; + +namespace ShippingProAPICollection.Provider.GLS +{ + public class GLSShipmentService : IShippingProviderService + { + private string apiContentType = "application/glsVersion1+json"; + private GLSSettings providerSettings = null!; + private ShippingProAPIAccountSettings accountSettings = null!; + + public GLSShipmentService(ShippingProAPIAccountSettings accountSettings, GLSSettings providerSettings) + { + this.accountSettings = accountSettings; + this.providerSettings = providerSettings; + } + + public async Task> RequestLabel(RequestShipmentBase request, CancellationToken cancelToken = default) + { + var GLSRequest = request as GLSShipmentRequestModel; + + PrintingOptions printOptions = new PrintingOptions() + { + ReturnLabels = new ReturnLabels() + { + LabelFormat = GLSLabelDocFormat.PDF, + TemplateSet = GLSTemplateSet.NONE + } + }; + + var shipment = CreateRequestModel(GLSRequest); + + var shipmentRequest = new ShipmentRequestData() + { + Shipment = shipment, + PrintingOptions = printOptions + }; + + RestResponse response = await CallApi( + new Uri(string.Format("https://shipit-wbm-{0}.gls-group.eu:443/backend/rs/shipments", providerSettings.ApiDomain)), + Method.Post, + shipmentRequest, + cancelToken + ); + + List createdLabels = new List(); + + for (int i = 0; i < response.Data.CreatedShipment.ParcelData.Count(); i++) + { + createdLabels.Add(new RequestShippingLabelResponse() + { + CancelId = response.Data.CreatedShipment.ParcelData[i].TrackID, + ParcelNumber = response.Data.CreatedShipment.ParcelData[i].ParcelNumber, + Label = response.Data.CreatedShipment.PrintData[i].Data, + LabelType = GLSRequest.ServiceType == GLSServiceType.SHOPRETURN ? ShippingLabelType.SHOPRETURN : (request.IsExpress() ? ShippingLabelType.EXPRESS : ShippingLabelType.NORMAL), + Weight = request.GetPackageWeight() + }); + } + + return createdLabels; + + } + + public async Task CancelLabel(string cancelId, CancellationToken cancelToken = default) + { + RestResponse response = await CallApi( + new Uri(string.Format("https://shipit-wbm-{0}.gls-group.eu:443/backend/rs/shipments/cancel/{1}", providerSettings.ApiDomain, cancelId)), + Method.Post, + cancelId, + cancelToken + ); + + switch (response.Data.Result) + { + case "CANCELLED": + case "CANCELLATION_PENDING": + return ShippingCancelResult.CANCLED; + case "SCANNED": + return ShippingCancelResult.ALREADY_IN_USE; + default: + throw new GLSException(ShippingErrorCode.UNKNOW, "Unknow cancel reponse", new { payload = cancelId, respone = response.Data.Result }); + } + + } + + public async Task ValidateLabel(RequestShipmentBase request, CancellationToken cancelToken) + { + var GLSRequest = request as GLSShipmentRequestModel; + + var shipment = CreateRequestModel(GLSRequest); + + var requestBody = new ValidateShipmentRequestData() { Shipment = shipment }; + + RestResponse response = await CallApi( + new Uri(string.Format("https://shipit-wbm-{0}.gls-group.eu:443/backend/rs/shipments/validate", providerSettings.ApiDomain)), + Method.Post, + requestBody, + cancelToken + ); + + + if (response.Data.Success == true) return new ValidationReponse() { Success = true }; + + List reponseIssues = new List(); + Dictionary validationErrors = new Dictionary(); + + response.Data.ValidationResult?.Issues?.ForEach(x => validationErrors.Add(x.Rule ?? "", x)); + + foreach (KeyValuePair validationErrorKey in validationErrors) + { + switch (validationErrorKey.Key) + { + case "SHIPMENT_VALID_INCOTERM_IF_NEEDED": + reponseIssues.Add(new ValidationReponseIssue() { ErrorCode = ShippingErrorCode.GLS_INCOTERM_ERROR, Message = "Es wird ein gültiger Incoterm für die Sendung benötigt." }); + break; + case "ARTICLES_PRODUCT_MUST_BE_SET": + reponseIssues.Add(new ValidationReponseIssue() { ErrorCode = ShippingErrorCode.GLS_PRODUCT_CANNOT_USE_ERROR, Message = "GLS-Produkt kann für die Lieferadresse nicht angewandt werden." }); + break; + case "ARTICLES_EXPRESS_SATURDAY": + reponseIssues.Add(new ValidationReponseIssue() { ErrorCode = ShippingErrorCode.GLS_NEXT_DAY_NOT_SATURDAY_ERROR, Message = "Nächster Werktag ist nicht Samstag. Service kann heute nicht gebucht werden." }); + break; + case "SHIPMENT_VALID_ROUTING": + reponseIssues.Add(new ValidationReponseIssue() { ErrorCode = ShippingErrorCode.GLS_ROUTING_ERROR, Message = "Kein gültiges Routing mit GLS möglich: " + validationErrorKey.Value.Parameters[0] }); + break; + case "ADDRESS_VALID_ZIPCODE": + reponseIssues.Add(new ValidationReponseIssue() { ErrorCode = ShippingErrorCode.GLS_POSTCODE_ERROR, Message = "Keine gültige Postleitzahl vorhanden." }); + break; + case "ARTICLES_PRODUCT_WEIGHT": + reponseIssues.Add(new ValidationReponseIssue() { ErrorCode = ShippingErrorCode.GLS_WEIGHT_ERROR, Message = "Gewicht ist zu gering oder zu hoch für dieses Produkt." }); + break; + case "ARTICLE_COMBINATIONS": + reponseIssues.Add(new ValidationReponseIssue() { ErrorCode = ShippingErrorCode.GLS_ARTICLE_COMBINATIONS_ERROR, Message = "GLS-Produktkombination können nicht zusammen gebucht werden." }); + break; + case "ARTICLES_DESTINATION_EXCLUSIONS": + reponseIssues.Add(new ValidationReponseIssue() { ErrorCode = ShippingErrorCode.GLS_ARTICLE_DESTINATION_EXCLUSION_ERROR, Message = "GLS-Service und Produkt sind zur Lieferadresse nicht möglich" }); + break; + case "COMMON": + reponseIssues.Add(new ValidationReponseIssue() { ErrorCode = ShippingErrorCode.GLS_COMMON_ERROR, Message = $"GLS-Labeldruck einfacher Fehler aufgetreten: Location: {validationErrorKey.Value.Location} Message: {validationErrorKey.Value.Parameters[0]}" }); + break; + case "ARTICLES_VALID_FOR_COUNTRY": + reponseIssues.Add(new ValidationReponseIssue() { ErrorCode = ShippingErrorCode.GLS_ARTICLE_COMBINATIONS_ERROR, Message = $"Artikelkombination ist in diesem Land nicht verfügbar" }); + break; + default: + reponseIssues.Add(new ValidationReponseIssue() { ErrorCode = ShippingErrorCode.UNKNOW, Message = "GLS-Labeldruck nicht abgedeckter Fehler entdeckt: " + validationErrorKey.Key }); + break; + } + } + + return new ValidationReponse() { Success = true, ValidationIssues = reponseIssues }; + + } + + public async Task GetEstimatedDeliveryDays(RequestShipmentBase request, CancellationToken cancelToken) + { + + EstimatedDeliveryDaysAddress senderAddress = new EstimatedDeliveryDaysAddress() + { + City = accountSettings.City, + CountryCode = accountSettings.CountryIsoA2Code, + ZIPCode = accountSettings.PostCode, + Street = accountSettings.Street, + }; + senderAddress.Validate(); + + EstimatedDeliveryDaysAddress destinationAddress = new EstimatedDeliveryDaysAddress() + { + City = request.City, + CountryCode = request.Country, + ZIPCode = request.PostCode, + Street = request.Street, + StreetNumber = request.StreetNumber, + }; + destinationAddress.Validate(); + + var requestBody = new + { + Source = new + { + Address = senderAddress, + }, + Destination = new + { + Address = destinationAddress, + } + }; + + RestResponse response = await CallApi( + new Uri(string.Format("https://shipit-wbm-{0}.gls-group.eu:443/backend/rs/timeframe/deliverydays", providerSettings.ApiDomain)), + Method.Post, + requestBody, + cancelToken + ); + + return 0; + } + + + /// + /// Call GLS API and check HTTP Reponse + /// + /// + /// + /// + /// + /// + /// + private async Task> CallApi(Uri url, Method method, object body, CancellationToken cancelToken) + { + var clientOptions = new RestClientOptions(url) + { + RemoteCertificateValidationCallback = (sender, certificate, chain, sslPolicyErrors) => true, + Authenticator = new HttpBasicAuthenticator(providerSettings.Username, providerSettings.Password) + }; + + RestClient client = new RestClient(clientOptions); + + var clientRequest = new RestRequest() + { + Method = method + }; + + clientRequest.AddHeader("Content-Type", apiContentType); + clientRequest.AddHeader("Accept", apiContentType); + + string json = JsonConvert.SerializeObject(body, Formatting.Indented, new JsonSerializerSettings + { + NullValueHandling = NullValueHandling.Ignore, + }); + clientRequest.AddJsonBody(json, apiContentType); + + var response = await client.ExecuteAsync(clientRequest, cancelToken).ConfigureAwait(false); + + CheckHttpResponse(json, response); + + return response; + + } + + /// + /// Check the http reponse status + /// + /// + /// + /// + /// + private void CheckHttpResponse(object payload, RestResponse response) + { + if (response.StatusCode != System.Net.HttpStatusCode.OK) + { + //var glsErrorCode = response.Headers?.ToList().FirstOrDefault(x => x.Name != null && x.Name.Equals("error"))?.Value?.ToString() ?? "Unknow"; + var message = response.Headers?.ToList().FirstOrDefault(x => x.Name != null && x.Name.Equals("message"))?.Value?.ToString() ?? "Unknow"; + + ShippingErrorCode errorCode = ShippingErrorCode.UNKNOW; + + if (response.StatusCode == System.Net.HttpStatusCode.BadRequest) + { + errorCode = ShippingErrorCode.BAD_REQUEST_ERROR; + } + else if (response.StatusCode == System.Net.HttpStatusCode.Unauthorized) + { + errorCode = ShippingErrorCode.UNAUTHORIZED; + } + else if (response.StatusCode == System.Net.HttpStatusCode.InternalServerError) + { + errorCode = ShippingErrorCode.INTERNAL_SERVER_ERROR; + } + else + { + throw new GLSException(ShippingErrorCode.UNKNOW, response.ErrorMessage + "<------>" + response.Content, payload); + } + + throw new GLSException(errorCode, message, payload); + } + + if (response.Data == null) throw new GLSException(ShippingErrorCode.UNKNOW, "No Data available in response", payload); + } + + /// + /// Create the GLS request body informations + /// + /// + /// + private Shipment CreateRequestModel(GLSShipmentRequestModel request) + { + + float packageWeight = request.GetPackageWeight(); + + List units = new List(); + + List shipmentUnitReference = new List(); + + if (!String.IsNullOrEmpty(request.AmazonOrderId)) + { + shipmentUnitReference.Add(request.AmazonOrderId); + } + + if (!String.IsNullOrEmpty(request.InvoiceReference)) + { + shipmentUnitReference.Add("INr: " + request.InvoiceReference); + } + + if (!String.IsNullOrEmpty(request.CustomerReference)) + { + shipmentUnitReference.Add("KNr: " + request.CustomerReference); + } + + // Create shipment units + for (int i = 0; i < request.LabelCount; i++) + { + units.Add(new ShipmentUnit() + { + Weight = Convert.ToDecimal(packageWeight), + Note1 = request.Note1 ?? "", + Note2 = request.Note2 ?? "", + ShipmentUnitReference = shipmentUnitReference.ToArray(), + }); + } + + string? incotermCode = request.IncotermCode == null || request.IncotermCode != null && request.IncotermCode == 0 ? null : request.IncotermCode.ToString(); + + // Create shipment + Shipment shipment = new Shipment() + { + IncotermCode = incotermCode, + ShippingDate = request.EarliestDeliveryDate.ToString("yyyy-MM-dd"), + Product = request.ServiceProduct, + Consignee = new Consignee() + { + Address = new Address() + { + Name1 = request.Adressline1, + Name2 = request.Adressline2, + Name3 = request.Adressline3, + CountryCode = request.Country, + ZIPCode = request.PostCode, + City = request.City, + Street = request.Street, + StreetNumber = request.StreetNumber ?? "-", + EMail = (request.WithEmailNotification || !String.IsNullOrEmpty(request.AmazonOrderId)) ? request.EMail : null, + MobilePhoneNumber = request.Phone, + } + }, + + Shipper = new Shipper() + { + ContactID = providerSettings.ContactID, + AlternativeShipperAddress = null + }, + + ShipmentUnit = units.ToArray(), + Service = ResolveGLSShipmentService(request), + }; + + + return shipment; + + } + + /// + /// Build GLS shipping service + /// + /// + /// + private ShipmentService[]? ResolveGLSShipmentService(GLSShipmentRequestModel request) + { + if (request.ServiceType == GLSServiceType.NONE) return null; + + ShipmentService service = new ShipmentService(); + + switch (request.ServiceType) + { + case GLSServiceType.DEPOSIT: + service.Deposit = new DepositService() { PlaceOfDeposit = request.PlaceOfDeposit ?? "" }; + break; + case GLSServiceType.G24: + service.Service = new Guaranteed24Service(); + break; + case GLSServiceType.G8: + service.Service = new Service0800(); + break; + case GLSServiceType.G9: + service.Service = new Service0900(); + break; + case GLSServiceType.G10: + service.Service = new Service1000(); + break; + case GLSServiceType.G12: + service.Service = new Service1200(); + break; + case GLSServiceType.GSATURDAY10: + service.Service = new Saturday1000Service(); + break; + case GLSServiceType.GSATURDAY12: + service.Service = new Saturday1200Service(); + break; + case GLSServiceType.SHOPRETURN: + service.ShopReturn = new ShopReturnService() { NumberOfLabels = request.LabelCount }; + break; + default: + break; + } + + return new ShipmentService[] { service }; + } + + } +} diff --git a/ShippingProAPICollection/Provider/IShippingProviderService.cs b/ShippingProAPICollection/Provider/IShippingProviderService.cs new file mode 100644 index 0000000..071b88b --- /dev/null +++ b/ShippingProAPICollection/Provider/IShippingProviderService.cs @@ -0,0 +1,44 @@ +using ShippingProAPICollection.Models; +using ShippingProAPICollection.Models.Entities; +using ShippingProAPICollection.Provider.GLS.Entities.Validation; + +namespace ShippingProAPICollection.Provider +{ + public interface IShippingProviderService + { + /// + /// Erstellen ein Versandlabels | + /// Create shipping label + /// + /// + /// + /// + public Task> RequestLabel(RequestShipmentBase request, CancellationToken cancelToken); + + /// + /// Stornieren eines Versandlabels mit der Stornierungsnummer | + /// Cancel shipping label + /// + /// + /// + /// + public Task CancelLabel(string cancelId, CancellationToken cancelToken); + + /// + /// Prüfe einen Versandlabel request | + /// Validate a shippint label request + /// + /// + /// + public Task ValidateLabel(RequestShipmentBase request, CancellationToken cancelToken); + + /// + /// Prüfe wieviel Tage bis zur Auflieferung benötigt werden + /// This operation estimates the days needed to deliver a shipment unit from the given origin address to the given destination address. + /// + /// + /// + /// + public Task GetEstimatedDeliveryDays(RequestShipmentBase request, CancellationToken cancelToken); + } +} diff --git a/ShippingProAPICollection/Provider/ProviderSettings.cs b/ShippingProAPICollection/Provider/ProviderSettings.cs new file mode 100644 index 0000000..1a8bd58 --- /dev/null +++ b/ShippingProAPICollection/Provider/ProviderSettings.cs @@ -0,0 +1,10 @@ +namespace ShippingProAPICollection.Provider +{ + public class ProviderSettings + { + /// + /// Varianttype of the settings + /// + public string ContractID { get; set; } = null!; + } +} diff --git a/ShippingProAPICollection/Provider/RequestShipmentBase.cs b/ShippingProAPICollection/Provider/RequestShipmentBase.cs new file mode 100644 index 0000000..c28b730 --- /dev/null +++ b/ShippingProAPICollection/Provider/RequestShipmentBase.cs @@ -0,0 +1,188 @@ +using JsonSubTypes; +using Newtonsoft.Json; +using System.ComponentModel.DataAnnotations; +using ShippingProAPICollection.Models.Error; +using ShippingProAPICollection.Provider.DHL; +using ShippingProAPICollection.Provider.DPD; +using ShippingProAPICollection.Provider.GLS; + +namespace ShippingProAPICollection.Provider +{ + [JsonConverter(typeof(JsonSubtypes), nameof(ProviderType))] + [JsonSubtypes.KnownSubType(typeof(GLSShipmentRequestModel), "GLS")] + [JsonSubtypes.KnownSubType(typeof(DPDShipmentRequestModel), "DPD")] + [JsonSubtypes.KnownSubType(typeof(DHLShipmentRequestModel), "DHL")] + public abstract class RequestShipmentBase + { + public abstract string ProviderType { get; } + public abstract float MaxPackageWeight { get; } + + public RequestShipmentBase(string contractID) + { + ContractID = contractID; + } + + /// + /// Typ des Versandanbieters | + /// Type of the shipping provider + /// + public string ContractID { get; } + + /// + /// Datum wann das Paket frühestens geliefert werden soll | + /// Earliest delivery date for the package + /// + public DateTime EarliestDeliveryDate { get; set; } = DateTime.Now; + + /// + /// Adresszeile 1 des Empfängers | + /// First address line of reciever + /// + /// Alfa GmbH + [Required] + public required string Adressline1 { get; set; } + + /// + /// Adresszeile 2 des Empfängers | + /// Second address line of reciever + /// + /// Kevin Venclovas + public string? Adressline2 { get; set; } + + /// + /// Adresszeile 3 des Empfängers | + /// Third address line of reciever + /// + /// PO - IT + public string? Adressline3 { get; set; } + + /// + /// Länder Isocode A2 des Empfängers | + /// Country code in IDOA2 format + /// + /// DE + [Required] + public required string Country { get; set; } + + /// + /// Postleitzahl des Empfängers | + /// Postcode of reciever address + /// + /// 73479 + [Required] + public required string PostCode { get; set; } + + /// + /// Stadt des Empfängers | + /// city of reciever address + /// + /// Ellwangen + [Required] + public required string City { get; set; } + + /// + /// Straße des Empfängers | + /// street of reciever address + /// + /// Ferdinand-Porsche-Str. + [Required] + public required string Street { get; set; } + + /// + /// Hausnummer des Empfängers. Hausnummer kann auch '-' sein wenn Hausnummer und Straße in Feld Straße nicht getrennt werden können | + /// Street number of reciever address. Street number can also be '-' when field street contains the streetnumber + /// + /// 10 + public string? StreetNumber { get; set; } + + /// + /// E-Mail des Empfängers | + /// EMail of reciever + /// + /// 10 + public string? EMail { get; set; } + + /// + /// Gewicht der gesamten Fracht in KG | + /// Weight of the total freight in KG + /// + /// 5 + [Required] + public required float Weight { get; set; } + + /// + /// Auf wieviele Label soll die Fracht aufgeteilt werden? | + /// How many labels + /// + /// 1 + [Range(1, 99)] + [Required] + public required uint LabelCount { get; set; } + + /// + /// Kundennummer falls vorhanden | + /// Customernumber if available + /// + /// 1256872 + public string? CustomerReference { get; set; } + + /// + /// Rechnungsnummer falls vorhanden | + /// Invoice reference if available + /// + /// V.RE.123456 + public string? InvoiceReference { get; set; } + + /// + /// Telefonnummer | + /// Phone numer of reciever + /// + /// 07961 / 5799-0 + public string? Phone { get; set; } + + /// + /// IncotermCode wie die Ware am Zoll angemeldet wird | + /// Incoterm for the customs clearance + /// + /// 10,20,30 + public int? IncotermCode { get; set; } + + /// + /// Notiz 1 auf dem Label | + /// Note 1 printed on the label + /// + /// Ware auf den Briefkasten + public string? Note1 { get; set; } + + + public virtual void Validate() + { + if (LabelCount <= 0) throw new ShipmentRequestLabelCountException(LabelCount); + if (Country.Length != 2) throw new ShipmentRequestNoValidStringLengthException("Country", 2, 2); + + if (Weight <= 0) throw new ShipmentRequestWeightException(1, MaxPackageWeight, 0); + if (LabelCount == 1 && Weight > MaxPackageWeight) throw new ShipmentRequestWeightException(1, MaxPackageWeight, Weight); + if (Weight / LabelCount > MaxPackageWeight) throw new ShipmentRequestWeightException(1, MaxPackageWeight, Weight / LabelCount); + } + + /// + /// Get the single package weight of the request + /// + /// + public virtual float GetPackageWeight() + { + float packageWeight = Weight / LabelCount; + return (float)Math.Round(packageWeight, 2); + } + + /// + /// Is the booked service express shipping variant + /// + /// + /// + internal virtual bool IsExpress() + { + throw new NotImplementedException(); + } + } +} diff --git a/ShippingProAPICollection/Resources/DHLClient.yaml b/ShippingProAPICollection/Resources/DHLClient.yaml new file mode 100644 index 0000000..116f5b0 --- /dev/null +++ b/ShippingProAPICollection/Resources/DHLClient.yaml @@ -0,0 +1,2162 @@ +openapi: 3.0.1 +info: + title: Parcel DE Shipping API (Post & Parcel Germany) + description: > + Note: This is the specification of the DPDHL Group Parcel DE Shipping API for Post & Parcel Germany. This REST web service allows business customers to create shipping labels on demand. + version: 2.1.8 +servers: + - url: https://api-eu.dhl.com/parcel/de/shipping/v2 + description: Productive Server + - url: https://api-sandbox.dhl.com/parcel/de/shipping/v2 + description: Sandbox Server + +paths: + /: + get: + tags: + - General + summary: Return API version + description: > + Returns the current version of the API as major.minor.patch. Furthermore, it will also return more details (semantic version number, revision, environment) of the API layer. + operationId: rootGet + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ServiceInformation' + '401': + $ref: '#/components/responses/Unauthorized' + '429': + $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/InternalServerError' + /labels: + get: + tags: + - Shipments and Labels + summary: Download PDF document + description: > + Public download URL for shipment labels and documents. The URL is provided in the response of the POST /orders or GET /orders resources. The document is identified via the token query parameter. There is no additional authorization, the resource URL can be shared. Please protect the URL as needed. The call returns a PDF label. + operationId: getLabel + parameters: + - name: token + in: query + description: Identifies PDF document and requested print settings for download. + required: true + schema: + type: string + responses: + '200': + description: OK + content: + application/pdf: + schema: + $ref: '#/components/schemas/LabelDataResponse' + application/json: + schema: + $ref: '#/components/schemas/LabelDataResponse' + '404': + $ref: '#/components/responses/Unauthorized' + '429': + $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/InternalServerError' + /manifests: + get: + tags: + - Manifests + summary: Retrieve daily manifest document + description: Return the manifest document for the specific date (abbreviated ISO8601 format YYYY-MM-DD). If no date is provided, the manifest for today will be returned. The manifest PDF document will list the shipments for your EKP, separated by billing numbers. Potentially, the document is large and response time will reflect this.
Additionally, the response contains a mapping of billing numbers to sheet numbers of the manifest and a mapping of shipment numbers to sheet numbers.
The call can be repeated as often as needed. Should a date be provided which is too old or lies within the future, HTTP 400 is returned. + operationId: getManifests + security: + - ApiKey: [] + - BasicAuth: [] + parameters: + - name: billingNumber + in: query + description: Customer billingNumber number. + required: false + schema: + type: string + - name: date + in: query + schema: + type: string + - name: includeDocs + in: query + description: |- + Legacy name **labelResponseType**. Shipping labels and further shipment documents can be: + * __include__: included as base64 encoded data in the response (default) + * __URL__: provided as URL reference. + Default is include the base64 encoded labels. + schema: + type: string + enum: + - include + - URL + default: include + - name: Accept-Language + in: header + description: Control the APIs response language via locale abbreviation. English (en-US) and german (de-DE) are supported. If not specified, the default is english. + schema: + type: string + example: de-DE + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/SingleManifestResponse' + application/problem+json: + schema: + $ref: '#/components/schemas/SingleManifestResponse' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '404': + $ref: '#/components/responses/NotFound' + '429': + $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/InternalServerError' + post: + tags: + - Manifests + summary: Mark shipments as being ready for shipping + description: |- + Shipments are normally ''closed out'' at a fixed time of the day (such as 6 pm, configured by EKP/account) for the date provided as shipDate in the create call. +
This call allows forcing the closeout for sets of shipments earlier. This will also override the original shipDate. Afterwards, the shipment cannot be changed and the shipment labels cannot be queried anymore (however they may remain cached for limited duration). + Calling closeout repeatedly for the same shipments will result in HTTP 400 for the second call. HTTP 400 will also be returned if the automatic closeout happened prior to the call. It is however possible to add new shipments, they will be manifested as well and be part of the day's manifest. +
Note on billing: The manifesting step has billing implications. Some products (Warenpost, Parcel International partially) are billed based on the shipment data available to DHL at the end of the day. All other products (including DHL Paket Standard) are billed based on production data. For more details, please contact your account representative. + + #### Request + It's changing the status of the shipment, so parameters are provided in the body. + * ''profile'' attribute - defines the user group profile. A user group is permitted to specific billing numbers. Shipments are only closed out if they belong to a billing number that the user group profile is entitled to use. This attribute is mandatory. Please use the standard user group profile ''STANDARD_GRUPPENPROFIL'' if no dedicated user group profile is available. + * ''billingNumber'' attribute - defines the billing number for which shipments shall be closed out. If a billing number is set, then only the shipments of that billing number are closed out. In that case no list of specific shipment numbers needs to be passed. + * ''shipmentNumbers'' attribute - lists the specific shipping numbers of the shipments that shall be closed out. + If all shipments shall be closed, the query parameter ''all'' needs to be set to ''true''. In that case neither a billing number nor a list of shipment numbers need to be passed in the request body. + + #### Response + * Closing status for each shipment + operationId: manifestsPost + security: + - ApiKey: [] + - BasicAuth: [] + parameters: + - name: Accept-Language + in: header + description: Control the APIs response language via locale abbreviation. English (en-US) and german (de-DE) are supported. If not specified, the default is english. + schema: + type: string + example: de-DE + - name: all + in: query + description: Specify if all applicable shipments shall be marked as being ready for shipping. + schema: + type: boolean + default: false + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ShipmentManifestingRequest' + required: true + responses: + '207': + description: Response for manifesting request taking multiple input elements + content: + application/json: + schema: + $ref: '#/components/schemas/MultipleManifestResponse' + application/problem+json: + schema: + $ref: '#/components/schemas/MultipleManifestResponse' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '429': + $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/InternalServerError' + /orders: + get: + tags: + - Shipments and Labels + summary: Retrieve shipment documents - labels and customs documents + description: |- + Returns documents for existing shipment(s). The call accepts multiple shipment numbers and will provide sets of documents for those. The **format (PDF,ZPL)** and **method of delivery (URL, encoded, data)** can be selected for **all** shipments and labels in that call. You cannot chose one format and delivery method for one label and different for another label within the same call. You can also specify if you want regular labels, return labels, cod labels, or customsDoc. Any combination is possible. + + The call returns for each shipment number the status indicator and the selected labels and documents. If a label type (for example a cod label) does not exist for a shipment, it will not be returned. This is not an error. If you were sending multiple shipments, you will get an HTTP 207 response (multistatus) with detailed status for each shipment. Other standard HTTP response codes (200, 400, 401, 429, 500) are possible as well. Labels can be either provided as part of the response (base64 encoded for PDF, text for ZPL) or via URL link for view and download (PDF). Note that the format settings per query parameters apply to the shipping label. Retoure label paper type can be specified separately since a different printer may be used here. If requesting labels to be returned as URL for separate download, the URLs provided can be shared. + operationId: getOrder + security: + - ApiKey: [] + - BasicAuth: [] + parameters: + - name: shipment + in: query + description: This parameter identifies shipments. The parameter can be used multiple times in one request to get the labels and/or documents for up to 30 shipments maximum. Only documents and label for shipments that are not yet closed can be retrieved. + required: true + schema: + type: array + items: + type: string + - name: Accept-Language + in: header + description: Control the APIs response language via locale abbreviation. English (en-US) and german (de-DE) are supported. If not specified, the default is english. + schema: + type: string + example: de-DE + - name: docFormat + in: query + description: '**Defines** the **printable** document format to be used for label and manifest documents.' + schema: + type: string + enum: + - ZPL2 + - PDF + default: PDF + - name: printFormat + in: query + description: "**Defines** the print medium for the shipping label. The different option vary from standard papersizes DIN A4 and DIN A5 to specific label print formats.\_\n\nSpecific laser print formats using DIN A5 blanks are:\n\n* 910-300-600(-oz) (105 x 205mm)\n* 910-300-300(-oz) (105 x 148mm)\n\nSpecific laser print formats **not** using a DIN A5 blank:\n\n* 910-300-610 (105 x 208mm)\n* 100x70mm\n\nSpecific thermal print formats:\n\n* 910-300-600 (103 x 199mm)\n* 910-300-400 (103 x 150mm)\n* 100x70mm\n\nPlease use the different formats as follows. If you do not set the parameter the settings of DHL costumer portal account will be used as default." + schema: + type: string + enum: + - A4 + - 910-300-600 + - 910-300-610 + - 910-300-700 + - 910-300-700-oz + - 910-300-710 + - 910-300-300 + - 910-300-300-oz + - 910-300-400 + - 910-300-410 + - 100x70mm + - name: retourePrintFormat + in: query + description: "**Defines** the print medium for the return shipping label. This parameter is only usable, if you do not use **combined printing**. The different option vary from standard papersizes DIN A4 and DIN A5 to specific label print formats.\_\n\nSpecific laser print formats using DIN A5 blanks are:\n\n* 910-300-600(-oz) (105 x 205mm)\n* 910-300-300(-oz) (105 x 148mm)\n\nSpecific laser print formats **not** using a DIN A5 blank:\n\n* 910-300-610 (105 x 208mm)\n* 100x70mm\n\nSpecific thermal print formats:\n\n* 910-300-600 (103 x 199mm)\n* 910-300-400 (103 x 150mm)\n* 100x70mm\n\nPlease use the different formats as follows. If you do not set the parameter the settings of DHL costumer portal account will be used as default." + schema: + type: string + enum: + - A4 + - 910-300-600 + - 910-300-610 + - 910-300-700 + - 910-300-700-oz + - 910-300-710 + - 910-300-300 + - 910-300-300-oz + - 910-300-400 + - 910-300-410 + - 100x70mm + - name: includeDocs + in: query + description: |- + Legacy name **labelResponseType**. Shipping labels and further shipment documents can be: + * __include__: included as base64 encoded data in the response (default) + * __URL__: provided as URL reference. + Default is include the base64 encoded labels. + schema: + type: string + enum: + - include + - URL + default: include + - name: combine + in: query + description: If set, label and return label for one shipment will be printed as single PDF document with possibly multiple pages. Else, those two labels come as separate documents. The option does not affect customs documents and COD labels. + schema: + type: boolean + default: true + responses: + '200': + description: Success response for requests with a single shipment. + content: + application/json: + schema: + $ref: '#/components/schemas/LabelDataResponse' + '207': + description: Response for requests taking multiple input elements + content: + application/json: + schema: + $ref: '#/components/schemas/LabelDataResponse' + application/problem+json: + schema: + $ref: '#/components/schemas/LabelDataResponse' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '404': + $ref: '#/components/responses/NotFound' + '429': + $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/InternalServerError' + post: + tags: + - Shipments and Labels + summary: 'Create one or more shipments and their documents. (This is the primary call of the API.)' + description: |- + This request is used to create one or more shipments and return corresponding shipment tracking numbers, labels, and documentation. Up to 30 shipments can be created in a single call. + #### Request + The selected products and corresponding billing numbers, as well as the desired services and package details are required to create a shipment. Each shipment can have a dedicated shipper address. The example request body contains sample values for most services. + #### Response + The request will return shipment tracking numbers and the applicable labels for each shipment. If multiple shipments have been included, an HTTP 207 response (multistatus) is returned and holds detailed status for each shipment. Other standard HTTP response codes (401, 500, 400, 200, 429) are possible, too. Labels can be either provided as part of the response (base64 encoded for PDF, text for ZPL) or via URL link for view and download. Note that the format settings per query parameters apply to the shipping label. It may also apply to other labels included, depending on the configuration of your account. Label paper for return shipments can be specified separately since a different printer may be used here. If requesting labels to be provided as URL for separate download, the URLs can be shared. + #### Validation + It is recommended to validate the request first prior to shipment creation by setting the `validate` query parameter to `true`. Especially, during development and test, it is recommended to perform this validation. This functionality supports both + * JSON schema validation (against this API description). During development and test, it is recommended to do this validation. JSON schema is available for local validation + * Dry run against the DHL backend + + If this succeeds, actual shipment creation will also succeed. + operationId: createOrders + security: + - ApiKey: [] + - BasicAuth: [] + parameters: + - name: Accept-Language + in: header + description: Control the APIs response language via locale abbreviation. English (en-US) and german (de-DE) are supported. If not specified, the default is english. + schema: + type: string + example: de-DE + - name: validate + in: query + description: |- + If provided and set to `true`, the input document will be: + * validated against JSON schema (/orders/ endpoint) at the API layer. In case of errors, HTTP 400 and details will be returned. + * validated against the DHL backend. + + In that case, no state changes are happening, no data is stored, shipments neither deleted nor created, no labels being returned. The call will return a status (200, 400) for each shipment element. + schema: + type: boolean + default: false + - name: mustEncode + in: query + description: Legacy name **printOnlyIfCodable**. If set to *true*, labels will only be created if an address is encodable. This is only relevant for German consignee addresses. If set to false or left out, addresses, that are not encodable will be printed even though you receive a warning. + schema: + type: boolean + default: false + - name: includeDocs + in: query + description: |- + Legacy name **labelResponseType**. Shipping labels and further shipment documents can be: + * __include__: included as base64 encoded data in the response (default) + * __URL__: provided as URL reference. + schema: + type: string + enum: + - include + - URL + default: include + - name: docFormat + in: query + description: |- + **Defines** the **printable** document format to be used for label and manifest documents. + schema: + type: string + enum: + - ZPL2 + - PDF + default: PDF + - name: printFormat + in: query + description: |- + **Defines** the print medium for the shipping label. The different option vary from standard paper sizes DIN A4 and DIN A5 to specific label print formats. + + Specific laser print formats using DIN A5 blanks are: + * 910-300-600(-oz) (105 x 205mm) + * 910-300-300(-oz) (105 x 148mm) + + Specific laser print formats **not** using a DIN A5 blank: + * 910-300-610 (105 x 208mm) + * 100x70mm + + Specific thermal print formats: + * 910-300-600 (103 x 199mm) + * 910-300-400 (103 x 150mm) + * 100x70mm + + Please use the different formats as follows. If you do not set the parameter the settings of DHL costumer portal account will be used as default. + schema: + type: string + enum: + - A4 + - 910-300-600 + - 910-300-610 + - 910-300-700 + - 910-300-700-oz + - 910-300-710 + - 910-300-300 + - 910-300-300-oz + - 910-300-400 + - 910-300-410 + - 100x70mm + - name: retourePrintFormat + in: query + description: |- + **Defines** the print medium for the return shipping label. This parameter is only usable, if you do not use **combined printing**. The different option vary from standard paper sizes DIN A4 and DIN A5 to specific label print formats. + + Specific laser print formats using DIN A5 blanks are: + * 910-300-600(-oz) (105 x 205mm) + * 910-300-300(-oz) (105 x 148mm) + + Specific laser print formats **not** using a DIN A5 blank: + * 910-300-610 (105 x 208mm) + * 100x70mm + + Specific thermal print formats: + * 910-300-600 (103 x 199mm) + * 910-300-400 (103 x 150mm) + * 100x70mm + + Please use the different formats as follows. If you do not set the parameter the settings of DHL costumer portal account will be used as default. + schema: + type: string + enum: + - A4 + - 910-300-600 + - 910-300-610 + - 910-300-700 + - 910-300-700-oz + - 910-300-710 + - 910-300-300 + - 910-300-300-oz + - 910-300-400 + - 910-300-410 + - 100x70mm + - name: combine + in: query + description: If set, label and return label for one shipment will be printed as single PDF document with possibly multiple pages. Else, those two labels come as separate documents. The option does not affect customs documents and COD labels. + schema: + type: boolean + default: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ShipmentOrderRequest' + examples: + DHLPaket: + $ref: '#/components/examples/DHLPaket' + DHLPaketInternational: + $ref: '#/components/examples/DHLPaketInternational' + DHLPaketInternationalWithCustoms: + $ref: '#/components/examples/DHLPaketInternationalWithCustoms' + required: true + responses: + '200': + description: Success response for requests with a single shipment. + content: + application/json: + schema: + $ref: '#/components/schemas/LabelDataResponse' + application/problem+json: + schema: + $ref: '#/components/schemas/LabelDataResponse' + '207': + description: Response for requests taking multiple input elements + content: + application/json: + schema: + $ref: '#/components/schemas/LabelDataResponse' + application/problem+json: + schema: + $ref: '#/components/schemas/LabelDataResponse' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '429': + $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/InternalServerError' + delete: + tags: + - Shipments and Labels + summary: Delete one or more shipments + description: 'Delete one or more shipments created earlier. Deletion of shipments is only possible prior to them being manifested (closed out, ''Tagesabschluss''). The call will return HTTP 200 (single shipment) or 207 on success, with individual status elements for each shipment. Individual status elements are HTTP 200, 400. 400 will be returned when shipment does not exist (or was already deleted).' + operationId: ordersAccountDelete + security: + - ApiKey: [] + - BasicAuth: [] + parameters: + - name: Accept-Language + in: header + description: Control the APIs response language via locale abbreviation. English (en-US) and german (de-DE) are supported. If not specified, the default is english. + schema: + type: string + example: de-DE + - name: profile + in: query + required: true + description: 'Defines the user group profile. A user group is permitted to specific billing numbers. Shipments are only canceled if they belong to a billing number that the user group profile is entitled to use. This attribute is mandatory. Please use the standard user group profile ''STANDARD_GRUPPENPROFIL'' if no dedicated user group profile is available.' + schema: + type: string + example: 'STANDARD_GRUPPENPROFIL' + - name: shipment + required: true + in: query + description: Shipment number that shall be canceled. If multiple shipments shall be canceled, the parameter must be added multiple times. Up to 30 shipments can be canceled at once. + schema: + type: string + example: '123456789' + responses: + '200': + description: Response for requests with a single element + content: + application/json: + schema: + $ref: '#/components/schemas/LabelDataResponse' + application/problem+json: + schema: + $ref: '#/components/schemas/LabelDataResponse' + '207': + description: Response for requests taking multiple input elements + content: + application/json: + schema: + $ref: '#/components/schemas/LabelDataResponse' + application/problem+json: + schema: + $ref: '#/components/schemas/LabelDataResponse' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '429': + $ref: '#/components/responses/TooManyRequests' + '500': + $ref: '#/components/responses/InternalServerError' +components: + schemas: + ServiceInformation: + type: object + description: Response for the API version endpoint detailing version information. + properties: + amp: + type: object + properties: + name: + type: string + description: name of api + example: pp-parcel-shipping-native + env: + type: string + description: environment + example: sandbox + version: + type: string + description: version of api + example: v2.0.4 + rev: + type: string + description: revision + example: 22 + backend: + type: object + properties: + env: + type: string + description: environment + example: sandbox + version: + type: string + description: version of backend + example: v2.1.0 + + Document: + type: object + properties: + b64: + type: string + description: The Base64 encoded byte stream + zpl2: + type: string + description: The document in zpl encoding + url: + type: string + description: URL reference to download document + example: www.dhl.de/download/myobscurelink?label.png + fileFormat: + type: string + description: format of the encoded bytes + example: PDF + enum: + - ZPL2 + - PDF + printFormat: + type: string + description: The print format used. Customs documents cash on delivery documents can only be returned in format A4. + example: 910-300-700 + enum: + - A4 + - A4-PT + - 910-300-600 + - 910-300-610 + - 910-300-700 + - 910-300-700-oz + - 910-300-710 + - 910-300-300 + - 910-300-300-oz + - 910-300-400 + - 910-300-410 + - 100x70mm + description: 'Encoded document. All types of labels and documents.' + RequestStatus: + type: object + description: General status description for the attached response or response item. + required: + - statusCode + - title + properties: + title: + type: string + example: ok + statusCode: + description: The status code of the response. Usually, but not necessarliy the HTTP status code. + type: integer + format: int32 + example: 200 + instance: + type: string + description: A URI reference that identifies the specific occurrence of the problem. + detail: + maxLength: 80 + minLength: 0 + type: string + example: The Webservice call ran successfully. + LabelDataResponse: + type: object + properties: + status: + $ref: '#/components/schemas/RequestStatus' + items: + type: array + description: For consistency, response is a single element array. + example: + - shipmentNo: 340434310428091700 + sstatus: + title: OK + status: 200 + label: + url: https://api-dev.dhl.com/parcel/de/shipping/v1-feature-order-endpoint/labels?token=x5xzrHE7ctmqPqk33k%2BKkBwbvIfYP4elMQsBFM%2BJOdiT2bmoaXXzris%2Ftz9jBtdVFLY5cCENit0Jnd9aXuxoNEXhP9PQ8tAVdPeXD26RZ6JZqF5NCJlrihrAv1%2FAOzuDPqWJLRVaRq461BpT4bcbzChAAHVg%2FHUaQAkeIkaZ8NqfcxWEQzK1AYJWczpy6sv6 + format: PDF + items: + $ref: '#/components/schemas/ResponseItem' + ResponseItem: + required: + - sstatus + type: object + properties: + shipmentNo: + maxLength: 50 + minLength: 0 + type: string + returnShipmentNo: + maxLength: 50 + minLength: 0 + type: string + sstatus: + $ref: '#/components/schemas/RequestStatus' + shipmentRefNo: + maxLength: 50 + minLength: 6 + type: string + label: + $ref: '#/components/schemas/Document' + returnLabel: + $ref: '#/components/schemas/Document' + customsDoc: + $ref: '#/components/schemas/Document' + codLabel: + $ref: '#/components/schemas/Document' + validationMessages: + type: array + description: Optional validation messages attached to the shipment. + items: + $ref: '#/components/schemas/ValidationMessageItem' + description: Response for a single shipment containing status, numbers and labels + example: + - shipmentNo: 340434310428091700 + sstatus: + title: OK + status: 200 + label: + url: https://api-dev.dhl.com/parcel/de/shipping/v1-feature-order-endpoint/labels?token=x5xzrHE7ctmqPqk33k%2BKkBwbvIfYP4elMQsBFM%2BJOdiT2bmoaXXzris%2Ftz9jBtdVFLY5cCENit0Jnd9aXuxoNEXhP9PQ8tAVdPeXD26RZ6JZqF5NCJlrihrAv1%2FAOzuDPqWJLRVaRq461BpT4bcbzChAAHVg%2FHUaQAkeIkaZ8NqfcxWEQzK1AYJWczpy6sv6 + format: PDF + ValidationMessageItem: + type: object + properties: + property: + type: string + description: The property that is affected by the validation message. + example: dimension.weight + validationMessage: + type: string + description: The validation message describing the error. + example: The weight is too high + validationState: + type: string + description: The validation state resulting from the error. + example: Error + description: Representation of a validation message of a shipment container containing the most important information. + GetManifestData: + type: object + properties: + b64: + type: array + description: The encoded byte stream + items: + type: string + description: The encoded byte stream + format: byte + zpl2: + type: string + description: The document in zpl encoding + url: + type: string + description: URL reference to download document + example: www.dhl.de/download/myobscurelink?label.png + fileFormat: + type: string + description: format of the encoded bytes + example: PDF + enum: + - ZPL2 + - PDF + printFormat: + type: string + description: The print format used + example: 910-300-700 + enum: + - A4 + - 910-300-600 + - 910-300-610 + - 910-300-700 + - 910-300-700-oz + - 910-300-710 + - 910-300-300 + - 910-300-300-oz + - 910-300-400 + - 910-300-410 + - 100x70mm + SingleManifestResponse: + type: object + properties: + status: + $ref: '#/components/schemas/RequestStatus' + manifestDate: + type: string + manifest: + $ref: '#/components/schemas/GetManifestData' + MultipleManifestResponse: + type: object + properties: + status: + $ref: '#/components/schemas/RequestStatus' + items: + type: array + items: + $ref: '#/components/schemas/ShortResponseItem' + description: Response of the POST /manifests endpoint containing an overall request status and detailed shipment status. + ShortResponseItem: + required: + - sstatus + type: object + properties: + shipmentNo: + maxLength: 50 + minLength: 0 + type: string + example: '340434310428091700' + sstatus: + $ref: '#/components/schemas/RequestStatus' + description: Response for a single shipment element not containing labels. + ShipmentManifestingRequest: + required: + - profile + type: object + properties: + profile: + maxLength: 35 + minLength: 0 + type: string + shipmentNumbers: + maxItems: 30 + minItems: 1 + type: array + description: List of shipment IDs for manifesting. + items: + type: string + billingNumber: + type: string + description: Customer billingNumber number. + description: List of shipments which shall be manifested. + BankAccount: + required: + - accountHolder + - iban + type: object + properties: + accountHolder: + maxLength: 80 + minLength: 0 + type: string + example: John D. Rockefeller + bankName: + maxLength: 80 + minLength: 0 + type: string + example: The Iron Bank, Braavos + iban: + pattern: '[A-Z]{2,2}[0-9]{2,2}[a-zA-Z0-9]{1,30}' + type: string + example: DE02100100100006820101 + bic: + pattern: '[a-zA-Z0-9]{8,11}' + type: string + example: DEUTDEFFXXX + description: Bank account data used for CoD (Cash on Delivery). + Commodity: + required: + - itemDescription + - itemValue + - itemWeight + - packagedQuantity + type: object + properties: + itemDescription: + maxLength: 256 + minLength: 1 + type: string + example: T-Shirt Boys size 164 yellow + description: A text that describes the commodity item. Only the first 50 characters of the description text is printed on the customs declaration form CN23. + countryOfOrigin: + $ref: '#/components/schemas/Country' + description: A valid country code consisting of three characters according to ISO 3166-1 alpha-3. + hsCode: + maxLength: 11 + minLength: 6 + type: string + description: Harmonized System Code aka Customs tariff number. + example: '61099090' + packagedQuantity: + type: integer + description: How many items of that type are in the package + format: int32 + example: 1 + itemValue: + $ref: '#/components/schemas/Value' + itemWeight: + $ref: '#/components/schemas/Weight' + description: |- + Commodity line item (e.g. a t-shirt) for international shipments which require individual listing of goods. Each good must contain a description of the item, the amount of the item, the net weight of one single item and the value of one single item. If you ship 5 t-shirts, you need to include the weight and value of one single shirt. The correct final weight and value will be calculated automatically. + The HS Code and the country of origin are optional. + example: + - itemDescription: T-Shirt + hscode: '61099090' + countryOfOrigin: DE + packagedQuantity: 3 + - itemDescription: Book + hscode: '49019900' + packagedQuantity: 1 + Consignee: + type: object + description: Consignee address information. Either a doorstep address (contact address) including contact information or a droppoint address. One of packstation (parcel locker), or post office (postfiliale/retail shop). + oneOf: + - $ref: '#/components/schemas/ContactAddress' + - $ref: '#/components/schemas/Locker' + - $ref: '#/components/schemas/PostOffice' + - $ref: '#/components/schemas/POBox' + ContactAddress: + required: + - addressStreet + - city + - country + - name1 + type: object + properties: + name1: + maxLength: 50 + minLength: 1 + type: string + description: Name1. Line 1 of name information + example: Blumen Krause + name2: + maxLength: 50 + minLength: 1 + type: string + description: An optional, additional line of name information + example: To the attention of Erna. + name3: + maxLength: 50 + minLength: 1 + type: string + description: An optional, additional line of name information + example: Backdrawer all the way back. + dispatchingInformation: + maxLength: 35 + minLength: 1 + type: string + description: An optional, additional line of address. It's only usable for a few countries, e.g. Belgium. It is positioned below name3 on the label. + example: PO Box, bpack 24/7 + addressStreet: + maxLength: 50 + minLength: 1 + type: string + description: Line 1 of the street address. This is just the street name. Can also include house number. + example: Hauptstrasse + addressHouse: + maxLength: 10 + minLength: 1 + type: string + description: Line 1 of the street address. This is just the house number. Can be added to street name instead. + example: 1a + additionalAddressInformation1: + maxLength: 60 + minLength: 1 + type: string + description: Additional information that is positioned either behind or below addressStreet on the label. If it is printed and where exactly depends on the country. + example: 3. Etage + additionalAddressInformation2: + maxLength: 60 + minLength: 1 + type: string + description: Additional information that is positioned either behind or below addressStreet on the label. If it is printed and where exactly depends on the country. + example: Apartment 12 + postalCode: + maxLength: 10 + minLength: 3 + pattern: ^[0-9A-Za-z]+([ -]?[0-9A-Za-z]+)*$ + type: string + description: Mandatory for all countries but Ireland that use a postal code system. + example: '53113' + city: + maxLength: 40 + minLength: 1 + type: string + description: city + example: Berlin + state: + maxLength: 20 + minLength: 1 + type: string + description: State, province or territory. For the USA please use the official regional ISO-Codes, e.g. US-AL. + example: NRW + country: + $ref: '#/components/schemas/Country' + description: A valid country code consisting of three characters according to ISO 3166-1 alpha-3. + contactName: + maxLength: 80 + minLength: 3 + type: string + description: optional contact name. (this is not the primary name printed on label) + example: Konrad Kontaktmann + phone: + maxLength: 20 + minLength: 1 + type: string + description: Please note that, in accordance with Art. 4 No. 11 GDPR, you must obtain the recipient's consent to forward their phone number to Deutsche Post DHL Group. For shipments within Germany, the phone number cannot be transmitted. In some countries the provision of a telephone number and/or e-mail address is mandatory for a delivery to a droppoint. If your recipient has objected to the disclosure of their telephone number and/or e-mail address, the shipment can only be delivered in these countries using the service Premium. + example: +49 170 1234567 + email: + maxLength: 80 + minLength: 3 + type: string + description: "Please note that, in accordance with Art. 4 No. 11 GDPR, you must obtain the recipient's consent to forward their e-mail address to Deutsche Post DHL Group.\_For shipments within Germany, the e-mail address is used to send a DHL Parcel Notification to the recipient. The e-mail address is not mandatory for shipments within Germany. In some countries the provision of a telephone number and/or e-mail address is mandatory for a delivery to a droppoint. If your recipient has objected to the disclosure of their telephone number and/or e-mail address, the shipment can only be delivered in these countries using the service Premium." + example: mustermann@example.com + description: Combines name, address, contact information. The recommended way is to use the mandatory attribute addressStreet and submit the streetname and housenumber together – alternatively addressHouse + addressStreet can be used. For many international addresses there is no house number, please do not set a period or any other sign to indicate that the address does not have a housenumber. + CustomsDetails: + required: + - exportType + - postalCharges + - items + type: object + properties: + invoiceNo: + maxLength: 35 + minLength: 0 + type: string + description: Invoice number + exportType: + type: string + description: This contains the category of goods contained in parcel. + enum: + - OTHER + - PRESENT + - COMMERCIAL_SAMPLE + - DOCUMENT + - RETURN_OF_GOODS + - COMMERCIAL_GOODS + exportDescription: + maxLength: 80 + minLength: 0 + type: string + description: Mandatory if exporttype is 'OTHER' + example: Detailed description for OTHER goods. + shippingConditions: + type: string + description: Aka 'Terms of Trade' aka 'Frankatur'. The attribute is exclusively used for the product Europaket (V54EPAK). DDU is deprecated (use DAP instead). + enum: + - DDU + - DAP + - DDP + - DDX + - DXV + permitNo: + maxLength: 30 + minLength: 0 + type: string + description: Permit number. Very rarely needed. Mostly relevant for higher value goods. An example use case would be an item made from crocodile leather which requires dedicated license / permit identified by that number. + attestationNo: + maxLength: 30 + minLength: 0 + type: string + description: Attest or certification identified by this number. Very rarely needed. An example use case would be a medical shipment referring to an attestation that a certain amount of medicine may be imported within e.g. the current quarter of the year. + hasElectronicExportNotification: + type: boolean + description: flag confirming whether electronic record for export was made + MRN: + type: string + maxLength: 18 + example: "abcd1234567890" + postalCharges: + $ref: '#/components/schemas/Value' + officeOfOrigin: + maxLength: 35 + minLength: 0 + type: string + description: Optional. Will appear on CN23. + shipperCustomsRef: + description: "Optional. The customs reference is used by customs authorities to identify economics operators an/or other persons involved. With the given reference, granted authorizations and/or relevant processes in customs clearance an/or taxation can be taken into account. Aka Zoll-Nummer or EORI-Number but dependent on destination." + type: string + maxLength: 35 + example: "DE73282932000074" + consigneeCustomsRef: + description: "Optional. The customs reference is used by customs authorities to identify economics operators an/or other persons involved. With the given reference, granted authorizations and/or relevant processes in customs clearance an/or taxation can be taken into account. Aka Zoll-Nummer or EORI-Number but dependent on destination." + type: string + maxLength: 35 + example: "GB73282932000074" + items: + maxItems: 99 + minItems: 1 + type: array + description: Commodity types in that package + example: + - itemDescription: T-Shirt + hscode: '61099090' + countryOfOrigin: DE + packagedQuantity: 3 + - itemDescription: Book + hscode: '49019900' + packagedQuantity: 1 + items: + $ref: '#/components/schemas/Commodity' + description: For international shipments, this section contains information necessary for customs about the exported goods. ExportDocument can contain one or more positions as child element. This data is also transferred as electronic declaration to customs. The custom details are mandatory depending on whether the parcel will go to a country outside the European Customs Union. For DHL Parcel International (V53WPAK) CN23 will returned as a separate document, while for Warenpost International the customs information will be printed onto the shipment label (CN22). + Dimensions: + required: + - height + - length + - uom + - width + type: object + properties: + uom: + type: string + description: Unit of metric, applies to all dimensions contained. + example: cm + enum: + - cm + - mm + height: + type: integer + format: int32 + example: 10 + length: + type: integer + format: int32 + example: 20 + width: + type: integer + format: int32 + example: 15 + description: Physical dimensions (aka 'Gurtmass') of the parcel. If you provide the dimension information, all attributes need to be provided. You cannot provide just the height, for example. If you provide length, width, and height in millimeters, they will be rounded to full cm. + Locker: + required: + - city + - lockerID + - name + - postNumber + - postalCode + type: object + properties: + name: + maxLength: 50 + minLength: 1 + type: string + description: Name + example: Paula Packstation + lockerID: + maximum: 999 + minimum: 100 + type: integer + description: Packstationnummer. Three digit number identifying the parcel locker in conjunction with city and postal code + format: int32 + example: 118 + postNumber: + pattern: ^[0-9]{6,10}$ + type: string + description: postNumber (Postnummer) is the official account number a private DHL Customer gets upon registration. + city: + maxLength: 40 + minLength: 0 + type: string + description: City where the locker is located + example: Berlin + country: + $ref: '#/components/schemas/Country' + description: A valid country code consisting of three characters according to ISO 3166-1 alpha-3. + postalCode: + maxLength: 10 + minLength: 3 + pattern: ^[0-9A-Za-z]+([ -]?[0-9A-Za-z]+)*$ + type: string + description: Only usable for German Packstation, international lockers cannot be addressed directly. If your customer wishes for international delivery to a droppoint, please use DHL Parcel International (V53WPAK) with the delivery type "Closest Droppoint". + PostOffice: + required: + - city + - name + - postalCode + - retailID + type: object + properties: + name: + maxLength: 50 + minLength: 1 + type: string + description: Name + example: Fritz Filialabholer + retailID: + maximum: 999 + minimum: 401 + type: integer + description: Id or Number of Post office / Filiale / outlet / parcel shop + format: int32 + example: 518 + postNumber: + maxLength: 10 + minLength: 3 + pattern: ^[0-9]{6,10}$ + type: string + description: postNumber (Postnummer) is the official account number a private DHL Customer gets upon registration. To address a post office or retail outlet directly, either the post number or e-mail address of the consignee is needed. + email: + maxLength: 80 + minLength: 3 + type: string + description: Email address of the consignee. To address a post office or retail outlet directly, either the post number or e-mail address of the consignee is needed. + example: mustermann@example.com + city: + maxLength: 80 + minLength: 0 + type: string + description: City where the retail location is + example: Berlin + country: + $ref: '#/components/schemas/Country' + description: A valid country code consisting of three characters according to ISO 3166-1 alpha-3. + postalCode: + maxLength: 10 + minLength: 3 + pattern: ^[0-9A-Za-z]+([ -]?[0-9A-Za-z]+)*$ + type: string + description: Only usable for German post offices or retail outlets (Paketshops), international postOffices or retail outlets cannot be addressed directly. If your customer wishes for international delivery to a droppoint, please use DHL Parcel International (V53WPAK) with the delivery type "Closest Droppoint". + POBox: + required: + - name1 + - poBoxID + - city + - postalCode + type: object + properties: + name1: + maxLength: 50 + minLength: 1 + type: string + description: Name1. Line 1 of name information + example: Joe Black + name2: + maxLength: 50 + minLength: 1 + type: string + description: An optional, additional line of name information + example: To the attention of Mr. Black. + name3: + maxLength: 50 + minLength: 1 + type: string + description: An optional, additional line of name information + example: Backdrawer all the way back. + poBoxID: + type: integer + format: int32 + description: Number of P.O. Box (Postfach) + email: + maxLength: 80 + minLength: 3 + type: string + description: Email address of the consignee + city: + maxLength: 80 + minLength: 0 + type: string + description: City of the P.O. Box (Postfach) location + example: Berlin + country: + $ref: '#/components/schemas/Country' + description: Country of the P.O. Box (Postfach) location. A valid country code consisting of three characters according to ISO 3166-1 alpha-3. + postalCode: + maxLength: 10 + minLength: 3 + pattern: ^[0-9A-Za-z]+([ -]?[0-9A-Za-z]+)*$ + type: string + description: Postal code of the P.O. Box (Postfach) location + description: Alternative destination - P.O. Box (Postfach) + Shipment: + type: object + properties: + product: + type: string + description: |- + Determines the DHL Paket product to be used. + + * V01PAK: DHL PAKET; + * V53WPAK: DHL PAKET International; + * V54EPAK: DHL Europaket; + * V62WP: Warenpost; + * V66WPI: Warenpost International + example: V01PAK + billingNumber: + pattern: \w{10}\d{2}\w{2} + type: string + description: 14 digit long number that identifies the contract the shipment is booked on. Please note that in rare cases the last to characters can be letters. Digit 11 and digit 12 must correspondent to the number of the product, e.g. 333333333301tt can only be used for the product V01PAK (DHL Paket). + example: 33333333330101 or 333333333362aa + refNo: + maxLength: 35 + minLength: 8 + type: string + description: A reference number that the user can assign for better association purposes. It appears on shipment labels. To use the reference number for tracking purposes, it should be at least 8 characters long and unique. + costCenter: + type: string + description: Textfield that appears on the shipment label. It cannot be used to search for the shipment. + creationSoftware: + type: string + description: Is only to be indicated by DHL partners. + shipDate: + type: string + description: 'Date the shipment is transferred to DHL. The shipment date can be the current date or a date up to a few days in the future. It must not be in the past. Iso format required: yyyy-mm-dd. On the shipment date the shipment will be automatically closed at your end of day closing time.' + format: date + shipper: + description: Shipper information, including contact information and address. Alternatively, a predefined shipper reference can be used. + oneOf: + - $ref: '#/components/schemas/Shipper' + - $ref: '#/components/schemas/ShipperReference' + consignee: + $ref: '#/components/schemas/Consignee' + details: + $ref: '#/components/schemas/ShipmentDetails' + services: + $ref: '#/components/schemas/VAS' + customs: + $ref: '#/components/schemas/CustomsDetails' + description: Container for all shipments. Mixed shipment products per request are supported. Each shipment has a dedicated shipper address (or shipper reference, or both). + ShipmentDetails: + required: + - weight + type: object + properties: + dim: + $ref: '#/components/schemas/Dimensions' + weight: + $ref: '#/components/schemas/Weight' + description: Details for the shipment, such as dimensions, content + ShipmentOrderRequest: + required: + - profile + - shipments + type: object + properties: + profile: + maxLength: 35 + minLength: 0 + type: string + shipments: + maxItems: 30 + minItems: 1 + type: array + description: Shipment array having details for each shipment. + items: + $ref: '#/components/schemas/Shipment' + description: Complex request structure used to create, update, and validate shipment data. Note that most elements are part of the array of shipment items. + Shipper: + type: object + description: Shipper information, including contact information and address. + required: + - addressStreet + - city + - country + - name1 + properties: + name1: + maxLength: 50 + minLength: 1 + type: string + description: Name1. Line 1 of name information + example: Blumen Krause + name2: + maxLength: 50 + minLength: 1 + type: string + description: An optional, additional line of name information + example: To the attention of Erna. + name3: + maxLength: 50 + minLength: 1 + type: string + description: An optional, additional line of name information + example: Backdrawer all the way back. + addressStreet: + maxLength: 50 + minLength: 1 + type: string + description: Line 1 of the street address. This is just the street name. Can also include house number. + example: Hauptstrasse + addressHouse: + maxLength: 10 + minLength: 1 + type: string + description: Line 1 of the street address. This is just the house number. Can be added to street name instead. + example: 1a + postalCode: + maxLength: 10 + minLength: 3 + pattern: ^[0-9A-Za-z]+([ -]?[0-9A-Za-z]+)*$ + type: string + description: Mandatory for all countries but Ireland that use a postal code system. + example: '53113' + city: + maxLength: 40 + minLength: 1 + type: string + description: city + example: Berlin + country: + $ref: '#/components/schemas/Country' + description: Shipper address country + contactName: + maxLength: 80 + minLength: 3 + type: string + description: optional contact name. (this is not the primary name printed on label) + example: Konrad Kontaktmann + email: + maxLength: 80 + minLength: 3 + type: string + description: Optional contact email address of the shipper + example: mustermann@example.com + ShipperReference: + type: object + description: Contains a reference to the Shipper data configured in GKP(Geschäftskundenportal - Business Costumer Portal). Can be used instead of a detailed shipper address. The shipper reference can be used to print a company logo which is configured in GKP onto the label. + required: + - shipperRef + properties: + shipperRef: + maxLength: 50 + minLength: 0 + type: string + description: Reference string to the shipper data configured in GKP(Geschäftskundenportal - Business Costumer Portal). + VAS: + type: object + properties: + preferredNeighbour: + maxLength: 100 + minLength: 0 + type: string + description: Preferred neighbour. Can be specified as text. + example: Please ring at Meier next door + preferredLocation: + maxLength: 100 + minLength: 0 + type: string + description: Preferred location. Can be specified as text. + example: Please leave in carport + visualCheckOfAge: + pattern: A16|A18 + type: string + description: if used it will trigger checking the age of recipient + example: A18 + enum: + - A16 + - A18 + namedPersonOnly: + type: boolean + description: Delivery can only be signed for by yourself personally. + example: true + identCheck: + $ref: '#/components/schemas/VASIdentCheck' + signedForByRecipient: + type: boolean + description: Delivery must be signed for by the recipient and not by DHL staff + example: true + endorsement: + type: string + description: Instructions and endorsement how to treat international undeliverable shipment. By default, shipments are returned if undeliverable. There are country specific rules whether the shipment is returned immediately or after a grace period. + example: RETURN + enum: + - RETURN + - ABANDON + preferredDay: + type: string + description: Preferred day of delivery in format YYYY-MM-DD. Shipper can request a preferred day of delivery. The preferred day should be between 2 and 6 working days after handover to DHL. + format: date + noNeighbourDelivery: + type: boolean + description: Delivery can only be signed for by yourself personally or by members of your household. + example: true + additionalInsurance: + $ref: '#/components/schemas/Value' + bulkyGoods: + type: boolean + description: Leaving this out is same as setting to false. Sperrgut. + example: true + cashOnDelivery: + $ref: '#/components/schemas/VASCashOnDelivery' + individualSenderRequirement: + pattern: '[a-zA-Z0-9]{2}' + type: string + description: Special instructions for delivery. 2 character code, possible values agreed in contract. + example: ZZ + premium: + type: boolean + description: 'Choice of premium vs economy parcel. Availability is country dependent and may be manipulated by DHL if choice is not available. Please review the label.' + example: true + closestDropPoint: + type: boolean + description: 'Closest Droppoint Delivery to the droppoint closest to the address of the recipient of the shipment. For this kind of delivery either the phone number and/or the e-mail address of the receiver is mandatory. For shipments using DHL Paket International it is recommended that you choose one of the three delivery types: Economy, Premium, CDP. Otherwise, the current default for the receiver country will be picked.' + example: true + parcelOutletRouting: + type: string + description: 'Undeliverable domestic shipment can be forwarded and held at retail. Notification to email (fallback: consignee email) will be used.' + example: max.mustermann@example.com + dhlRetoure: + $ref: '#/components/schemas/VASDhlRetoure' + postalDeliveryDutyPaid: + type: boolean + description: 'All import duties are paid by the shipper.' + example: true + description: Value added services. Please note that services are specific to products and geographies and/or may require individual setup and billing numbers. Please test and contact your account representative in case of questions. + VASCashOnDelivery: + type: object + properties: + amount: + $ref: '#/components/schemas/Value' + bankAccount: + $ref: '#/components/schemas/BankAccount' + accountReference: + maxLength: 35 + minLength: 0 + type: string + description: Reference to bank account details. Account references are maintained in customer settings in Post & DHL business customer portal under Ship -> Settings -> Cash on delivery. Please note, that the default account reference is used if the provided account reference does not exist in your customer settings! + transferNote1: + maxLength: 35 + minLength: 0 + type: string + transferNote2: + maxLength: 35 + minLength: 0 + type: string + description: Cash on delivery (Nachnahme). Currency must be Euro. Either bank account information or account reference (from customer profile) must be provided. Transfernote1 + 2 are references transmitted during bank transfer. Providing account information explicitly requires elevated privileges. + VASDhlRetoure: + required: + - billingNumber + type: object + properties: + billingNumber: + pattern: \w{10}\d{2}\w{2} + type: string + refNo: + maxLength: 50 + minLength: 6 + type: string + returnAddress: + $ref: '#/components/schemas/ContactAddress' + description: Requests return label (aka 'retoure') to be provided. Also requires returnAddress and return billing number. Neither weight nor dimension need to be specified for the retoure (flat rate service). + VASIdentCheck: + required: + - firstName + - lastName + type: object + properties: + firstName: + maxLength: 35 + minLength: 1 + type: string + example: Max + lastName: + maxLength: 35 + minLength: 1 + type: string + example: Mustermann + dateOfBirth: + type: string + description: date of birth, used in conjunction with minimumAge and shipping date. Format yyyy-mm-dd is used. + format: date + minimumAge: + pattern: A16|A18 + type: string + description: Checks if recipient will have reached specified age by shipping date. + example: A18 + enum: + - A16 + - A18 + description: Check the identity of the recipient via name (firstname, lastname), date of birth or age. This uses firstName and lastName as separate attributes since for identity check an automatic split of a one-line name is not considered reliable enough. + Country: + type: string + description: A valid country code consisting of three characters according to ISO 3166-1 alpha-3. + enum: + - ABW + - AFG + - AGO + - AIA + - ALA + - ALB + - AND + - ARE + - ARG + - ARM + - ASM + - ATG + - AUS + - AUT + - AZE + - BDI + - BEL + - BEN + - BES + - BFA + - BGD + - BGR + - BHR + - BHS + - BIH + - BLM + - BLR + - BLZ + - BMU + - BOL + - BRA + - BRB + - BRN + - BTN + - BVT + - BWA + - CAF + - CAN + - CCK + - CHE + - CHL + - CHN + - CIV + - CMR + - COD + - COG + - COK + - COL + - COM + - CPV + - CRI + - CUB + - CUW + - CXR + - CYM + - CYP + - CZE + - DEU + - DJI + - DMA + - DNK + - DOM + - DZA + - ECU + - EGY + - ERI + - ESP + - EST + - ETH + - FIN + - FJI + - FLK + - FRA + - FRO + - FSM + - GAB + - GBR + - GEO + - GGY + - GHA + - GIB + - GIN + - GLP + - GMB + - GNB + - GNQ + - GRC + - GRD + - GRL + - GTM + - GUF + - GUM + - GUY + - HKG + - HMD + - HND + - HRV + - HTI + - HUN + - IDN + - IMN + - IND + - IRL + - IRN + - IRQ + - ISL + - ISR + - ITA + - JAM + - JEY + - JOR + - JPN + - KAZ + - KEN + - KGZ + - KHM + - KIR + - KNA + - KOR + - KWT + - LAO + - LBN + - LBR + - LBY + - LCA + - LIE + - LKA + - LSO + - LTU + - LUX + - LVA + - MAC + - MAF + - MAR + - MCO + - MDA + - MDG + - MDV + - MEX + - MHL + - MKD + - MLI + - MLT + - MMR + - MNE + - MNG + - MNP + - MOZ + - MRT + - MSR + - MTQ + - MUS + - MWI + - MYS + - MYT + - NAM + - NCL + - NER + - NFK + - NGA + - NIC + - NIU + - NLD + - NOR + - NPL + - NRU + - NZL + - OMN + - PAK + - PAN + - PCN + - PER + - PHL + - PLW + - PNG + - POL + - PRI + - PRK + - PRT + - PRY + - PSE + - PYF + - QAT + - REU + - ROU + - RUS + - RWA + - SAU + - SDN + - SEN + - SGP + - SHN + - SJM + - SLB + - SLE + - SLV + - SMR + - SOM + - SPM + - SRB + - SSD + - STP + - SUR + - SVK + - SVN + - SWE + - SWZ + - SXM + - SYC + - SYR + - TCA + - TCD + - TGO + - THA + - TJK + - TKL + - TKM + - TLS + - TON + - TTO + - TUN + - TUR + - TUV + - TWN + - TZA + - UGA + - UKR + - URY + - USA + - UZB + - VAT + - VCT + - VEN + - VGB + - VIR + - VNM + - VUT + - WLF + - WSM + - YEM + - ZAF + - ZMB + - ZWE + - UNKNOWN + + Value: + required: + - currency + - value + type: object + description: Currency and numeric value. + properties: + currency: + type: string + description: iso 4217 3 character currency code accepted. Recommended to use EUR where possible + enum: + - AED + - AFN + - ALL + - AMD + - ANG + - AOA + - ARS + - AUD + - AWG + - AZN + - BAM + - BBD + - BDT + - BGN + - BHD + - BIF + - BMD + - BND + - BOB + - BOV + - BRL + - BSD + - BTN + - BWP + - BYR + - BZD + - CAD + - CDF + - CHE + - CHF + - CHW + - CLF + - CLP + - CNY + - COP + - COU + - CRC + - CUC + - CUP + - CVE + - CZK + - DJF + - DKK + - DOP + - DZD + - EGP + - ERN + - ETB + - EUR + - FJD + - FKP + - GBP + - GEL + - GHS + - GIP + - GMD + - GNF + - GTQ + - GYD + - HKD + - HNL + - HRK + - HTG + - HUF + - IDR + - ILS + - INR + - IQD + - IRR + - ISK + - JMD + - JOD + - JPY + - KES + - KGS + - KHR + - KMF + - KPW + - KRW + - KWD + - KYD + - KZT + - LAK + - LBP + - LKR + - LRD + - LSL + - LTL + - LVL + - LYD + - MAD + - MDL + - MGA + - MKD + - MMK + - MNT + - MOP + - MRO + - MUR + - MVR + - MWK + - MXN + - MXV + - MYR + - MZN + - NAD + - NGN + - NIO + - NOK + - NPR + - NZD + - OMR + - PAB + - PEN + - PGK + - PHP + - PKR + - PLN + - PYG + - QAR + - RON + - RSD + - RUB + - RWF + - SAR + - SBD + - SCR + - SDG + - SEK + - SGD + - SHP + - SLL + - SOS + - SRD + - SSP + - STD + - SYP + - SZL + - THB + - TJS + - TMT + - TND + - TOP + - TRY + - TTD + - TWD + - TZS + - UAH + - UGX + - USD + - USN + - USS + - UYI + - UYU + - UZS + - VEF + - VND + - VUV + - WST + - XAF + - XAG + - XAU + - XBA + - XBB + - XBC + - XBD + - XCD + - XDR + - XFU + - XOF + - XPD + - XPF + - XPT + - XXX + - YER + - ZAR + - ZMW + - UNKNOWN + value: + type: number + description: Numeric value + maximum: 100000 + exclusiveMaximum: false + minimum: 0 + exclusiveMinimum: false + Weight: + required: + - uom + - value + type: object + properties: + uom: + type: string + description: metric unit for weight + example: g + enum: + - g + - kg + value: + maximum: 31500 + exclusiveMaximum: false + minimum: 0 + exclusiveMinimum: false + type: number + example: 500 + description: Weight of item or shipment. Both uom and value are required. + examples: + DHLPaket: + value: + profile: STANDARD_GRUPPENPROFIL + shipments: + - product: V01PAK + billingNumber: "33333333330102" + refNo: Order No. 1234 + shipper: + name1: My Online Shop GmbH + addressStreet: Sträßchensweg 10 + additionalAddressInformation1: 2. Etage + postalCode: "53113" + city: Bonn + country: DEU + email: max@mustermann.de + phone: +49 123456789 + consignee: + name1: Maria Musterfrau + addressStreet: Kurt-Schumacher-Str. 20 + additionalAddressInformation1: Apartment 107 + postalCode: "53113" + city: Bonn + country: DEU + email: maria@musterfrau.de + phone: +49 987654321 + details: + dim: + uom: mm + height: 100 + length: 200 + width: 150 + weight: + uom: g + value: 500 + DHLPaketInternational: + value: + profile: STANDARD_GRUPPENPROFIL + shipments: + - product: V53WPAK + billingNumber: "33333333335301" + refNo: Order No. 1234 + shipper: + name1: My Online Shop GmbH + addressStreet: Sträßchensweg 10 + additionalAddressInformation1: 2. Etage + postalCode: "53113" + city: Bonn + country: DEU + email: max@mustermann.de + phone: +49 123456789 + consignee: + name1: Jan Vermeer + addressStreet: Museumstraat + addressHouse: "1" + postalCode: "1071 AA" + city: Amsterdam + country: NLD + email: jan@vermeer.com + phone: +31 888888888 + details: + dim: + uom: mm + height: 100 + length: 200 + width: 150 + weight: + uom: g + value: 500 + DHLPaketInternationalWithCustoms: + value: + profile: STANDARD_GRUPPENPROFIL + shipments: + - product: V53WPAK + billingNumber: "33333333335301" + refNo: Order No. 1234 + shipper: + name1: My Online Shop GmbH + addressStreet: Sträßchensweg 10 + additionalAddressInformation1: 2. Etage + postalCode: "53113" + city: Bonn + country: DEU + email: max@mustermann.de + phone: +49 123456789 + consignee: + name1: Joe Black + addressStreet: 10 Downing Street + postalCode: "SW1A 1AA" + city: London + country: GBR + email: joe@black.uk + phone: +44 123456789 + details: + dim: + uom: mm + height: 100 + length: 200 + width: 150 + weight: + uom: g + value: 500 + customs: + exportType: COMMERCIAL_GOODS + postalCharges: + currency: EUR + value: 1 + items: + - itemDescription: Red T-Shirt + packagedQuantity: 1 + hsCode: "123456" + countryOfOrigin: FRA + itemValue: + currency: EUR + value: 10 + itemWeight: + uom: g + value: 400 + services: + endorsement: RETURN + securitySchemes: + BasicAuth: + type: http + scheme: basic + description: Credentials provided here are username and password of the partner system. + ApiKey: + type: apiKey + description: API key to authorize requests. API key can be obtained at [DHL's development + portal](https://developer.dhl.com). + name: dhl-api-key + in: header + responses: + BadRequest: + description: Bad Request + content: + application/problem+json: + schema: + $ref: '#/components/schemas/LabelDataResponse' + Unauthorized: + description: Unauthorized + content: + application/problem+json: + schema: + $ref: '#/components/schemas/RequestStatus' + NotFound: + description: Not Found + content: + application/problem+json: + schema: + $ref: '#/components/schemas/RequestStatus' + Forbidden: + description: Forbidden + content: + application/problem+json: + schema: + $ref: '#/components/schemas/RequestStatus' + TooManyRequests: + description: Too Many Requests + content: + application/problem+json: + schema: + $ref: '#/components/schemas/RequestStatus' + InternalServerError: + description: Internal Server Error + content: + application/problem+json: + schema: + $ref: '#/components/schemas/RequestStatus' diff --git a/ShippingProAPICollection/ShippingProAPICollection.csproj b/ShippingProAPICollection/ShippingProAPICollection.csproj new file mode 100644 index 0000000..5080be6 --- /dev/null +++ b/ShippingProAPICollection/ShippingProAPICollection.csproj @@ -0,0 +1,72 @@ + + + + netstandard2.1 + latest + enable + enable + ShippingProAPICollection + Kevin Venclovas + CodeKev Innovations + This project provides a unified interface for GLS GLS, DHL, and DPD, simplifying the shipping process for developers and businesses. With easy integration, you can now manage rates, track shipments, and handle logistics across different carriers seamlessly. Ideal for enhancing efficiency in e-commerce and logistics operations. + https://github.com/kevinvenclovas/ShippingProAPICollection + https://github.com/kevinvenclovas/ShippingProAPICollection + Api;GLS;DHL;DPD;Germany;Interface;Schnittstelle + False + README.md + MIT + LICENSE.txt + icon.png + + + + + $(NoWarn);nullable + + + + + True + \ + + + True + \ + + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + + + + + + NSwagCSharp + DHLClient + + + DHLClient + + + True + \ + + + + diff --git a/ShippingProAPICollection/ShippingProAPICollectionService.cs b/ShippingProAPICollection/ShippingProAPICollectionService.cs new file mode 100644 index 0000000..573e63b --- /dev/null +++ b/ShippingProAPICollection/ShippingProAPICollectionService.cs @@ -0,0 +1,99 @@ +using Microsoft.Extensions.Caching.Memory; +using ShippingProAPICollection.Models; +using ShippingProAPICollection.Models.Entities; +using ShippingProAPICollection.Provider; +using ShippingProAPICollection.Provider.DHL; +using ShippingProAPICollection.Provider.DPD; +using ShippingProAPICollection.Provider.GLS; +using ShippingProAPICollection.Provider.GLS.Entities.Validation; + +namespace ShippingProAPICollection +{ + public class ShippingProAPICollectionService + { + + Dictionary providerServices = new Dictionary(); + + public ShippingProAPICollectionService(IMemoryCache _cache, ShippingProAPICollectionSettings providerSettings) + { + Dictionary providers = providerSettings.GetProviders(); + + foreach (KeyValuePair provider in providers) + { + providerServices.Add(provider.Key, BuildProviderService(providerSettings.AccountSettings, provider.Value, _cache)); + } + } + + private IShippingProviderService BuildProviderService(ShippingProAPIAccountSettings accountSettings, ProviderSettings settings, IMemoryCache _cache) + { + switch (settings) + { + case GLSSettings providerSettings: + return new GLSShipmentService(accountSettings, providerSettings); + case DHLSettings providerSettings: + return new DHLShipmentService(accountSettings, providerSettings); + case DPDSettings providerSettings: + return new DPDShipmentService(accountSettings, providerSettings, _cache); + case CustomProviderSettings providerSettings: + return providerSettings.CreateProviderService(accountSettings, _cache); + default: throw new Exception("provider not available"); + } + } + + public async Task> RequestLabel(RequestShipmentBase request, CancellationToken ct = default) + { + request.Validate(); + + if (providerServices.TryGetValue(request.ContractID, out var service)) + { + return await service.RequestLabel(request, ct); + } + + throw new InvalidOperationException("Unknown shipping provider"); + } + + public async Task ValidateLabel(RequestShipmentBase request, CancellationToken ct = default) + { + request.Validate(); + + if (providerServices.TryGetValue(request.ContractID, out var service)) + { + return await service.ValidateLabel(request, ct); + } + + throw new InvalidOperationException("Unknown shipping provider"); + } + + public async Task GetEstimatedDeliveryDays(RequestShipmentBase request, CancellationToken ct = default) + { + request.Validate(); + + if (providerServices.TryGetValue(request.ContractID, out var service)) + { + return await service.GetEstimatedDeliveryDays(request, ct); + } + + throw new InvalidOperationException("Unknown shipping provider"); + } + + public async Task CancelLabel(string contractID, string cancelId, CancellationToken ct = default) + { + + if (providerServices.TryGetValue(contractID, out var service)) + { + return await service.CancelLabel(cancelId, ct); + } + + throw new InvalidOperationException("Unknown shipping provider"); + } + + public void ResetDPDAutToken() + { + foreach (var item in providerServices.Where(x => x.Value.GetType() == typeof(DPDShipmentService)).Select(x => x.Value as DPDShipmentService)) + { + item.ResetDPDAutToken(); + } + } + + } +} diff --git a/ShippingProAPICollection/ShippingProAPICollectionSettings.cs b/ShippingProAPICollection/ShippingProAPICollectionSettings.cs new file mode 100644 index 0000000..37b7796 --- /dev/null +++ b/ShippingProAPICollection/ShippingProAPICollectionSettings.cs @@ -0,0 +1,55 @@ +using ShippingProAPICollection.Models; +using ShippingProAPICollection.Provider; +using ShippingProAPICollection.Provider.DHL; +using ShippingProAPICollection.Provider.DPD; +using ShippingProAPICollection.Provider.GLS; + +namespace ShippingProAPICollection +{ + public class ShippingProAPICollectionSettings + { + public ShippingProAPIAccountSettings AccountSettings { get; private set; } + private Dictionary providerSettings { get; set; } = new Dictionary(); + + public ShippingProAPICollectionSettings(ShippingProAPIAccountSettings accountSettings) + { + this.AccountSettings = accountSettings; + } + + public Dictionary GetProviders() + { + return providerSettings; + } + + public void AddSettings(string contractID, ProviderSettings setting) + { + if (providerSettings.ContainsKey(contractID)) throw new Exception($"{contractID} Provider already initalized"); + setting.ContractID = contractID; + providerSettings.Add(contractID, setting); + } + + public void AddSettings(ProviderSettings setting) + { + string contractID = null!; + + switch (setting) + { + case GLSSettings: + contractID = "GLS"; + break; + case DHLSettings: + contractID = "DHL"; + break; + case DPDSettings: + contractID = "DPD"; + break; + default: throw new Exception("provider not available"); + } + + if (providerSettings.ContainsKey(contractID)) throw new Exception($"{contractID} Provider already initalized"); + setting.ContractID = contractID; + providerSettings.Add(contractID, setting); + } + + } +} diff --git a/ShippingProAPICollection/icon.png b/ShippingProAPICollection/icon.png new file mode 100644 index 0000000..b430f2e Binary files /dev/null and b/ShippingProAPICollection/icon.png differ