Skip to main content

Quick Start

The Ntropy API enriches banking data with information about merchants (website, name, location, category), transactions (category) and account holders (recurrence insights). To use the full API, you can either call it directly, through our Python SDK, or using our Postman collection.

The following subsections will get you quickly up to speed with your preferred access method.

Using Python

The Python SDK makes it easy to get started. It can be installed from the source repository or pypi:

$ pip install --upgrade 'ntropy-sdk'

Enriching your first transaction requires an SDK object and an input Transaction object, and using the sdk.add_transactions method. The API key can be set in the environment variable NTROPY_API_KEY or in the SDK constructor:

from ntropy_sdk import SDK, Transaction

sdk = SDK("YOUR-API-KEY")
tx = Transaction(
description = "SQ* STARBUCKS UNION SQUARE",
entry_type = "outgoing",
amount = 42.17,
iso_currency_code = "USD",
date = "2023-01-01",
transaction_id = "4yp49x3tbj9mD8DB4fM8DDY6Yxbx8YP14g565Xketw3tFmn",
country = "US",
account_holder_id = "id-1",
account_holder_type = "consumer"
)

enriched_tx = sdk.add_transactions([tx])[0]
print(enriched_tx.to_dict())

The returned EnrichedTransaction contains the added information by Ntropy API.

You can consult the Enrichment section for more information on the parameters for Transaction and EnrichedTransaction.

Using the REST API

The REST API can be called directly by using a CLI utility such as cURL. Your API key must be provided in the header X-API-KEY and the input transaction(s) as a JSON body:

$ curl \
-H "X-API-KEY: <YOUR-API-KEY>" \
-H "Content-Type: application/json" \
-X POST \
--data '[
{
"description": "SQ* STARBUCKS UNION SQUARE",
"entry_type": "outgoing",
"amount": 42.17,
"iso_currency_code": "USD",
"date": "2023-01-01",
"transaction_id": "4yp49x3tbj9mD8DB4fM8DDY6Yxbx8YP14g565Xketw3tFmn",
"country": "US",
"account_holder_id": "id-1",
"account_holder_type": "consumer"
}
]' \
https://api.ntropy.com/v2/transactions/sync

The response data will also be in JSON format. You can consult other API details in the API specification page.

Using Postman

You can also use our public Postman collection here to test the API:

  • Click Run in Postman to either run in your browser or the Postman desktop app, if installed.
  • Select a relevant workspace and import the collection. You should now be in the Authorization tab of Ntropy Transaction API v2.
  • Replace the {{ apiKey }} text with your API key, then click Save on the action bar above.

Testing your transactions

You can use the included endpoints to enrich your transactions:

  • Click Ntropy Transaction API v2 in the left column.
  • Click v2.
  • Click transactions.
  • Click Enrich and add transactions to the ledger of account holders synchronously.
  • Click Body in the top bar.
  • The Body page allows you to match the payload sent to the server to the fields you would like to test (some sample fields have already been filled in).
  • When you have finished editing, click Send at the top right.

The response should appear in the bottom half of the page.