Skip to main content

Create invoice simplified

Creates an invoice with simplified approach. You can attach project information, optionally.

Invoice does not require to have customer or company created before invoice creation. After invoice creation, you can get checkout url for invoice payment. During payment of this invoice we will automatically create customer based on registered user info.

Also property "payersInfo" contain list of persons for who we will send payment link via email and via sms. You can provide or email or phone number.

Endpoint

POST /integration/invoice/simplify

HTTP Request

POST /integration/invoice/simplify

Invoice Object

{
"invoiceDate": "2024-07-23T13:17:52.765Z",
"invoiceNumber": "string",
"dueDate": "2024-07-23T13:17:52.765Z",
"expirationDate": "2024-07-23T13:17:52.765Z",
"subTotal": 0,
"totalAmount": 0,
"taxAmount": 0,
"amountDue": 0,
"lines": [
{
"description": "Item 1",
"unitAmount": 500,
"quantity": 2,
"subTotal": 1000,
"taxAmount": 100,
"totalAmount": 1100
}
],
"sourceModifiedDate": "2024-07-23T13:17:52.765Z",
"payersInfo": [
{
"firstName": "string",
"lastName": "string",
"emailAddress": "string",
"cellPhoneNumber": "string",
"businessName": "string"
}
],
"id": "string",
"projectDetails": {
"projectId": "string",
"name": "string",
"address": "string",
"contractValue": 0,
"startDate": "2024-07-23T13:17:52.765Z",
"endDate": "2024-07-23T13:17:52.765Z",
"jobId": "string",
"jobAddress": {
"address": "string",
"unitNo": "string",
"state": "string",
"zipCode": "string",
"city": "string",
"lotNumber": "string",
"blockNumber": "string"
},
"role": "Default",
"primeContractorDetails": {
"businessName": "string",
"firstName": "string",
"lastName": "string",
"businessPhoneNumber": "string",
"businessEmail": "string",
"businessAddress": "string",
"state": "string",
"city": "string",
"zipCode": "string"
},
"type": "Default",
"privateProjectDetails": {
"privateProjectType": "Default",
"builtFor": {
"buildForType": "Default",
"notes": "string"
}
},
"publicProjectDetails": {
"description": "string",
"hasBond": true,
"isBondRequired": true
},
"federalProjectDetails": {
"hasBond": true
},
"individualOwners": [
{
"firstName": "string",
"lastName": "string",
"phone": "string",
"homeAddress": "string",
"state": "string",
"city": "string",
"zipCode": "string"
}
],
"businessOwners": [
{
"businessName": "string",
"firstName": "string",
"lastName": "string",
"businessPhoneNumber": "string",
"businessAddress": "string",
"state": "string",
"city": "string",
"zipCode": "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

{
"details": {
"totalAmount": 0
}
}

Erroneous response

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

Responses

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

Examples

curl https://api.bluetape.com/genericBthubService/integration/invoice/simplify \
-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/simplify';
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/simplify"
.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/simplify"

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)