Erro de Spring Global (Spring Omni): recurso não encontrado

Ao criar uma remessa usando o Spring Omni, você pode receber um erro na resposta, como mencionado abaixo:

[status] => 404 [código] => 10002 [title] => Recurso não encontrado [detalhe] => Um ou mais recursos da região não foram encontrados. Recebemos este erro ao enviar a seguinte solicitação para criar a remessa:

'{
  "data": {
    "type": "shipments",
    "attributes": {
      "recipient_address": {
        "street_1": "4363 N 55TH ST",
        "street_2": "Marylebone",
        "street_number": 221,
        "postal_code": "53216-1201",
        "city": "MILWAUKEE",
        "region_code": "WI",
        "country_code": "US",
        "first_name": "Sherlock",
        "last_name": "Holmes",
        "company": "Attn",
        "email": "Aparajita.singh@abc.com",
        "phone_number": "1234567890"
      },
      "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": "Aparajita.singh@abc.com",
        "phone_number": ""
      },
      "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": "Aparajita.singh@abc.com",
        "phone_number": ""
      },
      "description": "Order #8008135",
      "physical_properties": {
        "height": 150,
        "width": 300,
        "length": 500,
        "volume": 22.5,
        "weight": 100
      },
      "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": {
      "shop": {
        "data": {
          "type": "shops",
          "id": "1a9414f0-24ef-4008-b6ad-9a75e27a879e"
        }
      },
      "service": {
        "data": {
          "type": "services",
          "id": "05aeb5e9-90be-4ec7-94c9-1a0949262577"
        }
      }
    }
  }
}'

Quando perguntamos à Spring Global o motivo desse erro, eles responderam que o problema aqui é "A região que não é reconhecida, pois ainda não tem regiões para os EUA configuradas". Simplesmente omitir a região deve corrigir esse problema. O JSON abaixo deve funcionar:

'{
  "data": {
    "type": "shipments",
    "attributes": {
      "recipient_address": {
        "street_1": "4363 N 55TH ST",
        "street_2": "Marylebone",
        "street_number": 221,
        "postal_code": "53216-1201",
        "city": "MILWAUKEE",
        "country_code": "US",
        "first_name": "Sherlock",
        "last_name": "Holmes",
        "company": "Attn",
        "email": "Aparajita.singh@abc.com",
        "phone_number": "1234567890"
      },
      "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": "Aparajita.singh@abc.com",
        "phone_number": ""
      },
      "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": "Aparajita.singh@abc.com",
        "phone_number": ""
      },
      "description": "Order #8008135",
      "physical_properties": {
        "height": 150,
        "width": 300,
        "length": 500,
        "volume": 22.5,
        "weight": 100
      },
      "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": {
      "shop": {
        "data": {
          "type": "shops",
          "id": "1a9414f0-24ef-4008-b6ad-9a75e27a879e"
        }
      },
      "service": {
        "data": {
          "type": "services",
          "id": "05aeb5e9-90be-4ec7-94c9-1a0949262577"
        }
      }
    }
  }
}'

Por favor, visite aqui para informações relacionadas:

Erro Spring Global (Spring Omni): A propriedade phone_number é necessária

Manifestação Omni da Primavera

Erro Spring Global (Spring Omni): O envio não está sendo registrado

Spring Global (Spring Omni): Conceito de Faturamento

Erro Spring Global (Spring Omni): Obtenção de resposta em branco ao buscar o rótulo


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 *