IF Transactions
Endpoint to add fan transactions to the system.
📥 Postman Collection
URLs
| Method | URL | Action | Description |
|---|---|---|---|
| POST | /api/v2/IF_ID_Batch | Register | Adds fan transactions to the system |
Production:
{connect-producao}/api/v2/IF_ID_BatchStaging:
{connect-homologacao}/api/v2/IF_ID_BatchAuthentication
All requests require an access token obtained from the Security endpoint. The token must be sent in the AccessToken header.
Add Transactions
Request
Endpoint: POST {connect-producao}/api/v2/IF_ID_Batch
Headers:
AccessToken: {access_token}
Content-Type: application/jsonBody:
json
[
{
"userCode": "12345678900",
"userCodeType": 1,
"system": 0,
"name": "John Silva",
"email": "john@example.com",
"emailVerified": true,
"cpf": "12345678900",
"gender": "M",
"birthday": "15/08/1980",
"mobile": "+5511999999999",
"phone": "+5511888888888",
"addr1": "Example Street",
"addr2": "Apt 101",
"addrNumber": 123,
"addr3": "Downtown",
"addrCity": "São Paulo",
"addrState": "SP",
"addrZip": "01234567",
"addrCountry": "31",
"transactions": [
{
"externalCode": "SALE-001",
"date": "2025-09-20T18:41:31.219Z",
"type": 1,
"productType": 1,
"productDesc": "Example Product",
"productExternalCode": "PROD-001",
"qty": 2,
"value": 100.00,
"channel": "Online Store",
"deliveryMode": "Delivery",
"priceType": "Normal",
"cupon": "DISCOUNT10",
"paymentMode": "Credit Card",
"complement": "{\"line\": 1}",
"discount": "Discount coupon",
"discountValue": 10.00
}
]
}
]Body Fields
Buyer Data
| Field | Type | Required | Description |
|---|---|---|---|
userCode | string | Yes | Buyer's CPF or email |
userCodeType | number | Yes | Code type: 1 for CPF, 4 for email |
system | number | Yes | Source system (defined by Fanbase) |
name | string | Yes | Buyer's name |
email | string | Yes | Buyer's email |
emailVerified | boolean | Yes | Indicates if email was verified |
cpf | string | Yes | Buyer's CPF |
gender | string | No | Gender: M/F/O/null |
birthday | string | No | Date of birth (format DD/MM/YYYY) |
mobile | string | No | Mobile phone |
phone | string | No | Alternative phone |
addr1 | string | No | Street |
addr2 | string | No | Complement |
addrNumber | number | No | House number |
addr3 | string | No | Neighborhood |
addrCity | string | No | City |
addrState | string | No | State (2 digits: SP/DF/etc) |
addrZip | string | No | ZIP code |
addrCountry | string | No | Country numeric code |
Transactions
| Field | Type | Required | Description |
|---|---|---|---|
externalCode | string | Yes | Unique transaction code in source system |
date | datetime | Yes | Transaction date (ISO 8601) |
type | number | Yes | Type: 1 (sale), 2 (return), 161 (coupon used), 162 (coupon not used) |
productType | number | Yes | Type: 1 (product), 2 (service) |
productDesc | string | Yes | Product description |
productPrice | number | No | Obsolete - ignore |
productExternalCode | string | Yes | Product code in source system |
qty | number | Yes | Quantity |
value | number | Yes | Product unit value |
channel | string | Yes | Sales channel (e.g., store name) |
deliveryMode | string | Yes | Delivery mode |
priceType | string | Yes | Price type |
cupon | string | No | Discount coupon code |
paymentMode | string | Yes | Payment mode (e.g., Credit Card, Pix) |
complement | string | No | Complementary data (JSON string) |
discount | string | No | Discount reason |
discountValue | number | No | Discount value |
Success Response
Status: 200 OK
json
{
"header": {
"codigo": 1,
"msg": "Transactions processed successfully"
},
"data": {
"total": 1,
"processadas": 1,
"erros": 0
}
}Implementation Example
javascript
async function addTransactions(transactions, accessToken) {
const response = await fetch('{connect-producao}/api/v2/IF_ID_Batch', {
method: 'POST',
headers: {
'AccessToken': accessToken,
'Content-Type': 'application/json'
},
body: JSON.stringify(transactions)
});
if (!response.ok) {
throw new Error(`Error ${response.status}: ${response.statusText}`);
}
return await response.json();
}