Skip to main content

Upload or replace file of an invoice

Uploads or replaces file of an invoice.

Endpoint

POST /integration/invoice/{id}/file

HTTP Request

POST /integration/invoice/{id}/file

Use Content-Type: application/pdf header value.

Query parameters

NameDescriptionRequiredType
idIdentifier of the invoiceYesstring

Successful response

{
"blueTapeId": "fb5637b2e5f3"
}

Erroneous response

HTTP 404

{
"code": "404",
"reason": "Invoice not found."
}

Responses

CodeDescription
204No content
400Invalid request
401Unauthorized
404Not found
500Unexpected error

Examples

curl https://api.bluetape.com/genericBthubService/integration/invoice/<invoiceId>/file \
-X POST \
-H "X-BlueTape-Key: <your-key>" \
-H "X-Integration-AccountId: <your-account-id>" \
-H "Content-Type: application/pdf" \
-F "file=@C:\Users\User\Desktop\Invoice.pdf"
import fetch, {
Blob,
blobFrom,
blobFromSync,
File,
fileFrom,
fileFromSync,
} from 'node-fetch'

const mimetype = 'application/pdf'
const blob = fileFromSync('./Invoice.pdf', mimetype)
const invoiceId = "5ec12449be5a";
const url = `https://api.bluetape.com/genericBthubService/integration/invoice/${invoiceId}/file`

const response = await fetch(url, { method: 'POST', body: blob })
const data = await response.json()

console.log(data)
using Flurl.Http;

var invoiceId = "5ec12449be5a";
var url = $"https://api.bluetape.com/genericBthubService/integration/invoice/{invoiceId}/file";
var fileName = @"C:\Users\User\Desktop\Invoice.pdf";

var result = await url
.WithHeader("X-BlueTape-Key", "<your-key>")
.WithHeader("X-Integration-AccountId", "<your-account-id>")
.WithHeader("Content-Type", "application/pdf")
.PostMultipartAsync(part => part
.AddFile("file", stream, fileName)
);
import requests

url = "https://api.bluetape.com/genericBthubService/integration/invoice/<invoiceId>/file"

headers = {
"X-BlueTape-Key": "<your-key>",
"X-Integration-AccountId": "<your-account-id>",
"Content-Type": "application/pdf"
}

file = {'file': open('C:\Users\User\Desktop\Invoice.pdf','rb')}

response = requests.post(url, headers=headers, files=file)