Como receber dados do Credere via webhooks

O que é um webhook?

Webhook é um recurso que possibilita o envio de dados entre sistemas distintos. No caso do Credere, são enviados dados em sete ocasiões:

Como passar a receber webhooks do Credere

Existem duas formas de sinalizar para o Credere que deseja receber dados quando uma determinada ação acontecer. Em ambas, a partir de uma URL que nos é informada. O que muda é como e onde ela pode ser informada. Nos tópicos descritos a seguir, será informado como pode ser feito.

1. Enviar a URL no corpo da requisição

Existe um parâmetro opcional no corpo de criação da simulação e da proposta, denominado webhook_url, destinado ao disparo de webhook. Nele pode ser preenchido a URL que gostaria de receber esses dados. Exemplo: https://webhook.site/api/v1/webhooks. Essa URL deve conseguir receber uma requisição HTTP POST em formato JSON.

Ao criar uma simulação, a URL pode ser especificada no corpo da simulação. Para esse caso, o Credere só fará webhook quando o processamento da simulação for finalizado. Para mais informações sobre criação de simulações, acesse nossa referência da API.

 {
  "simulation": {
    "webhook_url": "https://webhook.site/api/v1/webhooks",
    "process_bank_suggested_conditions": true,
    "seller_cpf": "00000000000",
    "retrieve_lead": {
      "cpf_cnpj": "000.000.000-00"
    },
    "bank_febraban_codes": ["M22", "623"],
    "assets_value": 10000000,
    "documentation_value": 100000,
    "accessory_value": 100000,
    "insurance_value": 100000,
    "vehicle": {
      "vehicle_molicar_code": "00000000-0",
      "licensing_uf": "SP",
      "licensing_city": "São Paulo",
      "manufacture_year": 2022,
      "model_year": 2022,
      "asset_value": 10000000,
      "zero_km": true
    },
    "conditions": [
      {
        "installments": 12,
        "down_payment": 1000000,
        "financed_amount": 9000000
      }
    ]
  }
}

Ao criar uma proposta, a URL pode ser informada no corpo proposta. Nesse caso, o Credere fará webhook quando houver atualização nos dados ou status da tentativa de proposta, ou da proposta e quando a tentativa de proposta ou proposta for criada/editada. Para mais informações sobre criação de propostas e tentativa de proposta, acesse nossa referência da API.

{
  "proposal": {
    "customer_id": 1,
    "store_id": 1,
    "seller_id": 1,
    "commercial": false,
    "proposal_attemps": [
      {
        "webhook_url": "https://webhook.site/api/v1/webhooks",
        "simulation_condition_id": 1,
        "external_simulation_uuid": "0a00bc00-0d00-0000-0000-0ef0000g0hij"
      }
    ]
  }
}

2. Enviar a URL no formulário da loja

Outra forma de informar a URL de destino do webhook é preciso preenchendo no formulário o campo URLs, ao final da página, no momento de criação ou edição de uma loja. Pode ser informado uma ou mais URLs, através do botão "Adicionar mais". As URLs que forem adicionadas dessa forma acionam todos os webhooks, ou seja, em todas as sete ocasiões citadas acima. Apenas usuários com permissão de Administrador e Diretor tem acesso a esse campo no formulário.

Formulário de criação e edição de loja

Formulário de criação e edição de loja

🚧

Multiplas URLs informadas

Se for informadas URLs no corpo da requisição da simulação ou da proposta, através do parâmetro webhook_url mesmo quando já existir URLs preenchidas no formulário de criação/edição da loja, os webhooks serão enviados para todas as URLs informadas em ambos lugares.

🚧

Liberação de IPs

Em alguns casos, os sistemas limitam a comunicação em IPs específicos. Nossa API faz o envio de webhooks utilizando 4 IPs fixos. São eles:

  • 50.19.187.113
  • 54.232.123.189
  • 18.213.164.35
  • 18.213.78.197

Se for necessário, deve-se liberar a comunicação com esses endereços acima.

Dados que serão enviados pelo Credere

Cada uma das ocasiões tem seu próprio payload. Por padrão, serão enviados um parâmetro event, que identifica a ação que resultou o disparo do webhook e um parâmetro com o objeto resultado da ação. Este pode ser simulation ou proposal_attempt. Os próximos tópicos darão exemplo de cada um deles.

Quando o processamento da simulação for finalizado

  • Evento: processed_simulation
  • Objeto: simulation
{
	"event": "processed_simulation",
	"simulation": {
		"assets_value": 1000000,
		"conditions": [
			{
				"payment_flow": {
					"1": 100000,
					"2": 100000,
					"3": 100000,
					"4": 100000,
					"5": 100000,
					"6": 100000,
					"7": 100000,
					"8": 100000,
					"9": 100000,
					"10": 100000,
					"11": 100000,
					"12": 100000
				},
				"success": true,
				"installments": 12,
				"return_preference": "min",
				"reason_identifier": null,
				"bank": {
					"id": 160,
					"name": "Itaú Unibanco S.A.",
					"nickname": "Itaú",
					"febraban_code": "341"
				},
				"processed_at": "2022-01-01T01:01:01Z",
				"available": true,
				"id": 1,
				"run_pre_approval": true,
				"webhook_url": null,
				"cet_annually": 55.00,
				"down_payment": 100000,
				"bank_available_amount": null,
				"credit_condition_return_offset_percentage": null,
				"credit_condition_description": null,
				"interest_monthly": 2.11,
				"credit_condition_return_offset": null,
				"products_options": {
					"include_asset_insurance": false,
					"include_capitalization_bond": false
				},
				"last_installment_value": 100000,
				"interest_annually": 11.00,
				"bank_minimum_down_payment": null,
				"financed_amount": 100000,
				"bank_down_payment_suggestion": null,
				"reason": null,
				"error": false,
				"credit_condition_code": "ABC0",
				"first_installment_value": 100000,
				"include_financial_protection_insurance": true,
				"suggestion_reason": null,
				"pre_approval_status": 2,
				"quota_preference": "min",
				"cet_monthly": 3.00,
				"expenses": [
					{
						"fixed_value": 1000,
						"id": 1,
						"max_value": 1000,
						"min_value": 1000,
						"over_total": false,
						"payload": {
							"credere_type": "iof_value"
						},
						"percentage": 0,
						"type": "iof_value",
						"value": 1000
					},
					{
						"fixed_value": 0,
						"id": 2,
						"max_value": 0,
						"min_value": 0,
						"over_total": false,
						"payload": {
							"credere_type": "property_valuation_rate"
						},
						"percentage": 0,
						"type": "property_valuation_rate",
						"value": 0
					}
				],
				"process_task": {
					"ended_at": "2022-01-01T01:01:01Z",
					"error": false,
					"result": {
						"success": true
					}
				},
				"credit_condition_plus": null,
				"credit_condition_return": "0",
				"credit_condition_return_percentage": null,
				"process_condition_payload": {
					"id": "3a33bc33-3d33-3333-3333-3ef3333g3hij"
				},
				"fixed_installments": true,
				"pre_aproval_task": null,
				"created_at": "2022-01-01T01:01:01Z",
				"min_return": 0,
				"amount_paid_in_financing": 1000000,
				"max_return": null
			}
		],
		"created_at": "2022-01-01T01:01:01Z",
		"error": null,
		"items": [
			{
				"id": 1,
				"type": "documentation",
				"value": 0
			}
		],
		"lead": {
			"address": {
				"city": "São Paulo",
				"complement": null,
				"district": "Bairo X",
				"id": 1,
				"number": "111",
				"state": "SP",
				"street": "Rua X",
				"zip_code": "12345-000"
			},
			"birthdate": "1922-01-01",
			"cpf_cnpj": "000.000.000-00",
			"email": "[email protected]",
			"gender": {
				"credere_identifier": "F",
				"id": 1,
				"label": "Feminino",
				"type": "gender"
			},
			"has_cnh": false,
			"id": 1,
			"monthly_income": 1000000,
			"mother_name": "",
			"name": "Fulano Sicrano",
			"occupation": {
				"credere_identifier": "1",
				"id": 1,
				"label": "Autônomo",
				"type": "occupation"
			},
			"payload": {
				"store_id": 1,
				"user_id": 1
			},
			"phone_number": "+5511900000000",
			"profession": {
				"credere_identifier": "administrador",
				"id": 1,
				"label": "Administrador",
				"type": "profession"
			}
		},
		"payload": {
			"store_id": 1,
			"user_id": 1
		},
		"process_bank_suggested_conditions": true,
		"process_task": {
			"ended_at": "2022-01-01T00:00:00Z",
			"error": null,
			"result": {
				"success": true
			}
		},
		"reason": null,
		"success": true,
		"uuid": "0a00bc00-0d00-0000-0000-0ef0000g0hij",
		"vehicle": {
			"asset_value": 1000000,
			"chassi_code": null,
			"color": null,
			"fuel_type": null,
			"id": 1,
			"km_mileage": null,
			"license_plate_code": null,
			"licensing_city": null,
			"licensing_uf": "SP",
			"manufacture_year": 2022,
			"model_year": 2022,
			"renavam_code": null,
			"vehicle_model": {
				"available": true,
				"brand": "HONDA",
				"category": {
					"credere_identifier": "motocicleta",
					"id": 1,
					"label": "Motocicleta",
					"type": "vehicle-category"
				},
				"fipe_code": "000000-0",
				"fuel_type": {
					"credere_identifier": "1",
					"id": 1,
					"label": "Flex",
					"type": "fuel-type"
				},
				"id": 1,
				"model_name": "BIZ",
				"molicar_code": "00000000-0",
				"version": "125 - Basico",
				"year_end": 2023,
				"year_start": 2015
			},
			"zero_km": true
		},
		"webhook_url": "https://webhook.site/api/v1/webhooks",
		"store": {
			"id": 1,
			"name": "Credere",
			"cnpj": "00.000.000/0001-00"
		},
		"seller": {
			"id": 1,
			"name": "Admin",
			"cpf": "111.111.111-11"
		}
	}
}

Quando há atualização nos dados da tentativa da proposta

  • Evento: synced_proposal_condition_from_bank
  • Objeto: proposal_attempt
{
	"event": "synced_proposal_condition_from_bank",
	"proposal_attempt": {
		"object_type": "ProposalAttemp",
		"id": 1,
		"created_at": "2022-01-01T00:00:00.000-03:00",
		"updated_at": "2022-01-01T00:00:00.000-03:00",
		"active": true,
		"bank": {
			"id": 1,
			"name": "ItaúUnibancoS.A.",
			"tradename": "Itaú",
			"febraban_code": "341"
		},
		"input_financing_in_cents": 100000,
		"plan": {
			"return": "5",
			"return_offset": null
		},
		"quota_in_cents": 100000,
		"state": "análise",
		"table": {
			"description": "ABC0"
		},
		"term_financing": 12,
		"value_in_cents": 1000000,
		"obs": null,
		"value_of_the_license_plate_in_cents": 0,
		"financed_amount_in_cents": 1000000,
		"coefficient": null,
		"has_license_plate": false,
		"first_payment_in_days": 30,
		"funding_type": {
			"id": 1,
			"name": "CDC"
		},
		"payment_type": {
			"id": 1,
			"name": "Carnê"
		},
		"input_origin": 1,
		"external_simulation_uuid": "0a00bc00-0d00-0000-0000-0ef0000g0hij",
		"simulation_condition_id": 1,
		"external_proposal_uuid": "1a11bc11-1d11-1111-1111-1ef1111g1hij",
		"integration_error": {
			"error": "",
			"message": "",
			"error_details": ""
		},
		"state_rank": 2,
		"bank_proposal_identifier": "2a22bc22-2d22-2222-2222-2ef2222g2hij",
		"honda_id": "",
		"simulation_pre_approval_status": 2,
		"fixed_installments": true,
		"cet_monthly": 2.00,
		"cet_annually": 39.00,
		"return_value_cents": null,
		"formalization_state": null,
		"formalization": null,
		"replaced_by_proposal_attempt_id": null,
		"replaces_proposal_attempt_id": null,
		"has_accessory": null,
		"value_of_the_accessory_in_cents": null,
		"expenses": [
			{
				"object_type": "ExpenseInfo",
				"id": 1,
				"created_at": "2022-01-01T00: 00: 00.000-03: 00",
				"updated_at": "2022-01-01T00: 00: 00.000-03: 00",
				"value_in_cents": 100000,
				"credere_type": "spf",
				"description": null,
				"expense": null
			}
		],
		"payment_flow": [
			{
				"installment_number": 1,
				"value_cents": 100000
			},
			{
				"installment_number": 2,
				"value_cents": 100000
			},
			{
				"installment_number": 3,
				"value_cents": 100000
			},
			{
				"installment_number": 4,
				"value_cents": 100000
			},
			{
				"installment_number": 5,
				"value_cents": 100000
			},
			{
				"installment_number": 6,
				"value_cents": 100000
			},
			{
				"installment_number": 7,
				"value_cents": 100000
			},
			{
				"installment_number": 8,
				"value_cents": 100000
			},
			{
				"installment_number": 9,
				"value_cents": 100000
			},
			{
				"installment_number": 10,
				"value_cents": 100000
			},
			{
				"installment_number": 11,
				"value_cents": 100000
			},
			{
				"installment_number": 12,
				"value_cents": 100000
			}
		],
		"proposal": {
			"object_type": "CdcProposal",
			"id": 1,
			"created_at": "2022-01-01T00:00:00.000-03:00",
			"updated_at": "2022-01-01T00:00:00.000-03:00",
			"customer": {
				"id": 1,
				"name": "Fulano Silva Júnior",
				"cpf": "000.000.000-00",
				"cnpj": null,
				"born_at": "1990-01-01",
				"phones": [
					{
						"code": 11,
						"number": 999999999
					},
					{
						"code": 11,
						"number": 988888888
					}
				],
				"emails": [
					{
						"address": "[email protected]"
					}
				]
			},
			"seller": {
				"id": 1,
				"name": "Admin",
				"cpf": "111.111.111-11"
			},
			"state": "análise",
			"store": {
				"id": 1,
				"name": "Credere",
				"cnpj": "00.000.000/0001-00"
			},
			"sent_to_bank": true,
			"zero_km": true,
			"commercial": false,
			"creation_external_link_id": null,
			"licensing_uf": "RN"
		}
	}
}

Quando há atualização no status da tentativa

  • Evento: status_updated
  • Objeto: proposal_attempt
{
	"event": "status_updated",
	"proposal_attempt": {
		"object_type": "ProposalAttemp",
		"id": 1,
		"created_at": "2022-01-01T00:00:00.000-03:00",
		"updated_at": "2022-01-01T00:00:00.000-03:00",
		"active": true,
		"bank": {
			"id": 1,
			"name": "Itaú Unibanco S.A.",
			"tradename": "Itaú",
			"febraban_code": "341"
		},
		"input_financing_in_cents": 100000,
		"plan": {
			"return": "5",
			"return_offset": null
		},
		"quota_in_cents": 100000,
		"state": "aprovada",
		"table": {
			"description": "ABC0"
		},
		"term_financing": 12,
		"value_in_cents": 1000000,
		"obs": null,
		"value_of_the_license_plate_in_cents": 0,
		"financed_amount_in_cents": 1000000,
		"coefficient": null,
		"has_license_plate": false,
		"first_payment_in_days": 30,
		"funding_type": {
			"id": 1,
			"name": "CDC"
		},
		"payment_type": {
			"id": 1,
			"name": "Carnê"
		},
		"input_origin": 1,
		"external_simulation_uuid": "0a00bc00-0d00-0000-0000-0ef0000g0hij",
		"simulation_condition_id": 1,
		"external_proposal_uuid": "1a11bc11-1d11-1111-1111-1ef1111g1hij",
		"integration_error": {
			"error": "",
			"message": "",
			"error_details": ""
		},
		"state_rank": 2,
		"bank_proposal_identifier": "2a22bc22-2d22-2222-2222-2ef2222g2hij",
		"honda_id": "",
		"simulation_pre_approval_status": 2,
		"fixed_installments": true,
		"cet_monthly": 2.00,
		"cet_annually": 39.00,
		"return_value_cents": null,
		"formalization_state": null,
		"formalization": null,
		"replaced_by_proposal_attempt_id": null,
		"replaces_proposal_attempt_id": null,
		"has_accessory": null,
		"value_of_the_accessory_in_cents": null,
		"expenses": [
			{
				"object_type": "ExpenseInfo",
				"id": 1,
				"created_at": "2022-01-01T00:00:00.000-03:00",
				"updated_at": "2022-01-01T00:00:00.000-03:00",
				"value_in_cents": 100000,
				"credere_type": "spf",
				"description": null,
				"expense": null
			}
		],
		"payment_flow": [
			{
				"installment_number": 1,
				"value_cents": 100000
			},
			{
				"installment_number": 2,
				"value_cents": 100000
			},
			{
				"installment_number": 3,
				"value_cents": 100000
			},
			{
				"installment_number": 4,
				"value_cents": 100000
			},
			{
				"installment_number": 5,
				"value_cents": 100000
			},
			{
				"installment_number": 6,
				"value_cents": 100000
			},
			{
				"installment_number": 7,
				"value_cents": 100000
			},
			{
				"installment_number": 8,
				"value_cents": 100000
			},
			{
				"installment_number": 9,
				"value_cents": 100000
			},
			{
				"installment_number": 10,
				"value_cents": 100000
			},
			{
				"installment_number": 11,
				"value_cents": 100000
			},
			{
				"installment_number": 12,
				"value_cents": 100000
			}
		],
		"proposal": {
			"object_type": "CdcProposal",
			"id": 1,
			"created_at": "2022-01-01T00:00:00.000-03:00",
			"updated_at": "2022-01-01T00:00:00.000-03:00",
			"customer": {
				"id": 1,
				"name": "Fulano Silva Júnior",
				"cpf": "000.000.000-00",
				"cnpj": null,
				"born_at": "1990-01-01",
				"phones": [
					{
						"code": 11,
						"number": 999999999
					},
					{
						"code": 11,
						"number": 988888888
					}
				],
				"emails": [
					{
						"address": "[email protected]"
					}
				]
			},
			"seller": {
				"id": 1,
				"name": "Admin",
				"cpf": "111.111.111-11"
			},
			"state": "aprovada",
			"store": {
				"id": 1,
				"name": "Credere",
				"cnpj": "00.000.000/0001-00"
			},
			"sent_to_bank": true,
			"zero_km": true,
			"commercial": false,
			"creation_external_link_id": null,
			"licensing_uf": "RN"
		}
	}
}

Ver lista de status possíveis aqui.

Quando há atualização no status da proposta

  • Evento: proposal_status_updated
  • Objeto: proposal
{
	"event": "proposal_updated",
	"proposal": {
		"object_type": "CdcProposal",
		"id": 1,
		"created_at": "2022-01-01 00:00:00 -0300",
		"updated_at": "2022-01-01 00:00:00 -0300",
		"customer": {
			"id": 1,
			"name": "Fulano Silva Júnior",
			"cpf": "000.000.000-00",
			"cnpj": null,
			"born_at": "1990-01-01",
			"phones": [
				{
					"code": 11,
					"number": 999999999
				},
				{
					"code": 11,
					"number": 999999999
				}
			]
		},
		"seller": {
			"id": 1,
			"name": "Admin",
			"cpf": "111.111.111-11"
		},
		"state": "análise",
		"store": {
			"id": 1,
			"name": "Credere",
			"cnpj": "00.000.000/0001-00",
			"seller_can_send_proposal_to_bank": true
		},
		"year_of_model": 2022,
		"year_of_manufacture": 2022,
		"comments_count": 9,
		"external_simulation_uuid": "0a00bc00-0d00-0000-0000-0ef0000g0hi",
		"sent_to_bank": false,
		"zero_km": true,
		"commercial": true,
		"creation_external_link_id": null,
		"licensing_uf": "RN",
		"licensing_city": "Natal",
		"chassi_code": null,
		"license_plate_code": null,
		"renavam_code": null,
		"km_mileage": null,
		"color": null,
		"proposal_attempt": {
			"object_type": "ProposalAttemp",
			"id": 1,
			"created_at": "2022-01-01T00:00:00.000-03:00",
			"updated_at": "2022-01-01T00:00:00.000-03:00",
			"customer": {
				"id": 1,
				"name": "Fulano Silva Júnior",
				"cpf": "000.000.000-00",
				"born_at": "1990-01-01",
				"phones": [
					{
						"code": 11,
						"number": 999999999
					},
					{
						"code": 11,
						"number": 999999999
					}
				]
			},
			"active": true,
			"bank": {
				"id": 1,
				"name": "Itaú Unibanco S.A.",
				"tradename": "Itaú",
				"febraban_code": "341"
			},
			"input_financing_in_cents": 100000,
			"plan": {
				"return": "5",
				"return_offset": null
			},
			"quota_in_cents": 100000,
			"state": "análise",
			"table": {
				"description": "ABC0"
			},
			"term_financing": 12,
			"value_in_cents": 1000000,
			"obs": null,
			"value_of_the_license_plate_in_cents": 0,
			"financed_amount_in_cents": 1000000,
			"coefficient": null,
			"has_license_plate": false,
			"first_payment_in_days": 30,
			"funding_type": {
				"id": 1,
				"name": "CDC"
			},
			"payment_type": {
				"id": 1,
				"name": "Carnê"
			},
			"input_origin": 1,
			"external_simulation_uuid": "0a00bc00-0d00-0000-0000-0ef0000g0hij",
			"simulation_condition_id": 1,
			"external_proposal_uuid": "1a11bc11-1d11-1111-1111-1ef1111g1hij",
			"integration_error": {
				"error": "",
				"message": "",
				"error_details": ""
			},
			"state_rank": 2,
			"bank_proposal_identifier": "2a22bc22-2d22-2222-2222-2ef2222g2hij",
			"honda_id": "",
			"simulation_pre_approval_status": 2,
			"fixed_installments": true,
			"cet_monthly": 2.00,
			"cet_annually": 39.00,
			"return_value_cents": null,
			"formalization_state": null,
			"formalization": null,
			"replaced_by_proposal_attempt_id": null,
			"replaces_proposal_attempt_id": null,
			"has_accessory": null,
			"value_of_the_accessory_in_cents": null,
			"expenses": [
				{
					"object_type": "ExpenseInfo",
					"id": 1,
					"created_at": "2022-01-01T00:00:00.000-03:00",
					"updated_at": "2022-01-01T00:00:00.000-03:00",
					"value_in_cents": 100000,
					"credere_type": "spf",
					"description": null,
					"expense": null
				}
			],
			"payment_flow": [
				{
					"installment_number": 1,
					"value_cents": 100000
				},
				{
					"installment_number": 2,
					"value_cents": 100000
				},
				{
					"installment_number": 3,
					"value_cents": 100000
				},
				{
					"installment_number": 4,
					"value_cents": 100000
				},
				{
					"installment_number": 5,
					"value_cents": 100000
				},
				{
					"installment_number": 6,
					"value_cents": 100000
				},
				{
					"installment_number": 7,
					"value_cents": 100000
				},
				{
					"installment_number": 8,
					"value_cents": 100000
				},
				{
					"installment_number": 9,
					"value_cents": 100000
				},
				{
					"installment_number": 10,
					"value_cents": 100000
				},
				{
					"installment_number": 11,
					"value_cents": 100000
				},
				{
					"installment_number": 12,
					"value_cents": 100000
				}
			]
		},
		"vehicle_model": {
			"object_type": "VehicleModel",
			"id": 1,
			"created_at": "2022-01-01 00:00:00 -0300",
			"updated_at": "2022-01-01 00:00:00 -0300",
			"name": "BIZ",
			"brand": "HONDA",
			"molicar_code": "00000000-0",
			"version": "125 - Basico",
			"year_end": 2023,
			"year_start": 2015,
			"active": true,
			"public_price_cents": null,
			"public_price_as_string": "BRL",
			"publish": false,
			"fipe_code": "000000-0",
			"public_picture": null,
			"vehicle_brand": {
				"id": 1,
				"name": "HONDA"
			},
			"fuel": {
				"object_type": "Fuel",
				"id": 1,
				"created_at": "2022-01-01 00:00:00 -0300",
				"updated_at": "2022-01-01 00:00:00 -0300",
				"name": "Alc/Gas"
			},
			"vehicle_type": {
				"id": 1,
				"name": "Motos",
				"created_at": "2022-01-01 00:00:00 -0300",
				"updated_at": "2022-01-01 00:00:00 -0300",
				"honda_code": "MOT"
			}
		},
		"fuel": {
			"object_type": "Fuel",
			"id": 1,
			"created_at": "2022-01-01 00:00:00 -0300",
			"updated_at": "2022-01-01 00:00:00 -0300",
			"name": "Alc/Gas"
		}
	}
}

Ver lista de status possíveis aqui.

Quando a proposta é criada ou editada

  • Eventos: proposal_created ou proposal_updated
  • Objeto: proposal
{
	"event": "proposal_updated",
	"proposal": {
		"object_type": "CdcProposal",
		"id": 1,
		"created_at": "2022-01-01 00:00:00 -0300",
		"updated_at": "2022-01-01 00:00:00 -0300",
		"customer": {
			"id": 1,
			"name": "Fulano Silva Júnior",
			"cpf": "000.000.000-00",
			"cnpj": null,
			"born_at": "1990-01-01",
			"phones": [
				{
					"code": 11,
					"number": 999999999
				},
				{
					"code": 11,
					"number": 999999999
				}
			]
		},
		"seller": {
			"id": 1,
			"name": "Admin",
			"cpf": "111.111.111-11"
		},
		"state": "checagem",
		"store": {
			"id": 1,
			"name": "Credere",,
			"cnpj": "00.000.000/0001-00",
			"seller_can_send_proposal_to_bank": true
		},
		"year_of_model": 2022,
		"year_of_manufacture": 2022,
		"comments_count": 9,
		"external_simulation_uuid": "0a00bc00-0d00-0000-0000-0ef0000g0hi",
		"sent_to_bank": false,
		"zero_km": true,
		"commercial": true,
		"creation_external_link_id": null,
		"licensing_uf": "RN",
		"licensing_city": "Natal",
		"chassi_code": null,
		"license_plate_code": null,
		"renavam_code": null,
		"km_mileage": null,
		"color": null,
		"proposal_attempt": {
			"object_type": "ProposalAttemp",
			"id": 1,
			"created_at": "2022-01-01 00:00:00 -0300",
			"updated_at": "2022-01-01 00:00:00 -0300",
			"active": true,
			"bank": {
				"id": 1,
				"name": "Banco Votorantim S.A.",
				"tradename": "BV",
				"febraban_code": "655"
			},
			"input_financing_in_cents": 700000,
			"plan": {
				"return": "3",
				"return_offset": null
			},
			"quota_in_cents": 92122,
			"state": "checagem",
			"table": {
				"description": "BVMT4 - Motos"
			},
			"term_financing": 12,
			"value_in_cents": 1500000.0,
			"obs": null,
			"value_of_the_license_plate_in_cents": 0,
			"financed_amount_in_cents": 896156,
			"coefficient": null,
			"has_license_plate": false,
			"first_payment_in_days": 30,
			"funding_type": {
				"id": 1,
				"name": "CDC"
			},
			"payment_type": {
				"id": 1,
				"name": "Carnê"
			},
			"input_origin": 1,
			"external_simulation_uuid": "0a00bc00-0d00-0000-0000-0ef0000g0hi",
			"simulation_condition_id": 834,
			"external_proposal_uuid": null,
			"integration_error": null,
			"state_rank": 6,
			"bank_proposal_identifier": null,
			"honda_id": null,
			"simulation_pre_approval_status": 2,
			"fixed_installments": true,
			"cet_monthly": 3.44,
			"cet_annually": 50.98,
			"return_value_cents": null,
			"formalization_state": null,
			"formalization": null,
			"replaced_by_proposal_attempt_id": null,
			"replaces_proposal_attempt_id": null,
			"has_accessory": false,
			"value_of_the_accessory_in_cents": 0,
			"expenses": [
				{
					"object_type": "ExpenseInfo",
					"id": 1,
					"created_at": "2022-01-01 00:00:00 -0300",
					"updated_at": "2022-01-01 00:00:00 -0300",
					"value_in_cents": 3756,
					"credere_type": "iof_value",
					"description": null,
					"expense": null
				},
				{
					"object_type": "ExpenseInfo",
					"id": 1,
					"created_at": "2022-01-01 00:00:00 -0300",
					"updated_at": "2022-01-01 00:00:00 -0300",
					"value_in_cents": 92400,
					"credere_type": "contract_record_rate",
					"description": null,
					"expense": null
				}
			],
			"payment_flow": [
				{
					"installment_number": 1,
					"value_cents": 92122
				},
				{
					"installment_number": 2,
					"value_cents": 92122
				},
				{
					"installment_number": 3,
					"value_cents": 92122
				},
				{
					"installment_number": 4,
					"value_cents": 92122
				},
				{
					"installment_number": 5,
					"value_cents": 92122
				},
				{
					"installment_number": 6,
					"value_cents": 92122
				},
				{
					"installment_number": 7,
					"value_cents": 92122
				},
				{
					"installment_number": 8,
					"value_cents": 92122
				},
				{
					"installment_number": 9,
					"value_cents": 92122
				},
				{
					"installment_number": 10,
					"value_cents": 92122
				},
				{
					"installment_number": 11,
					"value_cents": 92122
				},
				{
					"installment_number": 12,
					"value_cents": 92122
				}
			]
		},
		"vehicle_model": {
			"object_type": "VehicleModel",
			"id": 1,
			"created_at": "2022-01-01 00:00:00 -0300",
			"updated_at": "2022-01-01 00:00:00 -0300",
			"name": "BIZ",
			"brand": "HONDA",
			"molicar_code": "00000000-0",
			"version": "125 - Basico",
			"year_end": 2023,
			"year_start": 2015,
			"active": true,
			"public_price_cents": null,
			"public_price_as_string": "BRL",
			"publish": false,
			"fipe_code": "000000-0",
			"public_picture": null,
			"vehicle_brand": {
				"id": 1,
				"name": "HONDA"
			},
			"fuel": {
				"object_type": "Fuel",
				"id": 1,
				"created_at": "2022-01-01 00:00:00 -0300",
				"updated_at": "2022-01-01 00:00:00 -0300",
				"name": "Alc/Gas"
			},
			"vehicle_type": {
				"id": 1,
				"name": "Motos",
				"created_at": "2022-01-01 00:00:00 -0300",
				"updated_at": "2022-01-01 00:00:00 -0300",
				"honda_code": "MOT"
			}
		},
		"fuel": {
			"object_type": "Fuel",
			"id": 1,
			"created_at": "2022-01-01 00:00:00 -0300",
			"updated_at": "2022-01-01 00:00:00 -0300",
			"name": "Alc/Gas"
		}
	}
}

Quando a tentativa de proposta é criada ou editada

  • Eventos: proposal_attempt_created ou proposal_attempt_updated
  • Objeto: proposal_attempt
{
	"event": "proposal_attempt_updated",
	"proposal_attempt": {
		"object_type": "ProposalAttemp",
		"id": 1,
		"created_at": "2022-01-01T00:00:00.000-03:00",
		"updated_at": "2022-01-01T00:00:00.000-03:00",
		"active": true,
		"bank": {
			"id": 1,
			"name": "Itaú Unibanco S.A.",
			"tradename": "Itaú",
			"febraban_code": "341"
		},
		"input_financing_in_cents": 100000,
		"plan": {
			"return": "5",
			"return_offset": null
		},
		"quota_in_cents": 100000,
		"state": "aprovada",
		"table": {
			"description": "ABC0"
		},
		"term_financing": 12,
		"value_in_cents": 1000000,
		"obs": null,
		"value_of_the_license_plate_in_cents": 0,
		"financed_amount_in_cents": 1000000,
		"coefficient": null,
		"has_license_plate": false,
		"first_payment_in_days": 30,
		"funding_type": {
			"id": 1,
			"name": "CDC"
		},
		"payment_type": {
			"id": 1,
			"name": "Carnê"
		},
		"input_origin": 1,
		"external_simulation_uuid": "0a00bc00-0d00-0000-0000-0ef0000g0hij",
		"simulation_condition_id": 1,
		"external_proposal_uuid": "1a11bc11-1d11-1111-1111-1ef1111g1hij",
		"integration_error": {
			"error": "",
			"message": "",
			"error_details": ""
		},
		"state_rank": 2,
		"bank_proposal_identifier": "2a22bc22-2d22-2222-2222-2ef2222g2hij",
		"honda_id": "",
		"simulation_pre_approval_status": 2,
		"fixed_installments": true,
		"cet_monthly": 2.00,
		"cet_annually": 39.00,
		"return_value_cents": null,
		"formalization_state": null,
		"formalization": null,
		"replaced_by_proposal_attempt_id": null,
		"replaces_proposal_attempt_id": null,
		"has_accessory": null,
		"value_of_the_accessory_in_cents": null,
		"expenses": [
			{
				"object_type": "ExpenseInfo",
				"id": 1,
				"created_at": "2022-01-01T00:00:00.000-03:00",
				"updated_at": "2022-01-01T00:00:00.000-03:00",
				"value_in_cents": 100000,
				"credere_type": "spf",
				"description": null,
				"expense": null
			}
		],
		"payment_flow": [
			{
				"installment_number": 1,
				"value_cents": 100000
			},
			{
				"installment_number": 2,
				"value_cents": 100000
			},
			{
				"installment_number": 3,
				"value_cents": 100000
			},
			{
				"installment_number": 4,
				"value_cents": 100000
			},
			{
				"installment_number": 5,
				"value_cents": 100000
			},
			{
				"installment_number": 6,
				"value_cents": 100000
			},
			{
				"installment_number": 7,
				"value_cents": 100000
			},
			{
				"installment_number": 8,
				"value_cents": 100000
			},
			{
				"installment_number": 9,
				"value_cents": 100000
			},
			{
				"installment_number": 10,
				"value_cents": 100000
			},
			{
				"installment_number": 11,
				"value_cents": 100000
			},
			{
				"installment_number": 12,
				"value_cents": 100000
			}
		],
		"proposal": {
			"object_type": "CdcProposal",
			"id": 1,
			"created_at": "2022-01-01T00:00:00.000-03:00",
			"updated_at": "2022-01-01T00:00:00.000-03:00",
			"customer": {
				"id": 1,
				"name": "Fulano Silva Júnior",
				"cpf": "000.000.000-00",
				"cnpj": null,
				"born_at": "1990-01-01",
				"phones": [
					{
						"code": 11,
						"number": 999999999
					},
					{
						"code": 11,
						"number": 988888888
					}
				],
				"emails": [
					{
						"address": "[email protected]"
					}
				]
			},
			"seller": {
				"id": 1,
				"name": "Admin",
				"cpf": "111.111.111-11"
			},
			"state": "aprovada",
			"store": {
				"id": 1,
				"name": "Credere",
				"cnpj": "00.000.000/0001-00"
			},
			"sent_to_bank": true,
			"zero_km": true,
			"commercial": false,
			"creation_external_link_id": null,
			"licensing_uf": "RN"
		}
	}
}

Quando o cliente é criado ou editado

  • Evento: customer_created ou customer_updated
  • Objeto: customer
{
	"event": "customer_updated",
	"customer": {
		"object_type": "Customer",
		"id": 1,
		"created_at": "2022-01-01 00:00:00 -0300",
		"updated_at": "2022-01-11 00:00:00 -0300",
		"name": "Fulano Silva Júnior",
		"cpf": "000.000.000-00",
		"have_bank_account": false,
		"have_credit_card": false,
		"has_made_funding": false,
		"property": 3,
		"public_person": false,
		"born_at": "1990-01-01",
		"rg": "1234567",
		"rg_date": "2003-01-01",
		"rg_state_id": 25,
		"genre_id": 1,
		"mother": "Fulana Silva",
		"education_id": 5,
		"marital_status_id": 1,
		"place_of_birth": "São Paulo",
		"state_of_birth_id": 25,
		"document_type": "RG",
		"rg_issuing": "SSP",
		"cnh": null,
		"cnh_type_id": null,
		"nationality": "Brasileira",
		"note": null,
		"accept_boleto": true,
		"nickname": null,
		"father": "Fulano Silva",
		"has_cnh": false,
		"credit_cards": null,
		"previous_funding_bank_id": null,
		"spouse_name": "Siclana da Silva",
		"spouse_born_at": "1987-01-01",
		"spouse_cpf": "000.000.000-00",
		"state": "valido",
		"creation_external_link_id": null,
		"cnpj": null,
		"joint_stock_cents": null,
		"ie": null,
		"im": null,
		"company_activity_id": null,
		"rg_state": {
			"id": 1,
			"name": "São Paulo",
			"abbreviation": "SP"
		},
		"genre": {
			"id": 1,
			"name": "Masculino"
		},
		"marital_status": {
			"id": 1,
			"name": "Casado",
			"honda_code": "C"
		},
		"education": {
			"id": 1,
			"name": "Ensino Superior",
			"honda_code": "SUP",
			"identifier": "7"
		},
		"state_of_birth": {
			"id": 1,
			"name": "São Paulo",
			"abbreviation": "SP"
		},
		"cnh_type": null,
		"company_activity": null,
		"accountant": null,
		"address": {
			"object_type": "Address",
			"id": 1,
			"created_at": "2022-01-01 00:00:00 -0300",
			"updated_at": "2022-01-01 00:00:00 -0300",
			"city": "São Paulo",
			"complement": "",
			"number": "213",
			"reference": null,
			"street": "Rua Vitorino Carmilo",
			"set_time_month": 1,
			"set_time_year": 18,
			"neighborhood": "Barra Funda",
			"zip_code": "01153-000",
			"rent_value_cents": null,
			"neighbourhood": "Barra Funda",
			"state": {
				"object_type": "State",
				"id": 1,
				"created_at": "2022-01-01 00:00:00 -0300",
				"updated_at": "2022-01-01 00:00:00 -0300",
				"name": "São Paulo",
				"abbreviation": "SP"
			},
			"build_type": {
				"object_type": "BuildType",
				"id": 1,
				"created_at": "2022-01-01 00:00:00 -0300",
				"updated_at": "2022-01-01 00:00:00 -0300",
				"name": "Quitada"
			},
			"address_type": {
				"object_type": "AddressType",
				"id": 1,
				"created_at": "2022-01-01 00:00:00 -0300",
				"updated_at": "2022-01-01 00:00:00 -0300",
				"name": "Principal"
			}
		},
		"job_reference": {
			"object_type": "JobReference",
			"id": 1,
			"created_at": "2022-01-01 00:00:00 -0300",
			"updated_at": "2022-01-11 00:00:00 -0300",
			"joined_at": "2003-02-01",
			"income_cents": 1500000,
			"another_income_type": null,
			"detail": "",
			"department": "RH",
			"name": "Empresa X",
			"cnpj": "",
			"first_job": true,
			"previous_work": null,
			"previous_work_start_at": null,
			"previous_work_end_at": null,
			"previous_job_phone": null,
			"another_income_cents": null,
			"address": {
				"object_type": "Address",
				"id": 1,
				"created_at": "2022-01-01 00:00:00 -0300",
				"updated_at": "2022-01-01 00:00:00 -0300",
				"city": "São Paulo",
				"complement": null,
				"number": "341",
				"reference": null,
				"street": "Rua Vitorino Carmilo",
				"set_time_month": null,
				"set_time_year": null,
				"neighborhood": "Barra Funda",
				"zip_code": "01153-000",
				"rent_value_cents": null,
				"neighbourhood": "Barra Funda",
				"state": {
					"object_type": "State",
					"id": 1,
					"created_at": "2022-01-01 00:00:00 -0300",
					"updated_at": "2022-01-01 00:00:00 -0300",
					"name": "São Paulo",
					"abbreviation": "SP"
				},
				"build_type": null,
				"address_type": {
					"object_type": "AddressType",
					"id": 1,
					"created_at": "2022-01-01 00:00:00 -0300",
					"updated_at": "2022-01-01 00:00:00 -0300",
					"name": "Comercial"
				}
			},
			"phone": {
				"object_type": "Phone",
				"id": 1,
				"created_at": "2022-01-01 00:00:00 -0300",
				"updated_at": "2022-01-01 00:00:00 -0300",
				"code": 11,
				"number": 999999999,
				"talk_to": null,
				"phone_type": {
					"object_type": "PhoneType",
					"id": 1,
					"created_at": "2022-01-01 00:00:00 -0300",
					"updated_at": "2022-01-01 00:00:00 -0300",
					"name": "Comercial"
				},
				"phone_confirmation": null
			},
			"profession": {
				"object_type": "Profession",
				"id": 1,
				"created_at": "2022-01-01 00:00:00 -0300",
				"updated_at": "2022-01-01 00:00:00 -0300",
				"name": "ADMINISTRADOR",
				"identifier": "administrador"
			},
			"company_activity": {
				"object_type": "CompanyActivity",
				"id": 1,
				"created_at": "2022-01-01 00:00:00 -0300",
				"updated_at": "2022-01-01 00:00:00 -0300",
				"name": "Serviços"
			},
			"professional_ocupation": {
				"object_type": "ProfessionalOcupation",
				"id": 1,
				"created_at": "2022-01-01 00:00:00 -0300",
				"updated_at": "2022-01-01 00:00:00 -0300",
				"name": "Assalariado",
				"identifier": "1"
			}
		},
		"previous_funding_bank": null,
		"addresses": [],
		"bank_references": [],
		"emails": [
			{
				"object_type": "Email",
				"id": 1,
				"created_at": "2022-01-01 00:00:00 -0300",
				"updated_at": "2022-01-01 00:00:00 -0300",
				"address": "[email protected]"
			}
		],
		"guarantors": [],
		"personal_references": [
			{
				"object_type": "PersonalReference",
				"id": 1,
				"created_at": "2022-01-01 00:00:00 -0300",
				"updated_at": "2022-01-01 00:00:00 -0300",
				"name": "Fulano Siclano",
				"relationship": "Amigo(a)",
				"city": "São Paulo",
				"phone": {
					"object_type": "Phone",
					"id": 1,
					"created_at": "2022-01-01 00:00:00 -0300",
					"updated_at": "2022-01-01 00:00:00 -0300",
					"code": 11,
					"number": 999999999,
					"talk_to": null,
					"phone_type": {
						"object_type": "PhoneType",
						"id": 1,
						"created_at": "2022-01-01 00:00:00 -0300",
						"updated_at": "2022-01-01 00:00:00 -0300",
						"name": "Principal"
					},
					"phone_confirmation": null
				}
			}
		],
		"phones": [
			{
				"object_type": "Phone",
				"id": 1,
				"created_at": "2022-01-01 00:00:00 -0300",
				"updated_at": "2022-01-01 00:00:00 -0300",
				"code": 11,
				"number": 999999999,
				"talk_to": null,
				"phone_type": {
					"object_type": "PhoneType",
					"id": 1,
					"created_at": "2022-01-01 00:00:00 -0300",
					"updated_at": "2022-01-01 00:00:00 -0300",
					"name": "Principal"
				},
				"phone_confirmation": null
			},
			{
				"object_type": "Phone",
				"id": 1,
				"created_at": "2022-01-01 00:00:00 -0300",
				"updated_at": "2022-01-01 00:00:00 -0300",
				"code": 11,
				"number": 999999999,
				"talk_to": null,
				"phone_type": {
					"object_type": "PhoneType",
					"id": 1,
					"created_at": "2022-01-01 00:00:00 -0300",
					"updated_at": "2022-01-01 00:00:00 -0300",
					"name": "Celular"
				},
				"phone_confirmation": null
			}
		],
		"attachments": [],
		"monthly_billings": [],
		"partners": []
	}
}

Status de proposta

Aqui estão apresentados os possíveis status que podem ser retornados no parâmetro state nas alterações da tentativa de proposta e da proposta.

StatusSignificado
análiseEm análise pelo banco
aprovadaAprovado e autorizado
pendentePendente de revisão ou documento
pré_aprovadaPré-aprovada pendente de alguma informação
recusadaRecusado ou rejeitado
restriçãoRestrito por limitações ou condições específicas
desistenciaDescartado ou ignorado
faturadaFaturado ou cobrado