Promissory notes (IoUs) can be signed by people or by businesses. This page lays out how to register business in Deceval. Let's see how we can do this with the REST API.
Create a "business"
Using your favorite programming language and libraries, make the following POST request. Make sure to create the legal representative as a "person" before submitting the ID to the endpoint.
document_type: This field represents the identity document type of the business. A value of "NIT" is required.
city_registration: This field represents the city where the business was registered in.
state_registration: This field represents the state where the business was registered in.
country_registration: This field represents country where the business was registered in.
legal_representatives: This field should be a list of objects with the legal representatives of the company.
legal_representatives.document_number: This field should be the national ID number of a previously created "person" to be used as one of the legal representatives of the company. You must create the "person" before sending this request.
legal_representatives.role: This field denotes the role of the legal representative. The (2) permitted values are "PRINCIPAL" and "SUPLENTE". The role "PRINCIPAL" should be used for the main legal representative of the company. At least one legal representative must have this role. The role "SUPLENTE" is optional and should be used for the other representatives besides the main legal representative of the company.
phone_number: This field represents the personal phone number of the business. Make sure to include the country code.
fax_number: This field represents the fax number of the business (If the business does not have one input the same value as the phone). Make sure to include the country code.
document_number: This field represents the identity document number (usually the tax identification number) of the business.
address: This field represents the business address.
email: This field represents the email address of the business.
business_name: This field represents the full legal name of the company.
constitution_date: This field represents the date of incorporation of the company in YYYY-MM-DD format.
registration_date: This field represents the date of registration of the business in YYYY-MM-DD format.
Obtain all "businesses"
Using your favorite programming language and libraries, make the following GET request.
import requests
# The business ID we want to retrieve is "1"
url = "https://apitude.co/iou/deceval-co/business/1/"
headers = {
'x-api-key': 'API-KEY',
'Content-Type': 'application/json'
}
response = requests.get(url, headers=headers)
print(response.json())
OkHttpClient client = new OkHttpClient().newBuilder().build();
MediaType mediaType = MediaType.parse("application/json");
// The business ID we want to retrieve is "1"
Request request = new Request.Builder()
.url("https://apitude.co/iou/deceval-co/business/1/")
.method("GET")
.addHeader("x-api-key", "API-KEY")
.addHeader("Content-Type", "application/json")
.build();
Response response = client.newCall(request).execute();
var myHeaders = new Headers();
myHeaders.append("x-api-key", "API-KEY");
myHeaders.append("Content-Type", "application/json");
var requestOptions = {
method: 'GET',
headers: myHeaders,
redirect: 'follow'
};
// The business ID we want to retrieve is "1"
fetch("https://apitude.co/iou/deceval-co/business/1/", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
// The business ID we want to retrieve is "1"
url := "https://apitude.co/iou/deceval-co/business/1/"
method := "GET"
client := &http.Client {}
req, err := http.NewRequest(method, url)
if err != nil {
fmt.Println(err)
}
req.Header.Add("x-api-key", "API-KEY")
req.Header.Add("Content-Type", "application/json")
res, err := client.Do(req)
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
fmt.Println(string(body))
The request will return a the business with the ID=1 you selected.
Edit a particular "business"
Using your favorite programming language and libraries, make the following PATCH request Only the fields shown in this example can be edited in a business.