Autorização - Jornada 2

A Jornada 2 consiste na geração de um QR Code de recorrência vinculado a uma location do tipo 'REC'. Há duas formas de criar essa location:

  • Cenário 1: Criação Independente: Configure a location primeiro e, em seguida, associe-a a um QR Code existente.
  • Cenário 2 :Criação Simultânea: Gere o QR Code e sua respectiva location ao mesmo tempo.

Uma vez que o QR Code é criado e enviado ao pagador, ele fará a leitura e poderá aceitar ou recusar a transação. Assim que o pagador tomar sua decisão (aceite ou recusa), o webhook 'completed' é automaticamente enviado ao recebedor.



⚠️

Para adesões de Pix Automático através da Jornada 2, não existe fluxo de pagamento realizado na hora, somente a adesão para cobranças futuras.



Cenário 1: Criação e associação de um location a um QR Code.


Passos para Integrar


  1. Autenticar na API: Obtenha o token de autenticação. - [API Reference]
  2. Criar o Location: Registre o novo location - [Reference]
  3. Criar e Vincular a Jornada 2: Associe a jornada 2 ao location recém-criado - [API Reference]
  4. Receber Webhook de Resposta: Aguarde o webhook com a confirmação ou negação da solicitação.


Fluxo de integração - Jornada 2 - Autorização da Recorrência - Cenário 1


Solicita a criação do location

JSON de Exemplo

{
 "clientRequestId": "a016bc8bd89a4f62be995fa0ebb91d77",
  "type": "COB" | "COBV" | "REC" | "COBR" | "COBVR",
  "merchant": {
    "postalCode": "01201005",
    "city": "Barueri",
    "merchantCategoryCode": 0,
    "name": "Celcoin"
  }
}

cURL da chamada

curl --location --request POST 'https://sandbox.openfinance.celcoin.dev/pix/v1/location' \
--header 'accept: application/json' \
--header 'Content-Type: application/json-patch+json' \
--header 'Authorization: Bearer {access_token}' \
--data-raw '{
 "clientRequestId": "a016bc8bd89a4f62be995fa0ebb91d77",
  "type": "COB" | "COBV" | "REC" | "COBR" | "COBVR",
  "merchant": {
    "postalCode": "01201005",
    "city": "Barueri",
    "merchantCategoryCode": 0,
    "name": "Celcoin"
  }
}'

Exemplo de retorno

👍

Sucesso 200

{
 "locationId": 12345,
  "status": "ACTIVE",
     "clientRequestId": "dc8de35155df4cf6a86c6cf960b797cb",
     "url": "qrcode-h.teste.com.brv1/location/cob/dc8de35155df4cf6a86c6cf960b797cb",
     "emv": "00020101021226930014br.gov.bcb.pix2571qrcode-   h.teste.com.brv1/location/cob/dc8de35155df4cf6a86c6cf960b797cb5204000053039865802BR5907Celcoin6007Barueri623605322b39d30a0dc84ed9bb9d0d79261af1076404D1B6",
  "type": "COB" | "COBV" | "REC" | "COBR" | "COBVR",
  "merchant": {
    "postalCode": "01201005",
    "city": "Barueri",
    "merchantCategoryCode": 0,
    "name": "Celcoin"
  },
 "recurrencyUrl": "qrcode-h.teste.com.brv1/location/cob/dc8de35155df4cf6a86c6cf960b797cb"
}

Error 400

{
  "version": "1.0.0",
  "status": 400,
  "error": {
    "errorCode": "",
    "message": ""
  }
}

Associar o location tipo REC a um novo QR Code de recorrência



JSON de Exemplo

{
    "locationId": 1234567890123456789,
    // Os campos recurrencyId e recurrency são mutuamente excludentes
    "recurrencyId": " RRxxxxxxxxyyyyMMddkkkkkkkkkkk",
    "recurrency": {
        "interval": {
            "start": "2025-07-07T13:00:00-03:00",
            "end": "2026-07-07T13:00:00-03:00",
            "frequencyType": "(WEEKLY|MONTHLY|QUARTER|SEMESTER|YEARLY)"
        },
        "amount": 299.90,
        "creditParty": {
            "branch": "0001",
            "account": "123456",
            "bank": "1122112",
            "taxId": "01234567000189",
            "name": "Comércio Digital Ltda."
        },
        "debitParty": {
            "personType": "NATURAL_PERSON",
            "taxId": "98765432100",
            "bank": "12345678",
            "branch": "0001",
            "account": "11223-4"
        },
        "debtor": {
            "personType": "LEGAL_PERSON",
            "taxId": "09876543000121",
            "name": "Pague Tudo Serviços S.A."
        },
        "contract": {
            "number": "CONTRATO-2025-ABCD",
            "description": "Assinatura mensal de plataforma"
        },
        "allowsNewAttemptsAfterExpiration": true,
        "maxValueFloor": 40.00,
        "allowAutoSendingPaymentInstructions": false
    }
}

cURL da chamada

curl --location --request POST 'https: //sandbox.openfinance.celcoin.dev/baas/v2/recurrencies/journey2' \
--header 'accept: application/json' \
--header 'Content-Type: application/json-patch+json' \
--header 'Authorization: Bearer {access_token
}' \
--data-raw '{
    "locationId": 1234567890123456789,
    "recurrencyId": " RRxxxxxxxxyyyyMMddkkkkkkkkkkk",
    "recurrency": {
        "interval": {
            "start": "2025-07-07T13:00:00-03:00",
            "end": "2026-07-07T13:00:00-03:00",
            "frequencyType": "(WEEKLY|MONTHLY|QUARTER|SEMESTER|YEARLY)"
        },
        "amount": 299.90,
        "creditParty": {
            "branch": "0001",
            "account": "123456",
            "bank": "0000000",
            "taxId": "01234567000189",
            "name": "Comércio Digital Ltda."
        },
        "debitParty": {
            "personType": "NATURAL_PERSON",
            "taxId": "98765432100",
            "bank": "00000000",
            "branch": "0001",
            "account": "11223-4"
        },
        "debtor": {
            "personType": "LEGAL_PERSON",
            "taxId": "09876543000121",
            "name": "Pague Tudo Serviços S.A."
        },
        "contract": {
            "number": "CONTRATO-2025-ABCD",
            "description": "Assinatura mensal de plataforma"
        },
        "allowsNewAttemptsAfterExpiration": true,
        "maxValueFloor": 40.00,
        "allowAutoSendingPaymentInstructions": false
    }
}'

Exemplo de retorno

👍

Sucesso 200

{
    "status": 200,
    "version": "1.0.0",
    "body": {
        "recurrencyId": "RR1234567820250607130155000",
        "interval": {
            "start": "2025-07-01T09:00:00-03:00",
            "end": "2026-06-30T09:00:00-03:00",
            "frequencyType": "MONTHLY"
        },
        "status": "CREATED",
        "journeys": [
            {
                "status": "PENDING",
                "type": 2,
                "createDate": "2025-06-07T10:00:00-03:00"
            }
        ],
        "amount": 550.00,
        "creditParty": {
            "branch": "0001",
            "account": "123456",
            "bank": "00000000",
            "taxId": "00112233000144",
            "name": "Loja Fictícia Ltda."
        },
        "debitParty": {
            "personType": "LEGAL_PERSON",
            "taxId": "11223344000155",
            "bank": "00000000",
            "branch": "0001",
            "account": "55443-2"
        },
        "debtor": {
            "personType": "NATURAL_PERSON",
            "taxId": "99988877766",
            "name": "Mariana Souza"
        },
        "contract": {
            "number": "CONTRATO-REC-2025-005",
            "description": "Pagamento de mensalidade de serviço online"
        },
        "allowsNewAttemptsAfterExpiration": true,
        "maxValueFloor": 800.00,
        "createDate": "2025-06-07T09:45:00-03:00",
        "allowAutoSendingPaymentInstructions": true,
        "location": {
            "merchant": {
                "postalCode": "06454000",
                "city": "Barueri",
                "merchantCategoryCode": 5411,
                "name": "Mercado Fictício"
            },
            "url": "https://url.ficticia.com/local/venda/123",
            "emv": "some_emv_data_string",
            "type": "STATIC_QR_CODE",
            "locationId": "LOC123456789",
            "id": "ID987654321",
            "recurrencyUrl": "https://qrcode-h.teste.com.br/v1/location/cob/dc8de35155df4cf6a86c6cf960b797cb"
        }
    }
}

Error 400

{
  "version": "1.0.0",
  "status": 400,
  "error": {
    "errorCode": "",
    "message": ""
  }
}


Cenário 2 - Criar o QR Code e o location simultaneamente.


Passos para Integrar

  1. Autenticar na API: Obtenha o token de autenticação. - [API Reference]
  2. Criando a Jornada 2: Local e QR Code Simultaneamente - [API Reference]
  3. Receber Webhook de Resposta: Aguarde o webhook com a confirmação ou negação da solicitação.

Fluxo de integração - Jornada 2 - Autorização da Recorrência - Cenário 2



Solicita a criação da jornada 2 + location

JSON de Exemplo

{
    "location": {
        "clientRequestId": "a016bc8bd89a4f62be995fa0ebb91d77",
        "merchant": {
            "postalCode": "01201005",
            "city": "Barueri",
            "merchantCategoryCode": 0,
            "name": "Celcoin"
        }
    }, // Os campos recurrencyId e recurrency são mutuamente excludentes
    "recurrencyId": " RRxxxxxxxxyyyyMMddkkkkkkkkkkk",
    "recurrency": {
        "interval": {
            "start": "2025-07-07T13:00:00-03:00",
            "end": "2026-07-07T13:00:00-03:00",
            "frequencyType": "(WEEKLY|MONTHLY|QUARTER|SEMESTER|YEARLY)"
        },
        "amount": 299.90,
        "creditParty": {
            "branch": "0001",
            "account": "123456",
            "bank": "1122112",
            "taxId": "01234567000189",
            "name": "Comércio Digital Ltda."
        },
        "debitParty": {
            "personType": "NATURAL_PERSON",
            "taxId": "98765432100",
            "bank": "12345678",
            "branch": "0001",
            "account": "11223-4"
        },
        "debtor": {
            "personType": "LEGAL_PERSON",
            "taxId": "09876543000121",
            "name": "Pague Tudo Serviços S.A."
        },
        "contract": {
            "number": "CONTRATO-2025-ABCD",
            "description": "Assinatura mensal de plataforma"
        },
        "allowsNewAttemptsAfterExpiration": true,
        "maxValueFloor": 40.00,
        "allowAutoSendingPaymentInstructions": false
    }
}

cURL da chamada

curl --location --request POST 'https://sandbox.openfinance.celcoin.dev/baas/v2/recurrencies/journey2' \
--header 'accept: application/json' \
--header 'Content-Type: application/json-patch+json' \
--header 'Authorization: Bearer {access_token}' \
--data-raw '{
    "location": {
        "clientRequestId": "a016bc8bd89a4f62be995fa0ebb91d77",
        "merchant": {
            "postalCode": "01201005",
            "city": "Barueri",
            "merchantCategoryCode": 0,
            "name": "Celcoin"
        }
    }, // Os campos recurrencyId e recurrency são mutuamente excludentes
    "recurrencyId": " RRxxxxxxxxyyyyMMddkkkkkkkkkkk",
    "recurrency": {
        "interval": {
            "start": "2025-07-07T13:00:00-03:00",
            "end": "2026-07-07T13:00:00-03:00",
            "frequencyType": "(WEEKLY|MONTHLY|QUARTER|SEMESTER|YEARLY)"
        },
        "amount": 299.90,
        "creditParty": {
            "branch": "0001",
            "account": "123456",
            "bank": "1122112",
            "taxId": "01234567000189",
            "name": "Comércio Digital Ltda."
        },
        "debitParty": {
            "personType": "NATURAL_PERSON",
            "taxId": "98765432100",
            "bank": "12345678",
            "branch": "0001",
            "account": "11223-4"
        },
        "debtor": {
            "personType": "LEGAL_PERSON",
            "taxId": "09876543000121",
            "name": "Pague Tudo Serviços S.A."
        },
        "contract": {
            "number": "CONTRATO-2025-ABCD",
            "description": "Assinatura mensal de plataforma"
        },
        "allowsNewAttemptsAfterExpiration": true,
        "maxValueFloor": 40.00,
        "allowAutoSendingPaymentInstructions": false
    }
}'

Exemplo de retorno

👍

Sucesso 200

{
    "status": 200,
    "version": "1.0.0",
    "body": {
        "recurrencyId": "RR1234567820250607130155000",
        "interval": {
            "start": "2025-07-01T09:00:00-03:00",
            "end": "2026-06-30T09:00:00-03:00",
            "frequencyType": "MONTHLY"
        },
        "status": "CREATED",
        "journeys": [
            {
                "status": "PENDING",
                "type": 2,
                "createDate": "2025-06-07T10:00:00-03:00"
            }
        ],
        "amount": 550.00,
        "creditParty": {
            "branch": "0001",
            "account": "123456",
            "bank": "00000000",
            "taxId": "00112233000144",
            "name": "Loja Fictícia Ltda."
        },
        "debitParty": {
            "personType": "LEGAL_PERSON",
            "taxId": "11223344000155",
            "bank": "00000000",
            "branch": "0001",
            "account": "55443-2"
        },
        "debtor": {
            "personType": "NATURAL_PERSON",
            "taxId": "99988877766",
            "name": "Mariana Souza"
        },
        "contract": {
            "number": "CONTRATO-REC-2025-005",
            "description": "Pagamento de mensalidade de serviço online"
        },
        "allowsNewAttemptsAfterExpiration": true,
        "maxValueFloor": 800.00,
        "createDate": "2025-06-07T09:45:00-03:00",
        "allowAutoSendingPaymentInstructions": true,
        "location": {
            "merchant": {
                "postalCode": "06454000",
                "city": "Barueri",
                "merchantCategoryCode": 5411,
                "name": "Mercado Fictício"
            },
            "url": "https://url.ficticia.com/local/venda/123",
            "emv": "some_emv_data_string",
            "type": "STATIC_QR_CODE",
            "locationId": "LOC123456789",
            "id": "ID987654321",
            "recurrencyUrl": "https://qrcode-h.teste.com.br/v1/location/cob/dc8de35155df4cf6a86c6cf960b797cb"
        }
    }
}

Error 400

{
  "version": "1.0.0",
  "status": 400,
  "error": {
    "errorCode": "",
    "message": ""
  }
}


❗️

Nenhum fluxo de Pix Automático garante ao Recebedor a certeza de recebimento. Em todos os cenários, mesmo que após a adesão, é permitido que o cliente pagador cancele seu consentimento do Pix Automático, que cancele um agendamento ou que o pagamento não seja realizado na data por falta de saldo em conta.


❗️

Esta documentação ainda está sujeita a atualizações. Quando tivermos a versão final publicada, este aviso será removido de todas as páginas.