biterp

Compensar a nota contra uma conta a receber

Applies the credit to a receivable of the same customer. Does not move money. A date in a closed month is rejected. Requires customer-credit-notes:update and receivables:update.

POST
/customer-credit-notes/{id}/offsets
AuthorizationBearer <token>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://api.biterp.ai/customer-credit-notes/{id}/offsets" \  -H "Content-Type: application/json" \  -d '{    "receivable_id": "c5fdbd77-089d-4f8e-bf49-b02b6e7fc04a",    "amount": "78.930000",    "offset_date": "2026-11-17"  }'
{
  "offset": {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "customer_credit_note_id": "862efd95-ed5d-4081-99c1-933637a8ded2",
    "receivable_id": "c5fdbd77-089d-4f8e-bf49-b02b6e7fc04a",
    "amount": "60.000000",
    "offset_date": "2019-08-24",
    "reverses_offset_id": "5242642e-29dc-4af9-9cbf-95fc9e424654",
    "reason": "string",
    "notes": "string",
    "created_at": "2019-08-24T14:15:22Z"
  },
  "note": {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "status": "open",
    "balance": "38.930000",
    "cancelled_amount": "0.000000"
  },
  "receivable": {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "status": "pending",
    "remaining_amount": "39.000000",
    "paid_at": "2019-08-24T14:15:22Z"
  }
}
{
  "status_code": 404,
  "message": "Customer not found",
  "error": "Not Found",
  "code": "CUSTOMER_NOT_FOUND"
}
{
  "status_code": 404,
  "message": "Customer not found",
  "error": "Not Found",
  "code": "CUSTOMER_NOT_FOUND"
}
{
  "status_code": 404,
  "message": "Customer not found",
  "error": "Not Found",
  "code": "CUSTOMER_NOT_FOUND"
}
{
  "status_code": 422,
  "message": "Could not resolve provided geography fields",
  "error": "Unprocessable Entity",
  "code": "string",
  "details": {
    "fields": {
      "country_code": [
        "Could not resolve country from '1112' (tried ISO2, ISO3, numeric code and names)"
      ],
      "city": [
        "Could not resolve city from 'CidadeQueNaoExiste' in country 'BR'"
      ]
    }
  }
}
{
  "status_code": 404,
  "message": "Customer not found",
  "error": "Not Found",
  "code": "CUSTOMER_NOT_FOUND"
}