SFC Code Examples - OpenBankProject/OBP-API GitHub Wiki

Where does the data come from:

Bank:

{
    "id": "BANGANADERO",   <- field 7 of rt1 (entity key)
    "short_name": "BBVA Colombia", <- data dictionary: supervised entities
    "full_name": "Banco Bilbao Vizcaya Argentaria Colombia S.A. podrá utilizar el nombre BBVA Colombia", <- data dictionary: supervised entities
    "logo": null,
    "website": null,
    "bank_routings": [
        {
            "scheme": "OBP", <- scheme "OBP"
            "address": "BANGANADERO"
        }
    ],
    "attributes": [
        {
            "name": "TAX_ID", 
            "value": "860003020-1" <- data dictionary: supervised entities
        }
    ]
}

Product:

{
    "bank_id": "BANGANADERO", <- Obp bank_id, comming from rt1 ( see 'Bank' above)
    "product_code": "1200",  <- data dictionary
    "parent_product_code": "PRODUCTOS_Y_SERVICIOS_FINANCIEROS_MINORISTAS", <- data dictionary
    "name": "CUENTA_DE_AHORRO",  <- rt4  field 5 Código de la Unidad de Captura , field 6 (Código de la Subcuenta), mapped against F365
    "more_info_url": null,
    "terms_and_conditions_url": null,
    "description": null,
    "meta": {
        "license": {
            "id": "ODbL",    <- The License that applies to the product data.
            "name": "Open Database License"
        }
    },
    "attributes": [],
    "fees": [ List of fees, see 'Fee" below
    ]
}

Fee:

{
           "product_fee_id": "6ab6659e-f234-4415-8e55-f2c8a77c5823",      <- autogenerated at fee creation
           "name": "CUOTA_DE_ADMINISTRACIÓN",   <-  rt4  field 5 Código de la Unidad de Captura , field 6 (Código de la Subcuenta), mapped against F365
           "is_active": false,  <- rt4  field 4 (Código de la Columna) == 01, and field 8 (value) == 2  => false, else true
           "more_info": "",
           "value": {
               "currency": "COP", <- Default, USD if Código de la Columna == 03, some Captura/Subcuanta map to Format 365 Tabla2 (Unidades) Codigo == 1
               "amount": "0.00",   
               "frequency": null, <- mapping of  Tabla2 Unidades,  if Código de la Columna == 03 for some Captura/Subcuanta
               "type": null   <-  mapping of  Tabla2 Unidades,  if Código de la Columna == 03 for some Captura/Subcuanta
           }
       }

Code examples

Get data

Postman collection can be found here: https://static.openbankproject.com/ifc/SFC_Fees_API.postman_collection.json

getBanks:

curl --location --request GET 'https://ifcsandbox.openbankproject.com/obp/v4.0.0/banks'

getBank: (replace BANGANADERO with your BANK_ID)

curl --location --request GET 'https://ifcsandbox.openbankproject.com/obp/v4.0.0/banks/BANGANADERO'

getProducts: (replace BANGANADERO with your BANK_ID)

curl --location --request GET 'https://ifcsandbox.openbankproject.com/obp/v4.0.0/banks/BANGANADERO/products'

getProduct: (replace BANGANADERO, 1200 with your BANK_ID, PRODUCT_CODE)

curl --location --request GET 'https://ifcsandbox.openbankproject.com/obp/v4.0.0/banks/BANGANADERO/products/1200'

getProductFees:

curl --location --request GET 'https://ifcsandbox.openbankproject.com/obp/v4.0.0/banks/BANGANADERO/products/1200/fees'

Upload data

create Authorization Token (YOURTOKEN): ( replace YOUR_USER_NAME, YOUR_PASSWORD, YOUR_CONSUMER_KEY)

curl --location --request POST 'https://ifcsandbox.openbankproject.com/my/logins/direct' \ --header 'Authorization: DirectLogin username="YOUR_USER_NAME",password="YOUR_PASSWORD",consumer_key=YOUR_CONSUMER_KEY'

createBank: ( replace YOURTOKEN)

curl --location --request POST 'https://ifcsandbox.openbankproject.com/obp/v4.0.0/banks' \ --header 'Content-Type: application/json' \ --header 'Authorization: DirectLogin token=YOURTOKEN' \ --data-raw '{ "id": "OBP_DEFAULT_BANK_ID", "short_name": "obp", "full_name": "obp", "logo": "https://static.openbankproject.com/whatever", "website": "https://www.openbankproject.com", "bank_routings": [{ "scheme": "OBP", "address": "OBP_DEFAULT_BANK" }] }'

create Entitlements for managing bank data: replace USER_ID with your user_id. replace BANK_ID and YOURTOKEN. replace ROLE_NAME with the following one of the role names, call for each role name individually: 'CanCreateBankAttribute',

'CanCreateProduct', 'CanCreateProductFee', 'CanDeleteProductFee', 'CanUpdateProductFee'

curl --location --request POST 'https://ifcsandbox.openbankproject.com/obp/v2.1.0/users/USER_ID/entitlements' \ --header 'Content-Type: application/json' \ --header 'Authorization: DirectLogin token=YOURTOKEN' \ --data-raw '{ "bank_id": "BANK_ID", "role_name": "ROLE_NAME" }'

create BankAttribute: (replace YOURTOKEN, BANK_ID)

curl --location --request POST 'https://ifcsandbox.openbankproject.com/obp/v4.0.0/banks/BANK_ID/attribute' \ --header 'Authorization: DirectLogin token=YOURTOKEN' \ --data-raw '{ "name": "TAX_ID", "type": "STRING", "value": "1234567-8", "is_active": true }'

create or update Product: ( replace YOURTOKEN, BANK_ID, PRODUCT_CODE)

curl --location --request PUT 'https://ifcsandbox.openbankproject.com/obp/v4.0.0/banks/BANK_ID/products/PRODUCT_ID' \ --header 'Content-Type: application/json' \ --header 'Authorization: DirectLogin token=YOURTOKEN' \ --data-raw '{ "parent_product_code": "PRODUCTOS_Y_SERVICIOS_FINANCIEROS_MINORISTAS", "name": "CUENTA_DE_AHORRO", "more_info_url": "no-example-provided", "terms_and_conditions_url": "no-example-provided", "description": "no-example-provided", "meta": { "license": { "id": "ODbL", "name": "Open Database License" } } }'

createFee ( replace YOURTOKEN, BANK_ID, PRODCUCT_CODE)

curl --location --request POST 'https://ifcsandbox.openbankproject.com//obp/v4.0.0/banks/BANK_ID/products/PRODCUCT_CODE/fee' \ --header 'Content-Type: application/json' \ --header 'Authorization: DirectLogin token=YOURTOKEN' \ --data-raw '{ "name": "ACCOUNT_MANAGEMENT_FEE", "is_active": true, "more_info": "for geneneric debit account", "value": { "currency": "COP", "amount": "10.12", "frequency": "MONTHLY", "type": "" } }'