POST /debts/:id/credits
Registers a credit note associated with this debt.
curl -XPOST \
--header "Content-Type: application/json" \
--header "Authorization: Bearer 7b53d640bc79eb1c076603a5e65aa0d266623ced13525d8ea84e06eaf704a5b6" \
https://api.invisiblecollector.com/debts/:id/credits \
--data '...'
This request can receive, for example, the following JSON data:
{
"number": "1",
"description": "fixing wrong debt",
"date": "2018-05-02",
"grossTotal": 1200.0
}
This request will return, for example, the following JSON response:
{
"number": "1",
"description": "fixing wrong debt",
"status": "FINAL",
"date": "2018-05-02",
"grossTotal": 1200.0
}
Endpoint
POST https://api.invisiblecollector.com/debts/:id/credits
Request body
A credit note object contains the following attributes:
Debt
| Attribute | Type | Mandatory | Default | Description |
|---|---|---|---|---|
| number | string | yes | N/A | The credit note number |
| description | string | no | N/A | A small description of this credit note |
| date | string | yes | N/A | The date this credit note was created. Must be in ISO 8601 format (YYYY-MM-DD) |
| grossTotal | double | no | N/A | The gross total of this credit note |
Response body
Debt
| Attribute | Type | Description |
|---|---|---|
| number | string | The credit note number |
| description | string | A small description of this credit note |
| status | string | The current status of this credit note |
| date | date | The date this credit note was created in ISO 8601 format (YYYY-MM-DD) |
| grossTotal | double | The gross total of this debt |
Errors
This endpoint may return the following errors:
| HTTP Code | Description |
|---|---|
| 401 Unauthorized | Invalid credentials were supplied |
| 409 Conflict | A credit note with the same number already exists for this company |
| 422 Unprocessable Entity | The request is syntactically correct but not a valid debt JSON object or one the sanity checks failed |