CPL API
Useful links
Useful links
  • Developer
  • Sandbox
Useful links
Useful links
  • Developer
  • Sandbox
Přepni do češtiny
    • Introduction
    • General
    • Creation of orders and shipments
    • Changelog
    • Authentication
      • Getting Bearer token
    • API Methods
    • Examples
      • Response - pick up labels (PDF A4)
      • Response - pickup label (ZPL)
      • Response - pick up label (JPG)
      • Shipment - shipment set items
      • International Shipment with or without COD – Parcels in a Set
      • Multiple shipments in one request
      • Shipment connect
    • FAQ
    • Postman Collection
    • Postman Flows
    • Schemas
      • Schemas
        • EmptyNullableObject
        • Eps.Api.MyApi2.Web.Models.Routing.RouteModel
        • AcceptLanguageSchema
        • Eps.Api.MyApi2.Web.Models.ShipmentBatch.ConnectHierarchyModel
        • Eps.Api.MyApi2.Web.Models.ShipmentBatch.ConnectHierarchyResultModel
        • Eps.Api.Infrastructure.WebApi.Model.InfoModel
        • Eps.Api.Infrastructure.WebApi.Model.ProblemJsonBasicModel
        • Eps.Api.Infrastructure.WebApi.Model.ProblemJsonModel
        • Eps.Api.MyApi2.Business.Dto.VersionInformation.VersionInformationDto
        • Eps.Api.MyApi2.Business.Enums.ConstImportState
        • Eps.Api.MyApi2.Business.Enums.ConstPageSize
        • Eps.Api.MyApi2.Business.Enums.ConstRelationType
        • Eps.Api.MyApi2.Business.Enums.ConstReturnChannel
        • Eps.Api.MyApi2.Web.Constants.ConstLabelFormat
        • Eps.Api.MyApi2.Web.Controllers.ShipmentBatchController.GetShipmentBatch.OrderBy.enum
        • Eps.Api.MyApi2.Web.Controllers.ShipmentBatchController.GetShipmentBatchLabel.OrderBy.enum
        • Eps.Api.MyApi2.Web.Models.AccessPoint.AccessPointCapacitySettingModel
        • Eps.Api.MyApi2.Web.Models.AccessPoint.AccessPointModel
        • Eps.Api.MyApi2.Web.Models.AccessPoint.AccessPointWorkHourModel
        • Eps.Api.MyApi2.Web.Models.AccessPoint.ConstMyApi2AccessPointType
        • Eps.Api.MyApi2.Web.Models.AccessPoint.CoordinatesModel
        • Eps.Api.MyApi2.Web.Models.AddressWhisper.AddressWhispModel
        • Eps.Api.MyApi2.Web.Models.AddressWhisper.CalledFrom
        • Eps.Api.MyApi2.Web.Models.Codelist.AgeCheckTypeModel
        • Eps.Api.MyApi2.Web.Models.Codelist.CountryModel
        • Eps.Api.MyApi2.Web.Models.Codelist.CurrencyModel
        • Eps.Api.MyApi2.Web.Models.Codelist.ProofOfIdentityTypeModel
        • Eps.Api.MyApi2.Web.Models.Codelist.ServicePriceLimitModel
        • Eps.Api.MyApi2.Web.Models.Codelist.ShipmentExternalNumberTypeModel
        • Eps.Api.MyApi2.Web.Models.Codelist.ShipmentPhaseModel
        • Eps.Api.MyApi2.Web.Models.Codelist.ShipmentProductType
        • Eps.Api.MyApi2.Web.Models.Codelist.ShipmentServiceModel
        • Eps.Api.MyApi2.Web.Models.Codelist.StatusModel
        • Eps.Api.MyApi2.Web.Models.Codelist.ValidationMessageModel
        • Eps.Api.MyApi2.Web.Models.Customer.AccountModel
        • Eps.Api.MyApi2.Web.Models.Customer.AddressModel
        • Eps.Api.MyApi2.Web.Models.Customer.CustomerModel
        • Eps.Api.MyApi2.Web.Models.CustomerAccess.CreateApiAccessModel
        • Eps.Api.MyApi2.Web.Models.CustomerAccess.CreateSandboxAccessModel
        • Eps.Api.MyApi2.Web.Models.CustomerAccess.ResendSandboxUserEmailModel
        • Eps.Api.MyApi2.Web.Models.Enum.OrderStates
        • Eps.Api.MyApi2.Web.Models.Enum.OrderType
        • Eps.Api.MyApi2.Web.Models.Integrator.AddressType
        • Eps.Api.MyApi2.Web.Models.Integrator.CodAccountModel
        • Eps.Api.MyApi2.Web.Models.Integrator.ContactType
        • Eps.Api.MyApi2.Web.Models.Integrator.CreateCustomerAddressModel
        • Eps.Api.MyApi2.Web.Models.Integrator.CreateCustomerContactModel
        • Eps.Api.MyApi2.Web.Models.Integrator.CreateCustomerModel
        • Eps.Api.MyApi2.Web.Models.Integrator.GetCustomerAddressModel
        • Eps.Api.MyApi2.Web.Models.Integrator.GetCustomerContactModel
        • Eps.Api.MyApi2.Web.Models.Integrator.GetCustomerModel
        • Eps.Api.MyApi2.Web.Models.Order.OrderModel
        • Eps.Api.MyApi2.Web.Models.Order.RecipientAddressModel
        • Eps.Api.MyApi2.Web.Models.Order.SenderAddressModel
        • Eps.Api.MyApi2.Web.Models.OrderBatch.CreateOrderBatchModel
        • Eps.Api.MyApi2.Web.Models.OrderBatch.OrderBatchResultModel
        • Eps.Api.MyApi2.Web.Models.OrderBatch.OrderModel
        • Eps.Api.MyApi2.Web.Models.OrderBatch.OrderResultItemModel
        • Eps.Api.MyApi2.Web.Models.OrderBatch.RecipientAddressModel
        • Eps.Api.MyApi2.Web.Models.OrderBatch.SenderAddressModel
        • Eps.Api.MyApi2.Web.Models.OrderEvent.CancelOrderEventModel
        • Eps.Api.MyApi2.Web.Models.Shipment.AccessPointFeatureModel
        • Eps.Api.MyApi2.Web.Models.Shipment.AdditionalParameterModel
        • Eps.Api.MyApi2.Web.Models.Shipment.BackShipmentFeatureModel
        • Eps.Api.MyApi2.Web.Models.Shipment.DormantShipmentFeatureModel
        • Eps.Api.MyApi2.Web.Models.Shipment.ExternalNumberModel
        • Eps.Api.MyApi2.Web.Models.Shipment.RoutingFeatureModel
        • Eps.Api.MyApi2.Web.Models.Shipment.ServiceModel
        • Eps.Api.MyApi2.Web.Models.Shipment.ShipmentAddressModel
        • Eps.Api.MyApi2.Web.Models.Shipment.ShipmentDeliveryFeatureModel
        • Eps.Api.MyApi2.Web.Models.Shipment.ShipmentModel
        • Eps.Api.MyApi2.Web.Models.Shipment.ShipmentPaymentFeatureModel
        • Eps.Api.MyApi2.Web.Models.Shipment.ShipmentSetFeatureModel
        • Eps.Api.MyApi2.Web.Models.Shipment.ShipmentStates
        • Eps.Api.MyApi2.Web.Models.Shipment.ShipmentWeightFeatureModel
        • Eps.Api.MyApi2.Web.Models.Shipment.SpecificDeliveryFeatureModel
        • Eps.Api.MyApi2.Web.Models.Shipment.TrackAndTraceItemModel
        • Eps.Api.MyApi2.Web.Models.Shipment.TrackAndTraceModel
        • Eps.Api.MyApi2.Web.Models.ShipmentBatch.BackAddressModel
        • Eps.Api.MyApi2.Web.Models.ShipmentBatch.CashOnDeliveryFeatureModel
        • Eps.Api.MyApi2.Web.Models.ShipmentBatch.CompleteLabelModel
        • Eps.Api.MyApi2.Web.Models.ShipmentBatch.CompleteLabelSettingsModel
        • Eps.Api.MyApi2.Web.Models.ShipmentBatch.CreateShipmentBatchModel
        • Eps.Api.MyApi2.Web.Models.ShipmentBatch.DirectInjectionFeatureModel
        • Eps.Api.MyApi2.Web.Models.ShipmentBatch.DormantExternalNumberModel
        • Eps.Api.MyApi2.Web.Models.ShipmentBatch.DormantRecipientAddressModel
        • Eps.Api.MyApi2.Web.Models.ShipmentBatch.DormantServiceModel
        • Eps.Api.MyApi2.Web.Models.ShipmentBatch.DormantShipmentModel
        • Eps.Api.MyApi2.Web.Models.ShipmentBatch.DormantWeighedShipmentFeatureModel
        • Eps.Api.MyApi2.Web.Models.ShipmentBatch.ExternalNumberModel
        • Eps.Api.MyApi2.Web.Models.ShipmentBatch.InsuranceFeatureModel
        • Eps.Api.MyApi2.Web.Models.ShipmentBatch.LabelServiceModel
        • Eps.Api.MyApi2.Web.Models.ShipmentBatch.LabelSettingsModel
        • Eps.Api.MyApi2.Web.Models.ShipmentBatch.RecipientAddressModel
        • Eps.Api.MyApi2.Web.Models.ShipmentBatch.ReturnChannelModel
        • Eps.Api.MyApi2.Web.Models.ShipmentBatch.SenderAddressModel
        • Eps.Api.MyApi2.Web.Models.ShipmentBatch.SenderMaskAddressModel
        • Eps.Api.MyApi2.Web.Models.ShipmentBatch.ServiceModel
        • Eps.Api.MyApi2.Web.Models.ShipmentBatch.ShipmentBatchResultModel
        • Eps.Api.MyApi2.Web.Models.ShipmentBatch.ShipmentModel
        • Eps.Api.MyApi2.Web.Models.ShipmentBatch.ShipmentResultChildItemModel
        • Eps.Api.MyApi2.Web.Models.ShipmentBatch.ShipmentResultItemModel
        • Eps.Api.MyApi2.Web.Models.ShipmentBatch.ShipmentRoutingModel
        • Eps.Api.MyApi2.Web.Models.ShipmentBatch.ShipmentSetFeatureModel
        • Eps.Api.MyApi2.Web.Models.ShipmentBatch.ShipmentSetItemModel
        • Eps.Api.MyApi2.Web.Models.ShipmentBatch.SpecificDeliveryFeatureModel
        • Eps.Api.MyApi2.Web.Models.ShipmentBatch.UpdateShipmentBatchModel
        • Eps.Api.MyApi2.Web.Models.ShipmentBatch.WeighedShipmentFeatureModel
        • Eps.Api.MyApi2.Web.Models.ShipmentEvent.RedirectRecipientAddressModel
        • Eps.Api.MyApi2.Web.Models.ShipmentEvent.RedirectShipmentEventModel
        • XCorrelationIdSchema
        • XLogLevelSchema
        • XPagingSchema
    Useful links
    Useful links
    • Developer
    • Sandbox
    Useful links
    Useful links
    • Developer
    • Sandbox
    Přepni do češtiny

    Authentication

    CPL API supports an authentication method based on a Bearer token using the OAuth 2.0 protocol. This type of authentication provides a secure and flexible way to access protected API resources.

    Authentication Requirements#

    GET/INFO Method: This method does not require authentication and can be called without logging in.
    All Other Methods: These require HTTP authentication using a valid Bearer token.
    To access the API, you must meet the following requirements:
    1.
    Enable OAuth 2.0:
    Request CPL support to enable OAuth 2.0 access and obtain your client credentials (Client ID and Client Secret).
    2.
    Generate an Access Token:
    Log in to the service using your Client ID and Client Secret.
    Send a request to the URL designated for issuing tokens (https://api.dhl.com/ecs/ppl/myapi2/login/getAccessToken).

    Security Guidelines#

    Due to the nature of this authentication, it is MANDATORY to use the HTTPS protocol exclusively. This ensures encrypted communication and protects sensitive data during transmission.

    Access Token Validity#

    The access token is valid for 30 minutes.
    After expiration, the token must be refreshed.
    The maximum number of tokens that can be generated is 12 tokens per minute.

    Recommendations#

    1.
    Secure Storage of Tokens:
    Access tokens and the Client Secret should never be stored in source code or in publicly accessible locations.
    2.
    Automatic Token Refresh:
    Implement a mechanism to automatically refresh the token before it expires.
    3.
    Use HTTPS for All Requests:
    Never send tokens or credentials over an unencrypted connection (HTTP).

    Common Issues#

    Invalid Token: Check that the access token has been correctly included in the Authorization header.
    Expiration: If the token has expired, generate a new one.
    Authentication Errors: Ensure that you are using the correct Client ID and Client Secret.
    Modified at 2025-02-07 07:04:38
    Previous
    Changelog
    Next
    Getting Bearer token