Allegro WebAPI

Programming interface of the Allegro platform

doGetDeals

Last change: 11.11.2011 r.
Availability:
This method allows for loading single purchase events concluded by a given buyer in an indicated offer (in which a logged-in user acts as the seller). That method returns only purchase events which is not paid yet while calling the method. The exception is a situation when a purchase had been paid for but the payment has been cancelled - that purchase is treated as unpaid and information about it will be returned. In case of providing an incorrect user identifier an empty structure is returned.

  1. session-handle | string | required
    User's session identifier received using the doLogin(Enc) method.
  2. item-id  | long | required
    Offer identifier.
  3. buyer-id | int | required
    Buyer's identifier.



Sample structure of method call

$dogetdeals_request = array(
   'session-handle' => '22eb99326c6be29aa16d07d622bcfbcbee94ad54846f2f4e03_1',
   'item-id' => 1087784659,
   'buyer-id' => 2580451
);

  1. deals-list | DealsStruct[]
    Array of structures containing information on purchase events.
    1. deal-id | long
      Identifier of a purchase event.
    2. deal-date | long
      Date of the purchase event.
    3. deal-quantity | int
      Number of items bought.
    4. deal-amount-original | float
      Total amount (number * unit price) for the purchase event - without the discount.
    5. deal-amount-discounted | float
      Total amount (number * unit price) for the purchase event - with granted discount. If the discount has not been granted - the amount equals the amount without discount.



Sample structure of server reply

$dogetdeals_response = array(
   'deals-list' => array(
      array(
         'deal-id' => 15204949,
         'deal-date' => 1275903331,
         'deal-quantity' => 1,
         'deal-amount-original' => 22.00,
         'deal-amount-discounted' => 22.00))
);

  • ERR_INCORRECT_BUYER_ID
    No buyer's identifier or incorrect value (<= 0) .
  • ERR_INCORRECT_ITEM_ID
    No, incorrect value (<=0)  of the offer identifier or such offer does not exist.
  • 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).
  • ERR_YOU_NOT_SOLD_THIS_ITEM
    Logged-in user is not the seller in the indicated offer.

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.