# Cancel Pickups

Cancel Pickups.

Endpoint: PUT /api/v1/pickups/cancel
Version: 1.0.0
Security: bearerAuth

## Header parameters:

  - `X-PB-Developer-Partner-Id` (string)
    This is the Developer Partner ID. When the developer is the only partner, this field is not required.

## Request fields (application/json):

  - `pickupIds` (array, required)
    Unique identifiers for scheduled pickups.

  - `options` (array, required)
    An array of key-value pairs specifying additional parameters for the cancellation request. There are three required keys: `REQUESTOR_NAME`, `REASON_FOR_CANCEL` and `REMARKS`. Different carriers required different keys and values for
| Carrier | Is `options` required? | Required keys | Value |
|  --- | --- | --- | --- |
| USPS | No |  |  |
| DHL Express | Yes | `REQUESTOR_NAME`, `REASON_FOR_CANCEL` | `REQUESTOR_NAME` value required; `REASON_FOR_CANCEL` value optional. |
| FedEx | Yes | `REMARKS` | `REMARKS` value required. |

**Notes:**
- Keys are case-sensitive.
- Provide only the keys relevant to the selected carrier.

  - `options.name` (string)
    The name of the parameter.
    Example: REQUESTOR_NAME

  - `options.value` (string)
    The corresponding value for the parameter.
    Example: John Doe

## Response 200 fields (application/json):

  - `pickups` (object)
    Details of the cancelled pickups and their status.

  - `pickups.UPS10191697701340901` (object)
    Pickup ID requested for cancelation.

  - `pickups.UPS10191697701340901.status` (string)
    The status of the pickup.
    Example: cancelled

  - `pickups.UPS10191697701340901.cancellationDate` (string)
    The date and time when the pickup was cancelled.
    Example: 2024-10-19T07:47:22.760623684Z

## Response 400 fields (application/json):

  - `errorCode` (string)
    Error code(s) that appear due to HTTP  400- Invalid or Bad Request, e.g., validation-error.
    Example: validation_error

  - `errorDescription` (string)
    The HTTP 400 Bad Request response status code indicates that the server cannot process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing).
    Example: string

  - `additionalCode` (string)
    A unique identifier for the error, for example 1101055, 0100008, or 1021126.

  - `additionalInfo` (string)
    This is an additional information about the error. This error 'Invalid Request' might appear due to invalid dimension, weight, or serviceID, or if the information is missing.

  - `additionalParameters` (array)

## Response 401 fields (application/json):

  - `message` (string, required)
    This is HTTP 401 Unauthorized response status code, which indicates that the client request has not been completed because it lacks valid authentication credentials for the requested resource.

## Response 500 fields (application/json):

  - `message` (string, required)
    This is HTTP 500 Internal Server Error response status code, which indicates that the server encountered an unexpected condition that prevented it from fulfilling the request.

