Skip to main content

Update an invoice

Updates an invoice.

Endpoint

PUT /integration/invoice/{id}

HTTP Request

PUT /integration/invoice/{id}

Update invoice object

{
"invoiceNumber": "INV/00003/2023",
"invoiceDate": "2023-01-04",
"customerId": "7ba4877cbf52",
"dueDate": "2023-01-12",
"expirationDate": "2023-01-12",
"subTotal": 1000,
"totalAmount": 1100,
"taxAmount": 100,
"amountDue": 1100,
"lines": [
{
"description": "Item 1",
"unitAmount": 500,
"quantity": 2,
"subTotal": 1000,
"taxAmount": 100,
"totalAmount": 1100
}
],
"sourceModifiedDate": "2024-06-13T09:41:34.633Z",
"status": "Placed",
"salesInfo": [
{
"firstName": "string",
"lastName": "string",
"emailAddress": "string",
"cellPhoneNumber": "string"
}
]
}

Successful response

HTTP 202

{
"blueTapeId": "63168de0cbee",
"details": {
"totalAmount": 1100
}
}

Erroneous response

HTTP 404

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

Responses

CodeDescription
202Updated, successful operation
400Invalid request
401Unauthorized
404Not found
500Unexpected error

Objects

Invoice Object

NameDescriptionRequiredType
invoiceNumberFriendly reference for the invoice. If available, this appears in the file name of invoice attachments.truestring
customerIdReference to the customer the invoice has been issued to.truestring
invoiceDateDate of the invoice as recorded in the accounting service provider.truestring (date)
dueDateDate the invoice is due to be paid by.truestring (date)
expirationDateExpiration date of the invoice.truestring (date)
subTotalValue of the invoice, including discounts and excluding tax.truedecimal
totalAmountAmount of the invoice, inclusive of tax.truedecimal
taxAmountAny tax applied to the invoice amount.truedecimal
amountDueAmount outstanding on the invoice.truedecimal
linesAn array of invoice lines.falsearray
statusStatus of the invoice.truestring
sourceModifiedDateDate the record was last changed in the accounting service provider.truestring (date)
salesInfoMembers of salesfalsearray

Invoice Line Object

NameDescriptionRequiredType
descriptionFriendly name of the goods or services received.falsestring
unitAmountPrice of each unit of goods or services.truedecimal
quantityNumber of units of goods or services.trueinteger
subTotalAmount of the line, inclusive of discounts but exclusive of tax.truedecimal
taxAmountAmount of tax for the line.truedecimal
totalAmountTotal amount of the line, inclusive of discounts and tax.truedecimal

SalesInfo object

NameDescriptionRequiredType
firstNameFirst name of sales memberfalsestring
lastNameLast name of sales memberfalsestring
emailAddressEmail address of sales memberfalsestring
cellPhoneNumberMobile phone number of sales memberfalsestring

Enums

Invoice Status

  • Draft - Created, but customer can not pay it, due to invoice or customer settings
  • Placed - Invoice Created, but no payment exist
  • InReview - User pay invoice with BlueTapeCredit and application need to be reviewed by BlueTape admin
  • Approved - Invoice is approved
  • PaymentProcessing - BlueTape start payment for invoice
  • Paid - Invoice is paid in BlueTape
  • Rejected - Credit aplication was rejected by BlueTape admin, and user can not pay with BlueTape credit any new invoice for 6 month
  • Canceled - Credit application was canceled by BlueTape admin, and user can pay next invoice with BlueTape credit
  • Failed - something go wrong during payment of invoice

Examples

curl https://api.bluetape.com/genericBthubService/integration/invoice/{id} \
-X PUT \
-H "X-BlueTape-Key: <your-key>" \
-H "X-Integration-AccountId: <your-account-id>" \
-H "Content-Type: application/json" \
-d "@request.json"
import fetch from 'node-fetch';

const invoice = { ... };
const url = 'https://api.bluetape.com/genericBthubService/integration/invoice/{id}';
const options = {
method: 'PUT',
headers: {
'X-BlueTape-Key': '<your-key>',
'X-Integration-AccountId': '<your-account-id>',
'Content-Type': 'application/json'
},
body: JSON.stringify(invoice)
};

fetch(url, options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
using Flurl.Http;

var invoice = new Invoice() {
...
};

var result = await "https://api.bluetape.com/genericBthubService/integration/invoice/{id}"
.WithHeader("X-BlueTape-Key", "<your-key>")
.WithHeader("X-Integration-AccountId", "<your-account-id>")
.WithHeader("Content-Type", "application/json")
.PutJsonAsync(invoice)
.ReceiveJson<BlueTapeIntegrationResult>();
import requests

url = "https://api.bluetape.com/genericBthubService/integration/invoice/{id}"

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

data = <your-invoice-data>

response = requests.put(url, headers=headers, data=data)

print(response.text)