abuzuhri / Amazon-SP-API-CSharp

.Net C# library for the new Amazon Selling Partner API
MIT License
215 stars 191 forks source link

Report - Start - End -Date #219

Closed kevinvenclovas closed 1 year ago

kevinvenclovas commented 2 years ago

Hi im very confused.

I want some some datas from my order. So i use this report : ReportTypes.GET_FLAT_FILE_ORDER_REPORT_DATA_INVOICING

Some information about my order:

PurchaseDate = 10:56:02 UTC Time LastUpdateDate = 12:10:51 UTC Time

Now i cant find this order in the report result with all combinations of the available timestamps. I tried some random timestamps and got the order only back on the timestamp: 11:35:31 UTC Time

What is this for an timestamp? This make zero sense for me!

abuzuhri commented 2 years ago

I agree in the report they don’t use fixed standards for all report i face this in many report . Maybe we need to open case for this in Amazon

sat-it commented 2 years ago

Hi,

it works for us. i think LastUpdateTime (12:10:51 UTC Time) is (at this time) the shipping date. (orderstatus is shipped)

All(mostly?) orders, first status are pending. If status change to unshipped, it comes in report GET_FLAT_FILE_ORDER_REPORT_DATA_INVOICING. So difference PurchaseDate = 10:56:02 UTC Time to Timestamp 11:35:31 UTC Time is ok.

We have pending orders for several days.

Example of one of our orders GET /orders/v0/orders PurchaseDate = "2022-06-27T12:30:29Z" LastUpdateDate = "2022-06-27T12:34:36Z" OrderStatus = Pending

LastUpdateDate = "2022-06-27T12:59:49Z" OrderStatus = Unshipped

result of report (includes order) - created manually CreatedTime = {30.06.2022 09:52:00} DataEndTime = {27.06.2022 13:02:00} DataStartTime = {27.06.2022 12:57:00}

ProcessingEndTime = {30.06.2022 09:52:15} ProcessingStartTime = {30.06.2022 09:52:05}

=> order was found in time range 12:57 - 13:02!

tip for report GET_FLAT_FILE_ORDER_REPORT_DATA_INVOICING: I no longer create the report manually. I scheduled the report (every 15min or 5 min or...) then, i check the report list for new entries and downlaod the file.

var parameterssSchedule = new ParameterReportList(); parameterssSchedule.pageSize = 100; parameterssSchedule.reportTypes = new List(); parameterssSchedule.reportTypes.Add(Constants.ReportTypes.GET_FLAT_FILE_ORDER_REPORT_DATA_INVOICING); parameterssSchedule.processingStatuses = new List(); parameterssSchedule.processingStatuses.Add(Constants.ProcessingStatuses.DONE); //todo i just wanted done parameterssSchedule.marketplaceIds = new List(); parameterssSchedule.marketplaceIds.Add(MarketPlace.Germany.ID); parameterssSchedule.createdSince = DateTime.UtcNow.AddDays(-7); //todo optimize (was for testing)

List reportsSchedulesList = amazonConnection.Reports.GetReports(parameterssSchedule); if (reportsSchedulesList != null && reportsSchedulesList.Count > 0) { //check for new reports foreach (var reportschedule in reportsSchedulesList) { if (reportschedule.ReportScheduleId != null) // IMPORTANT: only scheduled Reports! { //todo } } }

kevinvenclovas commented 2 years ago

@sat-it Thank you!

Do you have FBA orders? There are not available in this report. GET_FLAT_FILE_ORDER_REPORT_DATA_INVOICING

Is there an other solution for FbA orders?

sat-it commented 2 years ago

yes, i use report "GET_AMAZON_FULFILLED_SHIPMENTS_DATA_INVOICING". i have tried many reports, it is the only one with full address.

Note for B2B orders (with VAT Number) & FBA! Example: Amazon sends our goods from DE to AT. If the business customer (AT) has a VAT number, then it is a "tax free intracommunity delivery"

The report not includes vat information, the following fields are missing: "buyer-tax-registration-id" "buyer-tax-registration-country" "buyer-tax-registration-type"

I opened a case on amazon but no solution yet.

kevinvenclovas commented 2 years ago

@sat-it thanks again!

I think the sp-api is not ready for release. There are so many issuee But we have one month left to switch … :/

We need the VAT-Information also for FBA orders…

Love it to work with Amazon Api ❤️😅

Can you keep us up to date with your case for the tax issue.

semso-software commented 2 years ago

Hello @sat-it @kevinvenclovas

We are looking into retrieving order information from Amazon SP-API. For MFN MFA both; with VatRegistrationId and shipFrom if possible. Which endpoint do you recommend to use?

MFN: ? AFN: GET_ORDER_REPORT_DATA_INVOICING

sat-it commented 2 years ago

Hi,

i also miss shipFrom fields in the SP-API reports.

MFN: XML - GET_ORDER_REPORT_DATA_INVOICING TXT - GET_FLAT_FILE_ORDER_REPORT_DATA_INVOICING (both only contains MFN Orders)

I don't work with xml. I did a quick comparison of the results from both reports. GET_ORDER_REPORT_DATA_INVOICING also contains BuyerTaxRegistrationId, BillingAdress and ShippingAdress.

FBA: XML - I can't find a comparable report (https://developer-docs.amazon.com/sp-api/docs/report-type-values) TXT - GET_AMAZON_FULFILLED_SHIPMENTS_DATA_INVOICING is the only report that contains complete BillingAdress and ShippingAdress. But no BuyerTaxRegistrationId!

My case was cloesd. I should contact another department on Amazon. I did that and am waiting for an answer again...

abuzuhri commented 2 years ago

Any Update here ?

sat-it commented 2 years ago

no, unfortunately not yet. But the case is still open.

abuzuhri commented 2 years ago

Hi All,

Any progress here @kevinvenclovas @sat-it

kevinvenclovas commented 2 years ago

@abuzuhri

we implemented an workarround so i have not followed this up.

We created an schedule report on amazon and requested every 10 minutes the new reports so we didn't need start and end date of the report

sat-it commented 2 years ago

sorry, for waiting case is cloesd. there will be no change to the report "GET_AMAZON_FULFILLED_SHIPMENTS_DATA_INVOICING".

we can get the missing information (VAT Number) from the report: (Invoice data reports) XML - GET_XML_VAT_INVOICE_DATA_REPORT TXT - GET_FLAT_FILE_VAT_INVOICE_DATA_REPORT

PLEASE read description! https://developer-docs.amazon.com/sp-api/docs/report-type-values

I haven't finished testing yet, I can summarize the following

  1. Report (GET_FLAT_FILE_VAT_INVOICE_DATA_REPORT) contains all (MFN & FBA, SHIPMENT, REFUND, RETURN etc.)
  2. complete billing and shipping adress
  3. VAT-Number

I wanted to compare the FBA data GET_AMAZON_FULFILLED_SHIPMENTS_DATA_INVOICING / GET_FLAT_FILE_VAT_INVOICE_DATA_REPORT

var reportOptions = new FikaAmazonAPI.AmazonSpApiSDK.Models.Reports.ReportOptions(); reportOptions.Add("ReportOption=All", "true"); //to check! DateTime startDateTime = Convert.ToDateTime("01.09.2022 0:00:00"); DateTime endeDateTime = Convert.ToDateTime("03.09.2022 23:59:59"); var datatAndDownloadFile = amazonConnection.Reports.CreateReportAndDownloadFile( Constants.ReportTypes.GET_FLAT_FILE_VAT_INVOICE_DATA_REPORT, startDateTime, endeDateTime, reportOptions, false);

DateTimeRange (01.09.-03.09.22) Report "GET_AMAZON_FULFILLED_SHIPMENTS_DATA_INVOICING" contains orders with shipment-date DateTimeRange (01.09.-03.09.22) Report "GET_FLAT_FILE_VAT_INVOICE_DATA_REPORT" contains orders with order-date.


Quetion I only use FBA in the SP-API.

MWS Report "_GET_AMAZON_FULFILLED_SHIPMENTS_DATAINVOICING" SP-API Report "GET_AMAZON_FULFILLED_SHIPMENTS_DATA_INVOICING"

Both reports contains the same columns, with NO VAT-Number. what was the solution in MWS for FBA?

RenzoF commented 2 years ago

Hi @sat-it,

I use the orders API and the GET_VAT_TRANSACTION_DATA report to get the VAT Number

ThomasL1973 commented 1 year ago

That#s an issue you could never resolve, because this is amazon.

About 10 years ago we had the same problem using the MWS Order Api.

Amazon uses thousands of decoupled systems it takes some time to syncronize them all and sometimes some transactions get stuck and go a few days on holiday.

Therefore it is best practise if you use regular recurring reports e.g. if you request a report as described every 15 minutes for the last 15 minutes. it should be best practise to recall the report once a day for the last 24 hours and once a week for the last 7 days.

abuzuhri commented 1 year ago

Since we have no control to this i will close this issue