### Code Examples: Create Account Holder with cURL and Python SDK Source: https://docs.ntropy.com/documentation/api/account-holders/create-account-holder.mdx Practical code examples demonstrating how to create an account holder using both cURL commands for direct API interaction and the Ntropy Python SDK. Includes both specific data examples and generic placeholder examples. ```shell curl -X "POST" \ "https://api.ntropy.com/v3/account_holders" \ -H "Accept: application/json" \ -H "X-API-KEY: cd1H...Wmhl" \ -H "Content-Type: application/json" \ -d '{ "id": "35b927b6-6fda-40aa-93b8-95b47c2b2cad", "type": "consumer", "name": "John Doe" }' ``` ```python from ntropy_sdk import SDK sdk = SDK("cd1H...Wmhl") ah = sdk.account_holders.create( id="35b927b6-6fda-40aa-93b8-95b47c2b2cad", type="consumer", name="John Doe", ) ``` ```shell curl -X POST https://api.ntropy.com/v3/account_holders \ -H "X-Application-Id: string" \ -H "X-Api-Key: " \ -H "Content-Type: application/json" \ -d '{ "id": "string", "type": "consumer" }' ``` -------------------------------- ### cURL Example to List Rules with API Key Source: https://docs.ntropy.com/documentation/api/personalization/filter-get.mdx Illustrates how to make a GET request to the Ntropy API using cURL, including setting the 'Accept' header to 'application/json' and authenticating with an 'X-API-KEY'. ```shell curl -X "GET" \ "https://api.ntropy.com/v3/rules" \ -H "Accept: application/json" \ -H "X-API-KEY: cd1H...Wmhl" ``` -------------------------------- ### cURL Example to List All Reports Source: https://docs.ntropy.com/documentation/api/reports/get-reports.mdx Demonstrates how to use cURL to make a GET request to the Ntropy API's /v3/reports endpoint, including necessary 'Accept' and 'X-API-KEY' headers. ```shell curl -X "GET" \ "https://api.ntropy.com/v3/reports" \ -H "Accept: application/json" \ -H "X-API-KEY: cd1H...Wmhl" ``` -------------------------------- ### cURL Example: List All Transactions Source: https://docs.ntropy.com/documentation/api/transactions/list-transactions.mdx Example using cURL to make a basic GET request to the Ntropy transactions API, including necessary authentication headers. ```shell curl -X "GET" \ "https://api.ntropy.com/v3/transactions" \ -H "Accept: application/json" \ -H "X-API-KEY: cd1H...Wmhl" ``` -------------------------------- ### Install Ntropy Python SDK Source: https://docs.ntropy.com/introduction The Ntropy Python SDK simplifies integration with features like auto pagination, baked-in retry policies, validation, and idiomatic error handling. It supports both sync and async HTTP clients and can be installed from PyPI. ```bash pip install --upgrade 'ntropy-sdk' ``` -------------------------------- ### Create Rule using Python SDK Example Source: https://docs.ntropy.com/documentation/api/personalization/filter-post.mdx Example Python code using the Ntropy SDK to create a new personalization rule, setting a logo URL. It demonstrates SDK initialization and rule creation. ```python from ntropy_sdk import SDK sdk = SDK("cd1H...Wmhl") rule = sdk.rules.create({"set": "logo", "to": "http://example.com/favicon.ico"}) ``` -------------------------------- ### Examples: Retrieve Webhook using cURL and Python SDK Source: https://docs.ntropy.com/documentation/api/webhooks/get-webhook.mdx Provides practical examples for retrieving a webhook using both cURL command-line tools and the Ntropy Python SDK, demonstrating how to include necessary authentication and application headers. ```shell curl -X "GET" \ "https://api.ntropy.com/v3/webhooks/e94a150d-40af-4e96-8aa7-2948a6b4d8d3" \ -H "Accept: application/json" \ -H "X-API-KEY: cd1H...Wmhl" ``` ```python from ntropy_sdk import SDK sdk = SDK("cd1H...Wmhl") webhook = sdk.webhooks.get("e94a150d-40af-4e96-8aa7-2948a6b4d8d3") ``` ```shell curl https://api.ntropy.com/v3/webhooks/:id \ -H "X-Application-Id: string" \ -H "X-Api-Key: " ``` -------------------------------- ### Create Report using cURL with Example Data Source: https://docs.ntropy.com/documentation/api/reports/post-report.mdx Example cURL command to create a report, including authentication headers and a sample request body with specific transaction details. ```shell curl -X "POST" \ "https://api.ntropy.com/v3/reports" \ -H "Accept: application/json" \ -H "X-API-KEY: cd1H...Wmhl" \ -H "Content-Type: application/json" \ -d '{ "transaction_id": "xbx8YP14g565Xk", "description": "lorem ipsum", "fields": [ ".entities.counterparty" ] }' ``` -------------------------------- ### Python SDK Example to List Webhooks Source: https://docs.ntropy.com/documentation/api/webhooks/get-webhooks.mdx Illustrates how to use the Ntropy Python SDK to programmatically list and iterate through all available webhooks using an API key and auto-pagination. ```python from ntropy_sdk import SDK sdk = SDK(api_key) for webhook in sdk.webhooks.list().auto_paginate(): ... ``` -------------------------------- ### Retrieve Batch Results using Python SDK Source: https://docs.ntropy.com/documentation/api/batches/get-batch-results.mdx Example Python code demonstrating how to use the Ntropy SDK to get a batch object and then wait for its results using the provided batch ID. ```python from ntropy_sdk import SDK sdk = SDK("cd1H...Wmhl") batch = sdk.batches.get("203613d2-83c8-4130-8809-d14206eeec20") results = sdk.batches.wait_for_results("203613d2-83c8-4130-8809-d14206eeec20") ``` -------------------------------- ### Python SDK Example for Webhook Update Source: https://docs.ntropy.com/documentation/api/webhooks/patch-webhook.mdx Python SDK example demonstrating how to patch a webhook, specifying events and enabling status using the SDK's webhooks.patch method. ```python from ntropy_sdk import SDK sdk = SDK("cd1H...Wmhl") wh = sdk.webhooks.patch( "e94a150d-40af-4e96-8aa7-2948a6b4d8d3", events=["batches.completed", "batches.error"], enabled=False, ) ``` -------------------------------- ### API Cursor-Based Pagination Structure and Example Endpoint Source: https://docs.ntropy.com/api/pagination Describes the common structure for cursor-based pagination across all API endpoints, including request parameters and response fields. The `GET /v3/transactions` endpoint is provided as an example of an endpoint supporting this pagination. ```APIDOC Endpoint: GET /v3/transactions Request Parameters: limit: integer (Required) - The maximum number of objects to return in the response. cursor: string (Optional) - The starting point for the set of results, obtained from a previous `next_cursor`. Response Body: next_cursor: string | null - The starting point for the next set of results, or null if the current set is the last one. data: array - An array containing the elements of the requested set. ``` -------------------------------- ### Python SDK Example for Listing Rules Source: https://docs.ntropy.com/documentation/api/personalization/filter-get.mdx Demonstrates how to use the Ntropy Python SDK to programmatically retrieve all rules. It shows SDK initialization with an API key and calling the `rules.get()` method. ```python from ntropy_sdk import SDK sdk = SDK("cd1H...Wmhl") rules = sdk.rules.get() ``` -------------------------------- ### HTTP GET Request to List Webhooks Source: https://docs.ntropy.com/documentation/api/webhooks/get-webhooks.mdx Demonstrates the basic HTTP GET method to retrieve a list of all configured webhooks from the Ntropy API's v3 endpoint. ```http GET https://api.ntropy.com/v3/webhooks ``` -------------------------------- ### Generic cURL Example for Bank Statement Retrieval Source: https://docs.ntropy.com/documentation/api/bank-statements/get-bank-statement.mdx A generic cURL example to retrieve a bank statement, illustrating the use of a placeholder for the bank statement ID and including the X-Application-Id and X-Api-Key headers. ```shell curl https://api.ntropy.com/v3/bank_statements/:id \ -H "X-Application-Id: string" \ -H "X-Api-Key: " ``` -------------------------------- ### Generic Example: Enrich Transaction with cURL Source: https://docs.ntropy.com/documentation/api/transactions/post-transaction.mdx Provides a generic cURL example for synchronously enriching transactions, showing placeholder values for ID, description, date, amount, and other fields, along with required headers. ```shell curl -X POST https://api.ntropy.com/v3/transactions \ -H "X-Application-Id: string" \ -H "X-Api-Key: " \ -H "Content-Type: application/json" \ -d '{ "id": "string", "description": "string", "date": "string", "amount": 1, "entry_type": "incoming", "currency": "EUR", "account_holder_id": "string" }' ``` -------------------------------- ### Python SDK Example for Listing Reports Source: https://docs.ntropy.com/documentation/api/reports/get-reports.mdx Illustrates how to list reports using the Ntropy Python SDK, initializing the SDK with an API key and calling the reports.list() method. ```python from ntropy_sdk import SDK sdk = SDK("cd1H...Wmhl") reports = sdk.reports.list() ``` -------------------------------- ### Python SDK Example: List and Paginate Batches Source: https://docs.ntropy.com/documentation/api/batches/get-batches.mdx Illustrates how to initialize the Ntropy SDK and iterate through all available batches using automatic pagination, simplifying batch retrieval in Python applications. ```python from ntropy_sdk import SDK sdk = SDK("cd1H...Wmhl") for batch in sdk.batches.list().auto_paginate(): ... ``` -------------------------------- ### cURL Example for Webhook Update (POST) Source: https://docs.ntropy.com/documentation/api/webhooks/patch-webhook.mdx Example cURL command to update a webhook, setting specific events and disabling it. Includes required headers like Accept, X-API-KEY, and Content-Type. Note: This example uses POST, while the API specifies PATCH. ```shell curl -X "POST" \ "https://api.ntropy.com/v3/webhooks/e94a150d-40af-4e96-8aa7-2948a6b4d8d3" \ -H "Accept: application/json" \ -H "X-API-KEY: cd1H...Wmhl" \ -H "Content-Type: application/json" \ -d '{ "events": [ "batches.completed", "batches.error" ], "enabled": false }' ``` -------------------------------- ### Python SDK Example: Retrieve Bank Statement Results Source: https://docs.ntropy.com/documentation/api/bank-statements/get-bank-statement-result.mdx Illustrates how to use the Ntropy Python SDK to programmatically retrieve bank statement results. It shows initialization, getting a statement, and waiting for its processing to complete. ```python from ntropy_sdk import SDK sdk = SDK("cd1H...Wmhl") bs = sdk.bank_statements.get("7f8dceac-2848-472d-b5c3-55cdbaf35a9b") results = sdk.bank_statements.wait_for_results("7f8dceac-2848-472d-b5c3-55cdbaf35a9b") ``` -------------------------------- ### Generic cURL Example: Get Bank Statement Results Source: https://docs.ntropy.com/documentation/api/bank-statements/get-bank-statement-result.mdx A general cURL command demonstrating how to access bank statement results using placeholder ID and required 'X-Application-Id' and 'X-Api-Key' headers. ```shell curl https://api.ntropy.com/v3/bank_statements/:id/results \ -H "X-Application-Id: string" \ -H "X-Api-Key: " ``` -------------------------------- ### Retrieve Batch Results using cURL Source: https://docs.ntropy.com/documentation/api/batches/get-batch-results.mdx Example cURL command to retrieve batch results using a specific batch ID and API key. This demonstrates a direct HTTP GET request. ```shell curl -X "GET" \ "https://api.ntropy.com/v3/batches/203613d2-83c8-4130-8809-d14206eeec20/results" \ -H "Accept: application/json" \ -H "X-API-KEY: cd1H...Wmhl" ``` -------------------------------- ### cURL Example to List Rules with Application ID and API Key Source: https://docs.ntropy.com/documentation/api/personalization/filter-get.mdx Provides an alternative cURL command for listing rules, showcasing the inclusion of both 'X-Application-Id' and 'X-Api-Key' headers for authentication. ```shell curl https://api.ntropy.com/v3/rules \ -H "X-Application-Id: string" \ -H "X-Api-Key: " ``` -------------------------------- ### Generic cURL Command to Create Report Source: https://docs.ntropy.com/documentation/api/reports/post-report.mdx A generic cURL example for creating a report, showing placeholder values for transaction details and required headers. ```shell curl -X POST https://api.ntropy.com/v3/reports \ -H "X-Application-Id: string" \ -H "X-Api-Key: " \ -H "Content-Type: application/json" \ -d '{ "transaction_id": "string", "description": "string", "fields": [ "string" ] }' ``` -------------------------------- ### cURL Command to List Webhooks with Application ID Source: https://docs.ntropy.com/documentation/api/webhooks/get-webhooks.mdx Another cURL example for listing webhooks, demonstrating the use of both X-Application-Id and X-Api-Key headers for authentication. ```shell curl https://api.ntropy.com/v3/webhooks \ -H "X-Application-Id: string" \ -H "X-Api-Key: " ``` -------------------------------- ### cURL Example: List All Batches Source: https://docs.ntropy.com/documentation/api/batches/get-batches.mdx A basic cURL command to fetch all batches from the API, demonstrating the required 'Accept' and 'X-API-KEY' headers for authentication and content type negotiation. ```shell curl -X "GET" \ "https://api.ntropy.com/v3/batches" \ -H "Accept: application/json" \ -H "X-API-KEY: cd1H...Wmhl" ``` -------------------------------- ### Generic cURL Example for Webhook Creation Source: https://docs.ntropy.com/documentation/api/webhooks/post-webhook.mdx Provides a simplified cURL command for creating a webhook, focusing on the essential headers (X-Application-Id, X-Api-Key, Content-Type) and a generic payload structure for events like 'reports.resolved'. ```shell curl -X POST https://api.ntropy.com/v3/webhooks \ -H "X-Application-Id: string" \ -H "X-Api-Key: " \ -H "Content-Type: application/json" \ -d '{ "url": "string", "events": [ "reports.resolved" ] }' ``` -------------------------------- ### Append Rule using cURL Example Source: https://docs.ntropy.com/documentation/api/personalization/filter-post.mdx Example cURL command to append a rule to the personalization ruleset, demonstrating how to set a logo URL using a POST request with JSON data. ```shell curl -X "POST" \ "https://api.ntropy.com/v3/rules/append" \ -H "Accept: application/json" \ -H "X-API-KEY: cd1H...Wmhl" \ -H "Content-Type: application/json" \ -d '{"set": "logo", "to": "http://example.com/favicon.ico"}' ``` -------------------------------- ### Python SDK Example: List All Transactions with Pagination Source: https://docs.ntropy.com/documentation/api/transactions/list-transactions.mdx Demonstrates how to use the Ntropy Python SDK to list and paginate through all transactions, simplifying API interaction. ```python from ntropy_sdk import SDK sdk = SDK("cd1H...Wmhl") for tx in sdk.transactions.list().auto_paginate(): ... ``` -------------------------------- ### cURL Command to List Webhooks with API Key Source: https://docs.ntropy.com/documentation/api/webhooks/get-webhooks.mdx Example cURL command to list all webhooks, including necessary headers for authentication (X-API-KEY) and specifying the Accept header for JSON response. ```shell curl -X "GET" \ "https://api.ntropy.com/v3/webhooks" \ -H "Accept: application/json" \ -H "X-API-KEY: cd1H...Wmhl" ``` -------------------------------- ### Example: List Bank Statements using cURL Source: https://docs.ntropy.com/documentation/api/bank-statements/get-bank-statements.mdx Demonstrates a basic cURL command to fetch bank statements, including necessary headers for authentication and content negotiation. ```shell curl -X "GET" \ "https://api.ntropy.com/v3/bank_statements" \ -H "Accept: application/json" \ -H "X-API-KEY: cd1H...Wmhl" ``` -------------------------------- ### Retrieve Report with cURL Example (Specific ID) Source: https://docs.ntropy.com/documentation/api/reports/get-report.mdx Demonstrates how to retrieve a specific report using the cURL command-line tool. This example includes the full URL with a sample report ID and specifies the 'Accept' and 'X-API-KEY' headers for authentication and content negotiation. ```shell curl -X "GET" \ "https://api.ntropy.com/v3/reports/a652285d-de1b-4a6f-b6ce-45efa9be7952" \ -H "Accept: application/json" \ -H "X-API-KEY: cd1H...Wmhl" ``` -------------------------------- ### Retrieve Report with Generic cURL Example Source: https://docs.ntropy.com/documentation/api/reports/get-report.mdx Provides a generic cURL command for retrieving a report, using placeholder values for the report ID, application ID, and API key. This example highlights the essential headers required for authentication and identification when making API requests. ```shell curl https://api.ntropy.com/v3/reports/:id \ -H "X-Application-Id: string" \ -H "X-Api-Key: " ``` -------------------------------- ### Create Webhook using Ntropy Python SDK Source: https://docs.ntropy.com/documentation/api/webhooks/post-webhook.mdx Illustrates how to programmatically create a webhook using the Ntropy Python SDK. The example shows initializing the SDK with an API key and then calling the `webhooks.create` method with the webhook URL, desired events, and a token. ```python from ntropy_sdk import SDK sdk = SDK("cd1H...Wmhl") wh = sdk.webhooks.create( url="https://example.com:5689", events=["batches.completed", "batches.error"], token="hunter2", ) ``` -------------------------------- ### cURL Example: Get Bank Statement Results by ID Source: https://docs.ntropy.com/documentation/api/bank-statements/get-bank-statement-result.mdx Demonstrates a cURL command to fetch bank statement results using a specific ID, including 'Accept' and 'X-API-KEY' headers for authentication and content negotiation. ```shell curl -X "GET" \ "https://api.ntropy.com/v3/bank_statements/7f8dceac-2848-472d-b5c3-55cdbaf35a9b/results" \ -H "Accept: application/json" \ -H "X-API-KEY: cd1H...Wmhl" ``` -------------------------------- ### Create Rule using cURL with X-Application-Id Source: https://docs.ntropy.com/documentation/api/personalization/filter-post.mdx Example cURL command to create a new rule, demonstrating the use of X-Application-Id and X-Api-Key headers with a simple JSON payload. ```shell curl -X POST https://api.ntropy.com/v3/rules \ -H "X-Application-Id: string" \ -H "X-Api-Key: " \ -H "Content-Type: application/json" \ -d '{ "if": true }' ``` -------------------------------- ### Example: Find Recurring Groups using cURL Source: https://docs.ntropy.com/documentation/api/recurrence/get-account-holder-recurring-payments.mdx Demonstrates how to call the recurring groups API endpoint using cURL, showing both a specific example with an account holder ID and API key, and a generic example with placeholders for required headers. ```shell curl -X "POST" \ "https://api.ntropy.com/v3/account_holders/35b927b6-6fda-40aa-93b8-95b47c2b2cad/recurring_groups" \ -H "Accept: application/json" \ -H "X-API-KEY: cd1H...Wmhl" ``` ```shell curl -X POST https://api.ntropy.com/v3/account_holders/:id/recurring_groups \ -H "X-Application-Id: string" \ -H "X-Api-Key: " ``` -------------------------------- ### cURL Example: Uploading Bank Statement PDF Source: https://docs.ntropy.com/documentation/api/bank-statements/post-bank-statement.mdx Provides a command-line example using cURL to send a POST request to the bank statements API. It demonstrates how to include the X-Application-Id and X-Api-Key headers, set the content type, and attach a PDF file for upload. ```shell curl -X POST https://api.ntropy.com/v3/bank_statements \ -H "X-Application-Id: string" \ -H "X-Api-Key: " \ -H "Content-Type: multipart/form-data" \ -F file=@ ``` -------------------------------- ### HTTP GET Request to List Reports Source: https://docs.ntropy.com/documentation/api/reports/get-reports.mdx Shows the basic HTTP GET request to retrieve a list of all reports from the Ntropy API's v3 endpoint. ```http GET https://api.ntropy.com/v3/reports ``` -------------------------------- ### cURL Example: Filter Transactions by Date Source: https://docs.ntropy.com/documentation/api/transactions/list-transactions.mdx Example using cURL to retrieve transactions filtered by `created_after` and `created_before` query parameters, demonstrating how to apply date-based filtering. ```shell curl -G https://api.ntropy.com/v3/transactions \ -H "X-Application-Id: string" \ -H "X-Api-Key: " \ --data-urlencode created_after=2023-01-01T00:00:00Z \ --data-urlencode created_before=2023-01-01T00:00:00Z ``` -------------------------------- ### Generic cURL Example for Batch Retrieval Source: https://docs.ntropy.com/documentation/api/batches/get-single-batch.mdx Provides a generic cURL command for retrieving a batch, indicating placeholders for the batch ID, X-Application-Id, and X-Api-Key. ```shell curl https://api.ntropy.com/v3/batches/:id \ -H "X-Application-Id: string" \ -H "X-Api-Key: " ``` -------------------------------- ### Create Webhook with Specific Events via cURL Source: https://docs.ntropy.com/documentation/api/webhooks/post-webhook.mdx Demonstrates how to create a webhook using cURL, providing a specific URL, a list of events ('batches.completed', 'batches.error'), and a security token. This example includes necessary headers like Accept, X-API-KEY, and Content-Type. ```shell curl -X "POST" \ "https://api.ntropy.com/v3/webhooks" \ -H "Accept: application/json" \ -H "X-API-KEY: cd1H...Wmhl" \ -H "Content-Type: application/json" \ -d '{ "url": "https://example.com:5689", "events": [ "batches.completed", "batches.error" ], "token": "hunter2" }' ``` -------------------------------- ### Submit Batch Requests using Python SDK Source: https://docs.ntropy.com/documentation/api/batches/post-batch.mdx Example Python code using the Ntropy SDK to create a batch of transaction requests, demonstrating how to initialize the SDK and define the operation and data payload. ```python from ntropy_sdk import SDK sdk = SDK("cd1H...Wmhl") batch = sdk.batches.create( operation="POST /v3/transactions", data=[ { "id": "xbx8YP14g565Xk", "description": "SQ* STARBUCKS 10 Union Sq", "account_holder_id": "35b927b6-6fda-40aa-93b8-95b47c2b2cad", "amount": 10.0, "entry_type": "outgoing", "date": "2024-03-30", "currency": "USD", "location": { "country": "US", }, } ], ) ``` -------------------------------- ### Example: List Bank Statements using Ntropy Python SDK Source: https://docs.ntropy.com/documentation/api/bank-statements/get-bank-statements.mdx Illustrates how to use the Ntropy Python SDK to programmatically list and paginate through bank statements. ```python from ntropy_sdk import SDK sdk = SDK("cd1H...Wmhl") for bs in sdk.bank_statements.list().auto_paginate(): ... ``` -------------------------------- ### HTTP GET Endpoint for Listing Batches Source: https://docs.ntropy.com/documentation/api/batches/get-batches.mdx Defines the base HTTP GET endpoint used to retrieve a collection of submitted batches from the Ntropy API. ```http GET https://api.ntropy.com/v3/batches ``` -------------------------------- ### Generic cURL Example for Batch Results Source: https://docs.ntropy.com/documentation/api/batches/get-batch-results.mdx A generic cURL command to retrieve batch results, showing placeholders for the batch ID, application ID, and API key. ```shell curl https://api.ntropy.com/v3/batches/:id/results \ -H "X-Application-Id: string" \ -H "X-Api-Key: " ``` -------------------------------- ### HTTP GET Endpoint for Listing Bank Statements Source: https://docs.ntropy.com/documentation/api/bank-statements/get-bank-statements.mdx Defines the base HTTP GET endpoint used to retrieve a list of bank statements from the Ntropy API. ```http GET https://api.ntropy.com/v3/bank_statements ``` -------------------------------- ### Retrieve Entity with cURL (Generic) Source: https://docs.ntropy.com/documentation/api/entities/get-entity-by-id.mdx Generic cURL example for retrieving an entity using X-Application-Id and X-Api-Key placeholders. ```shell curl https://api.ntropy.com/v3/entities/:id \ -H "X-Application-Id: string" \ -H "X-Api-Key: " ``` -------------------------------- ### Resolve Entity with cURL GET Request Source: https://docs.ntropy.com/documentation/api/entities/search-entity.mdx Demonstrates how to resolve an entity using a cURL GET request, specifying the entity by name and including necessary headers. ```shell curl -X "GET" \\ "https://api.ntropy.com/v3/entities?name=Starbucks" \\ -H "Accept: application/json" \\ -H "X-API-KEY: cd1H...Wmhl" ``` -------------------------------- ### Call Ntropy Bank Statement Verify API with Examples Source: https://docs.ntropy.com/documentation/api/bank-statements/get-bank-statement-statement-info.mdx Practical examples demonstrating how to invoke the Ntropy Bank Statement Verify API using cURL for direct HTTP requests and the Ntropy Python SDK. These snippets illustrate passing the required statement ID and API keys to quickly extract initial bank statement details. ```shell curl -X "POST" \ "https://api.ntropy.com/v3/bank_statements/7f8dceac-2848-472d-b5c3-55cdbaf35a9b/verify" \ -H "Accept: application/json" \ -H "X-API-KEY: cd1H...Wmhl" ``` ```python from ntropy_sdk import SDK sdk = SDK("cd1H...Wmhl") bs = sdk.bank_statements.verify("7f8dceac-2848-472d-b5c3-55cdbaf35a9b") ``` ```shell curl -X POST https://api.ntropy.com/v3/bank_statements/:id/verify \ -H "X-Application-Id: string" \ -H "X-Api-Key: " ``` -------------------------------- ### Retrieve Entity with Python SDK Source: https://docs.ntropy.com/documentation/api/entities/get-entity-by-id.mdx Example of using the Ntropy Python SDK to retrieve an entity by ID. ```python from ntropy_sdk import SDK sdk = SDK("cd1H...Wmhl") entity = sdk.entities.get("d4bc3c80-ec1a-3da2-836e-2a4ca4758be5") ``` -------------------------------- ### cURL Example: Generic Webhook Deletion Source: https://docs.ntropy.com/documentation/api/webhooks/delete-webhook.mdx Provides a generic cURL command for deleting a webhook, using a placeholder for the webhook ID. This example highlights the required 'X-Application-Id' and 'X-Api-Key' headers for authentication with the Ntropy API. ```shell curl -X DELETE https://api.ntropy.com/v3/webhooks/:id \ -H "X-Application-Id: string" \ -H "X-Api-Key: " ``` -------------------------------- ### HTTP GET Request for Listing Rules Source: https://docs.ntropy.com/documentation/api/personalization/filter-get.mdx Specifies the HTTP method and endpoint for retrieving a list of all defined rules from the Ntropy API. ```http GET https://api.ntropy.com/v3/rules ``` -------------------------------- ### Submit Batch Requests with Generic Data using cURL Source: https://docs.ntropy.com/documentation/api/batches/post-batch.mdx A generic cURL example demonstrating how to submit a batch of requests with placeholder values for common transaction fields, including required headers. ```shell curl -X POST https://api.ntropy.com/v3/batches \ -H "X-Application-Id: string" \ -H "X-Api-Key: " \ -H "Content-Type: application/json" \ -d '{ "operation": "POST /v3/transactions", "data": [ { "id": "string", "description": "string", "date": "string", "amount": 1, "entry_type": "incoming", "currency": "EUR", "account_holder_id": "string" } ] }' ``` -------------------------------- ### Example: Enrich Transaction with Python SDK Source: https://docs.ntropy.com/documentation/api/transactions/post-transaction.mdx Illustrates enriching a transaction using the Ntropy Python SDK, showing SDK initialization with an API key and transaction creation with sample data including ID, description, amount, and currency. ```python from ntropy_sdk import SDK sdk = SDK("cd1H...Wmhl") enriched = sdk.transactions.create( id="xbx8YP14g565Xk", description="SQ* STARBUCKS 10 Union Sq", account_holder_id="35b927b6-6fda-40aa-93b8-95b47c2b2cad", amount=10.0, entry_type="outgoing", date="2024-03-30", currency="USD", location=dict(country="US"), ) ``` -------------------------------- ### Retrieve Report with Python SDK Example Source: https://docs.ntropy.com/documentation/api/reports/get-report.mdx Illustrates how to fetch a report using the Ntropy Python SDK. The snippet shows the initialization of the SDK with an API key and then calls the 'reports.get' method, passing the report's unique identifier to retrieve the report object. ```python from ntropy_sdk import SDK sdk = SDK("cd1H...Wmhl") report = sdk.reports.get("a652285d-de1b-4a6f-b6ce-45efa9be7952") ``` -------------------------------- ### API Documentation for List Webhooks Endpoint Source: https://docs.ntropy.com/documentation/api/webhooks/get-webhooks.mdx Details the required request headers and possible response body statuses for the GET /v3/webhooks endpoint, outlining authentication and potential errors. ```APIDOC Request Headers: - X-Application-Id (required) Response Body: - 200: Successful Response - 422: Validation Error ``` -------------------------------- ### Reset Category Set using cURL Example Source: https://docs.ntropy.com/documentation/api/categories/delete-custom-category-set.mdx An example cURL command demonstrating how to send a POST request to reset a specific category set, including the necessary API key and accept headers. ```shell curl -X "POST" \ "https://api.ntropy.com/v3/categories/my_category_id/reset" \ -H "Accept: application/json" \ -H "X-API-KEY: cd1H...Wmhl" ``` -------------------------------- ### Generic cURL Example: Delete Rule with Placeholders Source: https://docs.ntropy.com/documentation/api/personalization/filter-delete.mdx A general cURL command for deleting a rule, illustrating the endpoint structure with placeholders for the rule ID, application ID, and API key. This example is useful for understanding the required parameters. ```shell curl -X DELETE https://api.ntropy.com/v3/rules/:id \ -H "X-Application-Id: string" \ -H "X-Api-Key: " ``` -------------------------------- ### Example: Enrich Transaction with cURL and Specific Data Source: https://docs.ntropy.com/documentation/api/transactions/post-transaction.mdx Demonstrates how to synchronously enrich a transaction using a cURL command, including required headers (Accept, X-API-KEY, Content-Type) and a sample JSON payload with specific transaction details. ```shell curl -X "POST" \ "https://api.ntropy.com/v3/transactions" \ -H "Accept: application/json" \ -H "X-API-KEY: cd1H...Wmhl" \ -H "Content-Type: application/json" \ -d '{ "id": "xbx8YP14g565Xk", "description": "SQ* STARBUCKS 10 Union Sq", "date": "2024-03-30", "amount": 10.0, "entry_type": "outgoing", "currency": "USD", "account_holder_id": "35b927b6-6fda-40aa-93b8-95b47c2b2cad", "location": { "country": "US" } }' ``` -------------------------------- ### Submit Batch Requests with Specific Data using cURL Source: https://docs.ntropy.com/documentation/api/batches/post-batch.mdx Example cURL command demonstrating how to create a batch of transaction requests with specific, pre-defined data, including necessary headers and the JSON request body. ```shell curl -X "POST" \ "https://api.ntropy.com/v3/batches" \ -H "Accept: application/json" \ -H "X-API-KEY: cd1H...Wmhl" \ -H "Content-Type: application/json" \ -d '{ "operation": "POST /v3/transactions", "data": [ { "id": "xbx8YP14g565Xk", "description": "SQ* STARBUCKS 10 Union Sq", "date": "2024-03-30", "amount": 10.0, "entry_type": "outgoing", "currency": "USD", "account_holder_id": "35b927b6-6fda-40aa-93b8-95b47c2b2cad", "location": { "country": "US" } } ] }' ``` -------------------------------- ### Retrieve Category Set using cURL Source: https://docs.ntropy.com/documentation/api/categories/get-category-set.mdx Demonstrates how to retrieve a category set using the cURL command-line tool, showing specific and generic examples with necessary headers. ```shell curl -X "GET" \ "https://api.ntropy.com/v3/categories/consumer" \ -H "Accept: application/json" \ -H "X-API-KEY: cd1H...Wmhl" ``` ```shell curl https://api.ntropy.com/v3/categories/:id \ -H "X-Application-Id: string" \ -H "X-Api-Key: " ``` -------------------------------- ### cURL Example to List Reports with Date Filters Source: https://docs.ntropy.com/documentation/api/reports/get-reports.mdx Shows how to use cURL to filter reports by creation date using 'created_after' and 'created_before' query parameters, along with required headers. ```shell curl -G https://api.ntropy.com/v3/reports \ -H "X-Application-Id: string" \ -H "X-Api-Key: " \ --data-urlencode created_after=2023-01-01T00:00:00Z \ --data-urlencode created_before=2023-01-01T00:00:00Z ``` -------------------------------- ### Retrieve Entity with cURL (Specific ID) Source: https://docs.ntropy.com/documentation/api/entities/get-entity-by-id.mdx Example of using cURL to retrieve an entity with a specific ID, including API key and Accept header. ```shell curl -X "GET" \ "https://api.ntropy.com/v3/entities/d4bc3c80-ec1a-3da2-836e-2a4ca4758be5" \ -H "Accept: application/json" \ -H "X-API-KEY: cd1H...Wmhl" ``` -------------------------------- ### Example: Filter Bank Statements by Date using cURL Source: https://docs.ntropy.com/documentation/api/bank-statements/get-bank-statements.mdx Shows how to use cURL with query parameters (`created_after`, `created_before`) to filter the list of bank statements by their creation date. ```shell curl -G https://api.ntropy.com/v3/bank_statements \ -H "X-Application-Id: string" \ -H "X-Api-Key: " \ --data-urlencode created_after=2023-01-01T00:00:00Z \ --data-urlencode created_before=2023-01-01T00:00:00Z ``` -------------------------------- ### cURL Example: Filter Batches by Date Source: https://docs.ntropy.com/documentation/api/batches/get-batches.mdx Demonstrates how to use cURL to retrieve batches filtered by creation date, utilizing 'created_after' and 'created_before' query parameters with URL encoding. ```shell curl -G https://api.ntropy.com/v3/batches \ -H "X-Application-Id: string" \ -H "X-Api-Key: " \ --data-urlencode created_after=2023-01-01T00:00:00Z \ --data-urlencode created_before=2023-01-01T00:00:00Z ``` -------------------------------- ### Ntropy API Reference Structure Source: https://docs.ntropy.com/introduction The Ntropy API reference provides comprehensive documentation for all endpoints, including detailed descriptions and examples for requests and responses. It also covers essential general information such as authentication, error handling, pagination, and rate limits. ```APIDOC API Reference Structure: Endpoints: - Description - Request Examples - Response Examples General Information: - Authentication - Error Handling - Pagination - Rate Limits ``` -------------------------------- ### Retrieve Bank Statement using Ntropy Python SDK Source: https://docs.ntropy.com/documentation/api/bank-statements/get-bank-statement.mdx An example demonstrating how to retrieve a bank statement using the Ntropy Python SDK. It shows the initialization of the SDK with an API key and the method call to fetch a bank statement by its ID. ```python from ntropy_sdk import SDK sdk = SDK("cd1H...Wmhl") bs = sdk.bank_statements.get("7f8dceac-2848-472d-b5c3-55cdbaf35a9b") ``` -------------------------------- ### Python SDK Example: Assign Transaction Source: https://docs.ntropy.com/documentation/api/transactions/set-transaction-ah.mdx Illustrates the usage of the Ntropy Python SDK to programmatically assign a transaction to an account holder, showing how to initialize the SDK and call the assignment method. ```python from ntropy_sdk import SDK sdk = SDK("cd1H...Wmhl") sdk.transactions.assign( transaction_id="xbx8YP14g565Xk", account_holder_id="35b927b6-6fda-40aa-93b8-95b47c2b2cad", ) ``` -------------------------------- ### List Account Holders with Date Filters using cURL Source: https://docs.ntropy.com/documentation/api/account-holders/get-account-holders.mdx A cURL example showing how to query the `/v3/account_holders` endpoint and filter results by creation date using `created_after` and `created_before` query parameters. ```shell curl -G https://api.ntropy.com/v3/account_holders \ -H "X-Application-Id: string" \ -H "X-Api-Key: " \ --data-urlencode created_after=2023-01-01T00:00:00Z \ --data-urlencode created_before=2023-01-01T00:00:00Z ``` -------------------------------- ### Retrieve Specific Transaction with cURL Source: https://docs.ntropy.com/documentation/api/transactions/get-transaction.mdx Example cURL command demonstrating how to fetch a transaction using a specific ID and an API key, accepting JSON response. ```shell curl -X "GET" \ "https://api.ntropy.com/v3/transactions/xbx8YP14g565Xk" \ -H "Accept: application/json" \ -H "X-API-KEY: cd1H...Wmhl" ``` -------------------------------- ### Resolve Entity with cURL POST Request Source: https://docs.ntropy.com/documentation/api/entities/search-entity.mdx Provides an example of resolving an entity using a cURL POST request, including required application ID and API key headers. ```shell curl -X POST https://api.ntropy.com/v3/entities/resolve \\ -H "X-Application-Id: string" \\ -H "X-Api-Key: " \\ -H "Content-Type: application/json" \\ -d '{}' ``` -------------------------------- ### Replace Rules using Ntropy Python SDK Source: https://docs.ntropy.com/documentation/api/personalization/filter-replace.mdx Illustrates how to programmatically replace rules using the Ntropy Python SDK. The example shows initializing the SDK and calling the rules.replace method with a list of rule dictionaries, mirroring the complex payload structure. ```python from ntropy_sdk import SDK sdk = SDK("cd1H...Wmhl") rules = sdk.rules.replace( [ { "if": {"is_substring": [{"get": "website"}, "ntropy"]}, "then": [{"set": "logo", "to": "http://example.com/favicon.ico"}], "else": [{"remove_label": "example label"}], } ] ) ``` -------------------------------- ### Retrieve Specific Account Holder by ID Source: https://docs.ntropy.com/documentation/api/account-holders/get-account-holders.mdx Examples demonstrating how to fetch details for a single account holder using their unique identifier, provided in both cURL and Python SDK. ```shell curl -X "GET" \ "https://api.ntropy.com/v3/account_holders/35b927b6-6fda-40aa-93b8-95b47c2b2cad" \ -H "Accept: application/json" \ -H "X-API-KEY: cd1H...Wmhl" ``` ```python from ntropy_sdk import SDK sdk = SDK("cd1H...Wmhl") ah = sdk.account_holders.get("35b927b6-6fda-40aa-93b8-95b47c2b2cad") ``` -------------------------------- ### Retrieve Batch Results HTTP GET Endpoint Source: https://docs.ntropy.com/documentation/api/batches/get-batch-results.mdx Defines the HTTP GET endpoint for retrieving the results of a specific batch by its ID. ```http GET https://api.ntropy.com/v3/batches/{id}/results ``` -------------------------------- ### Retrieve Specific Batch using cURL Source: https://docs.ntropy.com/documentation/api/batches/get-single-batch.mdx Demonstrates how to retrieve a specific batch using a cURL GET request, including the batch ID, Accept header, and X-API-KEY for authentication. ```shell curl -X "GET" \ "https://api.ntropy.com/v3/batches/203613d2-83c8-4130-8809-d14206eeec20" \ -H "Accept: application/json" \ -H "X-API-KEY: cd1H...Wmhl" ``` -------------------------------- ### Retrieve Specific Account Holder using cURL Source: https://docs.ntropy.com/documentation/api/account-holders/get-account-holder.mdx Example cURL command to retrieve a specific account holder by ID, including the Accept header and X-API-KEY for authentication. ```shell curl -X "GET" \ "https://api.ntropy.com/v3/account_holders/35b927b6-6fda-40aa-93b8-95b47c2b2cad" \ -H "Accept: application/json" \ -H "X-API-KEY: cd1H...Wmhl" ``` -------------------------------- ### Example JSON Output for Recurring Groups API Response Source: https://docs.ntropy.com/enrichment/recurrence This JSON snippet illustrates the typical structure of the response from the Ntropy Recurrence API's `recurring_groups` endpoint. It details how individual recurring groups are represented, including their unique ID, start and end dates, total and average amounts, periodicity (in days and descriptive), counterparty details (ID, name, website, logo, type), categorized information, associated transaction IDs, and the overall entry type (e.g., 'outgoing' or 'incoming'). ```json [ { "id": "5a38529e-2df2-3e34-ac4d-98dcd294b781", "start_date": "2024-01-20", "end_date": "2024-04-20", "total_amount": 4000.0, "average_amount": 1000.0, "periodicity_in_days": 31.0, "periodicity": "monthly", "counterparty": { "id": "dc425051-df94-3509-9103-cf8c0f0bcf6a", "name": "Netflix", "website": "netflix.com", "logo": "https://logos.ntropy.com/netflix.com", "mccs": [], "type": "organization" }, "categories": { "general": "entertainment - television - subscriptions" }, "transaction_ids": [ "sub-4", "sub-3", "sub-2", "sub-1" ], "entry_type": "outgoing" }, { "id": "7e529088-cc5b-3eed-8050-b98034bc5184", "start_date": "2024-01-20", "end_date": "2024-04-20", "total_amount": 4000.0, "average_amount": 1000.0, "periodicity_in_days": 31.0, "periodicity": "monthly", "counterparty": { "id": "dc425051-df94-3509-9103-cf8c0f0bcf6a", "name": "Netflix", "website": "netflix.com", "logo": "https://logos.ntropy.com/netflix.com", "mccs": [], "type": "organization" }, "categories": { "general": "income - paycheck" }, "transaction_ids": [ "sal-4", "sal-3", "sal-2", "sal-1" ], "entry_type": "incoming" } ] ``` -------------------------------- ### Generic cURL PATCH Webhook Example Source: https://docs.ntropy.com/documentation/api/webhooks/patch-webhook.mdx Generic cURL command to perform a PATCH request to update a webhook, including placeholder headers for application ID and API key and an empty JSON body. ```shell curl -X PATCH https://api.ntropy.com/v3/webhooks/:id \ -H "X-Application-Id: string" \ -H "X-Api-Key: " \ -H "Content-Type: application/json" \ -d '{}' ``` -------------------------------- ### API Documentation: Retrieve Webhook Endpoint Source: https://docs.ntropy.com/documentation/api/webhooks/get-webhook.mdx Details the HTTP GET endpoint for retrieving a specific webhook, including its path, required headers, path parameters, and possible HTTP response codes. ```http GET https://api.ntropy.com/v3/webhooks/{id} ``` ```APIDOC Request Headers: - X-Application-Id (required) Path Parameters: - Id (required) Response Body: - 200: Successful Response - 422: Validation Error ``` -------------------------------- ### Define Nested Conditional Rules with Python SDK Source: https://docs.ntropy.com/personalization Demonstrates how to define and apply nested conditional rules using the Ntropy Python SDK. This example sets a 'logo' property based on the 'website' value, with a specific logo for 'api.ntropy.com' and a general one for 'ntropy.com'. ```Python from ntropy_sdk import SDK\n\nsdk = SDK("cd1H...Wmhl")\nrules = [\n {\n "if": {\n "==": [\n {"get": "website"},\n "ntropy.com"\n ]\n },\n "then": [\n {\n "if": {\n "==": [\n {"get": "website"},\n "api.ntropy.com"\n ]\n },\n "then": [\n {"set": "logo", "to": "https://logos.ntropy.com/api.ntropy.com"}\n ],\n "else": [\n {"set": "logo", "to": "https://logos.ntropy.com/ntropy.com"}\n ]\n }\n ]\n }\n]\nsdk.rules.replace(rules) ``` -------------------------------- ### Replace Rules using cURL with Complex Payload Source: https://docs.ntropy.com/documentation/api/personalization/filter-replace.mdx Provides a cURL command example demonstrating how to send a POST request to the /v3/rules/replace endpoint. It includes a detailed JSON payload illustrating conditional rule structures with is_substring, set, and remove_label actions. ```shell curl -X "POST" \ "https://api.ntropy.com/v3/rules/replace" \ -H "Accept: application/json" \ -H "X-API-KEY: cd1H...Wmhl" \ -H "Content-Type: application/json" \ -d '[{ "if": { "is_substring": [ {"get": "website"}, "ntropy" ] }, "then": [ {"set": "logo", "to": "http://example.com/favicon.ico"} ], "else": [ {"remove_label": "example label"} ] }]' ``` -------------------------------- ### Retrieve Specific Bank Statement using cURL Source: https://docs.ntropy.com/documentation/api/bank-statements/get-bank-statement.mdx An example demonstrating how to retrieve a specific bank statement using the cURL command-line tool, providing a concrete bank statement ID and including necessary headers for authentication and content type negotiation. ```shell curl -X "GET" \ "https://api.ntropy.com/v3/bank_statements/7f8dceac-2848-472d-b5c3-55cdbaf35a9b" \ -H "Accept: application/json" \ -H "X-API-KEY: cd1H...Wmhl" ```