Create Shipment for Locker

Creating a shipment, requires the sender's address, recipient's address, and a parcel (one or more items and their related information). Find below more details on how you can create a shipment

Create Shipment

POST https://api-sandbox.shiplemon.com/v1/shipments

Request Body

Name
Type
Description

related_order_id

string

You can use this to store your internal reference id.

For example the related order to be matched for this shipment from the ecommerce platform

cash_on_delivery

number

Cash on Delivery (Αντικαταβολή) will be allowed only if you have provided your own credentials when using the rated carrier

The amount for cash on delivery. If shipment does not use cash on delivery, set null

rate_id*

string

This is the selected rate (the id of the rate selected in the /rates request) This string is not a string that you have to create. It will be provided and you have to include it in the shipment request in order for us to know the selected option of the user

items*

array

This is an array that describes more details about the items that will be sent in the shipment and that you want to get rates for. Each item in this array is an object in the following format (all the dimensions are in cm and the weight in grams) The value and currency fields are optional {

"weight":1000,

"height":20,

"width":20,

"length":20,

"notes":"nike air max",

"value":20,

"currency": "EUR",

"compartment_size": 1 }

address_from*

object

This object describes where the pickup of the item will happen. This is the starting point (point A) of the shipment. company, address2, notes and zip are optional and can accept null This object looks like this: {

"loacation_id": "123",

"country":"GR",

"zip":"14451",

"name": "Kostas Papadopoulos",

"company": "Papadopoulou IKE",

"address": "Papadopoulou 23",

"address2": "Floor 2",

"city": "Athens",

"phone": "+306900000000",

"email":"example@email.com",

"country": "GR",

"notes": "call me" } In the country parameter we accept the ALPHA-2 code format. You can find more here: https://www.iban.com/country-codes)

address_to*

object

The same format as the address_from in order to define the destination of the shipment (point B)

incoming_order_id

string

Use this parameter to link this shipment as a child of an incoming order

extras

object

See request example for object properties

Example data for request (eg. Boxnow)

  • extras:

    • insurance_amount: the declared amount for the package to be insured

    • is_saturday_delivery: if the delivery is about to happen on Saturday (if the carrier support it)

    • is_customs_invoice_document: boolean flag that indicates if the upload PDF is invoice document to be used for customs

{
    "address_from":{
        "location_id":"12345",
        "country":"GR",
        "company":"",
        "name":"John Doe",
        "phone":"+306912345678",
        "email":"john@mail.com",
        "address":"Jane Street 1",
        "state":"I",
        "city":"Athens",
        "zip":"11111",
    },
    "address_to":{
        "location_id":"67890",
        "country":"GR",
        "country_code":"GR",
        "dial_code":"+30",
        "name":"Mary Doe",
        "zip":"11111",
        "city":"Athns",
        "address":"Jane Street 2",
        "phone":"+306912345678"
    },
    "items":[{
        "width":1,
        "height":1,
        "length":1,
        "weight":5000,
        "label":"Box",
        "notes":"Box",
        "invoice_lines":[],
        "compartment_size": 1,
    }],
    "rate_id": "boxnow_next-day_40b892de-02ea-47f7-85d9-f9dccef1144f",
    "cash_on_delivery":null,
    "related_order_id":null,
    "extras": {
        "insurance_amount": 100,
        "is_customs_invoice_document": false,
        "is_saturday_delivery": true
    }
}

Scheduling a pickup

You can also add the following if you want to schedule courier to PICKUP from address_from, otherwise set it to null or don't provide this property in the JSON completely. Important! you can set pickup only for rates that support it "has_pickup": true

    "pickup": {
      "date": "YYYY-MM-DD"
    }

Request

Example request body

curl -x POST https://api-sandbox.shiplemon.com/v1/shipments/  \
    -H "x-api-key: <YOUR_API_KEY>" \
    -H "Content-Type: application/json"  \
    -d '{
       "address_from": { 
            "location_id": "12345",
            "country":"GR", 
            "zip":"14451",
            "name": "Kostas Papadopoulos", 
            "company": "Papadopoulou IKE", 
            "address": "Papadopoulou 23",
            "address2": "Floor 2"
            "city": "Athens",
            "phone": "+306900000000",
            "email": "example@gmail.com"
            "country": "GR",
            "notes": "call me"            
        },
        "address_to": {
            "location_id": "67890",
            "name": "SG2",
            "country": "GR",
            "state": "I",
            "city": "Athens",
            "zip": "14451",
            "address": "Kolokotroni 2",
            "email": "example2@gmail.com",
            "phone": "+306900000000"
        },
        "items": [
            {
                "weight": 2000,
                "height": 10,
                "width": 10,
                "length": 10,
                "notes": "Clothes",
                "compartment_size": 1,
                "invoice_lines":[
                  {
                     "country_of_origin": "GR",
                     "description": "glasses-RETURN TO ORIGIN",
                     "commodity_code": "9004.90.10",
                     "quantity": "1",
                     "value": 10,
                     "weight": 500
                   }
                ],
            }
        ],
        "rate_id": "boxnow_next-day_40b892de-02ea-47f7-85d9-f9dccef1144f",
        "cash_on_delivery":10,
        "related_order_id":"23",
        "extras": {
            "insurance_amount": 100,
            "is_customs_invoice_document": false,
            "is_saturday_delivery": false
        }
    }'

Response

Returns the created shipment

{
  "invoice_id": null,
  "partner_credentials_used": true,
  "related_order_id": null,
  "incoming_order_id": null,
  "return_request_id": null,
  "payment_ref": "ownaccount",
  "payment_amount": 9.72,
  "state": "created",
  "driver": "boxnow",
  "pickup_ref": null,
  "pickup_list_ref": null,
  "tracking_ref": "2338891501",
  "tracking_url": null,
  "tracking_status": "PRE_TRANSIT",
  "tracking_history": [
    {
      "status": "DELIVERED",
      "status_date": "2023-11-20T00:00:01.992Z",
      "status_details": "ΠΑΡΑΔΟΣΗ ΑΠΟ ΔΙΑΝΟΜΕΑ"
    },
    {
      "status": "EXCEPTION",
      "status_date": "2023-11-20T00:00:02.195Z",
      "status_details": "ΑΚΥΡΩΣΗ ΑΠΟ ΔΙΑΝΟΜΕΑ"
    },
    {
      "status": "TRANSIT",
      "status_date": "2023-11-20T00:00:02.075Z",
      "status_details": "ΕΚΦΟΡΤΩΣΗ ΑΠΟ ΜΕΤΑΦΟΡΙΚΟ ΜΕΣΟ"
    },
    {
      "status": "PRE_TRANSIT",
      "status_date": "2023-11-20T00:00:02.064Z",
      "status_details": "ΔΗΜΙΟΥΡΓΙΑ ΣΥ.ΔΕ.ΤΑ. ΑΠΟ ΠΕΛΑΤΗ"
    }
  ],
  "tracking_history_last_updated_at": "2022-08-08T09:15:00.947Z", 
  "label_url": "https://static.shiplemon.com/sandbox/labels/boxnow/2338891501.pdf",
  "child_vouchers": [
    {
      "tracking_ref": "2338891501",
      "tracking_url": "",
      "label_url": "https://static.shiplemon.com/sandbox/labels/boxnow/2338891501.pdf"
    }
  ],
  "address_from": { 
    "country":"GR", 
    "zip":"14451",
    "name": "Kostas Papadopoulos", 
    "company": "Papadopoulou IKE", 
    "address": "Papadopoulou 23",
    "address2": "Floor 2"
    "city": "Athens",
    "phone": "+306900000000",
    "email": "example@gmail.com"
    "country": "GR",
    "notes": "call me"            
  },
  "address_to": {
    "name": "SG2",
    "country": "GR",
    "state": "I",
    "city": "Athens",
    "zip": "14451",
    "address": "Kolokotroni 2",
    "email": "example2@gmail.com",
    "phone": "+306900000000"
  },
  "items": [
    {
      "width": 20,
      "height": 20,
      "length": 20,
      "weight": 1600,
      "label": "Box",
      "notes": "Box",
      "invoice_lines": [
        {
          "country_of_origin": "GR",
          "description": "glasses-RETURN TO ORIGIN",
          "commodity_code": "9004.90.10",
          "quantity": "1",
          "value": 10,
          "weight": 500
        }
      ]
    }
  ],
  "pickup": { // if date not provided pickup is null
    "date": "2023-11-22",
    "time": "11:00-17:00"
  },
  "pickup_at": null,
  "delivered_at": null,
  "refunded_at": null,
  "rate": {
    "id": "boxnow_next-day_40b892de-02ea-47f7-85d9-f9dccef1144f",
    "friendly_name": "BoxNow",
    "driver": "boxnow",
    "provider": {
      "name": "BOXNOW",
      "image": "https://static.shiplemon.com/providers/boxnow.svg"
    },
    "service": {
       "code": "next-day",
       "name": "Next Day",
       "estimated_delivery_in_days": 2
    },
    "total_amount": 9.72,
    "total_without_tax_amount": 7.84,
    "tax_amount": 1.88,
    "currency": "EUR",
    "has_cash_on_delivery": false,
    "has_custom_credentials": false,
    "has_shipment_pickup_combined": false,
    "has_pickup": true,
    "transportation": "road",
    "has_mass_printing": false,
    "has_customs_invoice_upload": false,
    "has_insurance_ability": false,
    "has_saturday_delivery": false,
    "has_same_day_pickup": false,
    "pickup_slot_length_in_hours": 2,
    "pickup_same_day_latest_at": null,
    "pickup_earliest_at": null,
    "pickup_latest_at": null,
    "metadata": {
      "items": [
        {
          "width": 20,
          "height": 20,
          "length": 20,
          "weight": 1600,
          "label": "Box",
          "notes": "Box",
          "compartment_size": 1,
          "invoice_lines": [
            {
              "country_of_origin": "GR",
              "description": "glasses-RETURN TO ORIGIN",
              "commodity_code": "9004.90.10",
              "quantity": "1",
              "value": 10,
              "weight": 500
            }
          ]
        }
      ],
      "address_from": { 
        "country":"GR", 
        "zip":"14451",
        "name": "Kostas Papadopoulos", 
        "company": "Papadopoulou IKE", 
        "address": "Papadopoulou 23",
        "address2": "Floor 2"
        "city": "Athens",
        "phone": "+306900000000",
        "email": "example@gmail.com"
        "country": "GR",
        "notes": "call me"            
      },
      "address_to": {
        "name": "SG2",
        "country": "GR",
        "state": "I",
        "city": "Athens",
        "zip": "14451",
        "address": "Kolokotroni 2",
        "email": "example2@gmail.com",
        "phone": "+306900000000"
      },
    }
  },
  "cash_on_delivery": 0,
  "extras": {
    "insurance_amount": 100, // number or undefined
    "is_customs_invoice_document": false, // boolean or undefined
    "is_saturday_delivery": false // boolean or undefined
  },
  "created_at": "2023-11-21T12:51:51.422Z",
  "updated_at": "2023-11-21T12:51:51.422Z"
}

Last updated