Skip to main content

Update a company

Updates a specified company.

Endpoint

PUT /integration/company/{id}

HTTP Request

PUT /integration/company/{id}

Company Object

{
"businessAddress": "1400 24th Ave, San Francisco, CA 94122, USA",
"businessPhoneNumber": "+11234567890",
"businessName": "Acme Inc.",
"businessDisplayName": "Acme",
"creditDetails": {
"accountType": "credit",
"accountCreationDate": "2023-03-09T00:10:20.300Z",
"pricePackage": "A",
"creditProvider": "inhouse",
"creditStatus": "active",
"creditAmount": 10000,
"outstandingAmount": 3000,
"overdueBalance": 500,
"agingOverdueBalance": [
{
"name": "1-30 days",
"daysFrom": 1,
"daysTo": 30,
"overdueBalance": 3000
}
],
"invoicesOverallAmount": 7000,
"invoicesOverallCount": 58,
"invoicesLastYearAmount": 5000,
"invoicesLastYearCount": 33,
"invoicesYearToDateAmount": 2000,
"invoicesYearToDateCount": 25,
"invoicesLastMonthAmount": 300,
"invoicesLastMonthCount": 5,
"invoicesMonthToDateAmount": 500,
"invoicesMonthToDateCount": 2,
"invoicesMonthlyAverageAmount": 888.33,
"invoicesMonthlyAverageCount": 5.7
},
"sourceModifiedDate": "2023-01-04T09:47:57.477Z"
}

Query parameters

NameDescriptionRequiredType
idIdentifier for the company to updateYesstring

Request parameters

Company Object

NameDescriptionRequiredType
businessNameName of the companytruestring
businessAddressThe company addresstruestring
businessPhoneNumberPhone number of the company, usually is the line numberfalsestring
businessDisplayNameCompany display namefalsestring
creditDetailsThe credit detailsfalseobject
sourceModifiedDateDate the record was last changed in the accounting service providertruedatetime

Successful response

HTTP 200

{
"blueTapeId": "fb5637b2e5f3"
}

Erroneous response

HTTP 404

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

Responses

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

Objects

CreditDetails Object

NameDescriptionRequiredType
accountTypeThe account type (credit, cash)falsestring
accountCreationDateThe account creation datefalsedatetime
pricePackageThe price package of business (eg. A)falsestring
creditProviderThe credit provider (inhouse, co)falsestring
creditStatusThe actual credit status (active, suspended, closed)falsestring
creditAmountOverall credit amountfalsedecimal
outstandingAmountThe outstanding credit amount (current balance)falsedecimal
overdueBalanceThe overall overdue amountfalsedecimal
agingOverdueBalanceAging overdue balancefalsearray
invoicesOverallAmountOverall amount of invoicesfalsedecimal
invoicesOverallCountOverall number of invoicesfalseinteger
invoicesLastYearAmountOverall number of invoicesfalsedecimal
invoicesLastYearCountNumber of invoices last year.falseinteger
invoicesYearToDateAmountAmount of invoices in this year until current date.falsedecimal
invoicesYearToDateCountNumber of invoices in this year until current date.falseinteger
invoicesLastMonthAmountAmount of invoices last month.falsedecimal
invoicesLastMonthCountNumber of invoices last month.falseinteger
invoicesMonthToDateAmountAmount of invoices in this month until current date.falsedecimal
invoicesMonthToDateCountNumber of invoices in this month until current date.falseinteger
invoicesMonthlyAverageAmountAverage amount of invoices per month.falsedecimal
invoicesMonthlyAverageCountAverage number of invoices per month.falsedecimal

AgingOverdueBalance Object

NameDescriptionRequiredType
nameDescription of aging range (eg. 1-30 days)falsestring
daysFromAging range start daystrueinteger
daysToAging range end days. If not set, consider as infinite.falseinteger
overdueBalanceOverdue balance for this period.truedecimal

Examples

curl https://api.bluetape.com/genericBthubService/integration/company/<companyId> \
-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 company = { ... };
const url = `https://api.bluetape.com/genericBthubService/integration/company/${company.Id}`;
const options = {
method: 'PUT',
headers: {
'X-BlueTape-Key': '<your-key>',
'X-Integration-AccountId': '<your-account-id>',
'Content-Type': 'application/json'
},
body: JSON.stringify(company)
};

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

var companyId = "a0b9cedc32ce";

var company = <your-company-to-update>;

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

companyId = "a0b9cedc32ce"
url = f'https://api.bluetape.com/genericBthubService/integration/company/{companyId}'

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

data = <your-company-data>

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

print(response.text)