Allegro WebAPI

Programming interface of the Allegro platform

doGetMyPayments

Group: PayU
Last change: 16.05.2016 r.
Availability:

This method allows you to retrieve a list of completed payments made via PayU for transactions concluded within 90 days. In case the time range is not set, a list of payments made within a week (25 items) is retrieved and sorted in a descending order by their completion time.

Available filters:

  • sellerId – payment recipient
  • itemId – offer related to the payment
  • paymentTimeFrom/paymentTimeTo – time range to filter the payments
Different filters can be combined. If an incorrect user’s identifier is transferred, an empty structure is returned.

The strictedSearch field allows you to filter data by date. If you provide 0 or the field is not transferred at all (optional parameter with a default 0 value), the filter will work as follows:

If a particular value is provided in paymentTimeFrom, but 0 in paymentTimeTo:

  • paymentTimeFrom will be set to the provided date starting at 0:00, e.g. if you enter timestamp=1462486320 (05.05.2016 22:12:00), the system will change it to 1462406400 (05.05.2016 00:00:00).
  • paymentTimeTo will be calculated in the following manner and the lower value will be applied:
    • date provided in paymentTimeFrom + 7 days (1463011200 - 12.05.2016 00:00:00)
    • the day following the date provided in paymentTimeFrom (1462492800 - 06.05.2016 00:00:00); in this example the paymentTimeTo value will be set to 1462492800.

In an opposite case, if 0 is provided in paymentTimeFrom, but a particular value is provided in paymentTimeTo:

  • paymentTimeTo will be set to the provided date + 1 starting at 0:00, e.g. if you enter timestamp=1462536000 (06.05.2016 12:00:00), the system will change it to 1462579200 (07.05.2016 00:00:00).
  • paymentTimeFrom will be calculated in the following manner and the higher value will be applied:
    • zero (0),
    • paymentTimeTo - 7 days (1461974400 - 30.04.2016 00:00:00); in this case the paymentTimeFrom value will be set to 1461974400.

Provide particular values in start date, e.g. 1462486320 (05.05.2016 22:12:00) and in end date, e.g. 1462536000 (06.05.2016 22:12:00) to receive a list of payments processed in that period:

  • paymentTimeFrom will be set to 1462406400 (05.05.2016 00:00:00),
  • paymentTimeTo will be set to 1462579200 (07.05.2016 00:00:00).

If the value provided in paymentTimeFrom exceeds the current date - 3 months value (e.g. 3 months and 2 days), the parameter will be set to current date - 3 months. If the value provided in paymentTimeTo exceeds the current date + 1 day value (e.g. 1 day and 8 hours), the parameter will be set to current date + 1 day.

If the strictedSearch field transfers 1, the filter will work as follows:

  • When a particular value is provided in paymentTimeFrom and 0 in paymentTimeTo, a list of payments made between provided date and 7 following days will be returned.
  • In an opposite case, when 0 is provided in paymentTimeFrom and a particular value in paymentTimeTo, a list of payments made between provided date and 7 preceding days will be returned. Provide particular values for both start and end date to receive a list of payments processed in a given period.


  1. session-id  | string | required
    User's session identifier received using the doLogin(Enc) method.
  2. seller-id | int | non-required
    Seller's identifier for whom payments are to be loaded.
  3. item-id | long | non-required
    Identifier of an offer related to the payment (also when an offer is a part of a combined payment).
  4. payment-time-from | long | non-required
    Start date of time range (in the Unix time format) to load a list of payments.
  5. payment-time-to | long | non-required
    End date of time range (in the Unix time format) to load a list of payments.
  6. page-size | int | non-required
    Size of data portion (min. 1, max. 24; by entering 0 or a value outside the range sets the size portion to default value: 25).
  7. page-number | int | non-required
    Controlling  (through the incrementation of provided value)  the process of loading new data portions (portion numbers are indexed from 0).
  8. stricted-search | int | non-required
    Precise (up to seconds) search operation based on data provided in paymentTimeFrom and paymentTimeTo (0 - no, 1 - yes).



Sample structure of method call

$dogetmypayments_request = array(
   'session-id' => '22eb99326c6be29aa16d07d622bcfbcbee94ad54846f2f4e03_1',
   'seller-id' => 0,
   'item-id' => 0,
   'payment-time-from' => 1264636200,
   'payment-time-to' => 1264636500,
   'page-size' => 0,
   'page-number' => 0
   'stricted-search' => 0
);

  1. pay-trans-payment | UserPaymentStruct[]
    Array of structures containing information on payments of a logged user.
    1. pay-trans-id | long
      PayU transaction identifier.
    2. pay-trans-sellers | PaymentSellersStruct[]
      Array of structures containing information on items forming a transaction, bought from particular sellers.
      1. pay-trans-seller-id | int
        Seller's identifier.
      2. pay-trans-seller-name | string
        Seller's name
      3. pay-trans-items | PaymentItemsStruct[]
        Array of structures containing information on items bought from a particular seller.
        1. pay-trans-it-id | long
          Offer identifier.
        2. pay-trans-it-name | string
          Offer name
        3. pay-trans-it-count | int
          Number of items bought within the offer.
        4. pay-trans-it-price | float
          Value of item bought within the offer.
      4. pay-trans-seller-postage-amount | float
        Total cost of delivery methods selected for offers of the particular seller. 
    3. pay-trans-type | string
      Payment method (mBank, Multibank, BZ WBK, Pekao SA, BPH, Inteligo, Nordea, iPKO BP, ING, Raiffeisen Bank, Millennium, Kredyt Bank, Polbank, Citi Handlowy, Deutsche Bank, Getin Bank, Invest-Bank, Meritum Bank, Eurobank, Alior Bank, BGŻ, Payment card, Bank transfer, Standard transfer (outside PayU system), COD).
    4. pay-trans-status | string
      PayU transaction status (list of all possible payment statuses can be found here).
    5. pay-trans-amount | float
      Amount of payment from a user.
    6. pay-trans-create-date | long
      Date of creating a PayU transaction (in the Unix time format).
    7. pay-trans-price | float
      Value of items bought within the offer and paid via PayU (or 0 in case of an additional payment).
    8. pay-trans-postage-amount | float
      Total cost of delivery method selected by a user, paid via PayU (or 0 in case of an additional payment).
    9. pay-trans-incomplete | int
      Information on payment completion (1 - incomplete payment, 0 - complete payment).



Sample structure of server reply

$dogetmypayments_response = array(
   'pay-trans-payment' => array(
      array(
         'pay-trans-id' => 1964852,
         'pay-trans-sellers' => array(
            array(
               'pay-trans-seller-id' => 2907979,
               'pay-trans-seller-name' => 'mug-shop',
               'pay-trans-items' => array(
                  array(
                     'pay-trans-it-id' => 891436088,
                     'pay-trans-it-name' => 'Black mug 50ml',
                     'pay-trans-it-count' => 1,
                     'pay-trans-it-price' => 40.00),
                  array(
                     'pay-trans-it-id' => 891437091,
                     'pay-trans-it-name' => 'Mug spoon - black',
                     'pay-trans-it-count' => 1,
                     'pay-trans-it-price' => 12.00)),
               'pay-trans-seller-postage-amount' => 2.00)),

         'pay-trans-type' => 'BZ WBK',
         'pay-trans-status' => 'Complete',
         'pay-trans-amount' => 54.00,
         'pay-trans-create-date' => 1264636263,
         'pay-trans-price' => 52.00,
         'pay-trans-postage-amount' => 2.00,
         'pay-trans-incomplete' => 0))
);


  • ERR_INPUT_DATE_RANGE
    Incorrect range of dates (the range between start and end date exceeds 90 days, end date equals or precedes the start date or provided values are lower than 0).
  • ERR_INCORRECT_ITEM_ID
    Invalid (< 0) offer identifier or no offer with such identifier.
  • ERR_INCORRECT_PAGE_NUMBER
    Invalid (< 0) data portion number.
  • ERR_INCORRECT_PAGE_SIZE
    Invalid (< 0) data portion size.
  • ERR_INCORRECT_SELLER_ID
    Invalid (< 0) seller's identifier.
  • 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.