parcelLab Promise API

Pre-checkout delivery date predictions.

GitHub OpenAPI
Business capability
ETA Prediction Management BC-2510.30

Operations 1

GET /v4/promise/prediction/predict/ Generate prediction #

Documentation

Specifications

Schemas & Data

Other Resources

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/parcellab:parcellab-promise-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

parcellab-promise-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: parcelLab Promise API
  version: v4
  description: '# API Description


    ## Overview


    Use this API to interact with the parcelLab platform. It is currently in preview. For a reference of our current API, please refer to the API documentation.


    The API v4 allows for enhanced and more standardized interaction with our platform. It does however not yet cover all of the features of our v1/v2 APIs.


    ## Authentication


    Most endpoints in this API need authentication, unless otherwise stated. The authentication is done using the `Authorization` header with the value `Parcellab-API-Token `. You can generate the token in our portal, or ask our support team for one. The token needs to be base64 encoded together with the account ID, like: `base64encode(account_id:token)`. Here is an example of how to do it in Python:


    ```python

    import base64

    base64.b64encode(b''account_id:token'').decode(''utf-8'')

    ```


    ## Errors


    The API uses standard HTTP status codes to show the success or failure of a request. In case of an error, the response body will contain a JSON object with the following structure:


    ```json

    {

    "type": "client_error",

    "errors": [

    {

    "code": "error_code",

    "detail": "Error message.",

    "attr": "Optional additional information."

    }

    ]

    }

    ```


    ### 401 Unauthorized


    The API returns these errors with the status code 401 when the authentication fails. It also returns them when a request does not include the authentication information. Here are the 2 possible errors.


    ```json

    {

    "type": "client_error",

    "errors": [

    {

    "code": "authentication_failed",

    "detail": "Incorrect authentication credentials.",

    "attr": null

    }

    ]

    }

    ```


    ```json

    {

    "type": "client_error",

    "errors": [

    {

    "code": "not_authenticated",

    "detail": "Authentication credentials were not provided.",

    "attr": null

    }

    ]

    }

    ```


    ### 403 Forbidden


    The API returns this error when the authentication is correct but does not allow the request. For example, an API token with only the `read` scope gets this error on a POST. Here is how it looks:


    ```json

    {

    "type": "client_error",

    "errors": [

    {

    "code": "permission_denied",

    "detail": "You do not have permission to perform this action.",

    "attr": null

    }

    ]

    }

    ```


    ### 405 Method Not Allowed


    The API returns this error when you call an endpoint with an unexpected HTTP method. For example, if updating a user needs a POST request and you send a PATCH instead, you get this error. Here is how it looks:


    ```json

    {

    "type": "client_error",

    "errors": [

    {

    "code": "method_not_allowed",

    "detail": "Method “patch” not allowed.",

    "attr": null

    }

    ]

    }

    ```


    ### 406 Not Acceptable


    The API returns this error if you send an `Accept` header with a value other than `application/json`. Here is how the response would look:


    ```json

    {

    "type": "client_error",

    "errors": [

    {

    "code": "not_acceptable",

    "detail": "Could not satisfy the request Accept header.",

    "attr": null

    }

    ]

    }

    ```


    ### 415 Unsupported Media Type


    The API returns this error when the request content type is not JSON. Here is how the response would look:


    ```json

    {

    "type": "client_error",

    "errors": [

    {

    "code": "not_acceptable",

    "detail": "Unsupported media type “application/xml” in request.",

    "attr": null

    }

    ]

    }

    ```


    ### 500 Internal Server Error


    The API returns this error when the server encounters an unexpected error. Here is how the response would look:


    ```json

    {

    "type": "server_error",

    "errors": [

    {

    "code": "error",

    "detail": "A server error occurred.",

    "attr": null

    }

    ]

    }

    ```'
tags:
- name: Promise
paths:
  /v4/promise/prediction/predict/:
    get:
      operationId: promise_prediction_predict_retrieve
      description: 'If IP lookup fails or no delivery methods match, Backend uses fallback_country_iso3 when supplied. Matching IP methods take priority, even in another country. An empty prediction list after method selection does not trigger a fallback.


        IP requests are limited to 60 per minute per caller IP. Excess requests return HTTP 429 with Retry-After. Country and postal code requests do not use this limit.'
      summary: Generate prediction
      parameters:
      - in: query
        name: account
        schema:
          type: integer
          title: Account ID
        description: Account ID
        required: true
      - in: query
        name: calibration
        schema:
          enum:
          - conservative
          - balanced
          - aggressive
          - null
          type:
          - string
          - 'null'
        description: 'Set to true, to indicate that the prediction should be done based on the current, not yet published, promise configuration


          * `conservative` - conservative

          * `balanced` - balanced

          * `aggressive` - aggressive'
      - in: query
        name: courier
        schema:
          type:
          - string
          - 'null'
          minLength: 1
          maxLength: 40
        description: The logistics courier to be used. Defaults to returning all configured couriers.
      - in: query
        name: destination_country_iso3
        schema:
          type:
          - string
          - 'null'
        description: ISO 3166-1 alpha-3 code of the destination country. Supply either this field or destination_ip_address.
      - in: query
        name: destination_ip_address
        schema:
          type:
          - string
          - 'null'
          minLength: 1
        description: Shopper IPv4 or IPv6 address for an estimated delivery location. Do not combine with destination_country_iso3 or destination_postal_code. IP lookup does not confirm a delivery address.
      - in: query
        name: destination_postal_code
        schema:
          type:
          - string
          - 'null'
          minLength: 1
          maxLength: 10
        description: Postal code of the destination. Requires destination_country_iso3.
      - in: query
        name: dispatch_now
        schema:
          type: boolean
          default: false
        description: Forces the forecasted delivery date to skip any warehouse calculation and generate a prediction if the parcel is shipped at the moment of the API call, if set to 'true'
      - in: query
        name: draft
        schema:
          type:
          - boolean
          - 'null'
          title: Draft Mode
        description: Set to true, to indicate that the prediction should be done based on the current, not yet published, promise configuration
      - in: query
        name: fallback_country_iso3
        schema:
          type:
          - string
          - 'null'
        description: Optional ISO 3166-1 alpha-3 country for IP destinations. Used when IP lookup fails or no delivery methods match. Matching IP delivery methods take priority. The fallback uses no IP postal code or region.
      - in: query
        name: language_iso2
        schema:
          type:
          - string
          - 'null'
          minLength: 2
          title: Language
          maxLength: 5
          pattern: ^[a-zA-Z]{2}(?:[-_][a-zA-Z]{2})?$
        description: Language code to use for localization. Plain language codes such as en or es are supported. Locale codes with country suffixes such as es_US or es-US are also accepted.
      - in: query
        name: now_override
        schema:
          type:
          - string
          - 'null'
          format: date-time
          title: Now
        description: 'Locks the prediction for a specified request date as a ISO 8601 date and time in UTC format like 2022-06-10T06:42:00Z. Defaults now to the current time if omitted, which is required for production usage. '
      - in: query
        name: service_level
        schema:
          type:
          - string
          - 'null'
          minLength: 1
          maxLength: 40
        description: 'The courier service level mapped in your Promise configuration (for example: express delivery). Defaults to returning all courier service levels.'
      - in: query
        name: tag
        schema:
          type:
          - string
          - 'null'
          minLength: 1
          maxLength: 40
        description: Tag to target prediction adjustment rule
      - in: query
        name: warehouse
        schema:
          type:
          - string
          - 'null'
          minLength: 1
          maxLength: 40
        description: 'The warehouse the delivery shipped from (input field: key). Defaults to the default warehouse for the destination.'
      tags:
      - Promise
      security:
      - HeaderToken: []
      - OAuth2Authentication: []
      - {}
      responses:
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error400Response'
          description: ''
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse404'
              examples:
                NotFound:
                  value:
                    type: client_error
                    errors:
                    - code: not_found
                      detail: Not found.
                      attr: null
          description: ''
        '429':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse429'
              examples:
                Throttled:
                  value:
                    type: client_error
                    errors:
                    - code: throttled
                      detail: Request was throttled.
                      attr: null
          description: ''
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PredictionResponse'
          description: ''
components:
  schemas:
    Prediction:
      properties:
        id:
          description: Delivery Method ID
          title: Id
          type: string
        warehouse:
          description: Warehouse ID
          title: Warehouse
          type: string
        courier:
          description: parcelLab courier code, e.g. ups
          title: Courier
          type: string
        courier_name:
          description: Pretty courier name
          title: Courier Name
          type: string
        courier_alias:
          description: Retailer internal courier code
          items:
            type: string
          title: Courier Alias
          type: array
        courier_service_level:
          description: All specified aliases for the service level
          items:
            type: string
          title: Courier Service Level
          type: array
        global_courier_service_level:
          $ref: '#/components/schemas/CourierServiceLevelEnum'
          description: parcelLab global courier service level for the delivery method. Unrecognized Backend values are returned as unknown.
        prediction:
          $ref: '#/components/schemas/PredictionDetails'
          description: The prediction details
      required:
      - id
      - warehouse
      - courier
      - courier_name
      - courier_alias
      - courier_service_level
      - global_courier_service_level
      - prediction
      title: Prediction
      type: object
    Error429:
      type: object
      properties:
        code:
          $ref: '#/components/schemas/ErrorCode429Enum'
        detail:
          type: string
        attr:
          type:
          - string
          - 'null'
      required:
      - attr
      - code
      - detail
    PredictionLocation:
      properties:
        country:
          description: Country code returned by Backend for prediction.
          title: Country
          type: string
        region:
          description: Resolved region, or the ISO2 country for a country-level location.
          title: Region
          type: string
        zip:
          anyOf:
          - type: string
          - type: 'null'
          description: Postal code used for prediction. Can be null, or "0" for the existing country-level fallback.
          title: Zip
      required:
      - country
      - region
      - zip
      title: PredictionLocation
      type: object
    ErrorResponse404:
      type: object
      properties:
        type:
          $ref: '#/components/schemas/ClientErrorEnum'
        errors:
          type: array
          items:
            $ref: '#/components/schemas/Error404'
      required:
      - errors
      - type
    GenericErrorItem:
      type: object
      properties:
        code:
          type: string
        detail:
          type: string
        attr:
          type:
          - string
          - 'null'
      required:
      - code
      - detail
    ErrorResponse429:
      type: object
      properties:
        type:
          $ref: '#/components/schemas/ClientErrorEnum'
        errors:
          type: array
          items:
            $ref: '#/components/schemas/Error429'
      required:
      - errors
      - type
    ErrorCode429Enum:
      enum:
      - throttled
      type: string
      description: '* `throttled` - Throttled'
    Error400Response:
      type: object
      properties:
        type:
          type: string
        errors:
          type: array
          items:
            $ref: '#/components/schemas/GenericErrorItem'
      required:
      - errors
      - type
    ClientErrorEnum:
      enum:
      - client_error
      type: string
      description: '* `client_error` - Client Error'
    ErrorCode404Enum:
      enum:
      - not_found
      type: string
      description: '* `not_found` - Not Found'
    CourierServiceLevelEnum:
      enum:
      - standard
      - unused
      - express
      - expedited
      - unknown
      title: CourierServiceLevelEnum
      type: string
    Error404:
      type: object
      properties:
        code:
          $ref: '#/components/schemas/ErrorCode404Enum'
        detail:
          type: string
        attr:
          type:
          - string
          - 'null'
      required:
      - attr
      - code
      - detail
    PredictionResponse:
      properties:
        request_id:
          title: Request Id
          type: string
        success:
          title: Success
          type: boolean
        prediction:
          items:
            $ref: '#/components/schemas/Prediction'
          title: Prediction
          type: array
        location:
          anyOf:
          - $ref: '#/components/schemas/PredictionLocation'
          - type: 'null'
          default: null
          description: Location selected by Backend for prediction, including an IP fallback country when used. Retained when no predictions are generated. Null if resolution failed or an older Backend response omits the location.
      required:
      - request_id
      - success
      - prediction
      title: PredictionResponse
      type: object
    PredictionDetails:
      properties:
        min:
          description: 'The minimum number of expected courier working days until delivery. Note: The value for minimum and maximum can be equal.'
          title: Min
          type: integer
        max:
          description: 'The maximum number of expected courier working days until delivery. Note: The value for minimum and maximum can be equal.'
          title: Max
          type: integer
        likely:
          description: The most likely number of expected courier working days until delivery.
          title: Likely
          type: integer
        send_date:
          description: The date of dispatch as per warehouse configuration.
          format: date
          title: Send Date
          type: string
        earliest_date:
          description: The earliest expected delivery date taking into consideration working days of the courier, holidays in the destination, and warehouse cut-off and handling times.
          format: date
          title: Earliest Date
          type: string
        latest_date:
          description: The latest expected delivery date taking into consideration working days of the courier, holidays in the destination, and warehouse cut-off and handling times.
          format: date
          title: Latest Date
          type: string
        most_likely_date:
          description: The most likely individual date of delivery.
          format: date
          title: Most Likely Date
          type: string
        earliest_locale:
          description: Localized representations of the earliest expected delivery date in the specified format.
          title: Earliest Locale
          type: string
        latest_locale:
          description: Localized representations of the latest expected delivery date in the specified format.
          title: Latest Locale
          type: string
        most_likely_locale:
          description: Localized representations of the most likely delivery date in the specified format.
          title: Most Likely Locale
          type: string
        cutoff:
          description: The time in minutes until cut-off for the estimated delivery dates.
          title: Cutoff
          type: integer
        cutoff_locale:
          description: Localized representation of the cut-off time.
          title: Cutoff Locale
          type: string
      required:
      - min
      - max
      - likely
      - send_date
      - earliest_date
      - latest_date
      - most_likely_date
      - earliest_locale
      - latest_locale
      - most_likely_locale
      - cutoff
      - cutoff_locale
      title: PredictionDetails
      type: object
  securitySchemes:
    HeaderToken:
      type: apiKey
      in: header
      name: Authorization
      x-gitbook-prefix: Parcellab-API-Token
      x-gitbook-token-placeholder: YOUR_BASE64_ENCODED_API_TOKEN
      description: 'Send `Authorization: Parcellab-API-Token <encoded-token>`.


        `<encoded-token>` = `base64(account_id:token)` as provided in the portal.'
    OAuth2Authentication:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: 'Unbound access tokens use Authorization: Bearer <token>. DPoP-bound tokens use Authorization: DPoP <token> and a DPoP proof header signed with the bound key for each request. Supported proof algorithms: ES256 and RS256.'