Skip to content

Defaults

APIs to create, retrieve, update, and delete default shipment settings for frequently used fields such as carrier, service, sender address, label preferences, and parcel details.

Create Defaults

Request

While creating shipment, a few columns/ fields information are used mandatorily, and if the value for those columns are used repetitively, then it is always better to save last used values. And hence, this API has been introduced. Using this API, default values can be set up for frequently used columns/fields information like carrier and linked services. Setting up the defaults will save both time and efforts.

Security
bearerAuth
Bodyapplication/jsonrequired
namestring

Name of the Default.

Example:"FedEx-Defaults"
defaultIDstring

A unique identifier to be assigned to the Default.

Example:"0d4f3c51-059b-4c28-a83b-a8defa2962cc"
sendingOptionsobject(sendingOptions)

Sending Options will include carrier and its account details, sender details, and parcel details.

curl -i -X POST \
  https://api-dev.sendpro360.pitneycloud.com/shipping/api/v1/defaults \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "FedEx-Defaults",
    "defaultID": "0d4f3c51-059b-4c28-a83b-a8defa2962cc",
    "sendingOptions": {
      "carrier": "FedEx",
      "service": "2DA",
      "carrierAccounts": {
        "USPS": "JYKEb4VQvoVx!",
        "FEDEX": "WRF4VFUUJDx!"
      },
      "labelSize": "DOC_4X6",
      "labelType": "SHIPPING_LABEL",
      "labelFormat": "PDF",
      "fromAddress": {
        "name": "Sender Name",
        "addressLine1": "1600 Amphitheatre Parkway",
        "addressLine2": "near abc street",
        "addressLine3": "near xyz street",
        "company": "PB",
        "email": "testuser@gmail.com",
        "phone": "6502530000",
        "cityTown": "Mountain View",
        "stateProvince": "CA",
        "postalCode": "94043",
        "inductionPostalCode": "06905",
        "countryCode": "US",
        "residential": true
      }
    }
  }'

Responses

Defaults (i.e., default values) have been created successfully.

Bodyapplication/json
idstring

Unique identifier used in Database for Default, for mapping purpose.

Example:"66b1b6d6a2c763f9d0bd5396"
defaultIdstring

Assigned unique identifier for the created Default.

Example:"1c7937cf-fc56-4fc6-95bf-0465ae9acd4f"
Response
{ "id": "66b1b6d6a2c763f9d0bd5396", "defaultId": "1c7937cf-fc56-4fc6-95bf-0465ae9acd4f" }