Allegro WebAPI

Programming interface of the Allegro platform

doGetShipmentDataForRelatedItems

Last change: 25.04.2013 r.
Availability:
This method allows for loading common delivery methods for offers provided on input. Use it mostly with doSendPostBuyForm. Note: at this stage this method does not process the general delivery.

  1. session-id | string | required
    User's session identifier received using the doLogin(Enc) method.
  2. item-ids | long[] | required
    Array of offer identifiers where items were bought by a logged-in user (max. 25).



Sample structure of method call

$dogetshipmentdataforrelateditems_request = array(
   'session-id' => '22eb99326c6be29aa16d07d622bcfbcbee94ad54846f2f4e03_1',
   'item-ids' => array(1505350850, 1504460478, 1504460490)
);

  1. related-items-shipment-data | RelatedItemsShipmentDataStruct
    List of common delivery methods for the given offers.
    1. seller-shipment-data | SellerShipmentDataStruct[]
      Array of structures containing information on common delivery methods available in the given seller's offers.
      1. seller-id | int
        Seller's identifier.
      2. seller-payment-info | SellerPaymentInfoStruct
        List of common delivery methods available in the given seller's offers.
        1. shipment-payment-info-pza | ShipmentPaymentInfoStruct[]
          Array of structures containing information on common delivery methods related to PayU available in the given seller's offer.
          1. shipment-id | int
            Delivery method identifier.
          2. shipment-name | string
            Delivery method name.
          3. shipment-amount | float
            Amount for delivery method (if there is no common then -1 is returned).
          4. shipment-payment-type | int
            Information on payment method related to the given delivery method (mask: 1 - PayU, 2 - standard transfer, 4 - COD).
          5. shipment-item-ids | long[]
            Offer ID array for the given seller/delivery method.
        2. shipment-payment-info-non-pza | ShipmentPaymentInfoStruct[]
          Array of structures containing information on common delivery methods not related to PayU available in the given seller's offer.
          1. shipment-id | int
            Delivery method identifier.
          2. shipment-name | string
            Delivery method name.
          3. shipment-amount | float
            Amount for delivery method (if there is no common then -1 is returned).
          4. shipment-payment-type | int
            Information on payment method related to the given delivery method (mask: 1 - PayU, 2 - standard transfer, 4 - COD).
          5. shipment-item-ids | long[]
            Offer ID array for the given seller/delivery method.
      3. seller-other-shipment-is-active | int
        Information about the availability of a different method of delivery (0 - non-available, 1 - available).



Sample structure of server reply

$dogetshipmentdataforrelateditems_response = array(
   'related-items-shipment-data' => array(
      'seller-shipment-data' => array(
         array(

            'seller-id' => 1831859,
            'seller-payment-info' => array(
               'shipment-payment-info-pza' => array(
                  array(

                     'shipment-id' => 4,
                     'shipment-name' => 'Priority letter',
                     'shipment-amount' => 7.00,
                     'shipment-payment-type' => 1,
                     'shipment-item-ids' => array(1505350850, 1504460490))),
               'shipment-payment-info-non-pza' => array(
                  array(

                     'shipment-id' => 7,
                     'shipment-name' => 'Priority COD',
                     'shipment-amount' => 12.00,
                     'shipment-payment-type' => 4,
                     'shipment-item-ids' => array(1505350850, 1504460478))))
            'seller-other-shipment-is-active' => 1)))

);

  • ERR_ALL_ITEMS_PAID
    Offers are already paid or the payment procedure has been started.
  • ERR_INCORRECT_ITEM_ID
    At least on one provided offer identifiers is incorrect (the offer does not exist, it has been moved to an archive or a logged-in user was not the buyer).
  • ERR_ITEM_FROM_OTHER_COUNTRY
    Item is listed in other country than country which user is logged in.
  • ERR_ITEMS_ARRAY_EMPTY_OR_OVERFLOWED
    Array of offer identifiers is empty or its acceptable size has been exceeded (25 elements).
  • ERR_NEW_PAYMENT_INTERNAL_ERROR
    Internal system error due to loading PayU transactions.
  • ERR_NO_SESSION / ERR_SESSION_EXPIRED
    Invalid session identifier or the session has expired.
  • ERR_WEBAPI_KEY_INACTIVE
    The session-generating WebAPI key has been deactivated (the owner did not accept the User Agreement).

Allegro is not to be held liable for consequences of using examples of the published code. It does not guarantee its correct operation either. The code you see serves as an example only and may contain errors.