POST /v1/debts/:id/attributes

Configures a new collection of custom attributes for a single debt:

This operation is idempotent.

curl -XPOST \
  --header "Content-Type: application/json" \
  --header "Authorization: Bearer 7b53d640bc79eb1c076603a5e65aa0d266623ced13525d8ea84e06eaf704a5b6" \
  https://api.invisiblecollector.com/v1/debts/12345/attributes  \
  --data '...'
# example available soon
// example available soon
// example available soon
// example available soon

This request can receive, for example, the following JSON data:

{
  "key1": "value1",
  "key2": "value2",
  "key3": "value3"
}

This request will return, for example, the following JSON response:

{
  "number": "1",
  "id": "1fb0c683-bedc-45be-a88a-ff76da7bf650",
  "customerId": "0d3987e3-a6df-422c-8722-3fde26eec9a8",
  "type": "FT",
  "status": "PENDING",
  "date": "2018-05-02",
  "dueDate": "2019-01-02",
  "netTotal": 1000.0,
  "tax": 200.0,
  "grossTotal": 1200.0,
  "currency": "EUR",
  "items": [
    {
      "name": "an item name",
      "description": "a debt item description",
      "quantity": 3.0,
      "vat": 23.0,
      "price": 15.0
    },
    {
      "name": "another item name",
      "description": "another debt item description",
      "quantity": 4.0,
      "vat": 23.0,
      "price": 20.0
    },
  ],
  "attributes": {
    "key1": "value1",
    "key2": "value2",
    "key3": "value3"
  }
}

Endpoint

POST https://api.invisiblecollector.com/v1/debts/12345/attributes

Request body

The body is a key-value map of attributes to be added.

Response body

Debt

Attribute Type Description
number string The debt number
id string An unique identifier of this debt
customerId string The identification of the customer to whom this debt was issued to
type string The type of debt
status string The current status of this debt
date date The date this debt was created in ISO 8601 format (YYYY-MM-DD)
dueDate date The payment expiration date in ISO 8601 format (YYYY-MM-DD)
netTotal double This debt’s total net total
tax double The total amount being paid for tax purposes
grossTotal double The gross total of this debt
debitTotal double The debit total of this debt. This is the total amount of the corrections that have increased the value of this debt.
creditTotal double The credit total of this debt. This is the total amount of the corrections that have decreased the value of this debt.
paidTotal double The total amount paid. This is the sum of all payments that have been registered for this debt.
currency string The ISO 4217 currency code.
items array A list of items included in the transaction
attributes map A map of custom attributes related with this debt. Each attribute is a string-string key-value pair.

Item

Attribute Type Description
name string The name if the item.
description string A human readable description of the item.
quantity double The amount of items of this type included in the transaction.
netPrice double The item’s net total price (value without taxes).
vat percentage The percentage being applied to this item for tax purposes.
taxes double The value being paid for tax purposes.
price double This item’s gross total.

Errors

This endpoint may return the following errors:

HTTP Code Description
401 Unauthorized Invalid credentials were supplied.
404 Not Found The debt being updated wasn’t found.
422 Unprocessable Entity The request is syntactically correct but not a valid JSON object or one the sanity checks failed.

Feedback

If you have a question that needs an answer, please contact support.