HomeDocumentationCode SamplesAnnouncementsModelsRelease NotesFAQVideos
Developer HubAPI StatusSupport
Documentation
Developer HubAPI StatusSupport

(Option 3) Manually Upload Invoices

Use your tax data to create invoices, and upload them using the SP-API or through Seller Central (this option doesn't use VCS).

All sellers who do not choose to enroll on VCS also have the default option of uploading their own invoices to Amazon using the API or manually on Seller Central. This section will focus on uploading the invoices via the API. In this case, you should use your own tax data to create your invoices. You will not have access to VIDR report.

APIFeeds API
OperationcreateFeed
FeedTypeUPLOAD_VAT_INVOICE
marketplaceIds

Spain A1RKKUPIHCS9HS

UK A1F83G8C2ARO7P

France A13V1IB3VIYZZH

Germany A1PA6795UKMFR9

Italy APJ6JRA9NG5V4

Netherlands A1805IZSGTT6HS

Poland A1C3SOZRARQ6R3

Sweden A2NODRKZP88ZB9

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 (optional but recommended). 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 (optional but recommended). 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 provided here 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 (required). 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.

You can use the following example code to attach the PDF file. While this example is in Java, you can use it as a model for other programming languages.

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);

}

With this option, you are allowed to upload more than one invoice against the same order ID. However, the invoice number must be unique. Only the latest invoice will be considered as valid.