Skip to main content

Create new invoice

Creates an invoice. You can attach project information, optionally.

Endpoint

POST /integration/invoice

HTTP Request

POST /integration/invoice

Invoice Object

{
"id": "2eb1acd98a86",
"invoiceNumber": "INV/00003/2023",
"customerId": "7ba4877cbf52",
"invoiceDate": "2023-01-04",
"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
}
],
"quoteRefNumber": "QUOT/0567/2022",
"quoteId": "cbabdcfecfeb",
"status": "Placed",
"sourceModifiedDate": "2023-01-04T09:47:57.477Z",
"projectDetails": {
"projectId": "generic_project_id_1",
"name": "A new huge building",
"address": "285 Fulton St, New York, NY 10007, United States",
"contractValue": 50000,
"sourceModifiedDate": "2023-11-14T15:18:19.576Z",
"startDate": "2024-05-20T00:00:00.000Z",
"endDate": "2025-12-31T00:00:00.000Z",
"jobId": "generic_job_id_1",
"jobAddress": {
"address": "285 Fulton St",
"unitNo": "",
"state": "NY",
"zipCode": "10007",
"city": "New York",
"lotNumber": "",
"blockNumber": ""
},
"role": "PrimeOrGeneralContractor",
"primeContractorDetails": {
"businessName": "Builders",
"firstName": "John",
"lastName": "Doe",
"businessPhoneNumber": "202-555-0583",
"businessEmail": "[email protected]",
"businessAddress": "Washington str. 123",
"state": "California",
"city": "San Francisco",
"zipCode": "31702"
},
"type": "public",
"privateProjectDetails": {
"privateProjectType": "Сommercial",
"builtFor": {
"type": "PropertyOwnerNewBuilding",
"notes": "Test note"
}
},
"publicProjectDetails": {
"description": "Public description",
"hasBond": true,
"isBondRequired": true
},
"federalProjectDetails": {
"hasBond": true
},
"individualOwners": [
{
"firstName": "John",
"lastName": "Doe",
"phone": "202-555-0583",
"homeAddress": "Washington str. 123",
"state": "California",
"city": "San Francisco",
"zipCode": "31702"
}
],
"businessOwners": [
{
"businessName": "Builders",
"firstName": "Mary",
"lastName": "Matheson",
"businessPhoneNumber": "202-555-0583",
"businessAddress": "Washington str. 123",
"state": "California",
"city": "San Francisco",
"zipCode": "31702"
}
]
},
"salesInfo": [
{
"firstName": "string",
"lastName": "string",
"emailAddress": "string",
"cellPhoneNumber": "string"
}
],
"shippingAddress": {
"attention": "John Doe",
"address": "285 Fulton St, New York, NY 10007, US", // fill address or addressModel
"addressModel": {
"address": "285 Fulton St",
"city": "New York",
"state": "New York",
"zipCode": "10007",
"country": "US" // optional
}
}
}

Successful response

HTTP 201 Created

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

Erroneous response

HTTP 409 Conflict

{
"code": "409",
"reason": "Invoice already exists, invoice number: {invoiceNumber}"
}

Responses

CodeDescription
201Created, successful operation
400Invalid request
401Unauthorized
404Not found
500Unexpected error

Request parameters

Invoice Object

NameDescriptionRequiredType
idIdentifier of the invoice.truestring
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
quoteRefNumberReference to the quote.falsestring
quoteIdReference to the quote.falsestring
statusStatus of the invoice.truestring
sourceModifiedDateDate the record was last changed in the accounting service provider.truestring (date)
projectDetailsDetails of the attached project.falseobject
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

Project Object

NameDescriptionRequiredType
projectIdIdentifier for the project.truestring
nameProject name.falsestring
addressProject address.falsestring
contractValueThe total amount of contracted amount for the project.falsedecimal
sourceModifiedDateDate the record was last changed in the accounting service providerfalsedatetime
startDateFirst day on the job.falsedate
endDateExpected last day on the job.falsedate
jobIdThe job id.falsestring
jobAddressProject address in details.falseobject
  addressStreet address.falsestring
  unitNoUnit number (if applicable).falsestring
  stateState.falsestring
  zipCodeZIP Code.falsestring
  cityCity.falsestring
  lotNumberLot number.falsestring
  blockNumberBlock number.falsestring
roleRole on this project.falsestring(enum)
primeContractorDetailsFilled if role is one of subcontractor, subcontractor for another subcontractor, material supplier, property developer.falseobject
  businessNameThe prime contractor's business name.falsestring
  firstNameThe prime contractor's first name.falsestring
  lastNameThe prime contractor's last name.falsestring
  businessPhoneNumberThe prime contractor's business phone number.falsestring
  businessEmailThe prime contractor's business email address.falsestring
  businessAddressThe prime contractor's business address.falsestring
  stateThe prime contractor's business address state.falsestring
  cityThe prime contractor's business address city.falsestring
  zipCodeThe prime contractor's business address zipcode.falsestring
typeProject's typefalsestring(enum)
privateProjectDetailsFilled if project's type is private.falseobject
  privateProjectTypeSubtype of private project.falsestring(enum)
  builtForBuilt for which purpose.falseobject
   typeType of purposefalsestring(enum)
   notesFilled if type other.falsestring
publicProjectDetailsFilled if project's type is public.falseobject
  descriptionDescription of the public project.falsestring
  hasBondDetermines, is there a bond for this project.falsebool
  isBondRequiredIs the bond required to carry by the sub-contractor.falsebool
federalProjectDetailsFilled if project's type is federal.falseobject
  hasBondDetermines, is there a bond for this project.falsebool
propertyIndividualOwnersThe property individual owner's details.falsearray
  firstNameThe property owners's first name.falsestring
  lastNameThe property owners's last name.falsestring
  phoneNumberThe property owners's phone number.falsestring
  homeAddressThe property owners's home address.falsestring
  stateThe property owners's home address state.falsestring
  cityThe property owners's home address city.falsestring
  zipCodeThe property owners's home address zipcode.falsestring
propertyBusinessOwnersThe property business owner's details.falsearray
  businessNameThe property owners's business name.falsestring
  firstNameThe property owners's first name.falsestring
  lastNameThe property owners's last name.falsestring
  businessPhoneNumberThe property owners's business phone number.falsestring
  businessEmailThe property owners's business email address.falsestring
  businessAddressThe property owners's business address.falsestring
  stateThe property owners's business address state.falsestring
  cityThe property owners's business address city.falsestring
  zipCodeThe property owners's business address zipcode.falsestring

SalesInfo object

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

ShippingAddress object

Address or AddressModel to be filled.

NameDescriptionRequiredType
attentionAttention namefalsestring
addressFull shipping addressfalsestring
addressModelShipping address modelfalsestring

AddressModel object

NameDescriptionRequiredType
addressAddressfalsestring
cityCityfalsestring
stateStatefalsestring
zipCodeZip Codefalsestring
countryCountryfalsestring

Enums

Status

  • active
  • inactive

Role

  • PrimeOrGeneralContractor
  • SubContractor
  • SubContractorForAnotherSubContractor
  • MaterialSupplier
  • PropertyDeveloper
  • Owner
  • Tenant

Type

  • Private
  • Public
  • Federal

PrivateProjectType

  • Сommercial
  • Residential

BuiltFor.Type

  • Spec
  • PropertyOwnerNewBuilding
  • PropertyOwnerRenovation
  • Other

Examples

curl https://api.bluetape.com/genericBthubService/integration/invoice \
-X POST \
-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';
const options = {
method: 'POST',
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"
.WithHeader("X-BlueTape-Key", "<your-key>")
.WithHeader("X-Integration-AccountId", "<your-account-id>")
.WithHeader("Content-Type", "application/json")
.PostJsonAsync(invoice)
.ReceiveJson<BlueTapeIntegrationResult>();
import requests

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

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

data = <your-invoice-data>

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

print(response.text)