Knowband Blog | Ecommerce Modules

Spring Global (Spring Omni) Error: Resource Not Found

Podczas tworzenia przesyłki za pomocą Spring Omni może pojawić się błąd w odpowiedzi, taki jak wymieniony poniżej:

[status] => 404 [code] => 10002 [title] => Nie znaleziono zasobu [detail] => Nie można znaleźć jednego lub więcej zasobów regionu. Ten błąd wystąpił podczas wysyłania następującego żądania utworzenia przesyłki:

'{
  "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"
        }
      }
    }
  }
}'

Kiedy poprosiliśmy Spring Global o przyczynę tego błędu, odpowiedzieli, że problemem jest tutaj „region, który nie jest rozpoznawany, ponieważ nie ma jeszcze regionów dla USA”. Po prostu pominięcie regionu powinno rozwiązać ten problem. Poniższy JSON powinien działać:

'{
  "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"
        }
      }
    }
  }
}'

Odwiedź tutaj, aby uzyskać powiązane informacje:

Błąd Spring Global (Spring Omni): Wymagana jest właściwość numer_telefonu

Wiosenny manifest omni

Spring Global (Spring Omni) Error: Przesyłka nie jest zarejestrowana

Spring Global (Spring Omni): Koncepcja fakturowania

Błąd Spring Global (Spring Omni): uzyskiwanie pustej odpowiedzi podczas pobierania etykiety