REST API v2.5 SYSTEM OPERATIONAL

REST API Documentation

Welcome to the TF API Documentation Hub. Here you'll find complete references for consuming APIs from TF ERP, TF Store, TF Talk, TF Software and other group solutions. Consult endpoints, HTTP methods, authentication parameters and Complete Interconnection in a Single Channel.

account_balance

TF Fiscal API

Brazilian Electronic Invoice (NF-e)

Complete API for issuing, querying and canceling Electronic Invoices (NF-e) in Brazil. Supports automatic tax calculation (ICMS, IPI, PIS/COFINS), XML generation, SEFAZ authorization and integration with management systems. Currently supports invoice issuance for products throughout Brazilian territory.

Base URL (Production)
https://api.tffiscal.com/v1
Authentication
Headers: sign, timestamp, token
Requirements
Valid A1 Digital Certificate

sync_alt System Flow

input Input Data
  • Customer Information
  • Product Data
  • Fiscal Information
  • Transportation Data
settings Processing
  • Data validation
  • Tax calculation
  • XML generation
  • SEFAZ authorization
download Output
  • Invoice XML
  • Invoice PDF
  • DANFE (Auxiliary Document)
  • Authorization status

Main Endpoints

POST /api/company/create
Create new company

Use distributor token (b2b_token) to create company.

GET /api/company/get_list
List all companies

Returns paginated list of registered companies.

GET /api/company/get_detail
Query company details

Parameters (Query)

Field Type Description
company_id string Company unique ID
GET /api/category/get_list
List product categories

Returns all categories available for fiscal classification.

POST /api/invoice/create
Issue new invoice

Main Payload

{
  "company_id": "comp_123456",
  "customer": {
    "document": "123.456.789-09",
    "name": "Example Customer",
    "address": {...}
  },
  "products": [
    {
      "code": "PROD001",
      "description": "Example Product",
      "quantity": 2,
      "unit_price": 150.00,
      "ncm": "85176277"
    }
  ],
  "tax_parameters": {...},
  "payment_parameters": {...}
}
GET /api/invoice/get_list
List invoices

Parameters (Query)

Field Type Description
start_date date Start date (YYYY-MM-DD)
end_date date End date (YYYY-MM-DD)
status string Filter by status
GET /api/invoice/get_detail
Query invoice details

Parameters (Query)

Field Type Description
invoice_id string Invoice unique ID

Response Example

{
  "invoice_id": "nf_789012",
  "access_key": "35210112345678901234567890123456789012345678",
  "status": "AUTHORIZED",
  "issue_date": "2024-01-10T10:30:00Z",
  "xml_url": "https://storage.tffiscal.com/xml/nf_789012.xml",
  "pdf_url": "https://storage.tffiscal.com/pdf/nf_789012.pdf"
}
POST /api/invoice/refresh
Update invoice status

Queries current status at SEFAZ and updates locally.

POST /api/invoice/cancel
Cancel invoice

Request Payload

{
  "invoice_id": "nf_789012",
  "reason": "Order error"
}
POST /api/invoice/invalid
Invalidate invoice

For invoices with processing errors or duplicates.

vpn_key Authentication

All requests must include the following headers:

Header Type Required Description
Content-Type string Yes application/json;charset=utf-8
sign string Yes Request digital signature
timestamp string Yes Request UTC timestamp
token string Yes Authentication token

Note: To create company and get company list, use distributor token (b2b_token).

Signature Algorithm (SIGN)

static string GetSign(string AppKey, string Path, string bodyString, string timestamp)
{
    string input = AppKey + Path + bodyString + timestamp;
    using (MD5 md5 = MD5.Create())
    {
        byte[] inputBytes = Encoding.UTF8.GetBytes(input);
        byte[] hashBytes = md5.ComputeHash(inputBytes);
        
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < hashBytes.Length; i++)
        {
            sb.Append(hashBytes[i].ToString("x2"));
        }
        return sb.ToString();
    }
}

percent Tax Parameters

scale_balance ICMS Parameters
Taxation Scenario
padrao saida_fora_estado saida_dentro_estado entrada_fora_estado
Tax Situation
00: Input with credit recovery
01: Taxed input with zero rate
02: Exempt input
49: Other inputs
pie_chart PIS/COFINS Parameters
Taxation Scenario
padrao saida_fora_estado saida_dentro_estado entrada_fora_estado
Tax Situation
71: Purchase Operation with Exemption
72: Purchase Operation with Suspension
73: Purchase Operation with Zero Rate
98: Other Input Operations

credit_card Payment Parameters

Payment Indicator
0 Cash
1 Installment
Payment Methods
01 Cash
03 Credit Card
04 Debit Card
Card Brands
01 Visa
02 Mastercard
06 Elo

bug_report XML Troubleshooting

warning Rejection 225 - XML Schema Failure

Occurs when trying to cancel, download XML, invalidate number or make a declaration of an NF-e that was not successfully registered in the SEFAZ database.

1
Verify if the NF-e was authorized (status "Authorized")
2
Re-issue the NF-e if it was not authorized
3
Invalidate number if it was not used
lightbulb SEFAZ Online Validation

Use the official validator to identify XML problems:

https://www.sefaz.rs.gov.br/nfe/nfe-val.aspx

Common problems: Incomplete address, invalid NCM, incorrect value formatting, missing required fields.

business_center

TF ERP API

Enterprise Resource Planning

Integrate financial, accounting and administrative modules. The TF ERP API allows master data synchronization, accounting entries and centralized cash flow management.

Base URL (Production)
https://api.tferp.com/v3
Authentication
OAuth2 Bearer Token
GET /financial/cash-flow
Query Cash Flow

Parameters (Query)

Field Type Description
start_date date Period start
end_date date Period end

Response Example

{
  "balance": 150000.00,
  "entries": [
    { "date": "2023-11-01", "amount": 5000.00, "type": "credit" },
    { "date": "2023-11-02", "amount": -1200.00, "type": "debit" }
  ]
}
payments

TF Pay API

Payment Processing & Financial Transactions

Process payments with multiple methods (card, PIX, boleto, transfer) and securely manage financial transactions. TF Pay API provides full support for authorization, capture, refund and automatic reconciliation integrated with the TF ecosystem.

Base URL (Production)
https://api.tfpay.com/v2
Authentication
JWT Bearer Token

Main Endpoints

POST /payments/create
Create a new payment transaction

Requires JWT authentication with payments:write scope.

Request Payload

JSON
{
  "order_id": "ord_8x92nm",
  "amount": 299.90,
  "currency": "BRL",
  "payment_method": "credit_card",
  "card": {
    "number": "4111111111111111",
    "exp_month": "12",
    "exp_year": "2025",
    "cvc": "123",
    "holder_name": "John Doe"
  },
  "customer": {
    "id": "cus_99aa88",
    "email": "[email protected]"
  }
}

Response Example

JSON
{
  "payment_id": "pay_7d9f2a1b",
  "status": "authorized",
  "authorization_code": "AUTH123456",
  "amount": 299.90,
  "currency": "BRL",
  "created_at": "2023-11-01T10:30:00Z"
}
GET /payments/{payment_id}
Query payment status

Parameters (Path)

Field Type Description
payment_id string Payment unique ID

Response Example

{
  "payment_id": "pay_7d9f2a1b",
  "order_id": "ord_8x92nm",
  "status": "captured",
  "amount": 299.90,
  "currency": "BRL",
  "payment_method": "credit_card",
  "card_last_four": "1111",
  "created_at": "2023-11-01T10:30:00Z",
  "captured_at": "2023-11-01T10:31:00Z",
  "customer": {
    "id": "cus_99aa88",
    "email": "[email protected]"
  }
}
POST /payments/{payment_id}/refund
Refund a payment

Requires JWT authentication with payments:refund scope.

Payload JSON
{
  "amount": 299.90,
  "reason": "product_return"
}
Status Responses: 200 OK 400 Bad Request
GET /transactions
List transactions by period

Parameters (Query)

Field Type Description
start_date date Start date (YYYY-MM-DD)
end_date date End date (YYYY-MM-DD)
status string Filter by status

Response Example

{
  "data": [
    {
      "payment_id": "pay_7d9f2a1b",
      "order_id": "ord_8x92nm",
      "amount": 299.90,
      "status": "captured",
      "payment_method": "credit_card",
      "created_at": "2023-11-01T10:30:00Z"
    }
  ],
  "summary": {
    "total_amount": 299.90,
    "total_transactions": 1,
    "successful": 1,
    "failed": 0
  }
}
storefront

TF Store API

E-commerce & Digital Storefront

Manage catalogs, control inventory in real time and securely process orders. The TF Store API is the heart of ecosystem retail operations.

Base URL (Production)
https://api.tfloja.com/v1
Limits (Rate Limit)
1000 req/min (Standard)

Main Endpoints

GET /products
List Catalog Products

Parameters (Query)

Field Type Description
page int Pagination
category string Category ID filter

Response Example

{
  "data": [
    {
      "id": "prod_8x92nm",
      "name": "TF Smart Watch",
      "price": 299.90,
      "stock": 45
    }
  ]
}
POST /orders
Create New Order

Requires OAuth2 authentication with orders:write scope.

Payload JSON
{
  "customer_id": "cus_99aa88",
  "items": [
    { "product_id": "prod_8x92nm", "quantity": 1 }
  ],
  "payment_method": "credit_card"
}
chat_bubble

TF Talk API

Communication & Chatbot

Unified communication platform. Send messages via WhatsApp, SMS or Email and integrate intelligent chatbots into your customer service.

Base URL
https://api.tftalk.com/v2
Webhooks
Supported (Signature Verification)
POST /messages/send
Send Message

Request Payload

{
  "channel": "whatsapp",
  "recipient": "+5511999998888",
  "content": {
    "type": "text",
    "body": "Hello! Your order has been confirmed."
  }
}

Response (200 OK)

{
  "message_id": "msg_9921828",
  "status": "queued"
}
local_shipping

TF OMS API

Order Management System

Complete Order Management System. Orchestrate orders from multiple channels (omnichannel), manage logistics and reverse logistics.

Base URL
https://api.tfoms.com/v1
Headers
X-Tenant-ID Required
PUT /orders/{id}/status
Update Order Status

Updates the processing status of a specific order in the fulfillment flow.

Parameters (Path)

id string Order UUID

Request Payload

{
  "status": "shipped",
  "tracking_code": "BR123456789TR",
  "carrier": "Correios"
}
dns

TF Software API

SaaS Management & Licensing

API dedicated to software license management, version control and update distribution for group SaaS products.

Base URL
https://api.tfsoftwares.com/v2
Authentication
API Key (Header: X-TF-Key)
POST /licenses/verify
Verify License Validity

Required Headers

  • Content-Type application/json
  • X-TF-Key your_api_key

Request Payload

{
  "license_key": "XXXX-YYYY-ZZZZ",
  "machine_id": "hw_82738273",
  "product_code": "tf_crm_v1"
}
storefront

TF Shop API

E-commerce & Order Management

API dedicated to virtual store management, orders, payments and products. Allows creating orders, querying purchase status and integrating external systems into the TF Shop ecosystem.

Base URL
https://api.tfshop.com/v1
Authentication
API Key (Header: X-TF-Key)
POST /orders/create
Create New Order

Required Headers

  • Content-Type application/json
  • X-TF-Key your_api_key

Request Payload

{
  "customer_id": "cus_392018",
  "items": [
    {
      "product_id": "prd_001",
      "quantity": 2
    }
  ],
  "payment_method": "card",
  "currency": "AOA"
}
              
warehouse

TF WMS API

Warehouse & Inventory Management

API focused on warehouse management and inventory control. Allows registering product entries and exits, tracking stock in real time and querying detailed logistics reports.

Base URL
https://api.tfwms.com/v1
Sandbox Environment
https://sandbox.api.tfwms.com/v1
POST /inventory/entries
Register Product Entry into Warehouse
Status Responses: 201 Created 400 Bad Request
{
  "message": "Product entry registered successfully.",
  "entry_id": "ent_98451234",
  "warehouse_id": "wh_0021",
  "created_at": "2025-01-12T10:45:00Z"
}