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
id
number
name
string
partner
state
string
proposals_count
number
valor_economia_mensal
number
valor_economia_anual
number
/api/contract
Create a contract
Parameters
name
string
REQUIREDpartner_id
number
REQUIREDResponse
Returns a Contract object.
/api/contracts
Retrieve all contracts
Parameters
No parameter
Response
Returns a list of Contract objects.
/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_number
number
per_page
number
Response
Returns a list of Contract objects.
/api/contracts/:id
Retrieve a specific contract
Parameters
No parameter
Response
Returns a Contract object.
/api/contract/url_signature/:contract_id
Retrieve a url to signature
Parameters
No parameter
Response
Returns the urls for signing the contract.
/api/contract/update/
Update contracted energy
Parameters
contract_id
number
REQUIREDnew_energy_value
number
REQUIREDResponse
Returns a Contract object updated.
/api/contract/cancel/
Cancel Contract
Parameters
contract_id
number
REQUIREDcancel_reason
number
REQUIREDResponse
Returns a Contract object canceled.
/api/contract/partner_signature
Retrieve whether the partner has signed the contract
Parameters
partner_id
number
REQUIREDcontract_id
number
REQUIREDResponse
Returns a list of Contract objects.
/api/contract/active/
Active contract
Active contract by ID
Parameters
id
number
Response
Returns a list of Contract objects.
Errors
400
/api/contract/check_signature/:contract_id/:partner_id
Retrieve whether the client has signed the agreement
Parameters
partner_id
number
REQUIREDcontract_id
number
REQUIREDResponse
Returns a list of Contract objects.