{"id":20505654,"url":"https://github.com/openbankproject/do-data-import","last_synced_at":"2026-04-24T05:36:42.461Z","repository":{"id":60911041,"uuid":"543330526","full_name":"OpenBankProject/do-data-import","owner":"OpenBankProject","description":"Python scripts for populating DO data set from spreadsheets","archived":false,"fork":false,"pushed_at":"2022-10-13T12:51:50.000Z","size":94,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-05T21:28:18.503Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OpenBankProject.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-09-29T21:45:36.000Z","updated_at":"2023-03-14T20:11:12.000Z","dependencies_parsed_at":"2023-01-19T23:31:03.328Z","dependency_job_id":null,"html_url":"https://github.com/OpenBankProject/do-data-import","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/OpenBankProject/do-data-import","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenBankProject%2Fdo-data-import","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenBankProject%2Fdo-data-import/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenBankProject%2Fdo-data-import/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenBankProject%2Fdo-data-import/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OpenBankProject","download_url":"https://codeload.github.com/OpenBankProject/do-data-import/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenBankProject%2Fdo-data-import/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32211381,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-24T03:15:14.334Z","status":"ssl_error","status_checked_at":"2026-04-24T03:15:11.608Z","response_time":64,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-15T19:48:48.350Z","updated_at":"2026-04-24T05:36:42.446Z","avatar_url":"https://github.com/OpenBankProject.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Usage Guide\n\nThis document explains how to load the Dominican Republic SB Data Dictionary into the IFC OBP Sandbox and query it.\n\nPython Scripts are provided which read the spreadsheets and call the OBP APIs.\n\n\n### Configure the script\n\nWe need to copy the script config and modify it - and add our username / password and consumer key.\n\n1) cp ./obp_python/example_config.py to ./obp_python/config.py \n2) add your [username / password](https://ifcsandbox.openbankproject.com/user_mgt/sign_up) and [consumer key](https://ifcsandbox.openbankproject.com/consumer-registration) \n\n### Copy your data set to  the data  sheet\n\nWe need to copy the spreadsheet template and then add your own data. Please do not change the structure of the spreadsheet in any way.\n\n1) cp resources/sb_import_template.xlsx to resources/sb_import.xlsx\n2) import your data set into the spreadsheet resources/sb_import.xlsx_\n\n### Use the script\n\nWe need to import the data and check it loaded ok. We can also remove the data.\n\n1) To import data:\n run upload_data_set_to_sandbox.py\n   \n2) To check imported data:\nrun get_imported_data_from_sandbox.py\nNote: sb data set productos are account attributes within obp accounts\n   \n3) To delete imported data:\n run delete_imported_data_from_sandbox.py\n\n   \n## Endpoints for retrieving the data\n\nThere are multiple endpoints you can use to inspect and update the data. Here we list a basic set. \n\nYou need to be authenticated and authorised before you can call most of the endpoints.\n\nThe simplest way to authenticate is via Direct Login. You can also try the endpoints in API Explorer. API Explorer will tell you if you need a Role and you can request it on API Explorer by clicking a button there. Please contact support in case you need a Role.\n\n### Get Direct Login Token\n\nFor development purposes, you could use an easy access authentication, called direct login:\nRegister your username and password [here](https://ifcsandbox.openbankproject.com/user_mgt/sign_up)\nGet your consumer key [here](https://ifcsandbox.openbankproject.com/consumer-registration)\n\nExample (replace $YOUR_CONSUMER_KEY with your consumer key, not consumer secret):\n```\ncurl --location --request POST 'https://ifcsandbox.openbankproject.com/my/logins/direct' \\\n--header 'Authorization: DirectLogin username=\"YOURUSERNAME\",password=\"password\",consumer_key=$YOUR_CONSUMER_KEY' \\\n--header 'Content-Type: application/json' \n```\nReplace $YOUR_DIRECT_LOGIN_TOKEN in the Examples below with the token you get!\n\n### Get Bank\nUse Endpoint [Get Bank](https://ifcsandbox-explorer.openbankproject.com/?version=OBPv5.0.0\u0026operation_id=OBPv5_0_0-getBank\u0026currentTag=Bank#OBPv5_0_0-getBank)\n\nExample:\n```\ncurl --location --request GET 'https://ifcsandbox.openbankproject.com/obp/v5.0.0/banks/ADOPEM'\n```\n### Get Customers\n\nUse Endpoint [Get Customers at Bank](https://ifcsandbox-explorer.openbankproject.com/?version=OBPv5.0.0\u0026operation_id=OBPv5_0_0-getCustomersAtOneBank\u0026currentTag=Customer#OBPv5_0_0-getCustomersAtOneBank)\n\nExample:\n```\ncurl --location --request GET 'https://ifcsandbox.openbankproject.com//obp/v5.0.0/banks/ADOPEM/customers' \\\n--header 'Authorization: DirectLogin token=$YOUR_DIRECT_LOGIN_TOKEN'\n```\n### Get Customer by CustomerNumber\nUse Endpoint [Get Customer by CustomerNumber](https://ifcsandbox-explorer.openbankproject.com/?version=OBPv5.0.0\u0026operation_id=OBPv3_1_0-getCustomerByCustomerNumber\u0026currentTag=Customer#OBPv3_1_0-getCustomerByCustomerNumber)\n\nExample:\n\n```\ncurl --location --request POST 'https://ifcsandbox.openbankproject.com/obp/v4.0.0/banks/ADOPEM/customers/customer-number' \\\n--header 'Authorization: DirectLogin token=$YOUR_DIRECT_LOGIN_TOKEN' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{  \"customer_number\":\"4578102\"}'\n```\n### Get all accounts for one Bank\nUse Endpoint [Get Fast Firehose Accounts at Bank](https://ifcsandbox-explorer.openbankproject.com/?version=OBPv5.0.0\u0026operation_id=OBPv4_0_0-getFastFirehoseAccountsAtOneBank\u0026currentTag=Account#OBPv4_0_0-getFastFirehoseAccountsAtOneBank).\nTake a look at the documentation regarding the pagination\n\nExample:\n```\ncurl --location --request GET 'https://ifcsandbox.openbankproject.com//obp/v5.0.0/management/banks/ADOPEM/fast-firehose/accounts?limit=100\u0026offset=0' \\\n--header 'Authorization: DirectLogin token=$YOUR_TOKEN' \n```\n### Get Account by AccountRouting\nUse this Endpoint [Get Account by AccountRouting](https://ifcsandbox-explorer.openbankproject.com/?version=OBPv5.0.0\u0026operation_id=OBPv4_0_0-getAccountByAccountRouting\u0026currentTag=Account#OBPv4_0_0-getAccountByAccountRouting)\n\nExample\n```\ncurl --location --request POST 'https://ifcsandbox.openbankproject.com/obp/v5.0.0/management/accounts/account-routing-query' \\\n--header 'Content-Type: application/json' \\\n--header 'Authorization: DirectLogin token=$YOUR_DIRECT_LOGIN_TOKEN' \\\n--data-raw '{\n    \"bank_id\": \"ADOPEM\",\n    \"account_routing\": {\n        \"scheme\": \"account_number\",\n        \"address\": \"50000210007693\"\n    }\n}'\n```\n### Get Branches for a Bank\n\n```\ncurl --location --request GET 'https://ifcsandbox.openbankproject.com/obp/v3.0.0/banks/ADOPEM/branches' \\\n--header 'Authorization: DirectLogin token=$YOUR_DIRECT_LOGIN_TOKEN' \\\n--header 'Content-Type: application/json'\n```\n\n### Get Authority Data Requests\nUse the Endpoint [Get Authority Data Request List](https://ifcsandbox-explorer.openbankproject.com/?version=OBPv5.0.0\u0026operation_id=OBPv4_0_0-dynamicEntity_getauthority_data_requestList_ADOPEM\u0026currentTag=_Authority%20Data%20Request(ADOPEM)#OBPv4_0_0-dynamicEntity_getauthority_data_requestList_ADOPEM)\n\nTechnically, each bank has its own endpoint, but those only differ in the BANK_ID.\nExample:\n```\ncurl --location --request GET 'https://ifcsandbox.openbankproject.com//obp/dynamic-entity/banks/POPULAR/authority_data_request' \\\n--header 'Authorization: DirectLogin token=$YOUR_DIRECT_LOGIN_TOKEN' \n```\n\n### Get Customer Overview\n\nUse the endpoint [Get Customer Overview Flat](https://ifcsandbox-explorer.openbankproject.com/?version=OBPv5.0.0\u0026operation_id=OBPv5_0_0-getCustomerOverviewFlat\u0026currentTag=Customer#OBPv5_0_0-getCustomerOverviewFlat) to get all relavent information of a customer by their Customer Number.\n\nExample:\n```\ncurl --location --request POST 'https://ifcsandbox.openbankproject.com//obp/v5.0.0/banks/ADOPEM/customers/customer-number-query/overview-flat' \\\n--header 'Authorization: DirectLogin token=$YOUR_DIRECT_LOGIN_TOKEN' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n    \"customer_number\": \"4578102\"\n```\n## Endpoints for uploading the data\n\n\n\nIf you are interested in the scripts underlying api endpoints, or even creating your own upload scripts, \nfollow the process below\n\n### Create bank\n\nUse Endpoint  [create Bank](https://ifcsandbox-explorer.openbankproject.com/?version=OBPv4.0.0\u0026operation_id=OBPv4_0_0-createBank\u0026currentTag=Bank\u0026api-collection-id=#OBPv4_0_0-createBank)\nto create your bank.\n\nNeeds role \"CanCreateBank\" on the sandbox.\nWill give you the role \"CanCreateEntitlementAtOneBank\" , so you can grant yourself all roles needed below [here](https://ifcsandbox-explorer.openbankproject.com/?version=OBPv4.0.0\u0026operation_id=OBPv2_0_0-addEntitlement\u0026currentTag=Role#OBPv2_0_0-addEntitlement)\n\n\n### Create customer\n\nUse Endpoint [Create Customer](https://ifcsandbox-explorer.openbankproject.com/?version=OBPv4.0.0\u0026operation_id=OBPv3_1_0-createCustomer\u0026currentTag=Customer\u0026api-collection-id=#OBPv3_1_0-createCustomer)\nThe OBP modell demands information that you do not have. So for creation, there is the need to add some default values.\nThose could be hidden in the responses by query parameter, though.\n\nExample of minimal working create Customer:\n\n```\ncurl --location --request POST 'https://ifcsandbox.openbankproject.com//obp/v5.0.0/banks/APAP/customers' \\\n--header 'Authorization: DirectLogin token=YOUR_TOKEN' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n    \"legal_name\": \"Herbert Muller\",\n    \"mobile_phone_number\": \"\",\n    \"email\": \"\",\n    \"face_image\": {\n        \"url\": \"\",\n        \"date\": \"1100-01-01T00:00:00Z\"\n    },\n    \"date_of_birth\": \"1100-01-01T00:00:00Z\",\n    \"relationship_status\": \"\",\n    \"dependants\": 0,\n    \"dob_of_dependants\": [\n    ],\n    \"credit_rating\": {\n        \"rating\": \"\",\n        \"source\": \"\"\n    },\n    \"credit_limit\": {\n        \"currency\": \"\",\n        \"amount\": \"\"\n    },\n    \"highest_education_attained\": \"\",\n    \"employment_status\": \"\",\n    \"kyc_status\": true,\n    \"last_ok_date\": \"1100-01-01T00:00:00Z\",\n    \"title\": \"\",\n    \"branch_id\": \"\",\n    \"name_suffix\": \"\"\n}'\n```\nThis call will create the customer_id needed for subsequent customer related apis.\nNeeds role \"CanCreateCustomer\" for the bank (id), or \"CanCreateCustomerAtAnyBank\".\n\n\nCreate any bank specific customer attributes that you cannot map to obp generic attributes. [Here](https://apiexplorersandbox.openbankproject.com/?version=OBPv4.0.0\u0026operation_id=OBPv4_0_0-createCustomerAttribute\u0026currentTag=Customer\u0026api-collection-id=#OBPv4_0_0-createCustomerAttribute)\nNeeds role \"CanCreateCustomerAttributeAtOneBank\" for the bank.\n### Update customer number\n\nUse Endpoint [Update the number of a Customer](https://ifcsandbox-explorer.openbankproject.com/?version=OBPv4.0.0\u0026operation_id=OBPv3_1_0-updateCustomerNumber\u0026currentTag=Customer\u0026api-collection-id=#OBPv3_1_0-updateCustomerNumber) to change the automatically created Customernumber to the real value\n\nExample: \n```\ncurl --location --request PUT 'https://ifcsandbox.openbankproject.com//obp/v5.0.0/banks/APAP/customers/7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh/number' \\\n--header 'Authorization: DirectLogin token=$YOUR_TOKEN' \\\n--header 'Content-Type: application/json' \n--data-raw '{\n    \"customer_number\": \"5987953\"\n}'\n```\n### Accounts: If the product does not exist, create the Product\n\nAn account is of a certain product in obp ( like \"Gold Card\", \"Generic Debit\", \"any_arbitrary_string\"). If you want to add account attributes, which is what you want to do, you  need to name a product for account creation (next step)\nCreate [here](https://ifcsandbox-explorer.openbankproject.com/?version=OBPv4.0.0\u0026operation_id=OBPv3_1_0-createProduct\u0026currentTag=Product\u0026api-collection-id=#OBPv3_1_0-createProduct).\n\nNeeds role: \"CanCreateProduct\" at bank level or \"CanCreateProductAtAnyBank\".\n### Create the Account \nNote that new created accounts must always  have an balance of zero. So we need to make a initial transaction to/from the account to a settlement account \ncreate [here](https://ifcsandbox-explorer.openbankproject.com/?version=OBPv4.0.0\u0026operation_id=OBPv4_0_0-addAccount\u0026currentTag=Account\u0026api-collection-id=\u0026bank_id=\u0026account_id=\u0026view_id=\u0026counterparty_id=\u0026transaction_id=#OBPv4_0_0-addAccount)\n\nExample:\n```\ncurl --location --request POST 'https://ifcsandbox.openbankproject.com/obp/v5.0.0/banks/APAP/accounts' \\\n--header 'Content-Type: application/json' \\\n--header 'Authorization: DirectLogin token=$YOUR_TOKEN' \\\n--data-raw '{\n    \"user_id\": \"\",\n    \"label\": \"\",\n    \"product_code\": \"Basic\",\n    \"balance\": {\n        \"currency\": \"DOP\",\n        \"amount\": \"0\"\n    },\n    \"branch_id\": \"\",\n    \"account_routings\": [\n        {\n            \"scheme\": \"account_number\",\n            \"address\": \"799245353490933\"\n        }\n    ]\n}'\n```\nNeeds role \"CanCreateAccount\" at bank level.\n\nCreate any bank specific account attributes that you cannot map to obp generic attributes. [Here](https://ifcsandbox-explorer.openbankproject.com/?version=OBPv4.0.0\u0026operation_id=OBPv3_1_0-createAccountAttribute\u0026currentTag=Account#OBPv3_1_0-createAccountAttribute)\nNeeds role \"CanCreateAccountAttributeAtOneBank\" for the bank.\n### Create the settlement accounts\n\nTo make the initial transfer to set the balance, you will need a settlement account on the bank where this transaction goes to/ comes from.\nYou will need one settlement account per currency.\n\nExample:\n```\ncurl --location --request POST 'https://ifcsandbox.openbankproject.com/obp/v5.0.0/banks/APAP/settlement-accounts' \\\n--header 'Content-Type: application/json' \\\n--header 'Authorization: DirectLogin token=$YOUR_TOKEN' \\\n\n--data-raw '{\n    \"user_id\": \"\",\n    \"payment_system\": \"SANDBOX-TAN\",\n    \"balance\": {\n        \"currency\": \"DOP\",\n        \"amount\": \"0\"\n    },\n    \"label\": \"\",\n    \"branch_id\": \"\",\n    \"account_routings\": [\n        {\n            \"scheme\": \"settlement\",\n            \"address\": \"12345678\"\n        }\n    ]\n}'\n```\n\n### Create the balance\nUse Endpoint [Create Historical Transactions](https://ifcsandbox-explorer.openbankproject.com/?version=OBPv4.0.0\u0026operation_id=OBPv4_0_0-createHistoricalTransactionAtBank\u0026currentTag=Transaction-Request#OBPv4_0_0-createHistoricalTransactionAtBank)\nto create a transaction from (positive balance) or from (negative balance) the settlement account.\nSettlement account_id will be: SANDBOX-TAN_SETTLEMENT_ACCOUNT_$CURRENCY \u003c- replace $CURRENCY with the currency.\n\nE.g. : SANDBOX-TAN_SETTLEMENT_ACCOUNT_DOP\n\nExample:\n```\ncurl --location --request POST 'https://ifcsandbox.openbankproject.com/obp/v5.0.0/banks/ADOPEM/management/historical/transactions' \\\n--header 'Content-Type: application/json' \\\n--header 'Authorization: DirectLogin token=$YOUR_TOKEN' \\\n--data-raw '{\n    \"from_account_id\": \"SANDBOX-TAN_SETTLEMENT_ACCOUNT_DOP\",\n    \"to_account_id\": \"6153fd73-c5c8-449f-8f2c-a360f4ee2f9f\",\n    \"value\": {\n        \"currency\": \"DOP\",\n        \"amount\": \"2230\"\n    },\n    \"description\": \"this is for work\",\n    \"posted\": \"1100-01-01T01:01:01Z\",\n    \"completed\": \"1100-01-01T01:01:01Z\",\n    \"type\": \"SANDBOX_TAN\",\n    \"charge_policy\": \"SHARED\"\n```\n\n### Create Branch\nUse Endpoint [Create Branch](https://ifcsandbox-explorer.openbankproject.com/?version=OBPv4.0.0\u0026operation_id=OBPv3_0_0-createBranch\u0026currentTag=Branch\u0026api-collection-id=\u0026bank_id=#OBPv3_0_0-createBranch)\nNeeds role \"CanCreateBranch\" at bank level or \"CanCreateBranchAtAnyBank\"\n\n\n### Create Authority Data Requests\n\nUse Endpoint [Create new Authority Data Request](https://ifcsandbox-explorer.openbankproject.com/?version=OBPv4.0.0\u0026operation_id=OBPv4_0_0-dynamicEntity_createauthority_data_request_ADOPEM\u0026currentTag=_Authority%20Data%20Request(ADOPEM)#OBPv4_0_0-dynamicEntity_createauthority_data_request_ADOPEM)\n\nTechnically, each bank has its own endpoint, but those only differ in the BANK_ID.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenbankproject%2Fdo-data-import","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopenbankproject%2Fdo-data-import","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenbankproject%2Fdo-data-import/lists"}