PostNL Barcode API

Generate a unique barcode to use on a shipping label (v1_1).

GitHub OpenAPI
Business capability
Logistics Operations Management BC-520.50

Operations 1

GET /shipment/v1_1/barcode Generate a unique barcode #

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/postnl:barcode-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. See our Privacy Policy and Terms.

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

OpenAPI Specification

postnl-barcode-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Barcode API
  description: Generate a unique barcode to use for your shipping label
  version: v1_1
servers:
- url: https://api-sandbox.postnl.nl
  description: Non-Production server
- url: https://api.postnl.nl
  description: Production server
tags:
- name: Barcode
paths:
  /shipment/v1_1/barcode:
    get:
      tags:
      - Barcode
      summary: Generate a unique barcode
      operationId: GenerateBarcode
      security:
      - APIKeyHeader: []
      description: 'Request example:

        ```

        curl -X GET "https://api-sandbox.postnl.nl/shipment/v1_1/barcode?CustomerCode=DEVC&CustomerNumber=11223344&Type=3S&Serie=000000000-999999999&" \

        -H "Accept: application/json" \

        -H "apikey: APIKEY-HERE"

        ```'
      parameters:
      - name: CustomerCode
        in: query
        description: The customer code for which you want a barcode to be generated
        required: true
        schema:
          type: string
          example: DEVC
      - name: CustomerNumber
        in: query
        description: The customer code for which you want a barcode to be generated
        required: true
        schema:
          type: string
          example: '11223344'
      - name: Type
        in: query
        description: The barcode type that you want to be generated
        required: true
        schema:
          type: string
          example: 3S
          enum:
          - 2S
          - 3S
          - CC
          - CP
          - CD
          - CF
          - LA
          - RI
          - UE
      - name: Serie
        in: query
        description: Barcode serie in the format '###000000-###000000', for example 100000-20000. The range must consist of a minimal difference of 100.000. It is allowed to add extra leading zeros at the beginning of the serie. See [Guidelines](https://developer.postnl.nl/docs/#/http/api-endpoints/send-track/barcode/guidelines) for more information.
        required: false
        schema:
          type: string
          minLength: 6
          maxLength: 9
          example: '100000000'
      - name: Range
        in: query
        description: Only used for International Mail and Packet products (PEPS) shipments (with type LA, RI, UE). Identifying the issuing postal administration's country (NL in this case).
        required: false
        schema:
          type: string
      responses:
        '200':
          description: A barcode
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/barcodeResponse'
              example:
                Barcode: 3SDEVC903942795
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/barcodeResponseInvalid'
              example:
                errors:
                - ErrorMsg: Too many numbers in series
                  ErrorNumber: '8'
        '401':
          description: Invalid apikey
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Unauthorized'
              example:
                message: Failed to resolve API Key variable 'request.header.apikey'
                http_status_code: 401
        '405':
          description: Method not allowed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MethodNotAllowedOnlyGetPost'
              example:
                message: Only GET & POST requests allowed
                http_status_code: 405
        '429':
          description: Too many requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TooManyRequests'
              example:
                message: Too many requests. Rate limit exceeded!
                http_status_code: 429
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalServerError'
              example:
                fault:
                  faultstring: Unexpected token in object literal
                  detail:
                    errorcode: Validation Fault
components:
  schemas:
    barcodeError:
      type: object
      properties:
        ErrorMsg:
          type: string
          description: The error message
          example: Too many numbers in series
        ErrorNumber:
          type: string
          description: The error code
          example: '8'
    barcodeResponse:
      type: object
      properties:
        Barcode:
          type: string
          example: 3SDEVC903942795
    barcodeResponseInvalid:
      type: object
      properties:
        errors:
          type: array
          description: A list of errors. See [Error codes](https://developer.postnl.nl/docs/#/http/reference-data/error-codes) for possible values.
          items:
            $ref: '#/components/schemas/barcodeError'
    Unauthorized:
      type: object
      properties:
        message:
          type: string
          example: Failed to resolve API Key variable 'request.header.apikey'
        http_status_code:
          type: number
          example: 401
    InternalServerError:
      type: object
      properties:
        fault:
          type: object
          properties:
            faultstring:
              type: string
              example: Unexpected token in object literal
            detail:
              type: object
              properties:
                errorcode:
                  type: string
                  example: Validation Fault
    TooManyRequests:
      type: object
      properties:
        message:
          type: string
          example: Too many requests. Rate limit exceeded!
        http_status_code:
          type: number
          example: 429
    MethodNotAllowedOnlyGetPost:
      type: object
      properties:
        message:
          type: string
          example: Only Get & POST requests allowed
        http_status_code:
          type: number
          example: 405
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      name: apikey
      in: header