Allegro WebAPI

Programming interface of the Allegro platform

doGetRelatedItems

Last change: 01.09.2011 r.
Availability:
This method allows for loading offer identifiers related to those provided on input for which a common after-sale form is to be filled-out (realization of a first step of an after-sale process). Only offers for which the payment process has not started are returned from the list of related ones with an access to PayU. Use it mostly with doSendPostBuyForm.

  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

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

  1. related-items | RelatedItemsStruct
    List of offers related to input offers (inclusive).
    1. related-items-info | RelatedItemsInfoStruct[]
      Array of structures containing information on related offers.
      1. item-id | long
        Offer identifier.
      2. item-title | string
        Offer title.
      3. item-thumbnail | string
        Link to thumbnail (if available in offer).
      4. item-price | float
        Price of item in offer.
      5. item-bought-count | int
        Number of items bought.
      6. item-amount | float
        Total amount due for all items bought.
      7. item-payment-type | int
        Payment methods available in offer (mask: 1 - PayU, 2 - standard transfer, 4 - COD).
      8. item-seller-id| int
        Seller's identifier.
      9. item-seller-name| string
        Seller's name.
      10. item-invoice-info | int
        Information on whether an invoice may be issued for an offer (1 - yes, 0 - no).
    2. related-items-amount | float
      Total amount due for all items bought in related offers.



Sample structure of method call

$dogetrelateditems_response = array(
   'related-items' => array(
      'related-items-info' => array(
         array(

            'item-id' => 1624011084,
            'item-title' => 'Great bargain offer',
            'item-thumbnail' => 'http://img07.allegroimg.pl/photos/128x96/17/06/44/04/1706440465',
            'item-price' => 2.00,
            'item-bought-count' => 2,
            'item-amount' => 4.00,
            'item-payment-type' => 7,
            'item-seller-id' => 1631852,
            'item-seller-name' => 'jnowak',
            'item-invoice-info' => 0),
         array(
            'item-id' => 1624011085,
            'item-title' => 'Very cheap offer',
            'item-thumbnail' => 'http://img07.allegroimg.pl/photos/128x96/17/06/44/04/1706440486',
            'item-price' => 1.00,
            'item-bought-count' => 9,
            'item-amount' => 9.00,
            'item-payment-type' => 6,
            'item-seller-id' => 1631852,
            'item-seller-name' => 'jnowak',
            'item-invoice-info' => 1)),
      'related-items-amount' => 13.00)
);

  • ERR_INCORRECT_ITEM_ID
    At least one of provided offer identifiers is incorrect (the offer does not exist, it has been moved to the 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_ITEMS_MISMATCHED
    Provided offers are not connected by a common payment method (e.g. in one you can pay only via PayU and in others only COD is available).
  • 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.