Skip to main content

Transactions

Adding transactions to Blip is incredibly easy.

Adding transactions#

First, you need to submit transactions to our /transactions endpoint. You can do this with the following python code.

transactions_in = [
{
"origin_id": "jQfA2qMb6ZS8JEsdlDd5Y",
"name": "VERIZON*RECURRING PAY",
"date": "2019-09-16",
"amount": -64.99,
"account_id": "hl3EG5XCNTX3eMmzsn9Au",
"user_id": "ibN0eluvlVQBbjIma3DDG",
}
]
try:
api_response = blip.transactions.add_transactions(transactions_in)
print(api_response)
except blip.ApiException as e:
print("Exception when calling transactions->add_transactions: %s\n" % e)

The above example will return a response similar to:

{ "batch_id": "batch_UWdKMdKYeGxYiOOu8t4Df", "complete": false, "count": 1 }

This tells us three important pieces of information —

  1. batch_id : The unique identifier for this batch of transactions within the Blip platform.
  2. complete : Whether the batch of transactions have been successfully processed.
  3. count : The number of transactions successfully added.

Checking the status of transactions#

To check on the status of your submitted batch —

transactions_status_resp = blip.get_transactions_status(batch_id=api_response["batch_id"])
print(transactions_status_resp)

The above example will return a response similar to:

{ "batch_id": "batch_iq9oEPhMJhqbE0cg7xDhU", "complete": true, "count": 1000 }

Getting transaction results#

Once your transactions are processed, you can receive results by sending a request to our /transactions/results endpoint. When getting results, you can filter by user_id or batch_id to limit the amount of results. Results will include helpful information about the frequency of the transaction, whether it is a bill, the suggested billers for this transaction type, as well as other information you may find useful. For a complete list of attributes you will receive, check the transactions section of our API Reference documentation.

To get this response you can use the below example:

results_resp = blip.transactions.get_transactions_results(batch_id=api_response["batch_id"])
print(results_resp)

This returns a response like:

{
"user_id": "ibN0eluvlVQBbjIma3DDG",
"name": "AMERICAN EXPRESS",
"is_bill": true,
"amount_mean": -1840.14,
"amount_std": 3855.42,
"date_diff_avg": 25,
"first_transaction": "2019-08-01T00:00:00",
"last_transaction": "2021-02-04T00:00:00",
"transaction_count": 23,
"suggested_billers": [
{
"name": "American Express",
"domain": "www.americanexpress.com",
"logo_url": "https://cdn.tryblip.com/logos/billers/370052.png",
"login_url": "https://online.americanexpress.com/myca/logon/us/action?request_type=LogonHandler&Face=en_US&inav=iNavLnkLog",
"categories": ["loans-and-credit-cards", "credit-card"],
"confidence": 98.52
}
],
"transactions": [
{
"id": "trn_Dg9MJkpVz6REAeLVKR8Nd",
"origin_id": "ndGA6MrL7oABJeAIb79Wh"
}
]
}

With this information you are able to display the login_url link (and any other information) to your endusers so that they can manage and pay their bills.