Integration Testing

The scenarios in this guide are designed for validation and preparation before your integration connects directly to the CCA QA environment. The Sandbox reproduces the same transfer, response, and reversal patterns you will encounter in certification, so you can verify that your Gateway handles each outcome correctly — without touching production or shared QA infrastructure.

Because the Sandbox runs in a controlled environment, you can exercise every case safely and without limits on retries: repeat transfers, reversals, SAF cycles, or error triggers as many times as you need until your client behaviour is stable.

Prerequisite: Run these tests only after your full Endpoints and Webhooks implementation is complete. The scenarios below assume your Gateway can originate transfers, receive asynchronous responses, and process webhook notifications end-to-end. Testing before that foundation is in place will not give meaningful results.


Field conventions

All triggers below refer to fields inside the Send Transfers request body, under document.transactions[], unless stated otherwise.

Path Description
transactions[].amount Transfer amount as a string (e.g. "70000")
transactions[].creditor.account Destination account — send without zero-padding; the Gateway normalizes it
transactions[].creditor.financial_institution Destination FI — Shinkansen fin_id (e.g. "BANCO_BRASIL_CL") or CMF code, same format you use in production
transactions[].creditor.identification.id Destination RUT (e.g. "35600053-6")
transactions[].creditor.account_type "current_account", "savings_account", "cash_account", etc.
transactions[].debtor.financial_institution Origin FI — used for inter-account detection (same FI as creditor)

Rules are evaluated top-to-bottom within each table; the first match wins.

Warning: creditor.account = "111156789" is reserved for the SAF flow. Do not use it in any other test.


Happy path

Send a transfer via Send Transfers whose fields do not match any error trigger below. The outcome arrives asynchronously on your Receives Responses webhook with status approved (CCA 000).

Example payload

{
  "document": {
    "header": {
      "message_id": "d560eb8a-d644-4f12-8ae2-075ac6ee9320",
      "creation_date": "2026-01-15T10:30:00Z",
      "sender": "FINTECH_CL",
      "receiver": "SHINKANSEN"
    },
    "transactions": [
      {
        "transaction_id": "eae6df11-566c-4ef0-bee6-579c361024ff",
        "currency": "CLP",
        "amount": "70000",
        "reference": "Fintech TEF Test",
        "debtor": {
          "name": "Nombre debtor",
          "identification": {
            "id_schema": "CLID",
            "id": "11111111-1"
          },
          "financial_institution": "FINTECH_CL",
          "account": "12345678",
          "account_type": "current_account",
          "customer_type": "individual"
        },
        "creditor": {
          "name": "Nombre creditor",
          "identification": {
            "id_schema": "CLID",
            "id": "20667105-K"
          },
          "financial_institution": "BANCO_DESARROLLO_CL",
          "account": "8514092885",
          "account_type": "cash_account"
        }
      }
    ]
  }
}

Expected webhook: Receives Responses with status approved.


Same-bank transfers (inter-account)

In practice, this is a single transfer that the Sandbox routes through both sides of your integration: the sender (IFO) and the receiver (IFR), as if they were two distinct participants connected to the same Sandbox.

Trigger: debtor.financial_institution and creditor.financial_institution refer to the same institution.

Step-by-step flow

Step API / webhook What happens
1 Send Transfers Your system originates the transfer. Origin and destination are at the same bank.
2 Receives Transfers webhook The Sandbox does not return the final outcome to the IFO yet. It simulates that the transfer reached the destination bank and notifies you as the IFR receiving an incoming credit.
3 Send Transfer Responses Your integration, in the IFR role, processes the incoming webhook and approves or rejects the transfer.
4 Receives Responses webhook The Sandbox forwards the IFR outcome to the IFO side. You see the final result of the transfer from step 1.

What you are testing

  • Send Transfers and Receives Responses (IFO side) work together.
  • Receives Transfers and Send Transfer Responses (IFR side) work together.
  • The same client can act as both sender and receiver on an intra-bank transfer.

Inter-account transfers skip the IFR error-simulation table below. Error triggers only apply to standard cross-institution transfers.


Certification scenarios

Evaluated before account-based error rules.

Response Description Payload trigger (document.transactions[])
Error (state 197) MAC validation failure (cert 13/14) creditor.financial_institution = "BANCO_DE_CHILE_CL" and creditor.account = "197"
approved, ~5 s delay CCA MAC-validation failure certification case creditor.financial_institution = "SCOTIABANK_CL"
approved, immediate Default happy path Any transfer that does not match a trigger above

Simulate transaction errors (IFR)

Send a transfer via Send Transfers with the field values below. The outcome arrives on Receives Responses.

Status CCA Description Payload trigger (document.transactions[])
(protocol) 197 MAC validation failure (cert 13/14) creditor.financial_institution = "BANCO_DE_CHILE_CL" and creditor.account = "197"
approved 000 Delayed approved (cert 13/14) creditor.financial_institution = "SCOTIABANK_CL"
error_creditor_rut_account_relation_invalid 046 Invalid RUT / account relationship creditor.account = "987654321" and creditor.identification.id = "35600053-6"
error_creditor_account_type_disabled 050 Account type not enabled creditor.account = "987654321" and creditor.account_type = "savings_account"
error_creditor_fi_service_unavailable_due_maintenance 038 IFR unavailable (scheduled maintenance) creditor.financial_institution = "BANCO_BRASIL_CL" and creditor.account = "987111111"
error_creditor_fi_offline 091 IFR host unavailable creditor.financial_institution = "BANCO_PARIS_CL" and creditor.account = "987654321"
error_creditor_account_invalid 041 Invalid destination account creditor.account = "987654321"
error_creditor_account_closed 042 Destination account is closed creditor.account = "987654311"
error_creditor_fi_invalid 043 Invalid IFR identifier creditor.financial_institution = "BANCO_BRASIL_CL"
error_creditor_account_not_found 051 Destination account not found creditor.account = "987654111"
error_amount_field_invalid 056 Amount field error amount = "987654321"
error_amount_exceeds_maximum 062 Amount exceeds maximum limit amount = "999999999" (or any value ≥ 999999999)
error_ifr_service_unavailable 063 Service unavailable by IFR creditor.financial_institution = "BANCO_PARIS_CL"
error_creditor_account_over_limits 064 Account with deposit restrictions / over limits creditor.account = "987651111"
error_creditor_account_disabled 017 Destination account disabled for TEF creditor.account = "987611111"

Note: Compound rules (two conditions) take priority over simple ones. For example, creditor.account = "987654321" with creditor.identification.id = "35600053-6" triggers 046 (not 041).

Example — error 041

Change only creditor.account; keep the rest of your payload unchanged:

"creditor": {
  "financial_institution": "BANCO_DESARROLLO_CL",
  "account": "987654321",
  "account_type": "cash_account",
  "identification": { "id_schema": "CLID", "id": "20667105-K" }
}

Expected webhook: Receives Responses with status error_creditor_account_invalid (CCA 041).


Simulated errors from Switch (reversals)

After a transfer times out or fails, your IFO initiates a reversal via Send Reversals. The outcome arrives on Receives Reversal Responses (or the reversal section of your responses webhook, depending on your integration).

Conditional reversals must use reversal reason conditional (code 003). Any other reason returns error_invalid_message (CCA 011) immediately.

The 60-second window is measured from the original transfer timestamp to the reversal request. The deadline is inclusive — a reversal sent exactly 60 seconds after the original transfer is still accepted.

Shinkansen Code CCA Code Description How to trigger
error_invalid_message 011 Invalid message — wrong reversal reason Send reversal with any reason other than conditional (003)
error_reversal_duplicated 014 Duplicated reversal already exists Send a second reversal for the same original_transaction_id after a previously approved reversal response
error_reversal_max_time_conditional 009 Exceeded maximum time to request conditional reversal Send conditional reversal more than 60 seconds after the original transfer
error_reversal_closed_cycle 010 Closed settlement cycle (static stub) Original transfer used creditor.account = "123456789"
error_reversal_nonexistent_transaction 012 Transaction to reverse not found (static stub) Original transfer used creditor.account = "113456789"
error_reversal_transaction_not_approved 013 Original transaction not approved (static stub) Original transfer used creditor.account = "111456789"
approved 000 Default happy path Reversal on any account not matching a stub above

Notes

  • 014 only applies after a previously approved reversal. A prior error rejection (010, 012, 013, etc.) does not block retries.
  • Rows for 010, 012, and 013 are static trigger accounts for deterministic tests — they do not perform real settlement-cycle or IFR-approval lookups.
  • Error 009 applies when the reversal is sent more than 60 seconds after the original transfer — not within 60 seconds.

Store and Forward (SAF)

The SAF flow is a deterministic test artifact for exercising your client’s own Store-and-Forward retry cycle on conditional reversals. It is not a literal model of Switch CCA behaviour.

In production, if the destination IFR does not respond within 11 seconds, the Switch returns reversal error 037 (Time-out). Your IFO client is then expected to retry via its own SAF mechanism (typically starting ~11 s after the transfer, retrying every ~5 s until a terminal response: approved, 013, 014, or 069). The Sandbox does not model the 037 path.

Trigger

Step Field Value
Original transfer transactions[].creditor.account "111156789"

Do not use this account in any other test.

What the Sandbox simulates

Phase API / webhook Behaviour
Transfer Send Transfers Sandbox does not send Receives Responses (simulates missing transfer response). Your client must detect the timeout.
First reversal Send Reversals (reason = conditional / 003) Must arrive within 60 s of the original transfer. Sandbox starts a 30 s timer. No reversal response yet.
Retry while pending Send Reversals (duplicate) Silently ignored — no webhook, no new timer. Test your retry logic.
After 30 s Receives Reversal Responses Error error_reversal_transaction_not_approved (CCA 013) — terminal; stop retrying.
Subsequent reversal Send Reversals (same transaction) Immediate 013 again.
First reversal after 60 s Send Reversals Immediate error_reversal_max_time_conditional (CCA 009) — no 30 s delay.

Terminal responses for your IFO SAF loop: in production you stop on approved, 013, 014, or 069. This Sandbox flow terminates on 013. Error 069 is not simulated.

Exception: if the original transfer used creditor.financial_institution = "SCOTIABANK_CL", the delayed-approved certification rule applies instead — you receive Receives Responses with ~5 s delay rather than a timeout.

Step-by-step

Step Who What happens
0 You → Sandbox Send Transfers with creditor.account = "111156789".
1 Sandbox Accepts the transfer but does not publish Receives Responses.
2 You Detect timeout; Send Reversals with reason conditional (003).
3 Sandbox First reversal within 60 s → 30 s wait, no response yet.
4 You (Optional) Retry reversal while waiting → ignored.
5 Sandbox After 30 s → Receives Reversal Responses with 013.
6 You Any later reversal on the same transaction → immediate 013.

References