# Upload PDF invoice to Amazon using SP-API in Postman \[UPLOAD\_VAT\_INVOICE\]

**URL:** <https://community.postman.com/t/upload-pdf-invoice-to-amazon-using-sp-api-in-postman-upload-vat-invoice/41881>\
**Category:** Help Hub\
**Tags:** api, file, upload, pdf\
**Created:** [December 8, 2022, 3:04pm UTC](https://community.postman.com/t/upload-pdf-invoice-to-amazon-using-sp-api-in-postman-upload-vat-invoice/41881 "2022-12-08T15:04:52Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonanon42](https://avatars.discourse-cdn.com/v4/letter/a/848f3c/32.png) [@anonanon42](https://community.postman.com/u/anonanon42)\
**Post date:** [December 8, 2022, 3:04pm UTC](https://community.postman.com/t/upload-pdf-invoice-to-amazon-using-sp-api-in-postman-upload-vat-invoice/41881/1 "2022-12-08T15:04:52Z")

</div>

How do I upload a PDF invoice to Amazon using SP-API in Postman?  
(In MWS the feed was known as **UPLOAD\_VAT\_INVOICE** )

I found the following document for the topic at hand:

> **[Feeds API v2021-06-30 Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/feeds-api-v2021-06-30-use-case-guide)**
>
> Upload data to Amazon to manage a selling business.

Unfortunately the most important step, the upload itself, is just listed as:  
“2. Upload your feed document contents to the URL from the previous step.”

I got the **“feedDocumentId”** and the **“url”** from the first step, but I have no idea how to actually upload the PDF invoice with this information.

I created a POST request with the **“url”** I got from step 1.

Autorization (AWS Signature) is set with AccessKey, SecretKey, Session Token, AWS Region ( **eu-west-1** ) and Service Name **(“s3”** instead of _“execute-api”_).

Headers contains “Content-Type” as **“text/plain”** (I aslo tried **“application/pdf”** ).

In the body I tried the following combinations:

**form-data**  
“file” and then added the PDF file

**raw**  
Added base64 encoded PDF file as string

**binary**  
Added the PDF file

It doesn’t matter what configuration I choose, the answer alsways contains:

```auto
<Error>
    <Code>SignatureDoesNotMatch</Code>
    <Message>The request signature we calculated does not match the signature you provided. Check your key and signing method.</Message>

```

I have contacted Amazon Support about this, but they are not helpful at all, they just point me back to the above mentioned documentation.

I have also searched endlessly around to find anyone with the same or a similar problem, but so far nothing I found fits or was even remotely helpful.

Can someone please help me to figure out how I am able to successfully upload a PDF invoice to Amazon using SP-API in Postman?

The developer profile is approved for ALL roles including ALL restricted roles, so this shouldn’t be a problem.

---

<div class="post-metadata">

**Author:** ![michaelderekjones](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/michaelderekjones/32/14819_2.png) [@michaelderekjones](https://community.postman.com/u/michaelderekjones)\
**Post date:** [December 9, 2022, 10:36am UTC](https://community.postman.com/t/upload-pdf-invoice-to-amazon-using-sp-api-in-postman-upload-vat-invoice/41881/2 "2022-12-09T10:36:04Z")

</div>

I doubt you will get much of a response without posting some screenshots or your code where you are generating these elements.

---

<div class="post-metadata">

**Author:** ![anonanon42](https://avatars.discourse-cdn.com/v4/letter/a/848f3c/32.png) [@anonanon42](https://community.postman.com/u/anonanon42)\
**Post date:** [December 9, 2022, 5:27pm UTC](https://community.postman.com/t/upload-pdf-invoice-to-amazon-using-sp-api-in-postman-upload-vat-invoice/41881/3 "2022-12-09T17:27:31Z")

</div>

I am not sure if screenshots will provide any additional information that isn’t mentioned in the original post, but I will try to add more information so that maybe someone is able to help me.

Here are the screenshots of the request:

Params

 ![Params](https://us1.discourse-cdn.com/getpostman/original/3X/4/e/4ef224cb8fbb061657d07188b3b49e53e70804d3.jpeg)

Authorization

 ![Authorization](https://us1.discourse-cdn.com/getpostman/original/3X/d/5/d566356f30e81416d69e5748ff3fc3806af5504c.jpeg)  
**AccessKey** , **SecretKey** and **Session Token** replaced with a variable for this screenshot.

Headers

 ![Headers](https://us1.discourse-cdn.com/getpostman/original/3X/d/b/db8574145a5e2f5e918e3f8df50a287dbea133fe.jpeg)

**{{feedurl}}** was used in the screenshots. The real url comes from a **create Feed Document** request and looks like this:  
[https://tortuga-prod-eu.s3-eu-west-1.amazonaws.com/%2FNinetyDays/amzn1.tortuga.4.eu.\*\*\*.\*\*\*?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20221209T170630Z&X-Amz-SignedHeaders=content-type%3Bhost&X-Amz-Expires=300&X-Amz-Credential=\*\*\*%2F20221209%2Feu-west-1%2Fs3%2Faws4\_request&X-Amz-Signature=](https://tortuga-prod-eu.s3-eu-west-1.amazonaws.com/%2FNinetyDays/amzn1.tortuga.4.eu. ***.***?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20221209T170630Z&X-Amz-SignedHeaders=content-type%3Bhost&X-Amz-Expires=300&X-Amz-Credential=***%2F20221209%2Feu-west-1%2Fs3%2Faws4_request&X-Amz-Signature=)\*\*\*

---

<div class="post-metadata">

**Author:** ![anonanon42](https://avatars.discourse-cdn.com/v4/letter/a/848f3c/32.png) [@anonanon42](https://community.postman.com/u/anonanon42)\
**Post date:** [December 9, 2022, 5:28pm UTC](https://community.postman.com/t/upload-pdf-invoice-to-amazon-using-sp-api-in-postman-upload-vat-invoice/41881/4 "2022-12-09T17:28:01Z")

</div>

Hidden Headers

 ![Hidden Headers](https://us1.discourse-cdn.com/getpostman/original/3X/2/3/2307bb4338e2cbe040f2199d40fc6a195b9cfdd7.jpeg)

Body

 ![Body](https://us1.discourse-cdn.com/getpostman/original/3X/3/a/3ae415a0f3c8097925c8a7e77766d430c5497306.jpeg)  
The **raw** part of the Body contains the Base64 String of a PDF file.

If any more information is needed please let me know.

---

<div class="post-metadata">

**Author:** ![michaelderekjones](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/michaelderekjones/32/14819_2.png) [@michaelderekjones](https://community.postman.com/u/michaelderekjones)\
**Post date:** [December 12, 2022, 10:28am UTC](https://community.postman.com/t/upload-pdf-invoice-to-amazon-using-sp-api-in-postman-upload-vat-invoice/41881/5 "2022-12-12T10:28:59Z")

</div>

That documentation could do with some example request\responses for each step.

Pretty sure that the Base64 string for the PDF file is only part of the file.

There is an example hidden away on the right for Java that might be of use.  
[upload-sample-code-java](https://developer-docs.amazon.com/sp-api/docs/feeds-api-v2021-06-30-use-case-guide#upload-sample-code-java)

However, I don’t think that is your current issue.

It’s complaining about the authentication so I suspect the issues likes with one of the following.

**AccessKey** , **SecretKey** or **Session Token**

---

<div class="post-metadata">

**Author:** ![anonanon42](https://avatars.discourse-cdn.com/v4/letter/a/848f3c/32.png) [@anonanon42](https://community.postman.com/u/anonanon42)\
**Post date:** [December 12, 2022, 10:39am UTC](https://community.postman.com/t/upload-pdf-invoice-to-amazon-using-sp-api-in-postman-upload-vat-invoice/41881/6 "2022-12-12T10:39:41Z")

</div>

The documentation **desperately** needs a revision and definitely needs examples for each step.

The Base64 string I have represents the complete PDF file.  
You can convert the PDF file to a Base64 string and the Base64 string back to a PDF file.

I have tried working with the Java Code, but since I want to send out a raw request the code doesn’t help me out here.

**AccessKey** , **SecretKey** and **Session Token** work fine with others requests, so I doubt that this is the problem.

I have tried a different configuration for the **Body** :

 ![Body Options](https://us1.discourse-cdn.com/getpostman/original/3X/a/4/a4ff74996fa12780688f9e6905e055e426eaf559.jpeg)

The **Body** now contains the **feedTpye** , the **marketplaceId** , the **InputFeedDocumentId** I got from _createFeedDocument_, **feedOptions** and the **FeedContent** which in this case is the Base64 string of the PDF file.

When I execute the request now I get the following response:

```auto
<?xml version="1.0" encoding="UTF-8"?>
<Error>
    <Code>SignatureDoesNotMatch</Code>
    <Message>The request signature we calculated does not match the signature you provided. Check your key and signing method.</Message>
(...)

```

It is basically the same error as I’ve gotten before.

I have absolutely no idea what the problem is and how I could fix it.
