Skip to content

Santander OBP API Sandbox

Mulugeta Ayalew edited this page Mar 13, 2018 · 12 revisions

Hello!

This is a special page for the Santander OBP API sandbox.

TL;DR

Go here: Santander

Status

This document may be updated.

Overview

Open Bank Project is an open source API for banks that provides a RESTful interface for developers to build customer facing applications without needing to code for each bank or account type differently. You can use it as a flexible toolbox of data and services to help realise (a.k.a. hack!) your ideas together. For the hackathons, developers have access to simulated transaction data for imaginary customers that match certain customer profiles.

What sort of applications can I build with the OBP API?

Customer facing retail banking and fintech applications for consumers, SMEs, associations, charities, governments and NGOs; including (but not limited to!) Personal Finance Management (PFM) Solutions, online accounting integration, financial widgets, Savings Apps, Education Apps, Gamification, Peace of Mind Apps, Transparency Apps, Crowd funding, on boarding, CRM etc..

What data and services can I access?

This OBP instance contains simulated customer related data.

Simulated Customer related data / APIs include:

  • Account information, balance and transaction history of multiple bank accounts
  • Enrich bank transactions with metadata (tags, comments, urls and geolocation) for example to link a receipt or video to a transaction
  • Create/Access different views on accounts. Each view grants a subset of the data to a restricted group of users. For example, a customer could offer special views on his account to his accountants, auditors or regulators. A charity might open their accounts to the public
  • Initiate payments
  • Onboard Customers (KYC etc.)

Application registration

You will need to register your application here. You will get a consumer key and consumer secret for the calls requiring OAuth or Direct Login authentication.

Direct Login and OAuth

The recommended way to authenticate in the hackathon context is to use Direct Login.

To get started with OBP and OAuth we recommend you use (and fork) one of our OAuth Starter SDKs

Note: Many examples in the docs / SDKs use the general OBP sandbox domain. Make sure you use the correct domain in all calls i.e. santander.openbankproject.com !

API documentation

  • For the latest version (recommended) see 3.0.0

Customer logins

During the OAuth login, the user of your app will be asked for a customer username/password.

Here are some example logins to test your Direct Login or OAuth flow:

    [{
      "user_name":"Robert.Uk.01",
      "password":"X!7ba87540",
      "email":"robert.uk.01@x.y"
    },{
      "user_name":"Susan.Uk.01",
      "password":"X!14eb2bdd",
      "email":"susan.uk.01@x.y"
    },{
      "user_name":"Anil.Uk.01",
      "password":"X!47673402",
      "email":"anil.uk.01@x.y"
    },{
      "user_name":"Ellie.Uk.01",
      "password":"X!04c03f86",
      "email":"ellie.uk.01@x.y"
    },{
      "user_name":"Rosalie.Uk.01",
      "password":"X!67fe9ff7",
      "email":"rosalie.uk.01@x.y"
    },{
      "user_name":"Chris.Uk.01",
      "password":"X!00085da6",
      "email":"chris.uk.01@x.y"
    },{
      "user_name":"Dennis.Uk.01",
      "password":"X!72bfb95f",
      "email":"dennis.uk.01@x.y"
    },{
      "user_name":"Jane.Uk.01",
      "password":"X!20414394",
      "email":"jane.uk.01@x.y"
    },{
      "user_name":"Emma.Uk.01",
      "password":"X!fcfe91c5",
      "email":"emma.uk.01@x.y"
    },{
      "user_name":"Sebastien.Uk.01",
      "password":"X!906d4436",
      "email":"sebastien.uk.01@x.y"
    },{
      "user_name":"Wim.Uk.01",
      "password":"X!07bd706a",
      "email":"wim.uk.01@x.y"
    },{
      "user_name":"Simon.Uk.01",
      "password":"X!de9e0d9c",
      "email":"simon.uk.01@x.y"
    },{
      "user_name":"Jean-paul.Uk.01",
      "password":"X!3fe0c8d5",
      "email":"jean-paul.uk.01@x.y"
    },{
      "user_name":"Elise.Uk.01",
      "password":"X!2fa13af1",
      "email":"elise.uk.01@x.y"
    },{
      "user_name":"Eleanor.Uk.01",
      "password":"X!2521ab97",
      "email":"eleanor.uk.01@x.y"
    }]

Please ask a member of the Open Bank Project team for more logins if you require. You can use this application which also uses OAuth to browse your transaction data (use the above username/password).

Creating a Card

Example for creating a card (requires CanCreateCardsForBank role)

curl -X POST \
https://santander.openbankproject.com/obp/v3.0.0/banks/santander.01.uk.sanuk/cards \
  -H 'Authorization: DirectLogin token=$DirectLoginToken' \
  -H 'Content-Type: application/json' \
  -d '{  "bank_card_number":"1234560",  "name_on_card":"Melat",  "issue_number":"1",
 "serial_number":"3536653457578789",  "valid_from_date":"2018-03-01T00:08:00Z", 
"expires_date":"2020-12-31T00:08:00Z",  "enabled":true,  "cancelled":true,  
"on_hot_list":true, "technology":"Visa",  "networks":["String"],  "allows":["credit"],
"account_id":"12345678000", "replacement":{    "requested_date":"2013-01-22T00:08:00Z",
"reason_requested":"Good Point"  }, "pin_reset":[{    "requested_date":"2013-01-22T00:08:00Z",
"reason_requested":"forgot"  }], "collected":"2013-01-22T00:08:00Z",  "posted":"2013-01-22T00:08:00Z"}'

Creating an account

Example to create an account for user Rosalie.Uk.01 (requires CanCreateAccount role)

curl -X PUT \
https://santander.openbankproject.com/obp/v3.0.0/banks/santander.01.uk.sanuk/accounts/1234567800000111123 \
  -H 'Authorization: DirectLogin token=$DirectLoginToken' \
  -H 'Content-Type: application/json' \
  -d '{  "user_id":"59197420-7148-41ca-82f8-76580a2e6476",  "label":"Label",  "type":"CURRENT",
  "balance":{    "currency":"EUR",    "amount":"0"  },  "branch_id":"1234",  "account_routing":
{    "scheme":"OBP",    "address":"UK123456"  }}'

Creating a customer

Example for creating a customer for user Rosalie.Uk.01 (requires CanCreateCustomer and CanCreateUserCustomerLink roles)

curl -X POST \
https://santander.openbankproject.com/obp/v3.0.0/banks/santander.01.uk.sanuk/customers \
  -H 'Authorization: DirectLogin token=$DirectLoginToken' \
  -H 'Content-Type: application/json' \
  -d '{  "user_id":"59197420-7148-41ca-82f8-76580a2e6476",  "customer_number":"new customer number 687687678",
  "legal_name":"NONE",  "mobile_phone_number":"+44 07972 444 876",  "email":"person@example.com",  "face_image":
{    "url":"www.openbankproject",    "date":"2013-01-22T00:08:00Z"  },  "date_of_birth":"2013-01-22T00:08:00Z",
  "relationship_status":"Single",  "dependants":5,  "dob_of_dependants":["2013-01-22T00:08:00Z"],
  "credit_rating":{    "rating":"OBP",    "source":"OBP"  },  "credit_limit":{    "currency":"EUR",
  "amount":"10"  },  "highest_education_attained":"Bachelor’s Degree",  "employment_status":"Employed",
  "kyc_status":true,  "last_ok_date":"2013-01-22T00:08:00Z"}'

Creating a counterparty

Example for creating a counterparty for one of the accounts of user Rosalie.Uk.01

curl -X POST \
/banks/santander.01.uk.sanuk/accounts/c4082df5-1683-44b0-9bc7-78e73fd15c0e/owner/counterparties \
  -H 'Authorization: DirectLogin token=$DirectLoginToken' \
  -H 'Content-Type: application/json' \
  -d '{  "name":"CounterpartyName5",  "description":"My landlord", "other_account_routing_scheme":"IBAN",
  "other_account_routing_address":"7987987-2348987-234234", 
"other_account_secondary_routing_scheme":"accountNumber",  
"other_account_secondary_routing_address":"BIC201483",  "other_bank_routing_scheme":"bankCode",  
"other_bank_routing_address":"10",  "other_branch_routing_scheme":"branchNumber",  
"other_branch_routing_address":"10010",  "is_beneficiary":true,  "bespoke":[{    "key":"englishName",    
"value":"english Name"  }]}'

Querying the warehouse

Do a query using plain elasticsearch search DSL in the body:

Example for searchWarehouse using all indices (needs role "CanSearchWarehouse"):

curl -X POST \
  https://santander.openbankproject.com/obp/v3.0.0/search/warehouse/ALL \
  -H 'Authorization: DirectLogin token=$DirectLoginToken' \
  -H 'Content-Type: application/json' \
  -d '{ 
    "query": {
            "match_all": {}
    }
 }'

Example for searchWarehouse using just one index:

curl -X POST \
  https://santander.openbankproject.com/obp/v3.0.0/search/warehouse/testone-customer_transactions \
  -H 'Authorization: DirectLogin token=$DirectLoginToken' \
  -H 'Content-Type: application/json' \
  -d '{ 
    "query": {
            "match_all": {}
    }
 }'

Do a stats aggregation over one specific numeric field:

curl -X POST \
  https://santander.openbankproject.com/obp/v3.0.0/search/warehouse/statistics/testone-customer_transactions/amount \
  -H 'Authorization: DirectLogin token=$DirectLoginToken' \
  -H 'Content-Type: application/json' \
  -d '{ 
    "query": {
            "match_all": {}
    }
 }'

FAQ:

Questions / Contact?

Clone this wiki locally