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
| Code | Description |
|---|---|
| 202 | Updated, successful operation |
| 400 | Invalid request |
| 401 | Unauthorized |
| 404 | Not found |
| 500 | Unexpected error |
Objects
Invoice Object
| Name | Description | Required | Type |
|---|---|---|---|
| invoiceNumber | Friendly reference for the invoice. If available, this appears in the file name of invoice attachments. | true | string |
| customerId | Reference to the customer the invoice has been issued to. | true | string |
| invoiceDate | Date of the invoice as recorded in the accounting service provider. | true | string (date) |
| dueDate | Date the invoice is due to be paid by. | true | string (date) |
| expirationDate | Expiration date of the invoice. | true | string (date) |
| subTotal | Value of the invoice, including discounts and excluding tax. | true | decimal |
| totalAmount | Amount of the invoice, inclusive of tax. | true | decimal |
| taxAmount | Any tax applied to the invoice amount. | true | decimal |
| amountDue | Amount outstanding on the invoice. | true | decimal |
| lines | An array of invoice lines. | false | array |
| status | Status of the invoice. | true | string |
| sourceModifiedDate | Date the record was last changed in the accounting service provider. | true | string (date) |
| salesInfo | Members of sales | false | array |
Invoice Line Object
| Name | Description | Required | Type |
|---|---|---|---|
| description | Friendly name of the goods or services received. | false | string |
| unitAmount | Price of each unit of goods or services. | true | decimal |
| quantity | Number of units of goods or services. | true | integer |
| subTotal | Amount of the line, inclusive of discounts but exclusive of tax. | true | decimal |
| taxAmount | Amount of tax for the line. | true | decimal |
| totalAmount | Total amount of the line, inclusive of discounts and tax. | true | decimal |
SalesInfo object
| Name | Description | Required | Type |
|---|---|---|---|
| firstName | First name of sales member | false | string |
| lastName | Last name of sales member | false | string |
| emailAddress | Email address of sales member | false | string |
| cellPhoneNumber | Mobile phone number of sales member | false | string |
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)