Parrot Batch Overview

Overview

  • Generate encrypted data on POST: /batch/database/export
  • Download generated file from GET: /batch/database/export
  • Decrypt records using our SDK.
  • Get updates of data from batch/database/updates?version='', where version is the version of the Pagos BIN Database that was previous generated for you. Version comes in batch/database/export response. After receiving updates, a new version comes in batch/database/updates?version='', and you're are responsible for storing it locally so you receive valid updates.
  • Use the cursor parameter in your /batch/database/updates call to return decrypted data and speed up updates.

Initial Download of the Encrypted BIN Tables

As a user of Parrot, if you have purchased the Parrot Batch product, you'll be able to generate a download link in the Parrot Dashboard UI to obtain the base version of the BIN Tables.

Decryption SDK Usage

Install SDK

pip install askparrot-decryption-sdk

Get Started

Import pagos_data_cipher class

from pagos_data_cipher import pagos_data_cipher

Create new class instance with your decryption key

key = 'c5eecea51092f900b10ffc6e07345f72' #16bytes in hex form
cipher = pagos_data_cipher(key)

Decrypt data

data = {'cardType': 'd048354e1921fade74c9307fd38bd497'} 

decrypted = cipher.decrypt_object(data)

# decrypted = {'cardType': 'visa'}

decrypt_object function accepts data with the type of dict and decrypts the following fields:

  • cardType
  • cardCountry
  • brand
  • bank_name
  • product_code
  • clean_bank_name
  • creditOrDebit
  • cardCountry_alpha3

Updates

Our BIN data is updated at a minimum on a weekly basis. To update your local copy:

  1. Call batch/database/last-version to check the latest version of our BIN data.
  2. Compare the latest version with the version you have stored locally.
  3. If you have an outdated version of our BIN data, call batch/database/updates. The response will include a JSON file of updated records.

Decrypted Updates

Parrot Batch v1

When calling the /batch/database/updates endpoint for updates in Parrot Batch v1, Parrot batch returns your data in an encrypted file by default. However, you can choose to pass the optional cursor value in your call, which will return a decrypted JSON file and will generally result in faster operation time when calling for updates:

  1. Pass the version and cursor value in your /batch/database/updates call
  2. When you send first call with a cursor value of 0, Parrot Batch will return a next_cursor value
  3. You can stop requesting for updates when the next_cursor value is returned as “null“

Parrot Batch v2

In Parrot Batch v2, you can get decrypted updates by setting the ecrypted parameter to false when calling the /batch/database/updates/v2 endpoint for updates.