Получение данных о накладной по её номеру

Описание: Функция WaybillInfo возвращает детальную информацию по накладной на момент запроса.

Информация по накладной включает:

  • основные данные накладной;
  • даты печати/забора груза, ожидаемой и фактической доставки груза;
  • информацию о маршруте;
  • параметры груза;
  • информацию об оплате;
  • специальные условия доставки;
  • информацию о грузовых местах.

Адрес сервиса: /ShipmentService.asmx

SOAP Action: [http://tempuri.org/WaybillInfo](http://tempuri.org/WaybillInfo)

1. Параметры запроса (Request)

ПараметрОписание в WSDLОписание / Бизнес-смысл
waybillNumberminOccurs="0",
maxOccurs="1"
type="string"
Номер накладной МЭ

Пример SOAP-запроса (SOAP 1.1)

XML

POST /ShipmentService.asmx HTTP/1.1
Host: agents.major-express.ru
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://tempuri.org/WaybillInfo"

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
               xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
               xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Header>
    <TicketHeader xmlns="http://tempuri.org/">
      <Ticket>string</Ticket>
      <UserName>string</UserName>
      <CheckSum>int</CheckSum>
      <inRole>boolean</inRole>
    </TicketHeader>
  </soap:Header>
  <soap:Body>
    <WaybillInfo xmlns="http://tempuri.org/">
      <waybillNumber>string</waybillNumber>
    </WaybillInfo>
  </soap:Body>
</soap:Envelope>

Пример SOAP-запроса (SOAP 1.2)

XML

POST /ShipmentService.asmx HTTP/1.1
Host: agents.major-express.ru
Content-Type: application/soap+xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
  <soap12:Header>
    <TicketHeader xmlns="http://tempuri.org/">
      <Ticket>string</Ticket>
      <UserName>string</UserName>
      <CheckSum>int</CheckSum>
      <inRole>boolean</inRole>
    </TicketHeader>
  </soap12:Header>
  <soap12:Body>
    <WaybillInfo xmlns="http://tempuri.org/">
      <waybillNumber>string</waybillNumber>
    </WaybillInfo>
  </soap12:Body>
</soap12:Envelope>

2. Параметры ответа (Response)

2.1. Статус выполнения (Верхний уровень)

ПараметрОписание в WSDLОписание
ResCodeminOccurs="1"
maxOccurs="1"
nillable="true"
type="int"
Код результата выполнения запроса
ResTextminOccurs="0"
maxOccurs="1"
type="string"
Текстовое сообщение ошибки / успеха
WBInfominOccurs="0"
maxOccurs="1"
type="tns:WaybillInfo"
Комплексный объект информации о накладной

2.2. WBInfo.Header — Основные данные

ПараметрОписание в WSDLОписание
WBNumberminOccurs="0"
maxOccurs="1"
type="string"
Номер накладной МЭ
ExternalReferenceminOccurs="0"
maxOccurs="1" type="tns:ExternalReference"
Дополнительные связанные номера:
WBOldNumberminOccurs="0"
maxOccurs="1"
type="string"
Отметка клиента (номер №2)
FedexNumminOccurs="0"
maxOccurs="1"
type="string"
Номер международной накладной
WBReturnNumberminOccurs="0"
maxOccurs="1"
type="string"
Номер возвратной накладной
PackageNumberminOccurs="0"
maxOccurs="1"
type="string"
Номер упаковки для одноместного отправления
StatusminOccurs="0"
maxOccurs="1" type="tns:WaybillStatusLookUp"
Статус накладной:
CodeminOccurs="1"
maxOccurs="1"
type="unsignedByte"
Код статуса накладной
NameminOccurs="0"
maxOccurs="1"
type="string"
Наименование статуса
DeliveryRequirementsminOccurs="0"
maxOccurs="1" type="tns:DeliveryRequirements"
Требования к доставке:
SpecialDeliveryConditionsminOccurs="0"
maxOccurs="1" type="tns:ArrayOfDeliveryFeatures"
Особые условия доставки и дополнительные услуги
IsShippmentGuarantedminOccurs="1"
maxOccurs="1"
type="boolean"
Параметр в разработке, временно нерабочий, возвращает всегда false
IsNeedGuaranteeminOccurs="1"
maxOccurs="1"
type="boolean"
Параметр в разработке, временно нерабочий, возвращает всегда false
IsNeedScanminOccurs="1"
maxOccurs="1"
type="boolean"
Нужен скан с подписью получателя
WaybillMetaDataminOccurs="0"
maxOccurs="1" type="tns:WaybillMetaData"
Служебная информация:
CommentsminOccurs="0"
maxOccurs="1"
type="string"
Комментарии к накладной
ReturnAddressminOccurs="0"
maxOccurs="1"
type="string"
Адрес переадресации / возврата
SpecialRemarksminOccurs="0"
maxOccurs="1"
type="string"
Особые отметки для печати
SubmitterminOccurs="0"
maxOccurs="1"
type="string"
Кто принял груз
CourierminOccurs="0"
maxOccurs="1"
type="string"
Кто доставил груз
WBOpenDateminOccurs="1"
maxOccurs="1"
nillable="true"
type="dateTime"
Дата печати\забора накладной
ExpectedDeliveryDateminOccurs="1"
maxOccurs="1"
nillable="true"
type="dateTime"
Расчётная дата доставки
WBCloseDateminOccurs="1"
maxOccurs="1"
nillable="true"
type="dateTime"
Дата доставки

2.3. WBInfo.Route — Маршрут и участники

ПараметрОписание в WSDLОписание
ShipperminOccurs="0"
maxOccurs="1"
type="tns:Shipper"
Данные отправителя:
Address.CountryCodeminOccurs="1"
maxOccurs="1"
type="short"
Код страны отправителя
Address.CountryNameminOccurs="0"
maxOccurs="1"
type="string"
Страна отправителя
Address.PostalCodeminOccurs="0"
maxOccurs="1"
type="string"
Почтовый индекс отправителя
Address.CityCodeminOccurs="1"
maxOccurs="1"
type="int"
Код города отправителя
Address.CityNameminOccurs="0"
maxOccurs="1"
type="string"
Название города отправителя
Address.AddressminOccurs="0"
maxOccurs="1"
type="string"
Адрес отправителя
Agent.CodeminOccurs="1"
maxOccurs="1"
type="short"
Код Агента отправителя
Agent.NameminOccurs="0"
maxOccurs="1"
type="string"
Название Агента отправителя
ConsigneeminOccurs="0"
maxOccurs="1"
type="tns:Consignee"
Данные получателя:
Address.CountryCodeminOccurs="1"
maxOccurs="1"
type="short"
Код страны получателя
Address.CountryNameminOccurs="0"
maxOccurs="1"
type="string"
Страна получателя
Address.PostalCodeminOccurs="0"
maxOccurs="1"
type="string"
Почтовый индекс получателя
Address.CityCodeminOccurs="1"
maxOccurs="1"
type="int"
Код города получателя
Address.CityNameminOccurs="0"
maxOccurs="1"
type="string"
Название города получателя
Address.AddressminOccurs="0"
maxOccurs="1"
type="string"
Адрес получателя
Agent.CodeminOccurs="1"
maxOccurs="1"
type="short"
Код Агента получателя
Agent.NameminOccurs="0"
maxOccurs="1"
type="string"
Название Агента получателя
RouteConfigminOccurs="0"
maxOccurs="1"
type="tns:RouteConfig"
Конфигурация маршрута:
IsTransitMoscowminOccurs="1"
maxOccurs="1"
type="boolean"
Транзит через Москву\Прямая перевозка
IsInternationalConsigneeminOccurs="1"
maxOccurs="1"
type="boolean"
Признак международного получателя

2.4. WBInfo.CargoInfo — Параметры груза

ПараметрОписание в WSDLОписание
DescriptionminOccurs="0"
maxOccurs="1"
type="string"
Описание вложений
PlaceCountminOccurs="1"
maxOccurs="1"
type="short"
Количество мест в накладной
WeightminOccurs="1"
maxOccurs="1"
type="double"
Вес груза (кг)
LengthminOccurs="1"
maxOccurs="1"
nillable="true"
type="double"
Длина (см)
WidthminOccurs="1"
maxOccurs="1"
nillable="true"
type="double"
Ширина (см)
HeightminOccurs="1"
maxOccurs="1"
nillable="true"
type="double"
Высота (см)
VolumeminOccurs="1"
maxOccurs="1"
nillable="true"
type="double"
Объемный вес / Объем
Cost_RURminOccurs="1"
maxOccurs="1"
type="decimal"
Объявленная ценность (руб.)
PackageTypeminOccurs="1"
maxOccurs="1"
type="unsignedByte"
Код типа упаковки

2.5. WBInfo.PaymentInfo — Информация об оплате

ПараметрОписание в WSDLОписание
PayerminOccurs="0"
maxOccurs="1"
type="tns:Payer"
Плательщик:
PayerCodeminOccurs="1"
maxOccurs="1"
type="int"
Номер плательщика (клиентский номер)
ClientNameminOccurs="0"
maxOccurs="1"
type="string"
Название Клиента-плательщика
WhoWillPayminOccurs="1"
maxOccurs="1"
type="unsignedByte"
Код стороны оплаты:
1 - отправитель
2 - получатель
3 - 3-я сторона
PaymentTypeminOccurs="1"
maxOccurs="1"
type="unsignedByte"
Код типа оплаты
1 - Нал
2 - Б\нал
CalcWeightAgentminOccurs="1"
maxOccurs="1"
type="double"
Расчетный вес для агента
CalcWeightClientminOccurs="1"
maxOccurs="1"
type="double"
Расчетный вес для клиента
Insurance_USDminOccurs="1"
maxOccurs="1"
type="double"
Стоимость страховки (USD)
Insurance_RURminOccurs="1"
maxOccurs="1"
type="double"
Стоимость страховки (руб.)
Freight_USDminOccurs="1"
maxOccurs="1"
type="double"
Стоимость перевозки (USD)
Freight_RURminOccurs="1"
maxOccurs="1"
type="double"
Стоимость перевозки (руб.)
AddService_RURminOccurs="1"
maxOccurs="1"
type="double"
Стоимость доп. услуг (руб.)

2.6. WBInfo.Places — Информация о грузовых местах

Список элементов PlaceModel (minOccurs="0", maxOccurs="unbounded"):

ПараметрОписание в WSDLОписание
PlaceNumberminOccurs="0"
maxOccurs="1"
type="string"
Номер грузового места
WeightminOccurs="1"
maxOccurs="1"
type="double"
Физический вес места (кг)
WidthminOccurs="1"
maxOccurs="1"
nillable="true"
type="double"
Ширина места (см)
LengthminOccurs="1"
maxOccurs="1"
nillable="true"
type="double"
Длина места (см)
HeightminOccurs="1"
maxOccurs="1"
nillable="true"
type="double"
Высота места (см)
VolumeminOccurs="1"
maxOccurs="1"
nillable="true"
type="double"
Объемный вес места (кг)

Пример SOAP-ответа (SOAP 1.1)

XML

HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
               xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
               xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <WaybillInfoResponse xmlns="http://tempuri.org/">
      <WaybillInfoResult>
        <ResCode>0</ResCode>
        <ResText>Успешно</ResText>
        <WBInfo>
          <Header>
            <WBNumber>1244946107</WBNumber>
            <ExternalReference>
              <WBOldNumber>ORD-2026-99</WBOldNumber>
              <FedexNum>7738291029</FedexNum>
              <WBReturnNumber></WBReturnNumber>
              <PackageNumber>PKG-01</PackageNumber>
            </ExternalReference>
            <Status>
              <Code>5</Code>
              <Name>Доставлено</Name>
            </Status>
            <DeliveryRequirements>
              <IsShippmentGuaranted>true</IsShippmentGuaranted>
              <IsNeedGuarantee>false</IsNeedGuarantee>
              <IsNeedScan>true</IsNeedScan>
            </DeliveryRequirements>
            <WaybillMetaData>
              <Comments>Хрупкий груз</Comments>
              <ReturnAddress></ReturnAddress>
              <SpecialRemarks>Печать на лицевой стороне</SpecialRemarks>
              <Submitter>Иванов И.И.</Submitter>
              <Courier>Петров П.П.</Courier>
            </WaybillMetaData>
            <WBOpenDate>2026-08-01T10:00:00</WBOpenDate>
            <ExpectedDeliveryDate>2026-08-05T18:00:00</ExpectedDeliveryDate>
            <WBCloseDate>2026-08-04T14:20:00</WBCloseDate>
          </Header>
          <Route>
            <Shipper>
              <Address>
                <CountryCode>643</CountryCode>
                <CountryName>Россия</CountryName>
                <PostalCode>101000</PostalCode>
                <CityCode>77</CityCode>
                <CityName>Москва</CityName>
                <Address>ул. Ленина, д. 1</Address>
              </Address>
              <Agent>
                <Code>10</Code>
                <Name>МЭ Москва</Name>
              </Agent>
            </Shipper>
            <Consignee>
              <Address>
                <CountryCode>643</CountryCode>
                <CountryName>Россия</CountryName>
                <PostalCode>190000</PostalCode>
                <CityCode>78</CityCode>
                <CityName>Санкт-Петербург</CityName>
                <Address>Невский пр., д. 10</Address>
              </Address>
              <Agent>
                <Code>20</Code>
                <Name>МЭ СПб</Name>
              </Agent>
            </Consignee>
            <RouteConfig>
              <IsTransitMoscow>false</IsTransitMoscow>
              <IsInternationalConsignee>false</IsInternationalConsignee>
            </RouteConfig>
          </Route>
          <CargoInfo>
            <Description>Запчасти</Description>
            <PlaceCount>1</PlaceCount>
            <Weight>2.5</Weight>
            <Length>30</Length>
            <Width>20</Width>
            <Height>15</Height>
            <Volume>1.8</Volume>
            <Cost_RUR>15000.00</Cost_RUR>
            <PackageType>1</PackageType>
          </CargoInfo>
          <PaymentInfo>
            <Payer>
              <PayerCode>12345</PayerCode>
              <ClientName>ООО Рога и Копыта</ClientName>
            </Payer>
            <WhoWillPay>1</WhoWillPay>
            <PaymentType>1</PaymentType>
            <CalcWeightAgent>2.5</CalcWeightAgent>
            <CalcWeightClient>2.5</CalcWeightClient>
            <Insurance_USD>0</Insurance_USD>
            <Insurance_RUR>150.00</Insurance_RUR>
            <Freight_USD>0</Freight_USD>
            <Freight_RUR>850.00</Freight_RUR>
            <AddService_RUR>0</AddService_RUR>
          </PaymentInfo>
          <SpecialDeliveryConditions />
          <Places>
            <PlaceModel>
              <PlaceNumber>1244946107001</PlaceNumber>
              <Weight>2.5</Weight>
              <Width>20</Width>
              <Length>30</Length>
              <Height>15</Height>
              <Volume>1.8</Volume>
            </PlaceModel>
          </Places>
        </WBInfo>
      </WaybillInfoResult>
    </WaybillInfoResponse>
  </soap:Body>
</soap:Envelope>

Пример SOAP-ответа (SOAP 1.2)

XML

HTTP/1.1 200 OK
Content-Type: application/soap+xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
  <soap12:Body>
    <WaybillInfoResponse xmlns="http://tempuri.org/">
      <WaybillInfoResult>
        <ResCode>int</ResCode>
        <ResText>string</ResText>
        <WBInfo>
          <Header>
            <WBNumber>string</WBNumber>
            <ExternalReference xsi:nil="true" />
            <Status xsi:nil="true" />
            <DeliveryRequirements xsi:nil="true" />
            <WaybillMetaData xsi:nil="true" />
            <WBOpenDate>dateTime</WBOpenDate>
            <ExpectedDeliveryDate>dateTime</ExpectedDeliveryDate>
            <WBCloseDate>dateTime</WBCloseDate>
          </Header>
          <Route>
            <Shipper xsi:nil="true" />
            <Consignee xsi:nil="true" />
            <RouteConfig xsi:nil="true" />
          </Route>
          <CargoInfo>
            <Description>string</Description>
            <PlaceCount>short</PlaceCount>
            <Weight>double</Weight>
            <Length>double</Length>
            <Width>double</Width>
            <Height>double</Height>
            <Volume>double</Volume>
            <Cost_RUR>decimal</Cost_RUR>
            <PackageType>unsignedByte</PackageType>
          </CargoInfo>
          <PaymentInfo>
            <Payer xsi:nil="true" />
            <WhoWillPay>unsignedByte</WhoWillPay>
            <PaymentType>unsignedByte</PaymentType>
            <CalcWeightAgent>double</CalcWeightAgent>
            <CalcWeightClient>double</CalcWeightClient>
            <Insurance_USD>double</Insurance_USD>
            <Insurance_RUR>double</Insurance_RUR>
            <Freight_USD>double</Freight_USD>
            <Freight_RUR>double</Freight_RUR>
            <AddService_RUR>double</AddService_RUR>
          </PaymentInfo>
          <SpecialDeliveryConditions>
            <DeliveryFeatures xsi:nil="true" />
            <DeliveryFeatures xsi:nil="true" />
          </SpecialDeliveryConditions>
          <Places>
            <PlaceModel xsi:nil="true" />
            <PlaceModel xsi:nil="true" />
          </Places>
        </WBInfo>
      </WaybillInfoResult>
    </WaybillInfoResponse>
  </soap12:Body>
</soap12:Envelope>