Spring Global (Spring Omni) Error: Getting Blank Response While Fetching Label

We were facing an issue while we tried to create a shipment (Using /shipments API) and after that we were fetching the label (Using /shipments/{shipment_id}/files API). The issue was that we got blank response. When we checked Shipments on the back office, it looked like below screenshot:

Blank Response

When we clicked on the shipment (with status = “concept”), we got a message as “The shipment was created, but has not been registered with the carrier (yet).

When we understood the concept of this new shipment creation process in Spring Omni, we come to know that in Spring Global, We need to register a shipment instead of only creating the shipment before fetching the label corresponding to the shipment. There are two possible scenarios for registering a shipment:

  1. Create the shipment and register as well at the same time
  2. Create the shipment but register it at a given specific time i.e. in future

1. To register a shipment instantly

While sending the create shipment request, we need to send the “register_at” parameter value as 0 or past time (UNIX timestamp) in the request data. Kindly refer the below code for the same:

{
  "data": {
    "type": "shipments",
    "attributes": {
      "recipient_address": {
        "street_1": "Baker Street",
        "street_2": "Marylebone",
        "street_number": 221,
        "street_number_suffix": "B",
        "postal_code": "NW1 6XE",
        "city": "London",
        "region_code": "ENG",
        "country_code": "GB",
        "first_name": "Sherlock",
        "last_name": "Holmes",
        "company": "Holmes Investigations",
        "email": "s.holmes@holmesinvestigations.com",
        "phone_number": "+31 234 567 890"
      },
      "return_address": {
        "street_1": "Baker Street",
        "street_2": "Marylebone",
        "street_number": 221,
        "street_number_suffix": "B",
        "postal_code": "NW1 6XE",
        "city": "London",
        "region_code": "ENG",
        "country_code": "GB",
        "first_name": "Sherlock",
        "last_name": "Holmes",
        "company": "Holmes Investigations",
        "email": "s.holmes@holmesinvestigations.com",
        "phone_number": "+31 234 567 890"
      },
      "sender_address": {
        "street_1": "Baker Street",
        "street_2": "Marylebone",
        "street_number": 221,
        "street_number_suffix": "B",
        "postal_code": "NW1 6XE",
        "city": "London",
        "region_code": "ENG",
        "country_code": "GB",
        "first_name": "Sherlock",
        "last_name": "Holmes",
        "company": "Holmes Investigations",
        "email": "s.holmes@holmesinvestigations.com",
        "phone_number": "+31 234 567 890"
      },
      "pickup_location": {
        "code": "205604",
        "address": {
          "street_1": "Baker Street",
          "street_2": "Marylebone",
          "street_number": 221,
          "street_number_suffix": "B",
          "postal_code": "NW1 6XE",
          "city": "London",
          "region_code": "ENG",
          "country_code": "GB",
          "first_name": "Sherlock",
          "last_name": "Holmes",
          "company": "Holmes Investigations",
          "email": "s.holmes@holmesinvestigations.com",
          "phone_number": "+31 234 567 890"
        }
      },
      "description": "Order #8008135",
      "physical_properties": {
        "height": 150,
        "width": 300,
        "length": 500,
        "volume": 22.5,
        "weight": 5000
      },
      "items": [
        {
          "sku": "123456789",
          "description": "OnePlus X",
          "item_value": {
            "amount": 995,
            "currency": "EUR"
          },
          "quantity": 2,
          "hs_code": "8517.12.00",
          "origin_country_code": "GB",
          "item_weight": 135
        }
      ],
      "customs": {
        "content_type": "merchandise",
        "invoice_number": "9000",
        "non_delivery": "return",
        "incoterm": "DAP",
        "license_number": "218532158",
        "certificate_number": "12122121"
      },
      "register_at": 0
    },
    "relationships": {
      "service_options": {
        "data": [
          {
            "type": "service-options",
            "id": "4c675b1a-516c-4410-abff-d237fd45bcd0"
          }
        ]
      },
      "shop": {
        "data": {
          "type": "shops",
          "id": "35eddf50-1d84-47a3-8479-6bfda729cd99"
        }
      },
      "service": {
        "data": {
          "type": "services",
          "id": "175a235f-aff5-4e44-87b5-3657b75c1deb"
        }
      },
      "contract": {
        "data": {
          "type": "contracts",
          "id": "2cb32706-5762-4b96-9212-327e6afaeeff"
        }
      }
    }
  }
}

If we send the register_at value as current timestamp then we might get some delay in registering the shipment, So Spring Global has suggested us to send the register_at value as 0 so that the time will be considered in past and the shipment will be registered as soon as possible. Since the shipment will be registered now, we won’t be able to delete/edit the same.

2. Register a shipment in future time

If we want to edit/delete the shipment after creating the one, then we just need to register the shipment in future or at a given specific time. To register a shipment in future time, let’s say after 5 hours of shipment creation, simply pass the “register_at” value as future timestamp of five hours on basis of current time. Now we will be able to edit/delete the shipment till 5 hours but won’t be able to fetch the label and commercial invoice. At the given timestamp, the shipment will be registered automatically and we will be able to fetch the label and commercial invoice after the given time.

So these are the two ways to register the shipment. We can use both on basis of our requirement.

Please visit here for related information:

Spring Global (Spring Omni) Error: The property phone_number is required

Spring Omni Manifest

Spring Global (Spring Omni) Error: Shipment is not being Registered

Spring Global (Spring Omni): Billing Concept

Spring Global (Spring Omni) Error: Resource Not Found

Aparajita Singh

Aparajita Singh

Aparajita Singh is an experienced Software engineer in PHP. She also has knowledge of C, JAVA and database design. She has been working in the IT Industry from the last 2yrs and still looking forward to achieving more in the IT industry. She lives in New Delhi and her hobby is to write the technical writeups.

Leave a Reply

Your email address will not be published. Required fields are marked *