Skip to main content

Overview

Bank accounts represent the branch’s bank accounts used for receiving transfer payments in cash adjustments and expenses. Account numbers and CLABE are stored in masked format for security.

Create Bank Account

POST /api/v1/bank-accounts

Request Body

branch_id
integer
required
Branch ID that owns the account
alias
string
required
Account alias/nickname (max 255 characters, e.g., “Cuenta BBVA Principal”)
bank_name
string
required
Bank name (max 255 characters, e.g., “BBVA”, “Santander”)
account_number_masked
string
required
Masked account number (max 50 characters, e.g., “****1234”)
clabe_masked
string
Masked CLABE interbancaria (max 22 characters, e.g., “012345************”)
is_active
boolean
default:"true"
Active status
meta
object
Additional metadata

Response

message
string
Success message
data
object
curl -X POST https://api.sushigo.local/api/v1/bank-accounts \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "branch_id": 1,
    "alias": "Cuenta BBVA Principal",
    "bank_name": "BBVA",
    "account_number_masked": "****1234",
    "clabe_masked": "012345************",
    "is_active": true,
    "meta": {
      "currency": "MXN",
      "account_type": "CHECKING"
    }
  }'
{
  "message": "Bank account created successfully",
  "data": {
    "id": 1,
    "branch_id": 1,
    "alias": "Cuenta BBVA Principal",
    "bank_name": "BBVA",
    "account_number_masked": "****1234",
    "clabe_masked": "012345************",
    "is_active": true,
    "meta": {
      "currency": "MXN",
      "account_type": "CHECKING"
    },
    "created_at": "2025-12-13T08:00:00+00:00",
    "updated_at": "2025-12-13T08:00:00+00:00",
    "branch": {
      "id": 1,
      "name": "Sucursal Centro"
    }
  }
}

List Bank Accounts

GET /api/v1/bank-accounts

Query Parameters

branch_id
integer
Filter by branch ID
is_active
boolean
Filter by active status
sort_by
string
default:"alias"
Sort field
sort_order
string
default:"asc"
Sort order: asc or desc
per_page
integer
default:"15"
Items per page

Response

Returns paginated list of bank accounts with branch information.
curl https://api.sushigo.local/api/v1/bank-accounts?branch_id=1&is_active=true \
  -H "Authorization: Bearer YOUR_TOKEN"
{
  "current_page": 1,
  "data": [
    {
      "id": 1,
      "branch_id": 1,
      "alias": "Cuenta BBVA Principal",
      "bank_name": "BBVA",
      "account_number_masked": "****1234",
      "clabe_masked": "012345************",
      "is_active": true,
      "branch": {
        "id": 1,
        "name": "Sucursal Centro"
      }
    },
    {
      "id": 2,
      "branch_id": 1,
      "alias": "Cuenta Santander Secundaria",
      "bank_name": "Santander",
      "account_number_masked": "****5678",
      "clabe_masked": null,
      "is_active": true,
      "branch": {
        "id": 1,
        "name": "Sucursal Centro"
      }
    }
  ],
  "per_page": 15,
  "total": 2
}

Get Bank Account

GET /api/v1/bank-accounts/{id}

Path Parameters

id
integer
required
Bank account ID

Response

data
object
Bank account details with branch information
curl https://api.sushigo.local/api/v1/bank-accounts/1 \
  -H "Authorization: Bearer YOUR_TOKEN"

Update Bank Account

PUT /api/v1/bank-accounts/{id}

Path Parameters

id
integer
required
Bank account ID

Request Body

alias
string
Account alias
bank_name
string
Bank name
account_number_masked
string
Masked account number
clabe_masked
string
Masked CLABE
is_active
boolean
Active status
meta
object
Additional metadata

Response

message
string
Success message
data
object
Updated bank account object
curl -X PUT https://api.sushigo.local/api/v1/bank-accounts/1 \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "alias": "Cuenta BBVA Principal - Actualizada",
    "is_active": true
  }'

Delete Bank Account

Cannot delete a bank account with existing transactions (adjustment lines or expenses). Set is_active to false instead.
DELETE /api/v1/bank-accounts/{id}

Path Parameters

id
integer
required
Bank account ID

Response

message
string
Success message
curl -X DELETE https://api.sushigo.local/api/v1/bank-accounts/1 \
  -H "Authorization: Bearer YOUR_TOKEN"
{
  "message": "Bank account deleted successfully"
}

Security Best Practices

Always mask sensitive account information:

Account Number Masking

Only store last 4 digits visible:
  • Good: ****1234 or ••••1234
  • Bad: 1234567890 (full number)

CLABE Masking

Mexico’s 18-digit CLABE interbancaria:
  • Good: 012345************ (first 6 digits + asterisks)
  • Bad: 012345678901234567 (full CLABE)
The masked format provides enough information to identify accounts while protecting sensitive data.

Common Mexican Banks

BBVA México

Banco Bilbao Vizcaya Argentaria

Santander

Banco Santander México

Banorte

Banco del Norte

HSBC

HSBC México

Citibanamex

Citibank Banamex

Scotiabank

Scotiabank Inverlat

Usage in Transfer Payments

Bank accounts are referenced when recording TRANSFER tender type in:
  1. Cash Adjustments: When customers pay via bank transfer (SPEI, wire transfer)
  2. Cash Expenses: When paying vendors via bank transfer
Example adjustment line with bank account:
{
  "tender_type": "TRANSFER",
  "amount": 1000.00,
  "bank_account_id": 1,
  "reference": "SPEI-1234567890"
}
The reference field typically contains the SPEI tracking number or wire transfer confirmation.

Build docs developers (and LLMs) love