HomeDocumentationCode SamplesAnnouncementsModelsRelease NotesFAQGitHubVideos
Developer HubAPI StatusSupport
Documentation
Developer HubAPI StatusSupport

(Option 2) Use Amazon Tax Calculation Data to Create Invoices

Register through the VAT Calculation Services (VCS) program, use the Amazon tax calculation data to create data invoices, then upload the invoices using the Selling Partner API (SP-API).

This option can be used only with the Selling Partner API (SP-API). You must use the tax data provided by Amazon to create your invoices.

Use the following procedure to upload your invoices with the SP-API.

Step 1. Extract the tax calculation data for all your orders from the VAT invoice data report (VIDR).

The VIDR is a report that contains tax calculation details at the transaction level, and is only available to sellers who have enrolled in VCS. This report contains all the information required to generate an accurate VAT invoice for each shipment, whether seller-fulfilled or Fulfilled by Amazon (FBA). An order is available in this report immediately after its shipment has been dispatched.

APIReports API
OperationcreateReport
reportTypeGET_FLAT_FILE_VAT_INVOICE_DATA_REPORT or GET_XML_VAT_INVOICE_DATA_REPORT
reportOptions

pendingInvoices or all

  • pendingInvoices – A Boolean value. When true, the report contains only shipments for which invoices and credit notes are pending. This report does not contain shipments for which invoices have already been uploaded successfully. Includes shipments for orders that were placed within the previous 90 days. When false, or if pendingInvoices is not included in reportOptions, the content of the report depends on the value of all.
    Example: "reportOptions": {"ReportOption=pendingInvoices": "true"}

With this option, the report includes shipment details for shipped orders whose order dates are within the past 90 days, and for which invoices are due and must be uploaded. This means all shipments where the invoice status is InvoicePending or CreditNotePending. Reports with this option will not include shipments for which invoices have already been successfully uploaded. The purpose of this option is to allow the seller to simply loop through all the line items and create invoices, without having to apply their own business logic. When no ReportOption parameter is specified, the default is ReportOption=PendingInvoices.

  • all – A Boolean value. When true, the report contains shipments for orders that were placed within the date range that you specify. Includes shipments of all possible invoice statuses. You must specify the startDate and endDate parameters of the createReport operation. The dataStartTime and dataEndTime values must correspond to valid first and last days in the specified reportPeriod. For example, dataStartTime must be a Sunday and dataEndTime must be a Saturday when reportPeriod=WEEK. The maximum allowed date range is 30 days. When false, or if all is not included in reportOptions, the content of the report depends on the value of pendingInvoices.
    Example: "reportOptions": {"ReportOption=All": "true"}

The report includes shipments of all possible InvoiceStatus values. This includes shipments with InvoiceStatus=InvoiceCreatedByAmazon. InvoiceCreatedByAmazon means that Amazon will issue an invoice for this transaction, and therefore the seller is not required to upload an invoice. Similarly, this report also includes transactions with InvoiceStatus=NoTaxCalculated. NoTaxCalculated means that Amazon did not perform tax calculation for this transaction. This happens, for example, when the item is shipped from a country for which the seller has not provided a valid VAT number on Seller Central.

Default: "pendingInvoices" : "true".

You can determine when to schedule these reports. Amazon recommends scheduling at least twice a day so that invoices can be uploaded with a maximum delay of 12 hours (within the SLA of 24 hours) after the shipment has been dispatched.

An invoice is due for each shipment (not order) after the shipment has been dispatched. A shipment can have one of the statuses in the following table:

Invoice StatusDescriptionAction Required
InvoicePendingShipment has been dispatched.The seller must upload an invoice for the shipment.
InvoiceProcessingSeller has uploaded the invoice and Amazon is processing it.No action is required from the seller at this point. Amazon will process the invoice.
InvoiceUploadedSeller has uploaded the invoice and Amazon has finished processing it. There was no error detected.No action is required from the seller. Invoice successfully uploaded and is available to the customer in the Your Orders page. Customers can download the invoice at any time.
InvoiceRejectedSeller has uploaded the invoice and Amazon has finished processing it. There were errors detected in the upload.Seller must upload the invoice for this shipment again.
CreditNotePendingIn the case of a refund, the money has been returned to the buyer. In the case of a return, the item has been received in Amazon's fulfillment center for FBA orders, or has been authorized by the seller for seller fulfilled orders.Credit Note is now due for this transaction.
CreditNoteProcessingSeller has uploaded the invoice and Amazon is processing it.No action is required from the seller at this point. Amazon will process the credit note.
CreditNoteUploadedSeller has uploaded the credit note and Amazon has finished processing it. There was no error detected.No action is required from the seller. Credit Note successfully uploaded and made available to the customer on the Your Orders page.
CreditNoteRejectedSeller has uploaded the credit note and Amazon has finished processing it. There were errors detected in the upload.Seller must upload the Credit Note for this transaction again.
CreditNoteCreatedByAmazonAmazon created a credit note for this transaction.No action is required from the seller.
NoTaxCalculatedAmazon could not calculate any tax for this transaction. This usually happens when the seller has not uploaded a VAT number for the country from where the shipment was dispatched. For example, the seller opted in for Pan EU FBA, and did not provide a VAT number of CZ. If a shipment is dispatched from CZ, Amazon is not able to calculate VAT.Amazon will not calculate the VAT and the seller must upload the invoice for this transaction. The seller can upload the invoice in Seller Central or using Amazon Marketplace Web Service, following the Invoice Uploader Developer Guide.
InvoiceCreatedByAmazonAmazon created an invoice for this transaction.No action is required from the seller.

VIDR columns

VIDR Sample ReportReport Link
XMLCSV

The following table explains each VIDR column:

Field nameDefinitionExample
order-idAmazon's unique order identifier. Used for shipping confirmation and post-order processing.736-3563777-5518068
order-item-idAmazon's unique order item identifier. Used for shipping confirmation and post-order processing.583563777345
shipping-idShipping ID for this shipment.409302382
fulfilled-byThe fulfillment channel for this order.MFN or FBA
order-dateDate the order was placed.17/05/2018
marketplace-idThe marketplace in which the order was placed.DE, FR, UK, IT, ES
recipient-nameName of the recipient.Mary Major
buyer-nameName of the buyer.Diego Ramirez
ship-service-levelFulfillment service level paid for by the buyer when ordering the item. For example, standard or expedited.Standard
ship-address-1The first line of the Ship To address.123 Any Street
ship-address-2Second line of Ship To address.Apt. 12
ship-address-3Third line of Ship To address.c/o Example Corp.
ship-cityCity of Ship To address.Any City
ship-stateState of Ship To address.Any State
ship-postal-codePostal Code of Ship To address.SL1 1QP
ship-countryThe international standard two-letter country code (ISO 3166-compliant).UK
ship-phone-numberPhone number of the shipping address.999999999
shipment-dateDate of dispatch of this shipment.20/05/2018
billing-nameBilling name.Márcia Oliveira
bill-address-1The first line of the billing address.100 Main Street
bill-address-2The second line of the billing address.Apt. 12
bill-address-3The third line of the billing address.c/o AnyCompany
bill-cityCity of the billing address.Any City
bill-stateState of the billing address.Any State
bill-postal-codePostal code of the billing address.U7D 294
bill-countryThe international standard two-letter country code (ISO 3166-compliant).UK
bill-phone-numberPhone number of the billing address.44234343
ship-from-cityCity of Ship From address.Any City
ship-from-stateState of Ship From address.Any State
ship-from-countryCountry of Ship From address.UK
ship-from-postal-codePostal code of Ship From address.D76 UT9
skuStock-keeping unit. Seller-defined unique identifier for a product.sku123
product-nameName of the product.DJI CP.PT.03342 Spark - Battery Charging Hub
quantity-purchasedQuantity purchased.1
currencyThe currency used for the transaction.GBP
asinASIN of the product.AY39345YE8K
item-vat-incl-amountVAT Inclusive item price.120.00
item-vat-amountVAT amount of item price.20.00
item-vat-excl-amountVAT exclusive item price.100.00
item-vat-rateVAT rate of item price.0.20
gift-wrap-vat-incl-amountTotal VAT inclusive gift wrap.12.00
gift-wrap-vat-amountTotal VAT amount of gift wrap.2.00
gift-wrap-vat-excl-amountTotal VAT exclusive gift wrap.10.00
gift-wrap-vat-rateTotal VAT rate of gift price.0.20
shipping-vat-incl-amountVAT inclusive shipping price.6.00
shipping-vat-amountVAT amount of shipping price.1.00
shipping-vat-excl-amountVAT exclusive shipping price.5.00
shipping-vat-rateVAT rate of shipping price.0.20
item-promo-vat-incl-amountTotal VAT inclusive item promotion.-0.12
item-promo-vat-amountTotal VAT amount item promotion.-0.02
item-promo-vat-excl-amountTotal VAT exclusive item promotion.-0.10
item-promo-vat-rateTotal VAT rate item promotion.0.20
item-promotion-idPromotion ID for item promotion.

136643052:AKY54VWVKS3JCY6T

(This is an ID generated by Amazon; alphanumeric value)

shipping-promo-vat-incl-amountTotal VAT inclusive shipping promotion.-0.12
shipping-promo-vat-amountTotal VAT amount shipping promotion.-0.02
shipping-promo-vat-excl-amountTotal VAT exclusive shipping promotion.-0.10
shipping-promo-vat-rateTotal VAT rate shipping promotion.0.20
shipping-promotion-idPromotion ID of shipping promotion.

3943834723:BWJRJERIUDKERU

(This is an ID generated by Amazon; alphanumeric value)

gift-promo-vat-incl-amountTotal VAT inclusive gift wrap promotion.-0.20
gift-promo-vat-amountTotal VAT amount gift wrap promotion.-0.12
gift-promo-vat-excl-amountTotal VAT exclusive gift wrap promotion.-0.02
gift-promo-vat-rateTotal VAT rate gift wrap promotion.0.10
gift-promotion-idPromotion ID of gift wrap promotion.385934052:BWJRJDJSDS3JCY6T
transaction-idFor shipments, this is the shipping ID. For returns, this is a unique transaction ID (different from shipping ID).409302382 (if it is a shipment); amzn1:crow:A0f6kWaFSV6ymAlMHe4VJw (if return or refund. In the case of return/refund, this is a unique transaction ID in alphanumeric format)
transaction-typeValues can be shipment, refund, or return, depending on the type of transaction.SHIPMENT, RETURN, REFUND
is-amazon-invoicedIndicates if Amazon creates an Invoice for this transaction. True if the seller uses VCS and chooses the option to allow Amazon to create the invoices, or if Amazon World Imports buys from the seller. The seller should not create Invoices for these transactions. Amazon will generate an invoice and make it available to the seller.TRUE or FALSE
invoice-statusStatus of the invoice, described in detail in section 6.1.Refer to section 6.1 for details on invoice status.
invoice-status-descriptionDescription of the invoice status, described in detail in section section 6.1.The detailed description of what the invoice status means.
is-business-orderWas this order from Amazon Business website or B2C website?TRUE or FALSE
purchase-order-numberPO number (if supplied by the customer).AB45-234934 (can be any string)
seller-vat-numberVAT number of the seller used in VAT calculation.DE111111111
buyer-vat-numberBuyer VAT number used in VAT calculation.DE22222222 or blank if the customer does not have a VAT Number on Amazon.
buyer-company-nameCompany name of the buyer.AnyCompany
price-designationIndicates if this is Business Price or Standard Price.Business Price or Standard Price
invoice-numberThe invoice number provided by the seller. In the case of a PendingInvoices view, the column is blank because the invoice has not been uploaded. In the case of an All view, the column will contain the invoice number uploaded by the seller.XXXX
legacy-customer-order-item-idThis order item ID is the same as that found in FBA reports and MFN reports. If you want to match the individual line items from a VIDR to FBA or MFN reports, you can use this column.82840304120340
buyer-tax-registration-typeThe tax type of the customer (if the customer has a tax registration number).VAT/BusinessReg/CitizenId. In the Spain and Italy marketplaces, businesses could have Business Registration number (BusinessReg) or individuals could have tax IDs (CitizenID).
is-buyer-physically-presentTrue if the customer is physically established in the country for which the tax number was provided in the buyer-vat-number column.TRUE or FALSE
is-seller-physically-presentTrue if the seller is physically established in the country for which the VAT number was provided in the seller-vat-number column.TRUE or FALSE
buyer-e-invoice-account-idThe e-invoice account ID of the customer. This is populated if the customer has provided an e-invoice account ID (which can be used to send the invoice to Sistema di Interscambio (SdI), if required). This column is specifically added for Italy e-invoicing law that came into effect in 2019, so that sellers can upload invoices to SdI.XXXXXXXX
recommended-invoice-formatRecommended invoice format to be submitted for tax authorities. If the value is PDF, you must upload the PDF invoice format to Amazon, and use the same PDF as the true invoice copy. If the recommended format is XML, then Amazon has determined that the customer is a B2B Customer in IT, and the seller is physically established in IT, thus the seller must upload an XML invoice in Sistema di Interscambio (SdI) according to the Italian law related to E-invoicing. The XML invoice available on SdI will be considered the true copy of the invoice. However, you must also upload a PDF invoice to Amazon. The PDF should contain additional text or a watermark indicating that this is a duplicate invoice. The customer can retrieve the original invoice from SdI.PDF or XML. If the value in this column is XML, then the seller must additionally upload an XML invoice on SdI. If the value in this column in PDF, then the seller needs to upload the invoice only to Amazon through the Invoice Upload Feed Type. Note that regardless of the value in this column, the seller must always upload a PDF invoice to Amazon using the Invoice Upload feed type.
Citation-enThis column provides the citation text in English.We recommended that the seller use the citation text provided on the invoice. The seller is free to choose the language they want to use for citation, depending on the language on the invoice.
Citation-deThis column provides the citation text in German.We recommended that the seller use the citation text provided on the invoice. The seller is free to choose the language they want to use for citation, depending on the language on the invoice.
Citation-esThis column provides the citation text in Spanish.We recommended that the seller use the citation text provided on the invoice. The seller is free to choose the language they want to use for citation, depending on the language on the invoice.
Citation-frThis column provides the citation text in French.We recommended that the seller use the citation text provided on the invoice. The seller is free to choose the language they want to use for citation, depending on the language on the invoice.
Citation-itThis column provides the citation text in Italian.We recommended that the seller use the citation text provided on the invoice. The seller is free to choose the language they want to use for citation, depending on the language on the invoice.
Is-invoice-correctedIndicates if this transaction referring to a previous corrected invoice. True if this transaction is a correction of a previous transaction.TRUE or FALSE
original-vat-invoice-numberThe invoice number of the original shipment whose invoice has to be corrected.The original invoice number.
invoice-correction-detailsInvoice amendment details describing changes on the invoice. This is only applicable for invoice amendment transaction.

New invoice issued after amending billing address on original VAT invoice.

OR

Credit note issued to amend billing address on original VAT invoice.

Step 2. Create your own invoices based on the data from the VIDR report.

Download the VIDR report and use the information to compile your VAT invoice.

Step 3. Upload the invoices to Amazon using the Feeds API.

APIFeeds API
OperationcreateFeed
FeedTypeUPLOAD_VAT_INVOICE
marketplaceIds

Spain A1RKKUPIHCS9HS

UK A1F83G8C2ARO7P

France A13V1IB3VIYZZH

Germany 1PA6795UKMFR9

Italy APJ6JRA9NG5V4

Netherlands A1805IZSGTT6HS

Poland A1C3SOZRARQ6R3

Sweden A2NODRKZP88ZB9

Belgium AMEN7PMS3EDWL

feedOptions
  • Specify key-value pairs to provide important metadata along with the PDF invoice. The keys in these key-value pairs are:

    • OrderId (required if ShippingId is not specified). The identifier of the order for which the invoice is being submitted.

    • ShippingId (required if OrderId is not specified). The identifier of the shipment for which the invoice is being submitted.

Note: Either OrderId or ShippingId is required when uploading an invoice. Amazon strongly recommends uploading an invoice against the shipping ID. If both order ID and shipping ID are specified, Amazon will ignore the order ID and upload the invoice against shipping ID. If neither is provided, an error might be returned. Possible errors are in the following sections.

  • TotalAmount (required). The total amount on the invoice. This is VAT-inclusive prices on items, gift wrap, and shipping, minus the VAT on all promotions. If the total amount specified does not match Amazon's total amount for this shipment, to two decimal places, then the invoice upload will be rejected. We recommend strictly following the tax computations provided in the VIDR.

  • TotalVATAmount (required). The total VAT amount on the invoice. This is the VAT on the items, gift wrap, and shipping, minus the VAT on all promotions. If the VAT amount does not match the VAT amount calculated by Amazon for this shipment, to two decimal places, then the invoice upload will be rejected. We recommend strictly following the tax computations provided in the VIDR.

  • InvoiceNumber (required). The invoice number used in the invoice. This invoice number will be shared with customers. Sellers must ensure the same invoice number appears on the invoice.

  • DocumentType (optional). Possible values: Invoice. Use this you are uploading an invoice. CreditNote. Use this you are uploading a credit note for a refund or a return. Default: Invoice.

  • TransactionId (optional). Required only if DocumentType=CreditNote.

Invoice upload examples:

{"OrderID":"206-2341234-3455465", "InvoiceNumber":"INT-3431-XJE3", "DocumentType":"Invoice"}

Credit note example (CN-123-ABC is the Credit note number):

{"OrderID":"206-2341234-3455465", "InvoiceNumber":"CN-123-ABC", "DocumentType":"CreditNote"}

Do not add quotation marks around keys or values. Amazon only accepts the following characters: commas, forward slashes, backslashes, spaces, dashes, underscores, semi colons, colons, 0-9, A-Z, a-z, #. Amazon trims extra space.

The throttling limit for the Invoicing Feed (UPLOAD_VAT_INVOICE) is one invoice upload every three seconds.

Sample Java code for creating the feedoptions:

Map<String, String> feedOptions = new HashMap<>(); // building parameter map

feedOptions.put("metadata:OrderId", "XXX-XXXXXXX-XXXXXXX");
feedOptions.put("metadata:TotalAmount", String.format(TOTALAMMOUNT));
feedOptions.put("metadata:TotalVATAmount", String.format(TOTALVATAMMOUNT));
feedOptions.put("metadata:InvoiceNumber", INVOICE_NUMBER);

String options = feedOptions.entrySet().stream()
    .map(e -> String.format("%s=%s", e.getKey(), e.getValue()))
    .collect(Collectors.joining(";"));

File pdfD = new File("<PATH TO PDF>");

byte[] pdfDocument = FileUtils.readFileToByteArray(pdfD); // read pdf document to byte array
String contentMD5 = Base64.encodeBase64String(pdfDocument); // building hash code
InputStream contentStream = new ByteArrayInputStream(pdfDocument); // inputstream of
SubmitFeedResponse response = submitFeed(contentStream, contentMD5, "_UPLOAD_VAT_INVOICE_", options, ContentType.OctetStream);

public SubmitFeedResponse submitFeed(InputStream, String contentMD5, String feedType, String feedOptions, ContentType contentType)
{
    SubmitFeedRequest request = new SubmitFeedRequest();

    request.setContentMD5(contentMD5);
    request.setFeedContent(inputStream);
    request.setFeedOptions(feedOptions);
    request.setFeedType(feedType);
    request.setMarketplaceIdList(new IdList(Arrays.asList(getMarketPlaces());
    request.setMerchant(configuration.getAmazon().getSellerId());
    request.setMWSAuthToken(configuration.getAmazon().getMwsAuthToken());
    request.setContentType(contentType);

    return getMarketplaceWebServiceClient().submitFeed(request);
}