REST API v2.5 SYSTEM OPERATIONAL

Central REST API Documentation

Welcome to the TF API Documentation Hub. Here you find complete references for consuming TF ERP, TF Loja, TF Talk, TF Softwares APIs and other solutions from the TF group. 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, consulting 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 issuing invoices 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
  • Tax Information
  • Transport 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
Get company details

Parameters (Query)

Field Type Description
company_id string Unique company ID
GET /api/category/get_list
List product categories

Returns all available categories 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
Get invoice details

Parameters (Query)

Field Type Description
invoice_id string Unique invoice 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
Refresh invoice status

Checks 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 the 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
standard out_of_state in_state inbound_out_of_state
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
standard out_of_state in_state inbound_out_of_state
Tax Situation
71: Acquisition Operation with Exemption
72: Acquisition Operation with Suspension
73: Acquisition 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 manifest an NF-e that was not successfully registered in the SEFAZ database.

1
Check if the NF-e was authorized (status "Authorized")
2
Reissue 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 synchronization of master data, accounting entries and centralized cash flow management.

Base URL (Production)
https://api.tferp.com/v3
Authentication
OAuth2 Bearer Token

Endpoints

GET /financial/cash-flow
Get Cash Flow

Parameters (Query)

Field Type Desc
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" }
  ]
}
POST /accounting/entries
Register Accounting Entries

Registers accounting entries in the ERP system.

payments

TF Pay API

Payment Processing & Financial Transactions

Process payments with multiple methods (card, PIX, boleto, transfer) and manage financial transactions securely. The TF Pay API offers 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 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"
}
POST /payments/{payment_id}/refund
Refund a payment

Requires JWT authentication with payments:refund scope.

JSON Payload
{
  "amount": 299.90,
  "reason": "product_return"
}
Status Responses: 200 OK 400 Bad Request
storefront

TF Loja API

E-commerce & Digital Storefront

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

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 Desc
page int Pagination
category string Filter ID

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.

JSON Payload
{
  "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)

Endpoints

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"
}
POST /chatbots/respond
Respond via Chatbot

Endpoint for integration with intelligent chatbots.

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

Endpoints

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 Softwares API

SaaS Management & Licensing

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

Base URL
https://api.tfsoftwares.com/v2
Authentication
API Key (Header: X-TF-Key)

Endpoints

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 managing virtual stores, orders, payments and products. Allows creating orders, checking purchase status and integrating external systems with the TF Shop ecosystem.

Base URL
https://api.tfshop.com/v1
Authentication
API Key (Header: X-TF-Key)

Endpoints

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 consulting detailed logistics reports.

Base URL
https://api.tfwms.com/v1
Sandbox Environment
https://sandbox.api.tfwms.com/v1

Endpoints

POST /inventory/entries
Register Product Entry in 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"
}