Create and Upload Invoices
Learn how to create and upload invoices with and without VCS enrollment.
After you enroll in VCS, you have two options to create and upload invoices:
- Allow Amazon to automatically create and upload your invoices.
- Use Amazon tax calculation data to create your own invoices, then manually upload them using SP-API.
If you don't want to use VCS, you can use your own tax data to create invoices, then manually upload them using SP-API or through Seller Central. For instructions on how to use this method, refer to Manually upload invoices.
Tip
Don't provide seller remittance information on invoices because this can confuse customers. Amazon collects payments from customers directly and disburses the amount to sellers.
For information about invoice compliance requirements and invoice corrections, refer to VCS Invoice Compliance and Correction.
Allow Amazon to create invoices for you
This option is available for all sellers who enroll in the VAT Calculation Service (VCS) and select the I want Amazon to generate invoices on my behalf option get access to the Amazon VAT Calculation Report. This report contains useful information about VCS orders including: the invoice number, the invoice link, the buyer VAT, and ship-from/ship-to information. Orders are available in this report three days after shipment. Use the information in the following table to request the VCS report using the Selling Partner API (SP-API).
API | Reports API |
---|---|
Operation | createReport |
ReportType | SC_VAT_TAX_REPORT |
The VCS program affects the contents of the following reports:
Order reports
Include the VAT amount
Order reports that you request after you enroll in VCS appear as follows:
ItemTax
(in XML reports) anditem_tax
(in flat file reports). Contains the VAT amount, calculated by Amazon.ItemPrice
(in XML reports) anditem_price
(in flat file reports). Contains the VAT-inclusive price.
The VAT-exclusive amount is the item price minus the item tax.
Note
When the item tax is zero, 0% VAT was charged for the transaction. There are several circumstances in which this can happen. Examples include international transactions and B2B EU cross-border transactions. For more information, refer to VCS Calculation Methodology.
Include VAT details
You can choose to include VCS-related attributes in your order reports.
Use the following procedure to include VCS-related attributes in order reports:
-
Go to Add or remove order report columns in Seller Central.
-
Add the VAT details column.
After you complete this procedure, the following columns are added to your order reports: Item price VAT exclusive, Shipping price VAT exclusive, and Gift wrap price VAT exclusive.
FBA order reports
FBA order reports that you request after you enroll in VCS appear as follows:
ItemTax
(in XML reports) anditem_tax
(in flat file reports). Contains the VAT amount, calculated by Amazon.ItemPrice
(in XML reports) anditem_price
(in flat file reports). Contains the VAT-exclusive amount (changed from the VAT-inclusive amount).
The VAT-inclusive amount is the item price plus the item tax.
Use Amazon tax calculation data to create invoices
You can only use this option with the Selling Partner API (SP-API) and you must use the tax data provided by Amazon to create your invoices.
Step 1. Extract the tax calculation data for all your orders from the VAT invoice data report
The VAT invoice data report (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 you need 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.
Use the createReport
operation with the GET_FLAT_FILE_VAT_INVOICE_DATA_REPORT
or GET_XML_VAT_INVOICE_DATA_REPORT
report type (reportType
).
For reportOptions
, you can use pendingInvoices
or all
.
-
pendingInvoices
: A Boolean value. When noReportOption
parameter is specified, the default isReportOption=PendingInvoices
. Example:"reportOptions": {"ReportOption=pendingInvoices": "true"}
- When
true
, the report contains only shipments for which invoices and credit notes are pending. This report doesn't contain shipments for which invoices have already been successfully uploaded. This 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 ofall
.
These reports include shipment details for shipped orders with order dates in the past 90 days, for which invoices are due and must be uploaded (all shipments where the invoice status is
InvoicePending
orCreditNotePending
). Reports with this option don't include shipments for which invoices have already been successfully uploaded. The purpose of this option is to allow the seller to loop through all the line items and create invoices, without having to apply their own business logic. - When
-
all
: A Boolean value. The default is . Example:"reportOptions": {"ReportOption=All": "true"}
- When
true
, the report contains shipments for orders that were placed within the date range that you specify. This includes shipments of all possible invoice statuses. You must specify thestartDate
andendDate
parameters for thecreateReport
operation. ThedataStartTime
anddataEndTime
values must correspond to valid first and last days in the specifiedreportPeriod
. For example, whenreportPeriod=WEEK
,dataStartTime
must be a Sunday anddataEndTime
must be a Saturday. The maximum allowed date range is 30 days. - When
false
, or ifall
is not included inreportOptions
, the content of the report depends on the value ofpendingInvoices
. The default value is"pendingInvoices" : "true"
.
These reports include shipments for all possible
InvoiceStatus
values. This includes:- Shipments with
InvoiceStatus=InvoiceCreatedByAmazon
. Amazon issues an invoice for this transaction, so the seller is not required to upload an invoice. - Transactions with
InvoiceStatus=NoTaxCalculated
. Amazon didn't 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.
- When
You can determine when to schedule these reports. To meet the SLA of 24 hours, you can create a schedule for every 12 hours. This ensures a maximum delay of 12 hours after a shipment is dispatched.
An invoice is due for each shipment (not each order) after the shipment is dispatched. A shipment can have one of the following statuses:
Invoice status | Description | Action required |
---|---|---|
InvoicePending | Shipment has been dispatched. | The seller must upload an invoice for the shipment. |
InvoiceProcessing | Seller has uploaded the invoice and Amazon is processing it. | No action is required from the seller at this point. Amazon will process the invoice. |
InvoiceUploaded | Seller 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 on the Your Orders page. Customers can download the invoice at any time. |
InvoiceRejected | Seller has uploaded the invoice and Amazon has finished processing it. There are errors detected in the upload. | Seller must upload the invoice for this shipment again. |
CreditNotePending | In 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. |
CreditNoteProcessing | Seller 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. |
CreditNoteUploaded | Seller 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. |
CreditNoteRejected | Seller 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. |
CreditNoteCreatedByAmazon | Amazon created a credit note for this transaction. | No action is required from the seller. |
NoTaxCalculated | Amazon couldn't 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. | 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 with SP-API. |
InvoiceCreatedByAmazon | Amazon created an invoice for this transaction. | No action is required from the seller. |
VIDR columns
The following table explains each VIDR column:
Field name | Definition | Example |
---|---|---|
order-id | Amazon's unique order identifier. Used for shipping confirmation and post-order processing. | 736-3563777-5518068 |
order-item-id | Amazon's unique order item identifier. Used for shipping confirmation and post-order processing. | 583563777345 |
shipping-id | Shipping ID for this shipment. | 409302382 |
fulfilled-by | The fulfillment channel for this order. | MFN or FBA |
order-date | Date the order was placed. | 17/05/2018 |
marketplace-id | The marketplace in which the order was placed. | DE, FR, IT, ES |
recipient-name | Name of the recipient. | Mary Major |
buyer-name | Name of the buyer. | Diego Ramirez |
ship-service-level | Fulfillment service level paid for by the buyer when ordering the item. For example, standard or expedited. | Standard |
ship-address-1 | The first line of the Ship To address. | 123 Any Street |
ship-address-2 | Second line of Ship To address. | Apt. 12 |
ship-address-3 | Third line of Ship To address. | c/o Example Corp. |
ship-city | City of Ship To address. | Any City |
ship-state | State of Ship To address. | Any State |
ship-postal-code | Postal Code of Ship To address. | SL1 1QP |
ship-country | The international standard two-letter country code (ISO 3166-compliant). | DE |
ship-phone-number | Phone number of the shipping address. | 999999999 |
shipment-date | Date of dispatch of this shipment. | 20/05/2018 |
billing-name | Billing name. | Márcia Oliveira |
bill-address-1 | The first line of the billing address. | 100 Main Street |
bill-address-2 | The second line of the billing address. | Apt. 12 |
bill-address-3 | The third line of the billing address. | c/o AnyCompany |
bill-city | City of the billing address. | Any City |
bill-state | State of the billing address. | Any State |
bill-postal-code | Postal code of the billing address. | U7D 294 |
bill-country | The international standard two-letter country code (ISO 3166-compliant). | DE |
bill-phone-number | Phone number of the billing address. | 44234343 |
ship-from-city | City of Ship From address. | Any City |
ship-from-state | State of Ship From address. | Any State |
ship-from-country | Country of Ship From address. | DE |
ship-from-postal-code | Postal code of Ship From address. | 10178 |
sku | Stock-keeping unit. Seller-defined unique identifier for a product. | sku123 |
product-name | Name of the product. | DJI CP.PT.03342 Spark - Battery Charging Hub |
quantity-purchased | Quantity purchased. | 1 |
currency | The currency used for the transaction. | EUR |
asin | ASIN of the product. | AY39345YE8K |
item-vat-incl-amount | VAT Inclusive item price. | 120.00 |
item-vat-amount | VAT amount of item price. | 20.00 |
item-vat-excl-amount | VAT exclusive item price. | 100.00 |
item-vat-rate | VAT rate of item price. | 0.20 |
gift-wrap-vat-incl-amount | Total VAT inclusive gift wrap. | 12.00 |
gift-wrap-vat-amount | Total VAT amount of gift wrap. | 2.00 |
gift-wrap-vat-excl-amount | Total VAT exclusive gift wrap. | 10.00 |
gift-wrap-vat-rate | Total VAT rate of gift price. | 0.20 |
shipping-vat-incl-amount | VAT inclusive shipping price. | 6.00 |
shipping-vat-amount | VAT amount of shipping price. | 1.00 |
shipping-vat-excl-amount | VAT exclusive shipping price. | 5.00 |
shipping-vat-rate | VAT rate of shipping price. | 0.20 |
item-promo-vat-incl-amount | Total VAT inclusive item promotion. | -0.12 |
item-promo-vat-amount | Total VAT amount item promotion. | -0.02 |
item-promo-vat-excl-amount | Total VAT exclusive item promotion. | -0.10 |
item-promo-vat-rate | Total VAT rate item promotion. | 0.20 |
item-promotion-id | Promotion ID for item promotion. An alphanumeric value that is generated by Amazon. | 136643052:AKY54VWVKS3JCY6T |
shipping-promo-vat-incl-amount | Total VAT inclusive shipping promotion. | -0.12 |
shipping-promo-vat-amount | Total VAT amount shipping promotion. | -0.02 |
shipping-promo-vat-excl-amount | Total VAT exclusive shipping promotion. | -0.10 |
shipping-promo-vat-rate | Total VAT rate shipping promotion. | 0.20 |
shipping-promotion-id | Promotion ID of shipping promotion. An alphanumeric value that is generated by Amazon. | 3943834723:BWJRJERIUDKERU |
gift-promo-vat-incl-amount | Total VAT inclusive gift wrap promotion. | -0.20 |
gift-promo-vat-amount | Total VAT amount gift wrap promotion. | -0.12 |
gift-promo-vat-excl-amount | Total VAT exclusive gift wrap promotion. | -0.02 |
gift-promo-vat-rate | Total VAT rate gift wrap promotion. | 0.10 |
gift-promotion-id | Promotion ID of gift wrap promotion. | 385934052:BWJRJDJSDS3JCY6T |
transaction-id | For shipments, this is the shipping ID. For returns, this is a unique transaction ID that differs from the shipping ID. | 409302382 (for a shipment); amzn1:crow:A0f6kWaFSV6ymAlMHe4VJw (for a return or refund) |
transaction-type | The type of transaction. | SHIPMENT, RETURN, or REFUND |
is-amazon-invoiced | Indicates if Amazon creates an invoice for this transaction. If true, 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 generates an invoice and makes it available to the seller. | TRUE or FALSE |
invoice-status | Status of the invoice. | Refer to Step 1 for details about invoice status. |
invoice-status-description | Description of the invoice status. | Refer to Step 1 for details about invoice status. |
is-business-order | Was this order from Amazon Business website or B2C website? | TRUE or FALSE |
purchase-order-number | PO number (if supplied by the customer). | AB45-234934 (can be any string) |
seller-vat-number | VAT number of the seller used in VAT calculation. | DE111111111 |
buyer-vat-number | Buyer VAT number used in VAT calculation. | DE22222222 (or blank if the customer does not have a VAT Number on Amazon) |
buyer-company-name | Company name of the buyer. | AnyCompany |
price-designation | Indicates if this is Business Price or Standard Price. | Business Price or Standard Price |
invoice-number | The 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 contains the invoice number that is uploaded by the seller. | XXXX |
legacy-customer-order-item-id | This 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-type | The tax type of the customer (if the customer has a tax registration number). | VAT, BusinessReg, CitizenId. In Spain and Italy marketplaces, businesses can have a Business Registration number (BusinessReg) and individuals can have tax IDs (CitizenID). |
is-buyer-physically-present | True 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-present | True 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-id | The 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 the e-invoicing law in Italy that came into effect in 2019, so that sellers can upload invoices to SdI. | XXXXXXXX |
recommended-invoice-format | Recommended 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 e-invoice law. The XML invoice that is available on SdI is considered as the true copy of the invoice. However, you must also upload a PDF invoice to Amazon. The PDF must contain additional text or a watermark to indicate that it's a duplicate invoice. The customer can retrieve the original invoice from SdI. 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. | PDF or XML. |
Citation-en | This column provides the citation text in English. | We recommended that the seller use the citation text provided on the invoice. The seller can choose the language they want to use for citation, depending on the language on the invoice. |
Citation-de | This column provides the citation text in German. | We recommended that the seller use the citation text provided on the invoice. The seller can choose the language they want to use for citation, depending on the language on the invoice. |
Citation-es | This column provides the citation text in Spanish. | We recommended that the seller use the citation text provided on the invoice. The seller can choose the language they want to use for citation, depending on the language on the invoice. |
Citation-fr | This column provides the citation text in French. | We recommended that the seller use the citation text provided on the invoice. The seller can choose the language they want to use for citation, depending on the language on the invoice. |
Citation-it | This column provides the citation text in Italian. | We recommended that the seller use the citation text provided on the invoice. The seller can choose the language they want to use for citation, depending on the language on the invoice. |
Is-invoice-corrected | Indicates 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-number | The invoice number of the original shipment that requires an invoice correction. | The original invoice number. |
invoice-correction-details | Invoice amendment details that describe changes on the invoice. This is only applicable for an invoice amendment transaction. | A new invoice is issued after amending the billing address on original VAT invoice; or a credit note is issued to amend the billing address on the original VAT invoice. |
Step 2. Create your own invoices from data in the VIDR report
Download the VIDR report and use the information to compile your VAT invoice.
Step 3. Upload invoices to Amazon using Feeds API
Use the createFeed
operation with the UPLOAD_VAT_INVOICE
feed type (feedType
).
Tip
To get the marketplace IDs for your country, refer to Marketplace IDs.
For feedOptions
, you must specify metadata in key:value pairs with the PDF invoice. Either OrderId
or ShippingId
is required when you upload an invoice (ShippingId
is preferred).
OrderId
: The identifier of the order for which the invoice is being submitted.ShippingId
: The identifier of the shipment for which the invoice is being submitted.
If you include OrderId
and ShippingId
, Amazon ignores the order ID and uploads the invoice with the shipping ID. If neither is provided, you might get an error. For help with errors, refer to Error Handling.
The following feedOptions
are required:
TotalAmount
. The total amount on the invoice. This is the VAT-inclusive price for items, gift wrap, and shipping, minus the VAT for all promotions. If the total amount specified does not match Amazon's total amount for this shipment (to two decimal places), the invoice upload is rejected. We recommend strictly following the tax computations provided in the VIDR.TotalVATAmount
. The total VAT amount on the invoice. This is the VAT for the items, gift wrap, and shipping, minus the VAT for all promotions. If the VAT amount does not match the VAT amount calculated by Amazon for this shipment (to two decimal places), the invoice upload is rejected. We recommend strictly following the tax computations provided in the VIDR.InvoiceNumber
. The invoice number that is used on the invoice. This invoice number is shared with customers. Sellers must ensure the same invoice number appears on the invoice.
The following feedOptions
are optional:
-
DocumentType
. Possible values:Invoice
. Use this if you are uploading an invoice.CreditNote
. Use this if you are uploading a credit note for a refund or a return.
The default value isInvoice
.
-
TransactionId
. Required only ifDocumentType=CreditNote
.
Caution
Do not add quotation marks around keys or values. Amazon only accepts the following characters: commas (
,
), forward slashes (/
), backslashes (\
), spaces ( ), dashes (-
), underscores (_
), semicolons (;
), colons (:
), hashes (#
), 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.
Examples
Invoice uploads:
{"OrderID":"206-2341234-3455465", "InvoiceNumber":"INT-3431-XJE3", "DocumentType":"Invoice"}
Credit notes (CN-123-ABC
is the credit note number):
{"OrderID":"206-2341234-3455465", "InvoiceNumber":"CN-123-ABC", "DocumentType":"CreditNote"}
Java code to create the feed options:
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);
}
Manually upload invoices
All sellers who choose not to enroll in VCS have the default option to upload their own invoices to Amazon using the API or Seller Central. This section describes using the API.
To manually upload invoices, you must use your own tax data to create your invoices. You will not have access to a VIDR report.
Use the createFeed
operation with the UPLOAD_VAT_INVOICE
feed type (feedType
).
Tip
To get the marketplace IDs for your country, refer to Marketplace IDs.
For feedOptions
, you must specify metadata in key:value pairs with the PDF invoice. Either OrderId
or ShippingId
is required when you upload an invoice (ShippingId
is preferred).
OrderId
: The identifier of the order for which the invoice is being submitted.ShippingId
: The identifier of the shipment for which the invoice is being submitted.
If you include OrderId
and ShippingId
, Amazon ignores the order ID and uploads the invoice with the shipping ID. If neither is provided, you might get an error. For help with errors, refer to Error Handling.
The following feedOptions
are required:
InvoiceNumber
. The invoice number that is used on the invoice. This invoice number is shared with customers. Sellers must ensure the same invoice number appears on the invoice.DocumentType
. Possible values:Invoice
. Use this if you are uploading an invoice.CreditNote
. Use this if you are uploading a credit note for a refund or a return.
The default value isInvoice
.
Tip
With manual uploads, you can upload more than one invoice against the same order ID. However, the invoice number must be unique. Only the latest invoice is considered valid.
The following feedOptions
are optional:
TotalAmount
. The total amount on the invoice. This is the VAT-inclusive price for items, gift wrap, and shipping, minus the VAT for all promotions. If the total amount specified does not match Amazon's total amount for this shipment (to two decimal places), the invoice upload is rejected. We recommend strictly following the tax computations provided in the VIDR.TotalVATAmount
. The total VAT amount on the invoice. This is the VAT for the items, gift wrap, and shipping, minus the VAT for all promotions. If the VAT amount does not match the VAT amount calculated by Amazon for this shipment (to two decimal places), the invoice upload is rejected. We recommend strictly following the tax computations provided in the VIDR.TransactionId
. Required only ifDocumentType=CreditNote
.
Caution
Do not add quotation marks around keys or values. Amazon only accepts the following characters: commas (
,
), forward slashes (/
), backslashes (\
), spaces ( ), dashes (-
), underscores (_
), semicolons (;
), colons (:
), hashes (#
), 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.
Examples
Invoice uploads:
{"OrderID":"206-2341234-3455465", "InvoiceNumber":"INT-3431-XJE3", "DocumentType":"Invoice"}
Credit notes (CN-123-ABC
is the credit note number):
{"OrderID":"206-2341234-3455465", "InvoiceNumber":"CN-123-ABC", "DocumentType":"CreditNote"}
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);
}
Updated about 23 hours ago