Contract

This is an object that represents a Contract model. You can create a Contract object, retrieve an individual as well list all contracts.

Properties

idnumber
Unique identifier for the object.
namestring
The contracts name.
partner
The contracts partner relation.
statestring
The contracts state.
proposals_countnumber
The contracts proposal count.
valor_economia_mensalnumber
The contracts monthly economy.
valor_economia_anualnumber
The contracts yearly economy.
Contract Model
POST

/api/contract

Create a contract

Parameters

namestringREQUIRED
The contract name.
partner_idnumberREQUIRED
The contract partner relation.

Response

Returns a Contract object.

Request
Success
GET

/api/contracts

Retrieve all contracts

Parameters

No parameter

Response

Returns a list of Contract objects.

Success
GET

/api/v1/contracts

Retrieve all contracts paginated

Send a parameter. Ex: /api/v1/contracts?page_number=1&per_page=20 /api/v1/contracts?page_number=2 /api/v1/contracts

Parameters

page_numbernumber
page_number sets the number page.
per_pagenumber
per_page defines the maximum records.

Response

Returns a list of Contract objects.

Success
GET

/api/contracts/:id

Retrieve a specific contract

Parameters

No parameter

Response

Returns a Contract object.

Success
GET

/api/contract/url_signature/:contract_id

Retrieve a url to signature

Parameters

No parameter

Response

Returns the urls for signing the contract.

Success
Success
PUT

/api/contract/update/

Update contracted energy

Parameters

contract_idnumberREQUIRED
The id of the Contract.
new_energy_valuenumberREQUIRED
The new energy value of the Contract.

Response

Returns a Contract object updated.

Request
Success
POST

/api/contract/cancel/

Cancel Contract

Parameters

contract_idnumberREQUIRED
The contract name.
cancel_reasonnumberREQUIRED
The reason the contract is being canceled. The options are: 1 – Address change; 2 – End of activities; 3 – Financial difficulties; 4 – Dissatisfaction with the service; Any other number will be considered as 'Other reasons'.

Response

Returns a Contract object canceled.

Request
Success
GET

/api/contract/partner_signature

Retrieve whether the partner has signed the contract

Parameters

partner_idnumberREQUIRED
The contract's partner id.
contract_idnumberREQUIRED
The contract id.

Response

Returns a list of Contract objects.

Request
Success
POST

/api/contract/active/

Active contract

Active contract by ID

Parameters

idnumber
ID Contract.

Response

Returns a list of Contract objects.

Errors

400
O contrato ja foi ativado
Request
Success
Error
GET

/api/contract/check_signature/:contract_id/:partner_id

Retrieve whether the client has signed the agreement

Parameters

partner_idnumberREQUIRED
The contract's partner id.
contract_idnumberREQUIRED
The contract id.

Response

Returns a list of Contract objects.

Success