# Update receivable
Update receivable for fields passed.
If updating the status fails, a credit_rights_status_change_failure-1 event is generated. If updating the status succeeds, a credit_rights_status_change_success-1 event is generated.
If updating any other fields besides status fails, a credit_rights_change_failure-1 event is generated. If updating a non-status field succeeds, a credit_rights_change_success-1 event is generated.
# OpenAPI definition
```json
{
"openapi": "3.1.0",
"info": {
"title": "Banking - Credit receivables",
"contact": {
"email": "support@pismo.com.br",
"name": "API Support",
"url": "https://developers.pismo.io/support/"
},
"description": "Endpoints to handle contract operations",
"license": {
"name": "Copyright Pismo",
"url": "https://developers.pismo.io/licenses/"
},
"termsOfService": "https://developers.pismo.io/terms/",
"version": "v1"
},
"servers": [
{
"url": "https://api-sandbox.pismolabs.io/credit-rights-receivable",
"description": "Production server"
}
],
"tags": [
{
"name": "Receivable",
"description": "Endpoints to manage receivables"
}
],
"security": [
{
"bearerAuth": []
}
],
"components": {
"parameters": {
"InternalNumberPath": {
"in": "path",
"name": "internalNumber",
"description": "Client-assigned internal number.",
"required": true,
"schema": {
"type": "string"
}
}
},
"schemas": {
"AccessKey": {
"type": "string",
"description": "Client-generated identifier. This field is used for the [Get invoice](https://developers.pismo.io/pismo-docs/reference/findbyaccesskey) endpoint.",
"minLength": 1,
"maxLength": 44,
"example": "KAB6J8903CNMH01892749JKSNOAXMCA7199382ABCERL"
},
"CollateralType": {
"type": "integer",
"format": "int32",
"minimum": 1,
"maximum": 1,
"description": "Collateral type: \n\n 1 - Aval. In Brazil, the term \"aval collateral\" refers to a specific type of collateral used in financial transactions. \"Aval\" is a Portuguese term that means \"endorsement\" or \"guarantee,\" and it is commonly used in the Brazilian financial system. Aval collateral is a form of guarantee where a third party, known as the \"avalista\" or guarantor, pledges their assets or credit worthiness to secure a loan or financial obligation on behalf of the borrower. The avalista becomes jointly liable for the debt and agrees to fulfill the obligations if the borrower fails to do so. \n",
"enum": [
1
],
"example": 1
},
"ContactNumber": {
"type": "string",
"description": "Contact number",
"maxLength": 15,
"minLength": 1,
"example": "+14158675309"
},
"CorrelationID": {
"type": "string",
"description": "Correlation ID (CID). This field is used to link related API requests and events. The CID can help the Pismo engineering team track everything related to a call. If one isn't passed, one is automatically generated. You can find the CID in a response header. \n",
"example": "88474990237-94940"
},
"CreditOperationsArray": {
"maxItems": 2147483647,
"minItems": 1,
"type": "array",
"items": {
"$ref": "#/components/schemas/CreditOperation"
}
},
"CreditOperation": {
"type": "object",
"properties": {
"contact_number": {
"$ref": "#/components/schemas/ContactNumber"
},
"guarantee_percentage": {
"$ref": "#/components/schemas/GuaranteePercentage"
},
"operation_date": {
"$ref": "#/components/schemas/OperationDate"
},
"operation_maturity": {
"$ref": "#/components/schemas/OperationMaturity"
},
"operation_type": {
"$ref": "#/components/schemas/OperationType"
},
"operation_value": {
"$ref": "#/components/schemas/OperationValue"
}
}
},
"DebtorSigningDate": {
"type": "string",
"description": "Debtor signing date. Format = yyyy-mm-dd",
"format": "date",
"example": "2023-06-07"
},
"Description": {
"type": "string",
"description": "Receivable description",
"maxLength": 500,
"example": "Receivable description..."
},
"Errors": {
"type": "array",
"items": {
"type": "string"
}
},
"GlobalErrorResponse": {
"type": "object",
"properties": {
"correlationId": {
"$ref": "#/components/schemas/CorrelationID"
},
"errors": {
"$ref": "#/components/schemas/Errors"
}
}
},
"GuarantorName": {
"type": "string",
"description": "Guarantor name",
"minLength": 1,
"maxLength": 100,
"example": "Lansky Loan"
},
"GuaranteePercentage": {
"type": "number",
"description": "Gurantor percentage",
"example": 5
},
"IbgeCode": {
"type": "integer",
"format": "int32",
"description": "IBGE stands for Instituto Brasileiro de Geografia e Estatística, which translates to the Brazilian Institute of Geography and Statistics. This Brazilian national statistical agency is responsible for collecting and providing official data on various aspects of the country. An IBGE code is a specific numerical code assigned to various administrative divisions and geographical areas in Brazil.\n\nFor this application, the IBGE code identifies the town and **must** have 7 digits (1000000 to 9999999).\n",
"minLength": 7,
"maxLength": 7,
"example": 3304557
},
"InternalNumber": {
"type": "string",
"description": "Client-assigned internal number.",
"minLength": 1,
"maxLength": 40,
"example": "5eae1070-28cc-4e99-ad45-c380731d5c0a"
},
"LenderSigningDate": {
"type": "string",
"description": "Lender signing date. Format = yyyy-mm-dd. Must be before or equal to today.",
"format": "date",
"example": "2023-06-22"
},
"Message": {
"type": "string",
"description": "Message",
"maxLength": 500,
"example": "Credit rights update request is being processed"
},
"OperationDate": {
"type": "string",
"description": "Operation date. Format = yyyy-mm-dd.",
"format": "date",
"example": "2023-06-06"
},
"OperationMaturity": {
"type": "string",
"description": "Operation maturity. Format = yyyy-mm-dd.",
"format": "date",
"example": "2023-09-08"
},
"OperationType": {
"type": "string",
"description": "Operation type. You need to configure the operation types with Pismo.",
"maxLength": 50,
"minLength": 1
},
"OperationValue": {
"type": "number",
"description": "Operation value. Must be positive or zero. Can be up to 16 digits and two decimal places.\n",
"example": 234.5
},
"OwnerDocumentNumber": {
"type": "string",
"description": "Owner document number. A government document number, such as a Social Security number (US) or Cadastro de Pessoas Físicas number (Brazil). \n",
"example": "51008931000177"
},
"OwnerName": {
"type": "string",
"description": "Owner name",
"minLength": 1,
"maxLength": 100,
"example": "Biff Wellington"
},
"PaymentMethod": {
"type": "integer",
"format": "int32",
"minimum": 1,
"maximum": 6,
"enum": [
1,
2,
3,
4,
5,
6
],
"description": "Payment method: \n\n1 - **Boleto**: The Boleto payment method is a popular payment system in Brazil. It is a widely used alternative to traditional credit card payments and bank transfers. Boleto Bancário, commonly referred to as \"Boleto,\" is a payment voucher that allows individuals and businesses to make payments for goods and services.\n\n2 - **TED**: The TED (Transferência Eletrônica Disponível) payment method is a popular electronic funds transfer system in Brazil. It is commonly used for interbank transfers, allowing individuals and businesses to transfer funds between different financial institutions within the country.\n\n3 - **DOC**: The DOC (Documento de Ordem de Crédito) payment method is another electronic funds transfer system in Brazil, similar to TED (Transferência Eletrônica Disponível). DOC is primarily used for interbank transfers but differs from TED in terms of timing, limits, and processing.\n\n4 - **Dinheiro**: \"Dinheiro\" is the Portuguese word for \"money\" or a general term for cash payments. Cash is a widely used payment method in various countries, including Brazil, where the official currency is the Brazilian Real (BRL).\n\n5 - **Título**: \"Titulo\" means title in Portuguese.\n\n6 - **Pix**: The Pix payment method is a new and instant electronic payment system introduced by the Central Bank of Brazil. It was launched in November 2020 and has gained significant popularity in a short period. Pix allows individuals and businesses to make real-time transfers and payments between different financial institutions in Brazil. It operates 24/7, including weekends and holidays, providing a fast and alternative to traditional payment methods such as TED and DOC transfers. \n",
"example": 2
},
"PaymentStatus": {
"type": "integer",
"format": "int32",
"minimum": 1,
"maximum": 2,
"description": "Payment Status:\n 1 - PAID \n 2 - UNPAID\n",
"enum": [
1,
2
],
"example": 1
},
"UpdatedFaceValue": {
"type": "number",
"description": "Updated face value.",
"example": 456.99
},
"UpdatedMaturityDate": {
"type": "string",
"description": "Updated maturity date. Format = yyyy-mm-dd.",
"example": "2023-09-14"
},
"UpdateReceivableRequest": {
"type": "object",
"properties": {
"access_key": {
"$ref": "#/components/schemas/AccessKey"
},
"collateral_type": {
"$ref": "#/components/schemas/CollateralType"
},
"credit_operations": {
"$ref": "#/components/schemas/CreditOperationsArray"
},
"debtor_signing_date": {
"$ref": "#/components/schemas/DebtorSigningDate"
},
"description": {
"$ref": "#/components/schemas/Description"
},
"guarantor_name": {
"$ref": "#/components/schemas/GuarantorName"
},
"ibge_code": {
"$ref": "#/components/schemas/IbgeCode"
},
"lender_signing_date": {
"$ref": "#/components/schemas/LenderSigningDate"
},
"owner_document_number": {
"$ref": "#/components/schemas/OwnerDocumentNumber"
},
"owner_name": {
"$ref": "#/components/schemas/OwnerName"
},
"payment_method": {
"$ref": "#/components/schemas/PaymentMethod"
},
"payment_status": {
"$ref": "#/components/schemas/PaymentStatus"
},
"updated_face_value": {
"$ref": "#/components/schemas/UpdatedFaceValue"
},
"updated_maturity_date": {
"$ref": "#/components/schemas/UpdatedMaturityDate"
}
}
},
"UpdateReceivableResponse": {
"type": "object",
"properties": {
"internal_number": {
"$ref": "#/components/schemas/InternalNumber"
},
"message": {
"$ref": "#/components/schemas/Message"
}
}
}
},
"responses": {
"400BadRequest": {
"description": "Bad Request",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/GlobalErrorResponse"
}
}
}
},
"401Unauthorized": {
"description": "Missing or invalid access token",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/GlobalErrorResponse"
}
}
}
},
"500InternalServerError": {
"description": "Internal Server Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/GlobalErrorResponse"
}
}
}
}
},
"securitySchemes": {
"bearerAuth": {
"bearerFormat": "JWT",
"scheme": "bearer",
"type": "http"
}
}
},
"paths": {
"/v1/credit-rights/{internalNumber}": {
"patch": {
"summary": "Update receivable",
"description": "Update receivable for fields passed.\n\nIf updating the status fails, a credit_rights_status_change_failure-1 event is generated. If updating the status succeeds, a credit_rights_status_change_success-1 event is generated.\n\nIf updating any other fields besides status fails, a credit_rights_change_failure-1 event is generated. If updating a non-status field succeeds, a credit_rights_change_success-1 event is generated.\n",
"operationId": "update",
"parameters": [
{
"$ref": "#/components/parameters/InternalNumberPath"
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UpdateReceivableRequest"
}
}
},
"required": true
},
"responses": {
"202": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UpdateReceivableResponse"
}
}
},
"description": "Success message is sent to the client while update is processed asynchronously"
},
"400": {
"$ref": "#/components/responses/400BadRequest"
},
"401": {
"$ref": "#/components/responses/401Unauthorized"
},
"500": {
"$ref": "#/components/responses/500InternalServerError"
}
},
"tags": [
"Receivable"
]
}
}
}
}
```