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
| Name | Description | Required | Type |
|---|---|---|---|
| id | Identifier for the company to update | Yes | string |
Request parameters
Company Object
| Name | Description | Required | Type |
|---|---|---|---|
| businessName | Name of the company | true | string |
| businessAddress | The company address | true | string |
| businessPhoneNumber | Phone number of the company, usually is the line number | false | string |
| businessDisplayName | Company display name | false | string |
| creditDetails | The credit details | false | object |
| sourceModifiedDate | Date the record was last changed in the accounting service provider | true | datetime |
Successful response
HTTP 200
{
"blueTapeId": "fb5637b2e5f3"
}
Erroneous response
HTTP 404
{
"code": "404",
"reason": "Company not found."
}
Responses
| Code | Description |
|---|---|
| 202 | Accepted, successful operation |
| 400 | Invalid request |
| 401 | Unauthorized |
| 404 | Not found |
| 500 | Unexpected error |
Objects
CreditDetails Object
| Name | Description | Required | Type |
|---|---|---|---|
| accountType | The account type (credit, cash) | false | string |
| accountCreationDate | The account creation date | false | datetime |
| pricePackage | The price package of business (eg. A) | false | string |
| creditProvider | The credit provider (inhouse, co) | false | string |
| creditStatus | The actual credit status (active, suspended, closed) | false | string |
| creditAmount | Overall credit amount | false | decimal |
| outstandingAmount | The outstanding credit amount (current balance) | false | decimal |
| overdueBalance | The overall overdue amount | false | decimal |
| agingOverdueBalance | Aging overdue balance | false | array |
| invoicesOverallAmount | Overall amount of invoices | false | decimal |
| invoicesOverallCount | Overall number of invoices | false | integer |
| invoicesLastYearAmount | Overall number of invoices | false | decimal |
| invoicesLastYearCount | Number of invoices last year. | false | integer |
| invoicesYearToDateAmount | Amount of invoices in this year until current date. | false | decimal |
| invoicesYearToDateCount | Number of invoices in this year until current date. | false | integer |
| invoicesLastMonthAmount | Amount of invoices last month. | false | decimal |
| invoicesLastMonthCount | Number of invoices last month. | false | integer |
| invoicesMonthToDateAmount | Amount of invoices in this month until current date. | false | decimal |
| invoicesMonthToDateCount | Number of invoices in this month until current date. | false | integer |
| invoicesMonthlyAverageAmount | Average amount of invoices per month. | false | decimal |
| invoicesMonthlyAverageCount | Average number of invoices per month. | false | decimal |
AgingOverdueBalance Object
| Name | Description | Required | Type |
|---|---|---|---|
| name | Description of aging range (eg. 1-30 days) | false | string |
| daysFrom | Aging range start days | true | integer |
| daysTo | Aging range end days. If not set, consider as infinite. | false | integer |
| overdueBalance | Overdue balance for this period. | true | decimal |
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)