Skip to main content

Transaction - Examples

Regular

Most of your transactions probably will 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, 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'll only need the price and the quantity of the transaction and we'll consider the currency to be BRL (so inputting an exchangeRate will produce an error).

It's worth noting that CDBs, LCs, LCAs, LCIs, LFs, Stock Forwards and Custom Securities are securities managed by the organization, which means that you need to create them first before making a transaction with them.

Examples:

To insert transactions, make requests to Create Transaction.

Notes:

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

Accepted types of security identifier: securityId.

All securities in this group need to be created first, meaning that you'll only need to specify the characteristics of the desired security. In all cases, once created, you'll receive a new securityId of the specified or derived security, and that securityId is the relevant one to create a transaction.

Create a transaction of LCA: 105.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",
"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 types of security identifier: securityId or ISIN.

Create a transaction of XPBR31 using isin:

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

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

This will return a response like this:

//RESPONSE

{
"type": "REGULAR",
"id": "d110a188-cca6-4ed1-935a-cc92b929b32b",
"quantity": 300,
"transactDate": "2023-03-06",
"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 types of security identifier: securityId.

Create a transaction of 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": "18945670000146",
"security": {
"id": 62860971
},
"side": "BUY",
"price": 4.97,
"fees": {
"brokerageFee": 1.00,
"exchangeFee": 1.50
}
}

This will return a response like this:

//RESPONSE

{
"type": "REGULAR",
"id": "5fc86485-1924-4cd7-92ed-2d313300b1e3",
"quantity": 100,
"transactDate": "2023-03-28",
"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 types of security identifier: securityId or ISIN.

Create a transaction of 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",
"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, Debêntures)

Accepted types of security identifier: securityId or isin

Create a transaction of 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",
"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 types of security identifier: securityId.

Create a transaction of BTC using securityId:

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

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

This will return a response like this:

//RESPONSE

{
"type": "REGULAR",
"id": "8948b17f-272d-4279-b09c-fd4a7272586d",
"quantity": 0.5,
"transactDate": "2023-03-29",
"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 types of security identifier: securityId or ISIN.

Create a transaction of BOVA11 using isin:

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

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

This will return a response like this:

//RESPONSE

{
"type": "REGULAR",
"id": "69e11bf6-11d0-4338-bb74-343c0d254344",
"quantity": 100,
"transactDate": "2023-03-09",
"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 types of security identifier: securityId or ISIN.

Create a transaction of 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",
"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 types of security identifier: securityId or CNPJ.

Create a transaction of 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",
"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 types of security identifier: securityId or ISIN.

Create a transaction of 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",
"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"
}

Generic Securities

⚠️ Not implemented. Coming soon.

Accepted types of security identifier: securityId.

To create a transaction using a custom security, you must first create the custom security in 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",
"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 types of security identifier: securityId or ISIN.

Create a transaction of LTN - 01/01/2029 using isin:

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

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

This will return a response like this:

//RESPONSE

{
"type": "REGULAR",
"id": "5fc86485-1924-4cd7-92ed-2d313300b1e3",
"quantity": 50,
"transactDate": "2023-04-10",
"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:17:25.229141Z",
"updatedDate": "2023-04-11T14:17:25.229141Z"
}

Index Options

Accepted types of security identifier: securityId or ISIN.

Create a transaction of IBOVP75 (Maturity 17/04/2019) 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",
"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 types of security identifier: securityId.

Create a transaction of PETR4 20/12/2023 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",
"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 types of security identifier: securityId or ISIN.

Create a transaction of 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",
"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 types of security identifier: securityId or ISIN.

Create a transaction of 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",
"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 types of security identifier: securityId.

Create a transaction of 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",
"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 types of security identifier: securityId.

Create a transaction of 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",
"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 types of security identifier: securityId or ISIN.

Create a transaction of 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
}
}

Create a transaction of PETR4 using isin:

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

{
"type": "REGULAR",
"transactDate": "2023-04-10",
"quantity": 1000,
"brokerId": "18945670000146",
"security": {
"isin": "BRPETRACNPR6"
},
"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",
"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 operations include the following securities types: Savings Account, and Cash.

These are securities that can only be transactioned on its closing price (end-of-day) or is a Cash transaction, which means that you don't need to input a price when creating them.

Examples:

Savings Account - Poupança

Accepted types of security identifier: securityId.

Create a transaction of Saving, also known as "Poupança" (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",
"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 types of security identifier: securityId.

Create a transaction of CASH (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",
"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

These transactions are only valid for the Currencies security type. Currently, we only deal with calculating a portfolio in BRL terms. This means that all currency transactions are, by definition, against the Brazilian Real.

Example:

Currencies

Accepted types of security identifier: securityId.

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

Create a transaction of 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",
"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 securities types: Offshore Stock, Offshore ETFs, Offshore Funds, and Offshore Reit.

Gorila currently only supports offshore securities listed in the US. And since we calculate portfolios in BRL terms, you'll need to specify an exchangeRate (besides price and quantity) against the Brazilian Real (USDBRL). This means that the price and any fees (brokerageFee and exchangeFee) associated with the transaction needs to be expressed in USD.

Example:

Offshore Stocks

Create a transaction of 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",
"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

Create a transaction of 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",
"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

Create a transaction of 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",
"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

Create a transaction of 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",
"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 to put into effect the right to buy or sell the underlying financial instrument specified in an options contract. If the owner of an option decides to buy or sell the underlying instrument instead of allowing the contract to expire worthlessly or closing out the position, they will be "exercising the option" or making use of the right or privilege that is 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 stated price within a specific timeframe.

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

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

Example:

Create a transaction of 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",
"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 for changing the institution in charge of registering and safeguarding your investments, e.g., when you switch from a brokerage firm to an investment bank and take your applications to the new institution. In this case, the investor can change the institution responsible for his portfolio without the need to redeem all the investments made.

Example:

Create a transaction of 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",
"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"
}

Stock Receipt Exercise

⚠️ Not implemented. Coming soon.

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

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

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

Example:

Create a transaction of EVBI13 emissão 20/12/2022 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",
"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"
}

Come Cotas

The "Come Cotas" is an advance payment of Income Tax for some investment funds on income and takes place on the last working day of May and November.

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

Example:

Create a transaction of 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",
"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"
}