(Option 3) Upload invoices through the SP-API or manually through Seller Central

Create your own invoices using your tax data and upload the invoices using either the SP-API, or manually through Seller Central (this option does not 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
ReportTypeUPLOAD_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 may 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.

Separate the key-value pairs with a semicolon. Add metadata before each key.

Invoice upload examples:

metadata:orderid=206-2341234-3455465;metadata:invoicenumber=INT-3431-XJE3;metadata:documenttype=Invoice

Credit note example:

metadata:orderid=206-2341234-3455465;metadata:invoicenumber=INT-3431-XJE3;metadata: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.

  • FeedContent. This contains the feed content, in PDF format.

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.


Did this page help you?