DHL

DHL Purchases API

The Purchases API from DHL — 2 operation(s) for purchases.

GitHub OpenAPI

Operations 2

Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay

POST /shopping-carts/pre-paid Create a prepaid shopping cart (Germany) · Creates a new shopping cart for a given partner. #
Ask an LLM
“Can I create a pre-paid shopping cart so customers can buy parcels through franking?”
“Where do customers finish buying a prepaid shopping cart?”
Tell an agent
Create a prepaid shopping cart for our partner.
Create a shopping cart with a notify URL for partner purchases.
GET /shopping-carts/{shoppingCartId} Get a customer's shopping cart · Accesses a purchase of a given customer #
Ask an LLM
“What items are in a customer's shopping cart?”
“Can I load a shopping cart by its ID?”
Tell an agent
Get shopping cart {shoppingCartId}.
Show the contents of customer shopping cart {shoppingCartId}.

Documentation

📖
Documentation
https://developer.dhl.com/tracking
📖
Documentation
https://developer.dhl.com/api-reference/shipment-tracking-unified-push
📖
Documentation
https://developer.dhl.com/api-reference/additional-services-dhl-freight
📖
Documentation
https://developer.dhl.com/api-reference/authentication-dhl-ecommerce-americas
📖
Documentation
https://developer.dhl.com/api-reference/authentication-api-dhl-freight
📖
Documentation
https://developer.dhl.com/api-reference/authentication-api-post-parcel-germany
📖
Documentation
https://developer.dhl.com/api-reference/datafactory-autocomplete-20-post-parcel-germany
📖
Documentation
https://developer.dhl.com/api-reference/deutsche-post-hybrid-mail-shipments-e-post-post-parcel-germany
📖
Documentation
https://developer.dhl.com/api-reference/deutsche-post-international-post-parcel-germany
📖
Documentation
https://developer.dhl.com/api-reference/deutsche-post-internetmarke-post-parcel-germany
📖
Documentation
https://developer.dhl.com/api-reference/deutsche-post-print-mailing-dispatch-preparation-post-parcel-germany
📖
Documentation
https://developer.dhl.com/api-reference/deutsche-post-print-mailing-targeting-post-parcel-germany
📖
Documentation
https://developer.dhl.com/parcel-connect
📖
Documentation
https://developer.dhl.com/api-reference/econnect-beta-dhl-ecommerce-europe
📖
Documentation
https://developer.dhl.com/api-reference/dhl-parcel-de-pickup-post-parcel-germany
📖
Documentation
https://developer.dhl.com/api-reference/dhl-parcel-de-postnumber-post-parcel-germany
📖
Documentation
https://developer.dhl.com/api-reference/dhl-parcel-de-private-shipping-post-parcel-germany
📖
Documentation
https://developer.dhl.com/api-reference/dhl-parcel-de-returns-post-parcel-germany
📖
Documentation
https://developer.dhl.com/api-reference/parcel-de-shipping-post-parcel-germany-v2
📖
Documentation
https://developer.dhl.com/api-reference/dhl-parcel-de-shipment-tracking-post-parcel-germany
📖
Documentation
https://developer.dhl.com/api-reference/dgf-document
📖
Documentation
https://developer.dhl.com/api-reference/duty-tax-dhl-ecommerce-americas
📖
Documentation
https://developer.dhl.com/api-reference/ecommerce-uk
📖
Documentation
https://developer.dhl.com/api-reference/parcel-eu
📖
Documentation
https://developer.dhl.com/api-reference/pickup-cancellation-dhl-ecommerce-india-blue-dart
📖
Documentation
https://developer.dhl.com/api-reference/price-quote-dhl-freight
📖
Documentation
https://developer.dhl.com/api-reference/print-dhl-freight
📖
Documentation
https://developer.dhl.com/api-reference/product-dhl-freight
📖
Documentation
https://developer.dhl.com/api-reference/product-and-sub-product-pickup-detail-dhl-ecommerce-india-blue-dart
📖
Documentation
https://developer.dhl.com/api-reference/product-finder-dhl-ecommerce-americas
📖
Documentation
https://developer.dhl.com/api-reference/products-api-post-parcel-germany
📖
Documentation
https://developer.dhl.com/api-reference/dgf-push-api
📖
Documentation
https://developer.dhl.com/api-reference/registration-pickup-dhl-ecommerce-india-blue-dart
📖
Documentation
https://developer.dhl.com/api-reference/return-label-dhl-ecommerce-americas
📖
Documentation
https://developer.dhl.com/api-reference/shipment-booking-dhl-freight
📖
Documentation
https://developer.dhl.com/api-reference/dgf-shipment-booking
📖
Documentation
https://developer.dhl.com/api-reference/shipment-label-dhl-global-forwarding
📖
Documentation
https://developer.dhl.com/api-reference/dgf-shipment-status
📖
Documentation
https://developer.dhl.com/api-reference/shipment-tracking-dhl-ecommerce-india-blue-dart
📖
Documentation
https://developer.dhl.com/api-reference/shipment-tracking-v2-dhl-global-forwarding
📖
Documentation
https://developer.dhl.com/api-reference/time-table-dhl-freight
📖
Documentation
https://developer.dhl.com/api-reference/tracking-dhl-ecommerce-americas

Specifications

Schemas & Data

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/dhl:dhl-purchases-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

dhl-purchases-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Dhl Purchases API
  version: 1.0.0
  description: 'Operations tagged Purchases across 2 of this provider''s published API definitions: dhl-dhl-parcel-de-private-shipping-post-parcel-germany-openapi.yml, dhl-dhl-parcel-de-private-shipping-post-parcel-germany-openapi.yml. Each path carries the servers of the definition it was published in.'
servers:
- url: https://api-eu.dhl.com/parcel/de/shipping/of/v1/public
  description: The Private Shipping (DHL OF) Production Environment.
- url: https://api-sandbox.dhl.com/parcel/de/shipping/of/v1/public
  description: The Private Shipping (DHL OF) Sandbox Environment.
tags:
- name: Purchases
paths:
  /shopping-carts/pre-paid:
    post:
      tags:
      - Purchases
      summary: Creates a new shopping cart for a given partner.
      description: Posting a shopping cart on the prepaid endpoint will create a new resource on the server side and will return a complete configured `ShoppingCart` Template. This shopping cart contains an entryURL, pointing to a page on the DHL Online Franking application, which shows the contents of the posted shopping cart and where the shopping cart can be bought through the usual payment process. Partner systems should redirect their customers to this page, so customers can complete their purchase. It is possible to specify the request with an optional callback parameter called "notifyUrl", after a successful purchase, the specified URL including the shopping cart ID will be called, for example https://www.dhl.de?shoppingCartId=XXXXXXXXXXXX
      security:
      - ApiKeyAuth: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ShoppingCartPrePaid'
            examples:
              PrePaidSuccessful:
                summary: A successful Pre-Paid Request
                value:
                  shoppingcart:
                    confirmation:
                      email: noreply@dhl.com
                      notifyUrl: https://www.dhl.de
                    items:
                    - address:
                        receiver:
                          city: Bonn
                          country: DEU
                          email: noreply@dhl.com
                          name2: Selma Sender
                          plz: '53113'
                          street: Sträßchensweg
                          streetNumber: 1-5
                        sender:
                          city: Bonn
                          country: DEU
                          email: noreply@dhl.com
                          name2: Selma Sender
                          plz: '53113'
                          street: Sträßchensweg
                          streetNumber: 1-5
                      product:
                        id: PAK10.NNAHME
                      services:
                        NNAHME:
                          bic: TESTDETT000
                          currency: EUR
                          iban: DEXXXXXXXXXXXXXXXXXXXX
                          nnamount: '12.00'
                          owner: Tester
                          usage: Test
                      type: ShipmentItem
      responses:
        '201':
          description: OK Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ShoppingCartPrePaidOutput'
              examples:
                PrePaidSuccessful:
                  summary: Response of a successful Pre-Paid Request.
                  value:
                    shoppingcart:
                      state: PREPAID
                      download:
                        entryUrl: https://www.dhl.de/send-parcel/gw/rest/init?token=XXX
                      confirmation:
                        notifyUrl: https://www.dhl.de
                        email: noreply@dhl.com
                      items:
                      - address:
                          sender:
                            name2: Selma Sender
                            street: Sträßchensweg
                            streetNumber: 1-5
                            plz: '53113'
                            city: Bonn
                            country: DEU
                            email: noreply@dhl.com
                          receiver:
                            name2: Selma Sender
                            street: Sträßchensweg
                            streetNumber: 1-5
                            plz: '53113'
                            city: Bonn
                            country: DEU
                            email: noreply@dhl.com
                        product:
                          id: PAK10.NNAHME
                        state: PREPAID
                        position: 0
                        services:
                          NNAHME:
                            currency: EUR
                            owner: Tester
                            bic: TESTDETT000
                            iban: DEXXXXXXXXXXXXXXXXXXXX
                            nnamount: '12.00'
                            usage: Test
                        prices:
                        - amount: '10.10'
                          tax: '19.00'
                          vat: '1.61'
                          currency: EUR
                          id: PAK10
                        - amount: '6.90'
                          tax: '19.00'
                          vat: '1.10'
                          currency: EUR
                          id: NNAHME
          headers:
            entryUrl:
              schema:
                type: string
                format: uri
              description: The location (URL) of the generated shopping cart within the DHL checkout UI.
            notifyUrl:
              schema:
                type: string
                format: uri
              description: The callback URL to notify when the shoppingcart was successfully paid. This usually triggers processes at the caller's environment.
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
      operationId: postShoppingCartsPrePaid
      x-operation-id-source: derived
    servers:
    - url: https://api-eu.dhl.com/parcel/de/shipping/of/v1/public
      description: The Private Shipping (DHL OF) Production Environment.
    - url: https://api-sandbox.dhl.com/parcel/de/shipping/of/v1/public
      description: The Private Shipping (DHL OF) Sandbox Environment.
  /shopping-carts/{shoppingCartId}:
    parameters:
    - name: shoppingCartId
      in: path
      description: The shoppingcart id
      schema:
        type: string
      required: true
    get:
      tags:
      - Purchases
      summary: Accesses a purchase of a given customer
      description: Loads a created shoppingcart including all items and services.
      security:
      - ApiKeyAuth: []
      responses:
        '200':
          description: OK.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ShoppingCartPrePaidOutput'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
      operationId: getShoppingCartsByShoppingCartId
      x-operation-id-source: derived
    servers:
    - url: https://api-eu.dhl.com/parcel/de/shipping/of/v1/public
      description: The Private Shipping (DHL OF) Production Environment.
    - url: https://api-sandbox.dhl.com/parcel/de/shipping/of/v1/public
      description: The Private Shipping (DHL OF) Sandbox Environment.
components:
  schemas:
    ShoppingCart:
      type: object
      properties:
        owner:
          type: string
          description: the postnumber
          example: 12341887
        items:
          type: array
          items:
            $ref: '#/components/schemas/Item'
        controls:
          type: array
          items:
            $ref: '#/components/schemas/ShoppingCartPrePaidControl'
    ShoppingCartId:
      type: string
      maxLength: 12
      minLength: 12
    InvoiceOutput:
      type: object
      properties:
        invoiceNumber:
          type: string
          description: The Invoice-Number of the generated Invoice.
          example: DOF-XXX-XXX
        invoice:
          $ref: '#/components/schemas/Address'
    Error:
      type: object
      description: Error information.
      properties:
        code:
          type: string
          description: The business-level error code.
        detail:
          type: string
          description: The reason why the error occurred. This string is provided for user-friendliness and might change in the future. Use the error code for client-side workflow. (Note':' This is a business cause, not the HTTP error.)
      required:
      - code
      - detail
      example:
        code: Example Error Code
        detail: Error Details
    ShoppingCartPrePaid:
      type: object
      properties:
        shoppingcart:
          $ref: '#/components/schemas/ShoppingCart'
    Address:
      description: required fields can differ from country to country, so there are no fields marked as required in this document
      allOf:
      - $ref: '#/components/schemas/AddressBase'
      - properties:
          name1:
            type: string
            description: the salutation
            maxLength: 35
            example: Mr.
          name2:
            type: string
            maxLength: 35
            description: First and Lastname
            example: Selma Sender
          name3:
            type: string
            maxLength: 35
            description: Address Additional
          addressAddition1:
            type: string
            maxLength: 35
            description: additional address data, used only in a few countries
          addressAddition2:
            type: string
            maxLength: 35
            description: additional address data, used only in a few countries
          street:
            type: string
            maxLength: 35
            description: the street name
            example: Sträßchensweg
          streetNumber:
            type: string
            maxLength: 10
            example: 1-5
          city:
            type: string
            maxLength: 35
            example: Bonn
          plz:
            type: string
            maxLength: 17
            example: 53113
          province:
            type: string
            maxLength: 35
            example: Nordrhein-Westfalen
          country:
            type: string
            maxLength: 3
            minLength: 3
            example: DEU
          email:
            type: string
            format: email
            maxLength: 70
            example: noreply@dhl.com
          phone:
            type: string
            maxLength: 35
            example: +49 3521 123456789
    ShoppingCartPrePaidControl:
      type: string
    ShoppingCartPrePaidOutput:
      type: object
      properties:
        shoppingcart:
          type: object
          properties:
            state:
              $ref: '#/components/schemas/ShoppingCartState'
            items:
              type: array
              items:
                $ref: '#/components/schemas/Item'
            confirmation:
              $ref: '#/components/schemas/Confirmation'
            lang:
              type: string
              enum:
              - de
              - en
            owner:
              type: string
              description: the postnumber
            payment:
              $ref: '#/components/schemas/PaymentProvider'
            invoice:
              $ref: '#/components/schemas/InvoiceOutput'
            download:
              $ref: '#/components/schemas/DownloadUrl'
            shoppingCartId:
              $ref: '#/components/schemas/ShoppingCartId'
    PaymentProvider:
      type: object
      properties:
        provider:
          type: string
          enum:
          - caas
          - dummypay
    Confirmation:
      type: object
      properties:
        email:
          type: string
          format: email
        notifyUrl:
          type: string
          description: The callback URL to notify when the shoppingcart was successfully paid. This usually triggers processes at the caller's environment.
          example: https://www.dhl.de
        acceptAtb:
          type: boolean
        acceptAgb:
          type: boolean
    ShoppingCartState:
      type: string
      enum:
      - PREPAID
      - PAYED
      - RESERVED
      - VOIDED
      - INCOMPLETE
      - INPAYMENT
      - INPAYMENTCANCELED
      - CANCELED
    DownloadUrl:
      type: object
      properties:
        entryUrl:
          type: string
          description: The location (URL) of the generated shopping cart within the DHL checkout UI.
          example: https://www.dhl.de/int-versenden/gw/rest/init?token=XXX
    AddressBase:
      type: object
      description: Base Address type
      properties:
        type:
          type: string
      discriminator:
        propertyName: type
    Item:
      type: object
      discriminator:
        propertyName: type
        mapping:
          PickupItem: PickupItem
          ShipmentItem: ShipmentItem
          CouponSetItem: CouponSetItem
          PickupItemOutput: PickupItemOutput
          ShipmentItemOutput: ShipmentItemOutput
          CouponSetItemOutput: CouponSetItemOutput
      properties:
        type:
          type: string
  responses:
    '401':
      description: 'Unauthorized - The client could not be authenticated since the request lacks the required HTTP headers or the credentials are invalid.

        '
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    '404':
      description: Not found
    '403':
      description: 'Forbidden - The client has successfully been authenticated but has no authorization to access the given resource.

        '
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    '400':
      description: 'Bad Request - The request could not be understood by the server due to malformed syntax or semantic errors.

        '
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: dhl-api-key
      description: The dhl-api-key can be obtained at [DPDHL's development portal](https://developer.dhl.com).
x-refined-from:
- dhl-dhl-parcel-de-private-shipping-post-parcel-germany-openapi.yml
- dhl-dhl-parcel-de-private-shipping-post-parcel-germany-openapi.yml