Skip to main content

Transactions - Examples

Regular​

Most of your transactions will probably be of this type. We divide them into the following categories:

Regular - Price and Quantity Securities​

These operations include the following security types: Banking Bonds, BDRs, COE, Commodities, Corporate Bonds (CRA, CRI, CDCA and Debêntures), Cryptocurrencies, ETFs, FIIs, Funds, Futures, Custom Securities, Government Bonds, Index Options, Stock Forwards, Stock Indexes, Stock Options, Stock Receipts, Stock Rights and Stocks.

Since these are "vanilla" Brazilian securities, you will only need the price and the quantity of the transaction. We will consider the currency to be BRL; therefore, inputting an exchange rate (exchangeRate) will result in an error.

It is worth noting that Banking Bonds (CDBs, LCs, LCAs, LCIs, LFs and similar), Stock Forwards and Custom Securities are securities managed by the Organization, which means that you need to create them before making a transaction with them.

Examples:

To insert transactions, make requests to Create Transaction.

Notes:

Banking Bonds (CDB, LC, LCA, LCI, LF and similar)​

Accepted security identifier type: securityId.

All securities in this group (including DPGE, LCD, LFS, LFSN, LIG, RDB, RDC, P2B Lending and repurchase agreements - Compromissadas) need to be created first, which means that you only need to specify the characteristics of the desired security. In all cases, once it is created, you will receive a new securityId for the specified or derived security, and that securityId is the one to use when creating a transaction.

Create an LCA transaction: 5.00% a.a. using securityId:

// REQUEST
// POST https://core.gorila.com.br/portfolios/{portfolioId}/transactions

{
"type": "REGULAR",
"transactDate": "2020-01-02",
"quantity": 50,
"brokerId": "27652684000162",
"security": {
"id": 63621557
},
"side": "BUY",
"price": 1000
}

This will return a response like this:

//RESPONSE

{
"type": "REGULAR",
"id": "b783dfab-1ea1-40dd-a59d-f7e95d3dfd3b",
"quantity": 50,
"transactDate": "2020-01-02",
"status": "PROCESSING",
"price": 1000,
"side": "BUY",
"security": {
"id": 63621557,
"name": "LCA : 5.00% a.a. (emissor: BANCO TOYOTA DO BRASIL)",
"type": "CORPORATE_BONDS_LCA",
"issuer": "03.215.790/0001-10"
},
"broker": {
"kind": "broker",
"id": "27652684000162",
"name": "GENIAL INVESTIMENTOS",
"taxId": "27.652.684/0001-62",
"country": {
"name": "Brazil",
"symbol": "BR"
}
},
"fees": {},
"createdDate": "2023-07-17T17:37:12.669586Z",
"updatedDate": "2023-07-17T17:37:12.669586Z"
}

BDRs​

Accepted security identifier types: securityId or ISIN.

Creating a transaction for XPBR31 using the ISIN identifier:

// REQUEST
// POST https://core.gorila.com.br/portfolios/{portfolioId}/transactions

{
"type": "REGULAR",
"transactDate": "2023-03-06",
"quantity": 300,
"brokerId": "18945670000146",
"security": {
"isin": "BRXPBRBDR001"
},
"side": "BUY",
"price": 60.00,
"fees": {
"brokerageFee": 1.00,
"exchangeFee": 0.20
}
}

This will return a response like this:

//RESPONSE

{
"type": "REGULAR",
"id": "d110a188-cca6-4ed1-935a-cc92b929b32b",
"quantity": 300,
"transactDate": "2023-03-06",
"status": "PROCESSING",
"price": 60,
"side": "BUY",
"security": {
"id": 57921351,
"isin": "BRXPBRBDR001",
"name": "XPBR31",
"type": "STOCK_BDR",
"assetClass": "STOCKS"
},
"broker": {
"id": "18945670000146",
"name": "INTER DTVM"
},
"fees": {
"brokerageFee": 1,
"exchangeFee": 0.2
},
"createdDate": "2023-04-11T14:02:05.483273Z",
"updatedDate": "2023-04-11T14:02:05.483273Z"
}

COE​

Accepted security identifier type: securityId.

Creating a transaction for Banco XP S.A Jan/2028 using securityId:

// REQUEST
// POST https://core.gorila.com.br/portfolios/{portfolioId}/transactions

{
"type": "REGULAR",
"transactDate": "2023-03-28",
"quantity": 100,
"brokerId": "02332886001178",
"security": {
"id": 62860971
},
"side": "BUY",
"price": 4.97,
"fees": {
"brokerageFee": 1.20,
"exchangeFee": 0.50
}
}

This will return a response like this:

//RESPONSE

{
"type": "REGULAR",
"id": "5fc86485-1924-4cd7-92ed-2d313300b1e3",
"quantity": 100,
"transactDate": "2023-03-28",
"status": "PROCESSING",
"price": 4.97,
"side": "BUY",
"security": {
"id": 62860971,
"name": "COE Banco XP S.A Jan/2028",
"type": "STRUCTURED_COE"
},
"broker": {
"id": "02332886001178",
"name": "XP INVESTIMENTOS CCTVM"
},
"fees": {
"brokerageFee": 1.2,
"exchangeFee": 0.5
},
"createdDate": "2023-04-11T14:17:25.229141Z",
"updatedDate": "2023-04-11T14:17:25.229141Z"
}

Commodities​

Accepted security identifier types: securityId or ISIN.

Creating a transaction for OZ1D using securityId:

// REQUEST
// POST https://core.gorila.com.br/portfolios/{portfolioId}/transactions

{
"type": "REGULAR",
"transactDate": "2023-03-10",
"quantity": 10,
"price": 20,
"brokerId": "18945670000146",
"security": {
"id": 4998484
},
"side": "BUY"
}

This will return a response like this:

//RESPONSE

{
"type": "REGULAR",
"id": "c1ebe1f1-d0da-4586-b450-065ebf15950b",
"quantity": 10,
"transactDate": "2023-03-10",
"status": "PROCESSING",
"price": 20,
"side": "BUY",
"security": {
"id": 4998484,
"isin": "BRBMEFOZ1003",
"name": "OZ1D",
"type": "CURRENCY_COMMODITY",
"assetClass": "CURRENCIES"
},
"broker": {
"id": "18945670000146",
"name": "INTER DTVM"
},
"fees": {},
"createdDate": "2023-05-08T23:35:46.602846Z",
"updatedDate": "2023-05-08T23:35:46.602846Z"
}

Corporate Bonds (CRA, CRI, CDCA, Debêntures)​

Accepted security identifier types: securityId or ISIN.

Creating a transaction for CORPORATE_BONDS_DEBENTURE using securityId:

// REQUEST
// POST https://core.gorila.com.br/portfolios/{portfolioId}/transactions

{
"type": "REGULAR",
"transactDate": "2023-07-13",
"quantity": 10,
"brokerId": "27652684000162",
"security": {
"id": 74580
},
"side": "BUY",
"price": 1082.46,
"fees": {
"brokerageFee": 4.78,
"exchangeFee": 9.54
}
}

This will return a response like this:

//RESPONSE

{
"type": "REGULAR",
"id": "d71843d9-3a74-4654-ad98-30520aa0dc5e",
"quantity": 10,
"transactDate": "2023-07-13",
"status": "PROCESSING",
"price": 1082.46,
"side": "BUY",
"security": {
"id": 74580,
"isin": "BRPETRDBS0C2",
"name": "PETR27",
"type": "CORPORATE_BONDS_DEBENTURE"
},
"broker": {
"kind": "broker",
"id": "27652684000162",
"name": "GENIAL INVESTIMENTOS",
"taxId": "27.652.684/0001-62",
"country": {
"name": "Brazil",
"symbol": "BR"
}
},
"fees": {
"brokerageFee": 4.78,
"exchangeFee": 9.54
},
"createdDate": "2023-07-17T17:23:58.9258Z",
"updatedDate": "2023-07-17T17:23:58.9258Z"
}

Cryptocurrencies​

Accepted security identifier type: securityId.

Creating a transaction for BTC using securityId:

// REQUEST
// POST https://core.gorila.com.br/portfolios/{portfolioId}/transactions

{
"type": "REGULAR",
"transactDate": "2023-03-29",
"quantity": 0.5,
"brokerId": "18945670000146",
"security": {
"id": 128320
},
"side": "BUY",
"price": 76357.50,
"fees": {
"brokerageFee": 0.10,
"exchangeFee": 0.20
}
}

This will return a response like this:

//RESPONSE

{
"type": "REGULAR",
"id": "8948b17f-272d-4279-b09c-fd4a7272586d",
"quantity": 0.5,
"transactDate": "2023-03-29",
"status": "PROCESSING",
"price": 76357.50,
"side": "BUY",
"security": {
"id": 128320,
"name": "BTC",
"type": "CRYPTOCURRENCY",
"assetClass": "CURRENCIES"
},
"broker": {
"id": "18945670000146",
"name": "INTER DTVM"
},
"fees": {
"brokerageFee": 0.1,
"exchangeFee": 0.2
},
"createdDate": "2023-04-11T17:27:38.162076Z",
"updatedDate": "2023-04-11T17:27:38.162076Z"
}

ETFs​

Accepted security identifier types: securityId or ISIN.

Creating a transaction for BOVA11 using isin:

// REQUEST
// POST https://core.gorila.com.br/portfolios/{portfolioId}/transactions

{
"type": "REGULAR",
"transactDate": "2023-03-09",
"quantity": 100,
"brokerId": "18945670000146",
"security": {
"isin": "BRBOVACTF003"
},
"side": "BUY",
"price": 98.66,
"fees": {
"brokerageFee": 0.90,
"exchangeFee": 0.20
}
}

This will return a response like this:

//RESPONSE

{
"type": "REGULAR",
"id": "69e11bf6-11d0-4338-bb74-343c0d254344",
"quantity": 100,
"transactDate": "2023-03-09",
"status": "PROCESSING",
"price": 98.66,
"side": "BUY",
"security": {
"id": 124689,
"isin": "BRBOVACTF003",
"name": "BOVA11",
"type": "STOCK_ETF",
"assetClass": "STOCKS"
},
"broker": {
"id": "18945670000146",
"name": "INTER DTVM"
},
"fees": {
"brokerageFee": 0.9,
"exchangeFee": 0.2
},
"createdDate": "2023-04-11T14:09:25.978651Z",
"updatedDate": "2023-04-11T14:09:25.978651Z"
}

FIIs​

Accepted security identifier types: securityId or ISIN.

Creating a transaction for MXRF11 using isin:

// REQUEST
// POST https://core.gorila.com.br/portfolios/{portfolioId}/transactions

{
"type": "REGULAR",
"transactDate": "2023-03-07",
"quantity": 500,
"brokerId": "18945670000146",
"security": {
"isin": "BRMXRFCTF008"
},
"side": "BUY",
"price": 9.50,
"fees": {
"brokerageFee": 1.00,
"exchangeFee": 0.40
}
}

This will return a response like this:

//RESPONSE

{
"type": "REGULAR",
"id": "776287ce-4b50-4b7e-8e5b-23711578d4df",
"quantity": 500,
"transactDate": "2023-03-07",
"status": "PROCESSING",
"price": 9.5,
"side": "BUY",
"security": {
"id": 123009,
"isin": "BRMXRFCTF008",
"name": "MXRF11",
"type": "FII",
"assetClass": "STOCKS"
},
"broker": {
"id": "18945670000146",
"name": "INTER DTVM"
},
"fees": {
"brokerageFee": 1,
"exchangeFee": 0.4
},
"createdDate": "2023-04-11T13:52:40.17797Z",
"updatedDate": "2023-04-11T13:52:40.17797Z"
}

Funds​

Accepted security identifier types: securityId or CNPJ.

Creating a transaction for GIANT ZARATHUSTRA FC FIM using CNPJ:

// REQUEST
// POST https://core.gorila.com.br/portfolios/{portfolioId}/transactions

{
"type": "REGULAR",
"transactDate": "2023-03-10",
"price": 40,
"quantity": 50,
"brokerId": "18945670000146",
"security": {
"cnpj": "11052478000181"
},
"side": "BUY",
"fees": {
"brokerageFee": 1.20,
"exchangeFee": 0.50
}
}

This will return a response like this:

//RESPONSE

{
"type": "REGULAR",
"id": "ed9dbfd3-bc2c-4223-aa4d-b26d7b08bc4b",
"quantity": 50,
"transactDate": "2023-03-10",
"status": "PROCESSING",
"price": 40,
"side": "BUY",
"security": {
"id": 2407939,
"cnpj": "11052478000181",
"name": "GIANT ZARATHUSTRA FC FIM",
"type": "FUNDQUOTE",
"assetClass": "MULTIMARKET"
},
"broker": {
"id": "18945670000146",
"name": "INTER DTVM"
},
"fees": {
"brokerageFee": 1.2,
"exchangeFee": 0.5
},
"createdDate": "2023-04-12T18:57:44.952726Z",
"updatedDate": "2023-04-12T18:57:44.952726Z"
}

Futures​

Accepted security identifier types: securityId or ISIN.

Creating a transaction for DDIF28 using isin:

// REQUEST
// POST https://core.gorila.com.br/portfolios/{portfolioId}/transactions

{
"type": "REGULAR",
"transactDate": "2023-04-10",
"quantity": 100,
"brokerId": "18945670000146",
"security": {
"isin": "BRBMEFDDI4Z2"
},
"side": "BUY",
"price": 79806.85,
"fees": {
"brokerageFee": 1.20,
"exchangeFee": 0.50
}
}

This will return a response like this:

//RESPONSE

{
"type": "REGULAR",
"id": "550bfd77-977a-4705-aa1f-bb3b25ba5e2b",
"quantity": 100,
"transactDate": "2023-04-10",
"status": "PROCESSING",
"price": 79806.85,
"side": "BUY",
"security": {
"id": 122675,
"isin": "BRBMEFDDI4Z2",
"name": "DDIF28",
"type": "FUTURES",
"assetClass": "STOCKS"
},
"broker": {
"id": "18945670000146",
"name": "INTER DTVM"
},
"fees": {
"brokerageFee": 1.2,
"exchangeFee": 0.5
},
"createdDate": "2023-04-11T19:15:49.628477Z",
"updatedDate": "2023-04-11T19:15:49.628477Z"
}

Custom Securities​

Accepted security identifier type: securityId.

To create a transaction using a custom security, you must first create the security within the scope of your Organization. To learn more about creating and managing custom securities, click here.

After creating a custom security, you can create a transaction using its securityId:

// REQUEST
// POST https://core.gorila.com.br/portfolios/{portfolioId}/transactions

{
"type": "REGULAR",
"transactDate": "2023-03-10",
"quantity": 100,
"price": 20,
"brokerId": "18945670000146",
"security": {
"id": 63621561
},
"side": "BUY"
}

This will return a response like this:

//RESPONSE

{
"type": "REGULAR",
"id": "a1ecef0a-64a5-4f16-8fe3-9dc6f4b0df37",
"quantity": 100,
"transactDate": "2023-03-10",
"status": "PROCESSING",
"price": 20,
"side": "BUY",
"security": {
"id": 63621561,
"name": "Custom Example",
"type": "GENERIC",
"assetClass": "STOCKS"
},
"broker": {
"id": "18945670000146",
"name": "INTER DTVM"
},
"createdDate": "2023-04-12T18:57:44.952726Z",
"updatedDate": "2023-04-12T18:57:44.952726Z"
}

Government Bonds (LFT, LTN, NTN-B, NTN-B1, NTN-C, NTN-F)​

Accepted security identifier types: securityId or ISIN.

Creating a transaction for LTN - 01/01/2029 using isin:

// REQUEST
// POST https://core.gorila.com.br/portfolios/{portfolioId}/transactions

{
"type": "REGULAR",
"transactDate": "2023-04-10",
"quantity": 50,
"brokerId": "18945670000146",
"security": {
"isin": "BRSTNCLTN806"
},
"side": "BUY",
"price": 513.46,
"fees": {
"brokerageFee": 0.10,
"exchangeFee": 0.20
}
}

This will return a response like this:

//RESPONSE

{
"type": "REGULAR",
"id": "a3e1c9d2-6b47-4f0e-9c8a-2d5b7e14f630",
"quantity": 50,
"transactDate": "2023-04-10",
"status": "PROCESSING",
"price": 513.46,
"side": "BUY",
"security": {
"id": 58512279,
"isin": "BRSTNCLTN806",
"name": "LTN - 01/01/2029",
"type": "TREASURY_LOCAL_LTN"
},
"broker": {
"id": "18945670000146",
"name": "INTER DTVM"
},
"fees": {
"brokerageFee": 0.1,
"exchangeFee": 0.2
},
"createdDate": "2023-04-11T14:21:08.517392Z",
"updatedDate": "2023-04-11T14:21:08.517392Z"
}

Index Options​

Accepted security identifier types: securityId or ISIN.

Creating a transaction for IBOVP75 (expiring 2019-04-17) using securityId:

// REQUEST
// POST https://core.gorila.com.br/portfolios/{portfolioId}/transactions

{
"type": "REGULAR",
"transactDate": "2019-02-06",
"quantity": 2,
"brokerId": "18945670000146",
"security": {
"id": 7361157
},
"side": "BUY",
"price": 105645
}

This will return a response like this:

//RESPONSE

{
"type": "REGULAR",
"id": "6b0d469a-4a27-440b-a0a7-3ff43c2fbb1b",
"quantity": 2,
"transactDate": "2019-02-06",
"status": "PROCESSING",
"price": 105645,
"side": "BUY",
"security": {
"id": 7361157,
"isin": "BRIBOV9P0ID1",
"name": "IBOVP75 (Vencimento em 17/04/2019)",
"type": "OPTION_INDEX",
"assetClass": "STOCKS"
},
"broker": {
"id": "18945670000146",
"name": "INTER DTVM"
},
"fees": {},
"createdDate": "2023-05-08T23:41:07.112071Z",
"updatedDate": "2023-05-08T23:41:07.112071Z"
}

Stock Forwards​

Accepted security identifier type: securityId.

Creating a transaction for PETR4 2023-12-20 using securityId:

// REQUEST
// POST https://core.gorila.com.br/portfolios/{portfolioId}/transactions

{
"type": "REGULAR",
"transactDate": "2023-03-28",
"quantity": 100,
"brokerId": "18945670000146",
"security": {
"id": 63594844
},
"side": "BUY",
"price": 11.75
}

This will return a response like this:

//RESPONSE

{
"type": "REGULAR",
"id": "04a17d40-994b-435f-b15b-92be65e85377",
"quantity": 100,
"transactDate": "2023-03-28",
"status": "PROCESSING",
"price": 11.75,
"side": "BUY",
"security": {
"id": 63594844,
"name": "Termo de PETR4",
"type": "FORWARD_STOCK",
"assetClass": "STOCKS"
},
"broker": {
"id": "18945670000146",
"name": "INTER DTVM"
},
"createdDate": "2023-04-11T17:27:38.162076Z",
"updatedDate": "2023-04-11T17:27:38.162076Z"
}

Stock Indexes​

Accepted security identifier types: securityId or ISIN.

Creating a transaction for IBRA11 using isin:

// REQUEST
// POST https://core.gorila.com.br/portfolios/{portfolioId}/transactions

{
"type": "REGULAR",
"transactDate": "2023-03-09",
"quantity": 10,
"brokerId": "18945670000146",
"security": {
"isin": "BRIBRAINDM10"
},
"side": "BUY",
"price": 16.02
}

This will return a response like this:

//RESPONSE

{
"type": "REGULAR",
"id": "fa33365f-843f-42c1-bed8-de7227561c9a",
"quantity": 10,
"transactDate": "2023-03-09",
"status": "PROCESSING",
"price": 16.02,
"side": "BUY",
"security": {
"id": 123819,
"isin": "BRIBRAINDM10",
"name": "IBRA11",
"type": "STOCK_INDEX",
"assetClass": "STOCKS"
},
"broker": {
"id": "18945670000146",
"name": "INTER DTVM"
},
"fees": {},
"createdDate": "2023-05-08T23:45:34.055864Z",
"updatedDate": "2023-05-08T23:45:34.055864Z"
}

Stock Options​

Accepted security identifier types: securityId or ISIN.

Creating a transaction for PETRL30 using isin:

// REQUEST
// POST https://core.gorila.com.br/portfolios/{portfolioId}/transactions

{
"type": "REGULAR",
"transactDate": "2023-04-11",
"quantity": 120,
"brokerId": "18945670000146",
"security": {
"isin": "BRPETR4L1447"
},
"side": "BUY",
"price": 12.53,
"fees": {
"brokerageFee": 1.20,
"exchangeFee": 0.50
}
}

This will return a response like this:

//RESPONSE

{
"type": "REGULAR",
"id": "b5d57cbb-6d34-4286-8510-cb97d6396d52",
"quantity": 120,
"transactDate": "2023-04-11",
"status": "PROCESSING",
"price": 12.53,
"side": "BUY",
"security": {
"id": 62598463,
"isin": "BRPETR4L1447",
"name": "PETRL30 (Vencimento em 20/12/2024)",
"type": "OPTION_LOCAL",
"assetClass": "STOCKS"
},
"broker": {
"id": "18945670000146",
"name": "INTER DTVM"
},
"fees": {
"brokerageFee": 1.2,
"exchangeFee": 0.5
},
"createdDate": "2023-04-11T17:12:34.898052Z",
"updatedDate": "2023-04-11T17:12:34.898052Z"
}

Stock Receipts​

Accepted security identifier type: securityId.

Creating a transaction for GALG13 (Issue date 2022-11-24) using securityId:

// REQUEST
// POST https://core.gorila.com.br/portfolios/{portfolioId}/transactions

{
"type": "REGULAR",
"transactDate": "2023-03-10",
"quantity": 100,
"price": 30,
"brokerId": "18945670000146",
"security": {
"id": 43919971
},
"side": "BUY"
}

This will return a response like this:

//RESPONSE

{
"type": "REGULAR",
"id": "d0dfa140-6949-4c0c-a3fd-10ffc80e10af",
"quantity": 100,
"transactDate": "2023-03-10",
"status": "PROCESSING",
"price": 30,
"side": "BUY",
"security": {
"id": 43919971,
"isin": "BRGALGR08M16",
"name": "GALG13 (Emissão em 24/11/2022)",
"type": "STOCK_RECEIPT",
"assetClass": "STOCKS"
},
"broker": {
"id": "18945670000146",
"name": "INTER DTVM"
},
"fees": {},
"createdDate": "2023-05-08T22:57:29.989154Z",
"updatedDate": "2023-05-08T22:57:29.989154Z"
}

Stock Rights​

Accepted security identifier type: securityId.

Creating a transaction for BRHT12 using securityId:

// REQUEST
// POST https://core.gorila.com.br/portfolios/{portfolioId}/transactions

{
"type": "REGULAR",
"transactDate": "2023-03-10",
"quantity": 1000,
"price": 15,
"brokerId": "18945670000146",
"security": {
"id": 40792064
},
"side": "BUY"
}

This will return a response like this:

//RESPONSE

{
"type": "REGULAR",
"id": "a32c837d-2f30-4b19-8653-07e662713a73",
"quantity": 1000,
"transactDate": "2023-03-10",
"status": "PROCESSING",
"price": 15,
"side": "BUY",
"security": {
"id": 40792064,
"isin": "BRBRHTD01M16",
"name": "BRHT12",
"type": "STOCK_RIGHTS",
"assetClass": "STOCKS"
},
"broker": {
"id": "18945670000146",
"name": "INTER DTVM"
},
"fees": {},
"createdDate": "2023-05-08T23:01:26.869072Z",
"updatedDate": "2023-05-08T23:01:26.869072Z"
}

Stocks​

Accepted security identifier types: securityId or ISIN.

Creating a transaction for PETR4 using securityId:

// REQUEST
// POST https://core.gorila.com.br/portfolios/{portfolioId}/transactions

{
"type": "REGULAR",
"transactDate": "2023-04-10",
"quantity": 1000,
"brokerId": "18945670000146",
"security": {
"id": 122720
},
"side": "BUY",
"price": 24.6,
"fees": {
"brokerageFee": 1.78,
"exchangeFee": 0.54
}
}

This will return a response like this:

//RESPONSE

{
"type": "REGULAR",
"id": "07da89c4-623e-4986-ad58-1629454c3cea",
"quantity": 1000,
"transactDate": "2023-04-10",
"status": "PROCESSING",
"price": 24.6,
"side": "BUY",
"security": {
"id": 122720,
"isin": "BRPETRACNPR6",
"name": "PETR4",
"type": "STOCK_LOCAL",
"assetClass": "STOCKS"
},
"broker": {
"id": "18945670000146",
"name": "INTER DTVM"
},
"fees": {
"brokerageFee": 1.78,
"exchangeFee": 0.54
},
"createdDate": "2023-04-11T13:22:42.310038Z",
"updatedDate": "2023-04-11T13:22:42.310038Z"
}

Regular - Quantity-only Securities​

These transactions include the following security types: Savings Account and Cash.

These are securities that can only be transacted at their closing price (end of day) or that are a Cash transaction, which means that you do not need to input a price when creating a transaction.

Examples:

Savings Account - Poupança​

Accepted security identifier type: securityId.

Creating a Savings Account (Savings) transaction. The securityId will always be 63639335:

// REQUEST
// POST https://core.gorila.com.br/portfolios/{portfolioId}/transactions

{
"type": "REGULAR",
"transactDate": "2023-03-10",
"quantity": 1000,
"brokerId": "18945670000146",
"security": {
"id": 63639335
},
"side": "BUY"
}

This will return a response like this:

//RESPONSE

{
"type": "REGULAR",
"id": "06e9ccda-de6d-4b28-9cc8-19019459baf9",
"quantity": 1000,
"transactDate": "2023-03-10",
"status": "PROCESSING",
"side": "BUY",
"security": {
"id": 63639335,
"name": "Poupança",
"type": "SAVINGS"
},
"broker": {
"id": "18945670000146",
"name": "INTER DTVM"
},
"fees": {},
"createdDate": "2023-05-08T21:51:15.577661Z",
"updatedDate": "2023-05-08T21:51:15.577661Z"
}


Cash (BRL)​

Accepted security identifier type: securityId.

Creating a Cash transaction. The securityId will always be 177223:

// REQUEST
// POST https://core.gorila.com.br/portfolios/{portfolioId}/transactions

{
"type": "REGULAR",
"transactDate": "2023-03-10",
"quantity": 5000,
"brokerId": "18945670000146",
"security": {
"id": 177223
},
"side": "BUY"
}

This will return a response like this:

//RESPONSE

{
"type": "REGULAR",
"id": "44fede0f-c443-414e-a4b8-d45027b1d9e3",
"quantity": 5000,
"transactDate": "2023-03-10",
"status": "PROCESSING",
"side": "BUY",
"security": {
"id": 177223,
"name": "BRL",
"type": "CASH",
"assetClass": "CASH"
},
"broker": {
"id": "18945670000146",
"name": "INTER DTVM"
},
"fees": {},
"createdDate": "2023-04-11T20:52:48.794728Z",
"updatedDate": "2023-04-11T20:52:48.794728Z"
}

Regular - Exchange Rate and Quantity Securities​

These transactions are only valid for the Currencies security type. Currently, we only calculate portfolios in BRL (Brazilian Real) terms. This means that all currency transactions are, by definition, against the Brazilian Real.

Example:

Currencies​

Accepted security identifier type: securityId.

For currencies such as USD, EUR and MXN, inputting a price is not valid, since the price is the exchange rate itself (which is entered in the exchangeRate field).

Creating a transaction for USD using securityId:

// REQUEST
// POST https://core.gorila.com.br/portfolios/{portfolioId}/transactions

{
"type": "REGULAR",
"transactDate": "2023-03-10",
"quantity": 100,
"brokerId": "18945670000146",
"security": {
"id": 130497
},
"side": "BUY",
"exchangeRate": 5.50
}

This will return a response like this:

//RESPONSE

{
"type": "REGULAR",
"id": "5d79c866-da8c-4f02-9a3a-746a7a0a02bb",
"quantity": 100,
"transactDate": "2023-03-10",
"status": "PROCESSING",
"side": "BUY",
"security": {
"id": 130497,
"name": "Dólar",
"type": "CURRENCY",
"assetClass": "CURRENCIES"
},
"broker": {
"id": "18945670000146",
"name": "INTER DTVM"
},
"exchangeRate": 5.5,
"fees": {},
"createdDate": "2023-04-12T19:18:01.50089Z",
"updatedDate": "2023-04-12T19:18:01.50089Z"
}

Regular - Price, Exchange Rate and Quantity Securities​

These transactions include the following security types: Offshore Stocks, Offshore ETFs, Offshore Funds and Offshore REITs.

Gorila currently only supports offshore securities listed in the United States. And, since we calculate portfolios in BRL terms, you will need to specify an exchange rate (exchangeRate) - in addition to the price and quantity - against the Brazilian Real (USDBRL). This means that the price and any fees associated with the transaction, such as the brokerage fee (brokerageFee) and the exchange fee (exchangeFee), need to be expressed in USD.

Example:

Offshore Stocks​

Creating a transaction for AAPL using securityId:

// REQUEST
// POST https://core.gorila.com.br/portfolios/{portfolioId}/transactions

{
"type": "REGULAR",
"transactDate": "2023-03-10",
"quantity": 50,
"brokerId": "18945670000146",
"price": 160,
"security": {
"id": 135889
},
"side": "BUY",
"exchangeRate": 5.15,
"fees": {
"brokerageFee": 1.20,
"exchangeFee": 0.50
}
}

This will return a response like this:

//RESPONSE

{
"type": "REGULAR",
"id": "f2909f3f-18f6-479c-99b1-e52e994c5b73",
"quantity": 50,
"transactDate": "2023-03-10",
"status": "PROCESSING",
"price": 160,
"side": "BUY",
"security": {
"id": 135889,
"name": "AAPL",
"type": "OFFSHORE_STOCK",
"assetClass": "OFFSHORE"
},
"broker": {
"id": "18945670000146",
"name": "INTER DTVM"
},
"exchangeRate": 5.15,
"fees": {
"brokerageFee": 1.2,
"exchangeFee": 0.5
},
"createdDate": "2023-05-08T23:48:47.122086Z",
"updatedDate": "2023-05-08T23:48:47.122086Z"
}

Offshore ETFs​

Creating a transaction for IAUF using securityId:

// REQUEST
// POST https://core.gorila.com.br/portfolios/{portfolioId}/transactions

{
"type": "REGULAR",
"transactDate": "2023-03-10",
"quantity": 30,
"brokerId": "18945670000146",
"price": 20,
"security": {
"id": 132041
},
"side": "BUY",
"exchangeRate": 5.40,
"fees": {
"brokerageFee": 1.00,
"exchangeFee": 0.50
}
}

This will return a response like this:

//RESPONSE

{
"type": "REGULAR",
"id": "8da640c1-9a20-4a62-b334-72e4650bd3e5",
"quantity": 30,
"transactDate": "2023-03-10",
"status": "PROCESSING",
"price": 20,
"side": "BUY",
"security": {
"id": 132041,
"name": "IAUF",
"type": "OFFSHORE_ETF",
"assetClass": "OFFSHORE"
},
"broker": {
"id": "18945670000146",
"name": "INTER DTVM"
},
"exchangeRate": 5.4,
"fees": {
"brokerageFee": 1,
"exchangeFee": 0.5
},
"createdDate": "2023-05-09T00:10:41.394989Z",
"updatedDate": "2023-05-09T00:10:41.394989Z"
}

Offshore Funds​

Creating a transaction for VTIVX using securityId:

// REQUEST
// POST https://core.gorila.com.br/portfolios/{portfolioId}/transactions

{
"type": "REGULAR",
"transactDate": "2023-03-10",
"quantity": 50,
"brokerId": "18945670000146",
"price": 10,
"security": {
"id": 132200
},
"side": "BUY",
"exchangeRate": 4.40,
"fees": {
"brokerageFee": 1.00,
"exchangeFee": 0.80
}
}

This will return a response like this:

//RESPONSE

{
"type": "REGULAR",
"id": "611dd38c-2ebf-43cd-bce5-58239726e054",
"quantity": 50,
"transactDate": "2023-03-10",
"status": "PROCESSING",
"price": 10,
"side": "BUY",
"security": {
"id": 132200,
"name": "VTIVX",
"type": "OFFSHORE_FUNDQUOTE",
"assetClass": "OFFSHORE"
},
"broker": {
"id": "18945670000146",
"name": "INTER DTVM"
},
"exchangeRate": 4.4,
"fees": {
"brokerageFee": 1,
"exchangeFee": 0.8
},
"createdDate": "2023-05-09T00:12:57.911981Z",
"updatedDate": "2023-05-09T00:12:57.911981Z"
}

Offshore REITs​

Creating a transaction for VTR using securityId:

// REQUEST
// POST https://core.gorila.com.br/portfolios/{portfolioId}/transactions

{
"type": "REGULAR",
"transactDate": "2023-03-10",
"quantity": 70,
"brokerId": "18945670000146",
"price": 18,
"security": {
"id": 132580
},
"side": "BUY",
"exchangeRate": 4.53,
"fees": {
"brokerageFee": 0.70,
"exchangeFee": 0.80
}
}

This will return a response like this:

//RESPONSE

{
"type": "REGULAR",
"id": "c4efd5aa-6c56-4d72-a63b-af78bce93539",
"quantity": 70,
"transactDate": "2023-03-10",
"status": "PROCESSING",
"price": 18,
"side": "BUY",
"security": {
"id": 132580,
"name": "VTR",
"type": "OFFSHORE_REIT",
"assetClass": "OFFSHORE"
},
"broker": {
"id": "18945670000146",
"name": "INTER DTVM"
},
"exchangeRate": 4.53,
"fees": {
"brokerageFee": 0.7,
"exchangeFee": 0.8
},
"createdDate": "2023-05-09T00:15:04.862501Z",
"updatedDate": "2023-05-09T00:15:04.862501Z"
}

Options Exercise​

Exercise means putting into effect the right to buy or sell the underlying financial instrument specified in an options contract. If the holder of an option decides to buy or sell the underlying instrument instead of letting the contract expire worthless or closing out the position, they will be "exercising the option", that is, making use of the right or privilege available in the contract.

An option holder may exercise their right to buy or sell the contract's underlying shares at a specified price, also called the strike price.

Exercising a put option allows you to sell the underlying security at a specified price within a specific timeframe.

Exercising a call option allows you to buy the underlying security at a specified price within a specific timeframe.

To learn more about options: https://gorila.com.br/blog/o-que-sao-opcoes

Example:

Creating a transaction for PETRL30 using securityId:

// REQUEST
// POST https://core.gorila.com.br/portfolios/{portfolioId}/transactions

{
"type": "OPTION_EXERCISE",
"transactDate": "2023-04-11",
"quantity": 50,
"brokerId": "18945670000146",
"security": {
"id": 62598463
}
}

This will return a response like this:

//RESPONSE

{
"type": "OPTION_EXERCISE",
"id": "29fc9e31-a5da-4b37-801f-e548d1fe6bf7",
"quantity": 50,
"transactDate": "2023-04-11",
"status": "PROCESSING",
"security": {
"id": 62598463,
"isin": "BRPETR4L1447",
"name": "PETRL30 (Vencimento em 20/12/2024)",
"type": "OPTION_LOCAL",
"assetClass": "STOCKS"
},
"broker": {
"id": "18945670000146",
"name": "INTER DTVM"
},
"createdDate": "2023-04-12T19:26:57.804214Z",
"updatedDate": "2023-04-12T19:26:57.804214Z"
}

Custody Transfer​

It consists of the procedure of changing the institution responsible for registering and safeguarding your investments (the broker), for example, switching from a brokerage firm to an investment bank and transferring your investments to the new institution. In this case, the investor can change the institution responsible for their portfolio without having to redeem all the investments made.

Example:

Creating a transaction for PETR4 using securityId:

// REQUEST
// POST https://core.gorila.com.br/portfolios/{portfolioId}/transactions

{
"type": "CUSTODY_TRANSFER",
"transactDate": "2023-04-11",
"quantity": 500,
"price": 24.64,
"sourceBrokerId": "18945670000146",
"targetBrokerId": "02332886001178",
"security": {
"id": 122720
}
}

This will return a response like this:

//RESPONSE

{
"type": "CUSTODY_TRANSFER",
"id": "01032f75-70cc-4d18-a550-e96a24281616",
"quantity": 500,
"transactDate": "2023-04-11",
"status": "PROCESSING",
"price": 24.64,
"security": {
"id": 122720,
"isin": "BRPETRACNPR6",
"name": "PETR4",
"type": "STOCK_LOCAL",
"assetClass": "STOCKS"
},
"sourceBroker": {
"id": "18945670000146",
"name": "INTER DTVM"
},
"targetBroker": {
"id": "02332886001178",
"name": "XP INVESTIMENTOS CCTVM"
},
"createdDate": "2023-04-12T19:41:19.037682Z",
"updatedDate": "2023-04-12T19:41:19.037682Z"
}

Come Cotas​

"Come Cotas" is an advance payment of Income Tax on the earnings of some investment funds, and it takes place on the last business day of May and November.

To find out how the payment works, visit our blog: https://gorila.com.br/blog/come-cotas.

Example:

Creating a transaction for GIANT ZARATHUSTRA FC FIM using securityId:

// REQUEST
// POST https://core.gorila.com.br/portfolios/{portfolioId}/transactions

{
"type": "COME_COTAS",
"transactDate": "2022-11-30",
"quantity": 371.6242843,
"brokerId": "18945670000146",
"security": {
"id": 2407939
}
}

This will return a response like this:

//RESPONSE

{
"type": "COME_COTAS",
"id": "b5cc6cea-aba1-4527-960a-add72e9630e4",
"quantity": 371.6242843,
"transactDate": "2022-11-30",
"status": "PROCESSING",
"security": {
"id": 2407939,
"cnpj": "11052478000181",
"name": "GIANT ZARATHUSTRA FC FIM",
"type": "FUNDQUOTE",
"assetClass": "MULTIMARKET"
},
"broker": {
"id": "18945670000146",
"name": "INTER DTVM"
},
"createdDate": "2023-04-12T19:20:30.591252Z",
"updatedDate": "2023-04-12T19:20:30.591252Z"
}

Initial Custody Adjustment​

The initial custody adjustment (INITIAL_CUSTODY_ADJUSTMENT) records the position in a security on a cut-off date, as the starting point for the calculations, when there is no reliable history of transactions prior to that date. The quantity provided replaces the custody the position had up to the previous day. The price is optional: if it is not provided, Gorila uses the security's closing price on the transaction date. For more details, see the Transaction documentation.

Example:

Creating an initial custody adjustment for PETR4 using securityId:

// REQUEST
// POST https://core.gorila.com.br/portfolios/{portfolioId}/transactions

{
"type": "INITIAL_CUSTODY_ADJUSTMENT",
"transactDate": "2023-04-11",
"quantity": 300,
"side": "BUY",
"brokerId": "18945670000146",
"security": {
"id": 122720
}
}

This will return a response like this:

//RESPONSE

{
"type": "INITIAL_CUSTODY_ADJUSTMENT",
"id": "7d1f4c2a-3b8e-4f5a-9c6d-2e1b0a9f8c7d",
"quantity": 300,
"transactDate": "2023-04-11",
"status": "PROCESSING",
"side": "BUY",
"security": {
"id": 122720,
"isin": "BRPETRACNPR6",
"name": "PETR4",
"type": "STOCK_LOCAL",
"assetClass": "STOCKS"
},
"broker": {
"id": "18945670000146",
"name": "INTER DTVM"
},
"createdDate": "2023-04-12T19:45:10.512331Z",
"updatedDate": "2023-04-12T19:45:10.512331Z"
}

Position Close​

The position close (POSITION_CLOSE) zeroes the custody of a position at the end of the transaction date. There is no need to provide the quantity or the side: Gorila calculates the quantity that zeroes the position and recalculates it whenever the history prior to the closing date changes. For more details, see the Transaction documentation.

Example:

Closing the position in GIANT ZARATHUSTRA FC FIM using securityId:

// REQUEST
// POST https://core.gorila.com.br/portfolios/{portfolioId}/transactions

{
"type": "POSITION_CLOSE",
"transactDate": "2023-06-30",
"brokerId": "18945670000146",
"security": {
"id": 2407939
}
}

This will return a response like this:

//RESPONSE

{
"type": "POSITION_CLOSE",
"id": "c3a9e7b1-5d2f-4e8a-b6c4-9f0e1d2a3b4c",
"transactDate": "2023-06-30",
"status": "PROCESSING",
"security": {
"id": 2407939,
"cnpj": "11052478000181",
"name": "GIANT ZARATHUSTRA FC FIM",
"type": "FUNDQUOTE",
"assetClass": "MULTIMARKET"
},
"broker": {
"id": "18945670000146",
"name": "INTER DTVM"
},
"createdDate": "2023-07-03T14:02:41.108245Z",
"updatedDate": "2023-07-03T14:02:41.108245Z"
}

Stock Receipt Exercise​

⚠️ Not implemented. Coming soon. The example below shows the expected request format.

A stock subscription receipt is a document that proves an investor's right to acquire shares of a company at a price below market value.

It contains information such as the company name, the number of shares the investor is entitled to buy, the subscription price, the expiration date and the conditions associated with the subscription.

The exercise of the receipt occurs when the holder decides to buy the shares at the subscription price specified in the receipt. In Gorila, since it depends on the user's choice, you need to insert the subscription receipt operation, and on the receipt's expiration date it is automatically converted into the security in question.

Example:

Creating a transaction for EVBI13 issued 2022-12-20 using securityId:

// REQUEST
// POST https://core.gorila.com.br/portfolios/{portfolioId}/transactions

{
"type": "SUBSCRIPTION_EXERCISE",
"transactDate": "2022-12-22",
"quantity": 50,
"brokerId": "18945670000146",
"security": {
"id": 62599573
}
}

This will return a response like this:

//RESPONSE

{
"type": "SUBSCRIPTION_EXERCISE",
"id": "b88058d1-9a99-47b1-9e19-bbc3e969d5af",
"quantity": 50,
"transactDate": "2022-12-22",
"status": "PROCESSING",
"security": {
"id": 62599573,
"isin": "BREVBIR03M18",
"name": "EVBI13 (Emissão em 20/12/2022)",
"type": "STOCK_RECEIPT",
"assetClass": "STOCKS"
},
"broker": {
"id": "18945670000146",
"name": "INTER DTVM"
},
"createdDate": "2023-04-13T18:42:46.779592Z",
"updatedDate": "2023-04-13T18:42:46.779592Z"
}