Create Order


This method is used to create pickup orders that can be viewed from the pickup orders page in the dashboard. It can be used by sending a POST request to: https://system.deftship.com/api/pickup-orders.

Endpoint

Method URI Headers
POST pickup-orders default

Requests

Field Required Type Description
id No Integer Pickup order id to update an already existing order
from_address_id No* Integer This field is used to identify sender address. You can fetch your saved addresses from address-book. Addresses can be managed from the website on live dashboard or sandbox dashboard. Not required if a "from_address" object was used.

Note: If both "from_address_id" and "from_address" fields are defined system will prioritise the "from_address_id".
from_address {} No* Object Sender address container, not required if a "from_address_id" was used
+name Yes String Name of the sender
+attention No String Attention of the sender
+street_1 Yes String Street line 1
+street_2 No String Street line 2
+street_3 No String Street line 3
+city Yes String City
+zip Yes String Postal Zip code
+state No* String State - This field is required for US or Canada addresses please refer to country-codes
+country Yes String Country (code) for the list please refer to country-codes
+telephone Yes String Telephone Number
+email No String Email
+is_residential Yes Boolean Residential Indicator
carrier Yes String Carrier is one of the following [ups, fedex, dhl, usps]
pickup_date No* String Proposed pickup date, in Y-m-d. Condition: only required if a "carrier" is "ups", "fedex"
ready_time No* String Opening time of pickup address, in H:i. Condition: only required if a "carrier" is "ups", "fedex"
close_time No* String Closing time of pickup address, in H:i. Condition: only required if a "carrier" is "ups", "fedex"
pieces [] Yes Array An array containing all the information about pieces
+is_gfp No* Boolean If the item is Ground Freight. Default value is false. Condition: only required if a "carrier" is "ups"
+service Yes String For a full list please check out carrier service types. If is_gfp is true the value will be set to
+container_type No* String Container type is either "package" or "letter". Condition: only required if a "carrier" is "ups"
+quantity Yes Integer Quantity of the pickup item
+weight Yes Float Weight (LBS)
+destination_country_code No* String Destination country needs to be a country code please refer to country-codes. Condition: only required if a "carrier" is "ups"

Request Examples

UPS Request Example

{
    "from_address_id": 1387235969,
    "carrier": "ups",
    "ready_time": "13:30",
    "close_time": "15:30",
    "pickup_date": "04/28/2023",
    "pieces": [
        {
            "is_gfp": false,
            "service": "PICKUP-UPS-1",
            "container_type": "package",
            "quantity": "2",
            "weight": "20",
            "destination_country_code": "US"
        }
    ]
}

FedEx Request Example

{
    "from_address_id": 362451571,
    "carrier": "fedex",
    "ready_time": "13:30",
    "close_time": "15:30",
    "pickup_date": "05/01/2023",
    "pieces": [
        {
            "service": "PICKUP-FEDEX-1",
            "quantity": "2",
            "weight": "3"
        }
    ]
}

USPS Request Example

{
    "from_address_id": 696756088,
    "carrier": "usps",
    "pieces": [
        {
            "service": "PICKUP-USPS-1",
            "quantity": "2",
            "weight": "20"
        }
    ]
} 

Response

Field Type Description
success Boolean true or false
data Object Pickup order data container
+id Integer This is the id of your pickup order
+from_address Object This is the from address detail object
++name String Name of the sender
++attention String Attention of the sender
++street_1 String Street line 1
++street_2 String Street line 2
++street_3 String Street line 3
++city String City
++zip String Postal Zip code
++state String State
++country String Country (code) for the list please refer to country-codes
++telephone String Telephone Number
++is_residential Boolean If the address is residential
+piece_count Integer Total piece count
+status String Status
+carrier String Carrier ([ups, fedex, dhl, usps])
+pieces Array Piece details
++readable_service String Readable service name
++is_gfp Boolean If the piece is Ground with Freight Pricing.
++service String Service Code
++container_type String Container Type
++quantity Integer Pieces Quantity
++weight Integer Weight
++destination_country_code String Country of the destination country (code) for the list please refer to country-codes
+total_weight String Total weight in pounds
+ready_time String Ready time of order
+close_time String Close time of order
+pickup_date String Pickup date

Response Example

Successful Example

{
    "success": true,
    "data": {
        "from_address": {
            "id": 1387235969,
            "name": "NV",
            "attention": "NV",
            "city": "LAS VEGAS",
            "state": "NV",
            "zip": "89107",
            "country": "US",
            "telephone": "888888888888",
            "is_residential": false,
            "street_1": "556 Vanguard Way Suite D",
            "street_2": null,
            "street_3": null
        },
        "id": 740102512,
        "piece_count": 1,
        "status": "ready",
        "carrier": "ups",
        "pieces": [
            {
                "readable_service": "UPSĀ® Ground",
                "is_gfp": false,
                "service": "03",
                "container_type": "package",
                "quantity": 2,
                "weight": 20,
                "destination_country_code": "US"
            }
        ],
        "total_weight": "40 LBS",
        "ready_time": "13:30",
        "close_time": "15:30",
        "pickup_date": "05-01-2023"
    }
}

Failed

{
    "success": false,
    "message": "Pickup order could not be saved"
}