allegro / allegro-api

Issue tracker and wiki for Allegro REST API
https://developer.allegro.pl/
213 stars 39 forks source link

I get the balance of the last item in the waiting list from the API, but it is inconsistent with the waiting amount in my backend. What is the problem? #9490

Open a785817258 opened 2 months ago

a785817258 commented 2 months ago

image

AureliuszBrussy commented 2 months ago

The page shows the current combined balance for the two payment operators (PayU and Przelewy24). In response from the public API, we return separate balances for both payment operators and the balance as of the moment the payment operation occurred. It is difficult for me to address any differences (which, of course, should not occur). Please report it via the contact form after logging in to the related account.

a785817258 commented 2 months ago

Is it related to the time zone? My local time is Beijing time.

AureliuszBrussy commented 2 months ago

No, I don't think it's related to the time zone. In the API, we return all data in universal time (zulu).

a785817258 commented 2 months ago

In the previous question, I requested the API again and checked the amount in the backend and it was OK again. Is there any caching process? ? And if I want to get this list in batches, I see that your request parameters provide offset and limit for batch acquisition, but when the offset reaches 10000, the request will be restricted. How can I continue to get all the lists in batches?

a785817258 commented 2 months ago

Also, why is there no sorting field for this list? What attribute is used to sort the data each time it is retrieved?

AureliuszBrussy commented 2 months ago

We sort by default from the most recent event.

You need to pay attention to the fact that there are three payment operators (PayU, Przelewy24, Allegro Finanse) that potentially process the payment. Therefore, there are 3 separate balances. You can filter the results for a given operator using the query parameter wallet.paymentOperator.

a785817258 commented 2 months ago

------------------------------------AVAILABLE-------------------------------------------------------- Allegro Api:/payments/payment-operations Allegro request params:{"offset":0,"limit":1,"wallet.type":"AVAILABLE"} Allegro response:{"paymentOperations":[{"type":"DEDUCTION_CHARGE","group":"OUTCOME","wallet":{"paymentOperator":"PAYU","type":"AVAILABLE","balance":{"amount":"947.19","currency":"PLN"}},"occurredAt":"2024-07-24T10:30:26.104Z","value":{"amount":"-9.34","currency":"PLN"},"marketplaceId":"allegro-pl","deduction":{"id":"abe9d76b-6a57-4855-8bfc-b0b6852f0b2c"}}],"count":1,"totalCount":8405}

------------------------------------WAITING ------------------------------------------------------------- Allegro Api:/payments/payment-operations Allegro request params:{"offset":0,"limit":1,"wallet.type":"WAITING"} Allegro response:{"paymentOperations":[{"type":"CONTRIBUTION","group":"INCOME","wallet":{"paymentOperator":"PAYU","type":"WAITING","balance":{"amount":"6831.70","currency":"PLN"}},"occurredAt":"2024-06-14T07:23:51.961Z","value":{"amount":"97.99","currency":"PLN"},"marketplaceId":"allegro-pl","payment":{"id":"eeb4b42a-2a1e-11ef-afcb-e3671250ed78"},"participant":{"id":"","companyName":null,"login":"","firstName":"","lastName":"","address":{"street":"","city":"","postCode":""}}}],"count":1,"totalCount":305} image

I see that the first item in the document returns the latest data, why doesn't WAITING return the latest data?

AureliuszBrussy commented 2 months ago

@a785817258 it should respond with the latest event. Can you send the trace-id of this request? I'll check it out. You can get trace-id in response header.

a785817258 commented 2 months ago

@AureliuszBrussy 621b3d721b6dc8b6

AureliuszBrussy commented 2 months ago

Thank you - we will check it out. I will get back to you.

AureliuszBrussy commented 2 months ago

@a785817258 this is inconsistency on our side. We are preparing a fix so that we will return the entries according to the expected order (i.e. according to the occuredAt date). I will let you know when the fix is implemented.

stale[bot] commented 1 month ago

W tym wątku nie pojawiła się żadna nowa odpowiedź w ciągu 7 dni, dlatego automatycznie oznaczamy go jako przeterminowany. Jeśli w ciągu kolejnych 7 dni nie pojawi się żadna odpowiedź, wątek zostanie zamknięty. Dziękujemy za zaangażowanie w dyskusję i zachęcamy Cię do wypełnienia ankiety dotyczącej naszego wsparcia na forum.


There was no new reply in this thread within 7 days, therefore, we automatically marked it as expired. If no response is received within the next 7 days, this thread will be closed. Thank you for engaging in the discussion. We encourage you to complete our forum support survey.