Digital Onboarding

Última atualização: 6 de Junho de 2018

Introdução

O produto Digital Onboarding contempla API's para o envio de transações e arquivos vinculados e operações relacionadas a tokenização.

Transações

Envio

Requisição
POST https://api.clearsale.com.br/v1/digitalonboarding/transaction HTTP/1.1
Content-Type: application/json
Accept:application/json
Authorization: Bearer {Token}
{
	"name": "teste",
	"email": "teste@teste.com",
    "documentType": "cpf",
	"document": "12345678912",
	"zipCode": "12345000",
	"phone": "5511991919191"
}
POST https://homologacao.clearsale.com.br/api/v1/digitalonboarding/transaction HTTP/1.1
Content-Type: application/json
Accept:application/json
Authorization: Bearer {Token}
{
	"name": "teste",
	"email": "teste@teste.com",
    "documentType": "cpf",
	"document": "12345678912",
	"zipCode": "12345000",
	"phone": "5511997979922"
}
Resposta
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
	"id": 9958
	"status": "SAF",
    "name": "teste",
	"email": "teste@teste.com",
    "documentType": "cpf",
	"document": "12345678912",
	"zipCode": "12345000",
	"phone": "5511991919191",
	"creationDate": "2018-06-05T10:44:35.4920397-03:00"
}

Consulta

Requisição
GET https://api.clearsale.com.br/v1/digitalonboarding/transaction/{id} HTTP/1.1
Content-Type: application/json
Authorization: Bearer {Token}
GET https://homologacao.clearsale.com.br/api/v1/digitalonboarding/transaction/{id} HTTP/1.1
Content-Type: application/json
Authorization: Bearer {Token}
Resposta
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
	"id": 9958
	"status": "SAF",
    "name": "teste",
	"email": "teste@teste.com",
    "documentType": "cpf",
	"document": "12345678912",
	"zipCode": "12345000",
	"phone": "5511991919191",
	"creationDate": "2018-06-05T10:44:35.4920397-03:00",
	"result": {
		"status": "SAF",
		"signal": "Vermelho",
		"signalDescription": "Severe Analysis Flow",
		"diagnostics": [
			{
				"code": "C01",
				"text": "Invalid Phone Number"
			}
		]
	},
    "files": {
		"selfie": "https://apidata.clearsale.com.br/v1/digitalonboarding/transaction/9958/files/52",
		"document front": "https://apidata.clearsale.com.br/v1/digitalonboarding/transaction/9958/files/53",
		"document back": "https://apidata.clearsale.com.br/v1/digitalonboarding/transaction/9958/files/54"
	}
}                                
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
	"id": 9958
	"status": "SAF",
    "name": "teste",
	"email": "teste@teste.com",
    "documentType": "cpf",
	"document": "12345678912",
	"zipCode": "12345000",
	"phone": "5511991919191",
	"creationDate": "2018-06-05T10:44:35.4920397-03:00",
	"result": {
		"status": "SAF",
		"signal": "Vermelho",
		"signalDescription": "Severe Analysis Flow",
		"diagnostics": [
			{
				"code": "C01",
				"text": "Invalid Phone Number"
			}
		]
	},
    "files": {
		"selfie": "https://homologacao.clearsale.com.br/apidata/v1/digitalonboarding/transaction/9958/files/52",
		"document front": "https://homologacao.clearsale.com.br/apidata/v1/digitalonboarding/transaction/9958/files/53",
		"document back": "https://homologacao.clearsale.com.br/apidata/v1/digitalonboarding/transaction/9958/files/54"
	}
}                     
Status Sigla
Pendente de validação de token PEN
Aprovado APR
Requer fluxo de análise tradicional TAF
Requer fluxo de análise severa SAF
Transação não concluída com token válido NCV
Transação não concluída com token inválido NCI
Transação não concluída por ausência de token NCA

Listar

Requisição
GET https://api.clearsale.com.br/v1/digitalonboarding/transactions?page={page} HTTP/1.1
Content-Type: application/json
Authorization: Bearer {Token}
GET https://homologacao.clearsale.com.br/api/v1/digitalonboarding/transactions?page={page} HTTP/1.1
Content-Type: application/json
Authorization: Bearer {Token}
Resposta
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
  "count": 2,
  "data": [
    {
      "id": 1212,
      "status": "SAF",
      "name": "teste",
      "email": "teste@teste.com",
      "documentType": "cpf",
      "document": "11111111111",
      "zipCode": "11111111",
      "phone": "11999999999",
      "creationDate": "2018-06-05T10:44:35.4920397-03:00",
      "result": {
        "status": "SAF",
        "signal": "Vermelho",
        "signalDescription": "Severe Analysis Flow",
		"diagnostics": [
			{
				"code": "C01",
				"text": "Invalid Phone Number"
			}
		]
      }
    },
    {
      "id": 1313,
      "status": "SAF",
      "name": "teste",
      "email": "teste@teste.com",
      "documentType": "cpf",
      "document": "22222222222",
      "zipCode": "11111111",
      "phone": "11999999999",
      "creationDate": "2018-06-05T10:44:35.4920397-03:00",
      "result": {
        "status": "SAF",
        "signal": "Vermelho",
        "signalDescription": "Severe Analysis Flow",
		"diagnostics": [
			{
				"code": "C01",
				"text": "Invalid Phone Number"
			}
		]
      }
    }
  ]
}
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
  "count": 2,
  "data": [
    {
      "id": 1212,
      "status": "SAF",
      "name": "teste",
      "email": "teste@teste.com",
      "documentType": "cpf",
      "document": "11111111111",
      "zipCode": "11111111",
      "phone": "11999999999",
      "creationDate": "2018-06-05T10:44:35.4920397-03:00",
      "result": {
        "status": "SAF",
        "signal": "Vermelho",
        "signalDescription": "Severe Analysis Flow",
		"diagnostics": [
			{
				"code": "C01",
				"text": "Invalid Phone Number"
			}
		]
      }
    },
    {
      "id": 1313,
      "status": "SAF",
      "name": "teste",
      "email": "teste@teste.com",
      "documentType": "cpf",
      "document": "22222222222",
      "zipCode": "11111111",
      "phone": "11999999999",
      "creationDate": "2018-06-05T10:44:35.4920397-03:00",
      "result": {
        "status": "SAF",
        "signal": "Vermelho",
        "signalDescription": "Severe Analysis Flow",
		"diagnostics": [
			{
				"code": "C01",
				"text": "Invalid Phone Number"
			}
		]
      }
    }
  ]
} 

Consulta resultado da transação

Requisição
GET https://api.clearsale.com.br/v1/digitalonboarding/transaction/{id}/result HTTP/1.1
Content-Type: application/json
Authorization: Bearer {Token}
GET https://homologacao.clearsale.com.br/api/v1/digitalonboarding/transaction/{id}/result HTTP/1.1
Content-Type: application/json
Authorization: Bearer {Token}
Resposta
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
	"status": "SAF",
	"signal": "Vermelho",
	"signalDescription": "Severe Analysis Flow",
	"diagnostics": [
		{
			"code": "C01",
			"text": "Invalid Phone Number"
		}
	]
}
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
	"status": "SAF",
	"signal": "Vermelho",
	"signalDescription": "Severe Analysis Flow",
	"diagnostics": [
		{
			"code": "C01",
			"text": "Invalid Phone Number"
		}
	]
}                     

Alterar

Requisição
PUT https://api.clearsale.com.br/v1/digitalonboarding/transaction/{id} HTTP/1.1
Content-Type: application/json
Accept:application/json
Authorization: Bearer {Token}
{
  "email": "teste@teste.com",
  "zipCode": "01010010",
  "phone": "5511999999999"
}
PUT https://homologacao.clearsale.com.br/api/v1/digitalonboarding/transaction/{id} HTTP/1.1
Content-Type: application/json
Accept:application/json
Authorization: Bearer {Token}
{
  "email": "teste@teste.com",
  "zipCode": "01010010",
  "phone": "5511999999999"
}
Resposta
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
	"id": 9958
	"status": "SAF",
    "name": "teste",
	"email": "teste@teste.com",
    "documentType": "cpf",
	"document": "12345678912",
	"zipCode": "12345000",
	"phone": "5511991919191",
	"creationDate": "2018-06-05T10:44:35.4920397-03:00",
	"result": {
		"status": "SAF",
		"signal": "Vermelho",
		"signalDescription": "Severe Analysis Flow",
		"diagnostics": [
			{
				"code": "C01",
				"text": "Invalid Phone Number"
			}
		]
	},
    "files": {
		"selfie": "https://apidata.clearsale.com.br/v1/digitalonboarding/transaction/9958/files/52",
		"document front": "https://apidata.clearsale.com.br/v1/digitalonboarding/transaction/9958/files/53",
		"document back": "https://apidata.clearsale.com.br/v1/digitalonboarding/transaction/9958/files/54"
	}
}

Arquivos

Requisição
POST https://apidata.clearsale.com.br/v1/digitalonboarding/transaction/{id}/files HTTP/1.1
Content-Type: application/json
Accept:application/json
Authorization: Bearer {Token}
{
	"type": "selfie|idFront|idBack",
	"file": "base64"
}
POST https://homologacao.clearsale.com.br/apidata/v1/digitalonboarding/transaction/{id}/files HTTP/1.1
Content-Type: application/json
Accept:application/json
Authorization: Bearer {Token}
{
	"type": "selfie|idFront|idBack",
	"file": "base64"
}
Resposta
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
	id: 95
	url: "https://apidata.clearsale.com.br/v1/digitalonboarding/transaction/9958/files/95"
}                           
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
	id: 95
	url: "https://homologacao.clearsale.com.br/apidata/v1/digitalonboarding/transaction/9958/files/95"
}                    

Token

Validação

Requisição
POST https://api.clearsale.com.br/v1/digitalonboarding/transaction/{id}/token?token={token} HTTP/1.1
Content-Type: application/json
Authorization: Bearer {Token}
POST https://homologacao.clearsale.com.br/api/v1/digitalonboarding/transaction/{id}/token?token={token} HTTP/1.1
Content-Type: application/json
Authorization: Bearer {Token}
Resposta
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
	"result": "Valid|Invalid|Expired"
}

Reenvio

Requisição
GET https://api.clearsale.com.br/v1/transaction/{id}/resendtoken HTTP/1.1
GET https://homologacao.clearsale.com.br/api/v1/transaction/{id}/resendtoken HTTP/1.1
Resposta
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
	"result": "Sent|Wait|Unavailable|Limit Exceeded",
	"availableIn": 70
}