### Get Cards Response Example Source: https://developer.investec.com/api-reference/SA%20Card%20Code This is an example of a successful JSON response when retrieving card information. It includes details for multiple cards, indicating their status, type, and associated account. ```json { "data": { "cards": [ { "CardKey": "1010101", "CardNumber": "402167XXXXXX1111", "IsProgrammable": true, "Status": "Active", "CardTypeCode": "VGC", "AccountNumber": "10011001100", "AccountId": "177778438355553632224", "EmbossedName": "JOHN SMITH", "IsVirtualCard": false }, { "CardKey": "1020202", "CardNumber": "402167XXXXXX2222", "IsProgrammable": true, "Status": "Active", "CardTypeCode": "VGC", "AccountNumber": "10011001100", "AccountId": "177778438355553632224", "EmbossedName": "JANE DOE", "IsVirtualCard": true }, { "CardKey": "1030303", "CardNumber": "402167XXXXXX3333", "IsProgrammable": true, "Status": "Active", "CardTypeCode": "VGC", "AccountNumber": "10011001100", "AccountId": "177778438355553632224", "EmbossedName": "JOHN DOE", "IsVirtualCard": false } ] }, "links": { "self": "https://openapi.investec.com/za/v1/cards" }, "meta": { "totalPages": 1 } } ``` -------------------------------- ### Get Authorisation Setup Details Source: https://developer.investec.com/api-reference/SA%20PB%20Account%20Information Retrieves the authorisation setup details for a specified Investec Online Banking profile and account. This includes the number of authorisers, name of the authorisers, and the allowable authorisation time period. ```APIDOC ## GET /za/pb/v1/profiles/{profileId}/accounts/{accountId}/authorisationsetupdetails ### Description Get the authorisation setup details for a specified Investec Online Banking profile and account. This includes the number of authorisers, name of the authorisers, and the allowable authorisation time period. This is typically used by Private Business users when making payments. ### Method GET ### Endpoint /za/pb/v1/profiles/{profileId}/accounts/{accountId}/authorisationsetupdetails ### Parameters #### Path Parameters - **profileId** (string) - Required - The ID of the Investec Online Banking profile. - **accountId** (string) - Required - The ID of the account. ### Request Example ```shell curl https://openapisandbox.investec.com/za/pb/v1/profiles/4643233712010169349094403/accounts/10190798011073/authorisationsetupdetails \ --header 'Authorization: Bearer YOUR_SECRET_TOKEN' ``` ### Response #### Success Response (200) Resource has been retrieved. - **data** (object) - Contains the authorisation setup details. - **numberOfAuthorisationRequired** (string) - The number of authorisations required. - **period** (array) - A list of available authorisation periods. - **id** (string) - The ID of the period. - **description** (string) - The description of the period (e.g., '1 Working day'). - **authorisersListA** (array) - A list of authorisers for List A. - **authoriserId** (string) - The ID of the authoriser. - **name** (string) - The name of the authoriser. - **authorisersListB** (array) - A list of authorisers for List B. - **authoriserId** (string) - The ID of the authoriser. - **name** (string) - The name of the authoriser. - **links** (object) - Contains links related to the resource. - **self** (string) - The self link for the resource. - **meta** (object) - Contains metadata about the response. - **totalPages** (number) - The total number of pages. #### Response Example ```json { "data": { "numberOfAuthorisationRequired": "2", "period": [ { "id": "1", "description": "1 Working day" }, { "id": "2", "description": "2 Working days" }, { "id": "3", "description": "3 Working days" }, { "id": "4", "description": "4 Working days" }, { "id": "5", "description": "5 Working days" }, { "id": "6", "description": "6 Working days" }, { "id": "7", "description": "7 Working days" }, { "id": "8", "description": "8 Working days" }, { "id": "9", "description": "9 Working days" }, { "id": "10", "description": "10 Working days" }, { "id": "0", "description": "Current Day" } ], "authorisersListA": [ { "authoriserId": "hnNhB6qb5H6SvJC1ZPK2qQ==", "name": "Mr Auth 1" }, { "authoriserId": "ijxHLoVHqCyF86dGG4rZww==", "name": "Mr Auth 2" }, { "authoriserId": "TAd6rGuhOeNRiujN0nlKxQ==", "name": "All" } ], "authorisersListB": [ { "authoriserId": "hnNhB6qb5H6SvJC1ZPK2qQ==", "name": "Mr Auth 3" }, { "authoriserId": "ijxHLoVHqCyF86dGG4rZww==", "name": "Mr Auth 4" }, { "authoriserId": "TAd6rGuhOeNRiujN0nlKxQ==", "name": "All" } ] }, "links": { "self": "https://openapi.investec.com/za/pb/v1/profiles/{profileId}/accounts/{accountId}/authorisationsetupdetails" }, "meta": { "totalPages": 1 } } ``` ### Error Handling - **400** Bad Request - The requested operation will not be carried out. - **401** Unauthorized - The requested operation was refused access. - **403** Forbidden - Not permitted to make this request. - **429** Too Many Requests - Too many requests in quick succession, Retry the request. - **500** Internal Server Error - The requested operation failed to execute. ``` -------------------------------- ### Get Cards Request Example Source: https://developer.investec.com/api-reference/SA%20Card%20Code Use this cURL command to retrieve a list of cards associated with a specified account. Ensure you replace `{yourBearerToken}` with your actual Bearer token. ```shell curl --location 'https://openapi.investec.com/za/v1/cards' \ --header 'Authorization: Bearer {yourBearerToken}' ``` -------------------------------- ### BOP Reports Response Example Source: https://developer.investec.com/api-reference/SA%20Intermediary%20Forex%20Settlement%20API This is an example of a successful response when retrieving BOP reports that require documentation. It includes details like reference, status, and amount. ```json { "data": [ { "reference": "lakkfi9mdkcc979h", "status": "DocsReceived", "valueDate": "2020-02-19", "currency": "GBP", "amount": "89357.09", "systemReference": "216d70e2-4c54-b5e6-d1ab-717214c40ee9", "tradeReference": "CORP2020012556688", "flow": "IN" }, { "reference": "twslzzlz3j97cnd1", "status": "DocsRequired", "valueDate": "2020-02-25", "currency": "ZAR", "amount": "93348.90", "systemReference": "84db466c-0cae-ef86-b2dc-1ff15dacd784", "tradeReference": "CORP2020072532484", "flow": "OUT" } ], "links": { "self": "https://openapisandbox.investec.com/za/ifi/v1/forex/bop-reports?type=DocsRequired" }, "meta": { "totalPages": 1 } } ``` -------------------------------- ### Successful Authorisation Setup Details Response Source: https://developer.investec.com/api-reference/SA%20PB%20Account%20Information This JSON structure represents a successful retrieval of authorization setup details, including the number of authorisations required, available periods, and lists of authorisers. ```JSON { "data": { "numberOfAuthorisationRequired": "2", "period": [ { "id": "1", "description": "1 Working day" }, { "id": "2", "description": "2 Working days" }, { "id": "3", "description": "3 Working days" }, { "id": "4", "description": "4 Working days" }, { "id": "5", "description": "5 Working days" }, { "id": "6", "description": "6 Working days" }, { "id": "7", "description": "7 Working days" }, { "id": "8", "description": "8 Working days" }, { "id": "9", "description": "9 Working days" }, { "id": "10", "description": "10 Working days" }, { "id": "0", "description": "Current Day" } ], "authorisersListA": [ { "authoriserId": "hnNhB6qb5H6SvJC1ZPK2qQ==", "name": "Mr Auth 1" }, { "authoriserId": "ijxHLoVHqCyF86dGG4rZww==", "name": "Mr Auth 2" }, { "authoriserId": "TAd6rGuhOeNRiujN0nlKxQ==", "name": "All" } ], "authorisersListB": [ { "authoriserId": "hnNhB6qb5H6SvJC1ZPK2qQ==", "name": "Mr Auth 3" }, { "authoriserId": "ijxHLoVHqCyF86dGG4rZww==", "name": "Mr Auth 4" }, { "authoriserId": "TAd6rGuhOeNRiujN0nlKxQ==", "name": "All" } ] }, "links": { "self": "https://openapi.investec.com/za/pb/v1/profiles/{profileId}/accounts/{accountId}/authorisationsetupdetails" }, "meta": { "totalPages": 1 } } ``` -------------------------------- ### Get Authorisation Setup Details Request Source: https://developer.investec.com/api-reference/SA%20PB%20Account%20Information Use this cURL command to retrieve the authorization setup details for a specific Investec Online Banking profile and account. Ensure you replace YOUR_SECRET_TOKEN with your actual token. ```Shell curl https://openapisandbox.investec.com/za/pb/v1/profiles/4643233712010169349094403/accounts/10190798011073/authorisationsetupdetails \ --header 'Authorization: Bearer YOUR_SECRET_TOKEN' ``` -------------------------------- ### Get Account Balance Response Schema Source: https://developer.investec.com/api-reference/SA%20PB%20Account%20Information Example JSON response schema for the 'Get Account Balance' endpoint, showing details like current balance, available balance, and currency. ```json { "data": { "accountId": "172878438321553632224", "currentBalance": 28857.76, "availableBalance": 98857.76, "budgetBalance": 0, "straightBalance": 0, "cashBalance": -10818415.98, "currency": "ZAR" }, "links": { "self": "https://openapi.investec.com/za/pb/v1/accounts/{accountId}/balance" }, "meta": { "totalPages": 1 } } ``` -------------------------------- ### cURL Request Example Source: https://developer.investec.com/api-reference/SA%20CIB%20Account%20Information Example of how to make a request to the SA CIB Account Information API using cURL. This snippet demonstrates the basic structure for sending a request. ```shell curl -X GET \ 'https://example.com/api/v1/accounts?fields=all' --header 'Accept: application/json' ``` -------------------------------- ### FX Quote Response Example Source: https://developer.investec.com/api-reference/SA%20CIB%20Investec%20for%20Intermediaries This is an example of a successful response when requesting FX quotes. It details currency pairs, rates, and validity periods. ```json { "data": { "channel": "circuit global", "tier": "Tier 3", "source": "IFI", "clientId": "541867890", "counterparty": "solid state Profit-focused", "requestId": "gkie3hp8xn", "timeToLive": 5.72412487595921, "requestDateTime": "7/11/2025 8:42:20 PM", "currencyPairs": [ { "currencyPair": "AUDZAR", "buyCurrency": "ZAR", "sellCurrency": "AUD", "buyCurrencyAmount": 3.53, "sellCurrencyAmount": 59.53, "tenor": "TODAY", "expiryTime": "5/9/2026 2:34:52 AM", "rateId": "137b07f3-5308-8bd3-ff6b-cf8552dd0bcf", "side": "A", "clientRate": 0.6656, "maxClientRate": 0.5976, "settlementDate": "2027-02-21" }, { "currencyPair": "AUDZAR", "buyCurrency": "ZAR", "sellCurrency": "AUD", "buyCurrencyAmount": 64.57, "sellCurrencyAmount": 92.79, "tenor": "TODAY", "expiryTime": "8/26/2026 10:20:12 PM", "rateId": "aa1e1855-f395-e884-c22d-76ed95c3b582", "side": "A", "clientRate": 0.7, "maxClientRate": 0.6348, "settlementDate": "2026-05-21" }, { "currencyPair": "AUDZAR", "buyCurrency": "ZAR", "sellCurrency": "AUD", "buyCurrencyAmount": 57.27, "sellCurrencyAmount": 43.69, "tenor": "TODAY", "expiryTime": "2/1/2027 8:17:37 AM", "rateId": "9e617e64-7d07-07c4-727e-9c64e47f3241", "side": "A", "clientRate": 0.0212, "maxClientRate": 0.1425, "settlementDate": "2027-01-22" }, { "currencyPair": "AUDZAR", "buyCurrency": "ZAR", "sellCurrency": "AUD", "buyCurrencyAmount": 69.92, "sellCurrencyAmount": 13.82, "tenor": "TODAY", "expiryTime": "11/9/2026 3:39:12 PM", "rateId": "828a567a-dde8-6022-fd96-b038784d59cb", "side": "A", "clientRate": 0.5279, "maxClientRate": 0.5303, "settlementDate": "2026-07-30" }, { "currencyPair": "AUDZAR", "buyCurrency": "ZAR", "sellCurrency": "AUD", "buyCurrencyAmount": 95.67, "sellCurrencyAmount": 55.69, "tenor": "TODAY", "expiryTime": "7/26/2026 7:11:33 PM", "rateId": "7452bf5d-760f-59eb-bf16-334bd36e8179", "side": "A", "clientRate": 0.1683, "maxClientRate": 0.3753, "settlementDate": "2027-01-09" } ] }, "links": { "self": "https://openapisandbox.investec.com/za/ifi/v1/fx/quote" }, "meta": { "totalPages": 1 } } ``` -------------------------------- ### Get Accounts Response Schema Source: https://developer.investec.com/api-reference/SA%20PB%20Account%20Information Example JSON response schema for the 'Get Accounts' endpoint, detailing the structure of account data returned. ```json { "data": { "accounts": [ { "accountId": "3353431574710163189587446", "accountNumber": "10101010101", "accountName": "Mr John Doe", "referenceName": "My Investec Private Bank Account", "productName": "Private Bank Account", "kycCompliant": true, "profileId": "10163189587443", "profileName": "My Profile" } ] }, "links": { "self": "https://openapi.investec.com/za/pb/v1/accounts" }, "meta": { "totalPages": 1 } } ``` -------------------------------- ### Get Account Transactions cURL Example Source: https://developer.investec.com/api-reference/SA%20PB%20Account%20Information Use this cURL command to retrieve a list of transactions for a specific account. Replace '{accountId}' with the actual account ID and 'YOUR_SECRET_TOKEN' with your authorization token. ```Shell curl 'https://openapisandbox.investec.com/za/pb/v1/accounts/{accountId}/transactions' \ --header 'Authorization: Bearer YOUR_SECRET_TOKEN' ``` -------------------------------- ### Successful Get Cards Response Source: https://developer.investec.com/api-reference/SA%20Card%20Code An example of a successful response from the Get Cards endpoint. It returns a JSON object containing card details such as CardKey, CardNumber, Status, and CardTypeCode. ```json { "data": { "cards": [ { "CardKey": "1010101", "CardNumber": "402167XXXXXX1111", "IsProgrammable": true, "Status": "Active", "CardTypeCode": "VGC", "AccountNumber": "10011001100", "AccountId": "177778438355553632224" } ] }, "links": { "self": "https://openapi.investec.com/za/v1/cards" }, "meta": { "totalPages": 1 } } ``` -------------------------------- ### Get Account Pending Transactions cURL Example Source: https://developer.investec.com/api-reference/SA%20PB%20Account%20Information This cURL command retrieves pending transactions for a given account. Ensure you replace '{accountId}' with the correct account ID and 'YOUR_SECRET_TOKEN' with your valid authorization token. ```Shell curl 'https://openapisandbox.investec.com/za/pb/v1/accounts/{accountId}/pending-transactions' \ --header 'Authorization: Bearer YOUR_SECRET_TOKEN' ``` -------------------------------- ### Get Accounts by Type Source: https://developer.investec.com/api-reference/SA%20CIB%20Investec%20for%20Intermediaries Retrieves accounts based on their type. ```APIDOC ## GET /za/ifi/v1/accounts/{accountType} ### Description Retrieves accounts based on their type. ### Method GET ### Endpoint /za/ifi/v1/accounts/{accountType} ### Parameters #### Path Parameters - **accountType** (string) - Required - The type of the account. ``` -------------------------------- ### Get Accounts Source: https://developer.investec.com/api-reference/SA%20PB%20Account%20Information Retrieve a list of all accounts associated with the user. ```APIDOC ## GET /za/pb/v1/accounts ### Description Get a list of all accounts. ### Method GET ### Endpoint /za/pb/v1/accounts ``` -------------------------------- ### Get Accounts List (cURL) Source: https://developer.investec.com/api-reference/SA%20CIB%20Account%20Information Use this cURL command to retrieve a list of accounts and their balances. Ensure you replace '<>' with a valid access token. ```shell curl --location 'https://openapisandbox.investec.com/za/bb/v2/accounts' \ --header 'Accept: application/json' \ --header 'Authorization: Bearer <>' ``` -------------------------------- ### Successful Token Response Source: https://developer.investec.com/api-reference/SA%20Intermediary%20Forex%20Settlement%20API This is an example of a successful response when requesting an access token. The 'access_token' is valid for 30 minutes. ```json { "access_token": "qwertyuiop123456789", "token_type": "Bearer", "expires_in": 1799, "scope": "accounts" } ``` -------------------------------- ### Get Account Details Source: https://developer.investec.com/api-reference/SA%20CIB%20Investec%20for%20Intermediaries Retrieves detailed information for a specific account. ```APIDOC ## GET /za/ifi/v1/accounts/{accountNumber}/account-details ### Description Retrieves detailed information for a specific account. ### Method GET ### Endpoint /za/ifi/v1/accounts/{accountNumber}/account-details ### Parameters #### Path Parameters - **accountNumber** (string) - Required - The unique identifier for the account. ``` -------------------------------- ### Get Merchants Reference Data Source: https://developer.investec.com/api-reference/SA%20Card%20Code Retrieves reference data for merchants. ```APIDOC ## GET /za/v1/cards/merchants ### Description Retrieves reference data for merchants. ### Method GET ### Endpoint /za/v1/cards/merchants ``` -------------------------------- ### Get Currencies Reference Data Source: https://developer.investec.com/api-reference/SA%20Card%20Code Retrieves reference data for currencies. ```APIDOC ## GET /za/v1/cards/currencies ### Description Retrieves reference data for currencies. ### Method GET ### Endpoint /za/v1/cards/currencies ``` -------------------------------- ### Get Card Environmental Variables Source: https://developer.investec.com/api-reference/SA%20Card%20Code Retrieves user-defined environmental variables for a specified card. ```APIDOC ## GET /za/v1/cards/{cardKey}/environmentvariables ### Description Retrieves user-defined environmental variables for a specified card. ### Method GET ### Endpoint /za/v1/cards/{cardKey}/environmentvariables ### Parameters #### Path Parameters - **cardKey** (string) - Required - The unique identifier of the card. ``` -------------------------------- ### Get Accounts v1.0 Source: https://developer.investec.com/api-reference/SA%20CIB%20Account%20Information Retrieves a list of accounts with their associated balances using the v1.0 endpoint. This endpoint is deprecated. ```APIDOC ## get/za/bb/v1/accounts ### Description Get a list of accounts with their associated balances. ### Method GET ### Endpoint /za/bb/v1/accounts ### Parameters #### Query Parameters None #### Request Body None ### Request Example ```curl curl --location 'https://openapisandbox.investec.com/za/bb/v1/accounts' \ --header 'Accept: application/json' \ --header 'Authorization: Bearer <>' ``` ### Response #### Success Response (200) - **body** (application/json) - The requested operation was successfully completed. #### Error Responses - **400** - Bad Request - **401** - Unauthorized - **403** - Forbidden - **408** - Request timeout - **429** - Too Many Requests - **500** - Internal Server Error ``` -------------------------------- ### Create Virtual Card Request Example Source: https://developer.investec.com/api-reference/SA%20Card%20Code This cURL command demonstrates how to create a virtual card. You need to provide the account number and desired embossed name in the JSON payload. Replace `{yourBearerToken}` and `{accountNumber}` with your specific credentials. ```shell curl --location 'https://openapi.investec.com/za/v1/cards' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer {yourBearerToken}' \ --data '{ "AccountNumber": "{accountNumber}", "EmbossName" : "CardEmbossName", "EmbossName2" : "CardEmbossName2" }' ``` -------------------------------- ### Create Virtual Card Response Example Source: https://developer.investec.com/api-reference/SA%20Card%20Code This JSON object represents a successful response after creating a virtual card. It confirms the creation and returns details like the new `CardKey` and embossed names. ```json { "data": { "result": { "CardKey": "212121", "IsVirtualCard": true, "EmbossName": "CardEmbossName", "EmbossName2": "CardEmbossName2" } }, "links": { "self": "https://openapi.investec.com/za/v1/cards" }, "meta": { "totalPages": 1 } } ``` -------------------------------- ### Get Accounts v2.0 Source: https://developer.investec.com/api-reference/SA%20CIB%20Account%20Information Retrieves a list of accounts with their associated balances. This endpoint is used to get account information for SA CIB. ```APIDOC ## GET /za/bb/v2/accounts ### Description Get a list of accounts with their associated balances. ### Method GET ### Endpoint /za/bb/v2/accounts ### Parameters #### Query Parameters None #### Request Body None ### Request Example ```curl curl --location 'https://openapisandbox.investec.com/za/bb/v2/accounts' \ --header 'Accept: application/json' \ --header 'Authorization: Bearer <>' ``` ### Response #### Success Response (200) - **data** (object) - Contains the account information. - **accounts** (array) - A list of account objects. - **accountId** (string) - The unique identifier for the account. - **accountName** (string) - The name of the account. - **accountNumber** (string) - The account number. - **accountType** (string) - The type of the account (e.g., 'Call Accounts', 'Cards'). - **electronicAccountNumber** (string or null) - The electronic account number, if available. - **nickName** (string) - A user-defined nickname for the account. - **availableBalance** (number) - The available balance of the account. - **balance** (number) - The current balance of the account. - **currencyCode** (string) - The currency code of the balance (e.g., 'ZAR'). - **links** (object) - Contains links related to the response. - **self** (string) - The URL for the current request. - **meta** (object) - Contains metadata about the response. - **totalPages** (integer) - The total number of pages for the results. #### Response Example ```json { "data": { "accounts": [ { "accountId": "12", "accountName": "Call Deposit", "accountNumber": "12356789", "accountType": "Call Accounts", "electronicAccountNumber": "987654321", "nickName": "Call Deposit", "availableBalance": 9.54, "balance": 9.54, "currencyCode": "ZAR" }, { "accountId": "13", "accountName": "Racing Stripes (Pty) Ltd CFC", "accountNumber": "123456789", "accountType": "Call Accounts", "electronicAccountNumber": null, "nickName": "Racing Stripes (Pty) Ltd CFC", "availableBalance": 1, "balance": 1, "currencyCode": "ZAR" }, { "accountId": "14", "accountName": "Corporate Credit Card", "accountNumber": "123456789", "accountType": "Cards", "electronicAccountNumber": null, "nickName": "Corporate Credit Card", "availableBalance": 61814.13, "balance": 61714.13, "currencyCode": "ZAR" } ] }, "links": { "self": "https://openapi.investec.com/za/bb/v2/accounts" }, "meta": { "totalPages": 1 } } ``` ### Error Handling - **400 Bad Request**: The server cannot process the request due to an apparent client error. - **401 Unauthorized**: The requested operation was refused access because the client authentication failed. - **403 Forbidden**: Operation not permitted because the client is not authorized to access the requested resource. - **408 Request Timeout**: The service timed out waiting too long for the request to complete. - **429 Too Many Requests**: Too many requests in the given timespan, client exceeded the maximum allowed request rate. - **500 Internal Server Error**: The requested operation failed to execute. ``` -------------------------------- ### Get Access Token (Sandbox) Source: https://developer.investec.com/api-reference/SA%20Intermediary%20Forex%20Settlement%20API Use this cURL command to obtain an access token for the sandbox environment. Ensure you replace placeholders with your actual API key, client ID, and client secret. ```curl curl --location 'https://openapisandbox.investec.com/identity/v2/oauth2/token' \ --header 'x-api-key: <>' \ --header 'Accept: application/json' \ --header 'Content-Type: application/x-www-form-urlencoded' \ --header 'Authorization: Basic <>' \ --data-urlencode 'grant_type=client_credentials' ``` -------------------------------- ### Get an access token Source: https://developer.investec.com/api-reference/SA%20Intermediary%20Forex%20Settlement%20API Obtain an access token by exchanging your client credentials (client_id, client_secret) and x-api-key for a token. This token is required for all subsequent API requests and is valid for 30 minutes. ```APIDOC ## Get an access token ### Description Obtain an access token by exchanging your client credentials (`client_id`, `client_secret`) and `x-api-key` for the token. This token is required for all subsequent API requests and is valid for 30 minutes. ### Method POST ### Endpoint `https://openapi.investec.com/identity/v2/oauth2/token` ### Headers - **x-api-key** (string) - Required - API key generated on Investec Online - **Authorization** (string) - Required - Base64-encoded `client_id:client_secret` - **Content-Type** (string) - Required - `application/x-www-form-urlencoded` ### Request Body - **grant_type** (string) - Required - `client_credentials` ### Response #### Success Response (200) - **access_token** (string) - The obtained access token. - **token_type** (string) - The type of token (e.g., Bearer). - **expires_in** (integer) - The token's validity period in seconds. ### Request Example ```bash curl --location 'https://openapi.investec.com/identity/v2/oauth2/token' \ --header 'x-api-key: <>' \ --header 'Authorization: Basic <>' \ --header 'Content-Type: application/x-www-form-urlencoded' \ --data-urlencode 'grant_type=client_credentials' ``` ``` -------------------------------- ### cURL Request for Get Cards Source: https://developer.investec.com/api-reference/SA%20Card%20Code This snippet shows how to make a GET request to the Investec API to retrieve card information using cURL. Ensure you have set up OAuth2 authentication and include the x-api-key header. ```shell curl -X GET "https://openapi.investec.com/za/v1/cards" \ -H "Accept: application/json" \ -H "x-api-key: YOUR_API_KEY" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" ``` -------------------------------- ### Get an access token Source: https://developer.investec.com/api-reference/SA%20Open%20API%20-%20Authorization Obtain an access token by exchanging your client credentials (client_id, client_secret) and x-api-key. This is typically done using the client credentials grant type. ```APIDOC ## POST /identity/v2/oauth2/token ### Description Exchanges client credentials and an API key for an access token using the client credentials grant type. ### Method POST ### Endpoint https://openapi.investec.com/identity/v2/oauth2/token ### Headers explained: * `x-api-key`: API key generated on Investec Online * `Authorization`: Base64-encoded `client_id:client_secret`. Take your `client_id` and `client_secret` and base64 encode them to provide a value for basic authorisation. * `Content-Type`: Indicates the request body format ### Request Body - **grant_type** (string) - Required - Must be 'client_credentials' ### Request Example ```curl curl --location 'https://openapi.investec.com/identity/v2/oauth2/token' \ --header 'x-api-key: <>' \ --header 'Authorization: Basic <>' \ --header 'Content-Type: application/x-www-form-urlencoded' \ --data-urlencode 'grant_type=client_credentials' ``` ### Response #### Success Response (200) - **access_token** (string) - The obtained access token. - **token_type** (string) - The type of token, typically 'Bearer'. - **expires_in** (integer) - The time in seconds until the token expires. - **refresh_token** (string) - The refresh token (if applicable for the grant type). - **scope** (string) - The scopes granted with this token. ``` -------------------------------- ### Get Cards Endpoint (cURL) Source: https://developer.investec.com/api-reference/SA%20Card%20Code Call the Get Cards endpoint using your obtained bearer token to retrieve a list of cards associated with your account. The request includes your access token in the Authorization header. ```curl curl --location 'https://openapi.investec.com/za/v1/cards' \ --header 'Accept: application/json' \ --header 'Authorization: Bearer <>' ``` -------------------------------- ### Successful Account Information Response Source: https://developer.investec.com/api-reference/SA%20PB%20Account%20Information This is an example of a successful response when requesting account information. It includes account details such as account ID, number, name, and KYC status. ```json { "data": { "accounts": [ { "accountId": "123456789", "accountNumber": "1234567890", "accountName": "Primary Private Bank Account", "referenceName": "Main Account", "productName": "Private Bank Cheque", "kycCompliant": true, "profileId": "ABCDEF" } ] }, "links": { "self": "https://openapisandbox.investec.com/za/pb/v1/accounts" }, "meta": { "totalPages": 1 } } ``` -------------------------------- ### Documents Source: https://developer.investec.com/api-reference/SA%20PB%20Account%20Information Get a list of documents and retrieve specified documents. ```APIDOC ## GET /za/pb/v1/accounts/{accountId}/documents ### Description Get a list of documents for a specified account. ### Method GET ### Endpoint /za/pb/v1/accounts/{accountId}/documents ### Parameters #### Path Parameters - **accountId** (string) - Required - The ID of the account for which to retrieve documents. ``` ```APIDOC ## GET /za/pb/v1/accounts/{accountId}/document/{documentType}/{documentDate} ### Description Retrieve a specified document for an account. ### Method GET ### Endpoint /za/pb/v1/accounts/{accountId}/document/{documentType}/{documentDate} ### Parameters #### Path Parameters - **accountId** (string) - Required - The ID of the account. - **documentType** (string) - Required - The type of the document. - **documentDate** (string) - Required - The date of the document. ``` -------------------------------- ### Get Card Detail (cURL) Source: https://developer.investec.com/api-reference/SA%20Card%20Code Use this cURL command to retrieve basic card details, excluding sensitive information. Ensure you replace `{yourBearerToken}` with your actual token. ```cURL curl --location 'https://openapi.investec.com/za/v1/cards/212121' \ --header 'Authorization: Bearer {yourBearerToken}' ``` -------------------------------- ### Get Accounts v1.0 (cURL) Source: https://developer.investec.com/api-reference/SA%20CIB%20Account%20Information Use this cURL command to retrieve a list of accounts and their associated balances using version 1.0 of the API. Ensure you replace '<>' with your actual access token. ```shell curl --location 'https://openapisandbox.investec.com/za/bb/v1/accounts' \ --header 'Accept: application/json' \ --header 'Authorization: Bearer <>' ``` -------------------------------- ### Get BOP Reports using cURL Source: https://developer.investec.com/api-reference/SA%20Intermediary%20Forex%20Settlement%20API This snippet demonstrates how to retrieve BOP reports using a cURL command. Ensure you have the correct API key and endpoint. ```Shell curl -X GET \ 'https://openapisandbox.investec.com/za/ifi/v1/forex/bop-reports?type=all' \ -H 'Accept: application/json' \ -H 'X-API-Key: YOUR_API_KEY' ``` -------------------------------- ### Get Intermediary Accounts Source: https://developer.investec.com/api-reference/SA%20CIB%20Investec%20for%20Intermediaries Retrieves information about intermediary accounts. ```APIDOC ## GET /za/ifi/v1/accounts/intermediary ### Description Retrieves information about intermediary accounts. ### Method GET ### Endpoint /za/ifi/v1/accounts/intermediary ``` -------------------------------- ### Get Transactions Source: https://developer.investec.com/api-reference/SA%20CIB%20Investec%20for%20Intermediaries Retrieves transaction history for a specific account. ```APIDOC ## GET /za/ifi/v1/accounts/{accountNumber}/transactions ### Description Retrieves transaction history for a specific account. ### Method GET ### Endpoint /za/ifi/v1/accounts/{accountNumber}/transactions ### Parameters #### Path Parameters - **accountNumber** (string) - Required - The unique identifier for the account. ``` -------------------------------- ### Request Account Information (cURL) Source: https://developer.investec.com/api-reference/SA%20PB%20Account%20Information Use this cURL command to retrieve a list of your accounts after obtaining an access token. Ensure the Authorization header contains your bearer token. ```shell curl --location 'https://openapisandbox.investec.com/za/pb/v1/accounts' \ --header 'Accept: application/json' \ --header 'Authorization: Bearer <>' ``` -------------------------------- ### Get Payment Status Source: https://developer.investec.com/api-reference/SA%20CIB%20Account%20Information Retrieves the status of a previously initiated payment. ```APIDOC ## GET /za/bb/v1/payments/{paymentId}/status ### Description Retrieves the status of a previously initiated payment. ### Method GET ### Endpoint /za/bb/v1/payments/{paymentId}/status ### Parameters #### Path Parameters - **paymentId** (string) - Required - The ID of the payment. ``` -------------------------------- ### Get Account Balance Source: https://developer.investec.com/api-reference/SA%20PB%20Account%20Information Fetches the current and available balance for a specific account. The account ID must be provided in the URL path. An Authorization header is required. ```curl curl --location 'https://openapisandbox.investec.com/za/pb/v1/accounts/{accountId}/balance' --header 'Authorization: Bearer {yourBearerToken}' ``` -------------------------------- ### Get All Accounts Source: https://developer.investec.com/api-reference/SA%20PB%20Account%20Information Retrieves a list of accounts associated with the user, including account details and profile information. Requires an Authorization header with a Bearer token. ```curl curl --location 'https://openapisandbox.investec.com/za/pb/v1/accounts' --header 'Authorization: Bearer {yourBearerToken}' ``` -------------------------------- ### Get Access Token using Client Credentials Source: https://developer.investec.com/api-reference/SA%20Open%20API%20-%20Authorization Use this cURL command to exchange your client credentials (client_id, client_secret) and x-api-key for an access token. Ensure your Authorization header is correctly Base64 encoded. ```cURL curl --location 'https://openapi.investec.com/identity/v2/oauth2/token' \ --header 'x-api-key: <>' \ --header 'Authorization: Basic <>' \ --header 'Content-Type: application/x-www-form-urlencoded' \ --data-urlencode 'grant_type=client_credentials' ``` -------------------------------- ### Get Account Book Value Source: https://developer.investec.com/api-reference/SA%20CIB%20Investec%20for%20Intermediaries Retrieves the book value of accounts. ```APIDOC ## GET /za/ifi/v1/accounts/book-value ### Description Retrieves the book value of accounts. ### Method GET ### Endpoint /za/ifi/v1/accounts/book-value ``` -------------------------------- ### Get Pending Transactions Source: https://developer.investec.com/api-reference/SA%20CIB%20Investec%20for%20Intermediaries Retrieves pending transactions for a specific account. ```APIDOC ## GET /za/ifi/v1/accounts/{accountNumber}/pending-transactions ### Description Retrieves pending transactions for a specific account. ### Method GET ### Endpoint /za/ifi/v1/accounts/{accountNumber}/pending-transactions ### Parameters #### Path Parameters - **accountNumber** (string) - Required - The unique identifier for the account. ``` -------------------------------- ### Search Accounts by Summary and Keyword Source: https://developer.investec.com/api-reference/SA%20CIB%20Investec%20for%20Intermediaries Searches for accounts based on summary and a keyword. ```APIDOC ## GET /za/ifi/v1/accounts/summary/{accountStatus}/search/{keyword} ### Description Searches for accounts based on summary and a keyword. ### Method GET ### Endpoint /za/ifi/v1/accounts/summary/{accountStatus}/search/{keyword} ### Parameters #### Path Parameters - **accountStatus** (string) - Required - The status of the account. - **keyword** (string) - Required - The keyword to search for. ``` -------------------------------- ### Request FX Quote (Sandbox) Source: https://developer.investec.com/api-reference/SA%20CIB%20Investec%20for%20Intermediaries This cURL command demonstrates how to request an FX quote. Populate either 'buyCurrencyAmount' or 'sellCurrencyAmount', but not both. Ensure the 'Authorization' and 'intermediaryId' headers are correctly set. ```curl curl --location 'https://openapisandbox.investec.com/za/ifi/v1/fx/quote' \ --header 'Authorization: Bearer {{access_token}}' \ --header 'intermediaryId: 123456' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "tier": "TIER_1", "requestId": "qs-quote-0001", "currencyPairs": [ { "currencyPair": "USDZAR", "buyCurrency": "USD", "sellCurrency": "ZAR", "buyCurrencyAmount": 10000.0, "sellCurrencyAmount": null, "tenor": "SP" } ] }' ``` -------------------------------- ### Get Countries Reference Data Source: https://developer.investec.com/api-reference/SA%20Card%20Code Retrieves reference data for countries. ```APIDOC ## GET /za/v1/cards/countries ### Description Retrieves reference data for countries. ### Method GET ### Endpoint /za/v1/cards/countries ``` -------------------------------- ### Get Profile Beneficiaries Request (cURL) Source: https://developer.investec.com/api-reference/SA%20PB%20Account%20Information Use this cURL command to retrieve all beneficiaries for a given profile and account ID. Ensure you replace YOUR_SECRET_TOKEN with your actual API token. ```Shell curl https://openapisandbox.investec.com/za/pb/v1/profiles/4643233712010169349094403/accounts/10190798011073/beneficiaries \ --header 'Authorization: Bearer YOUR_SECRET_TOKEN' ``` -------------------------------- ### Get Card Code Source: https://developer.investec.com/api-reference/SA%20Card%20Code Retrieves the code associated with a specified card. ```APIDOC ## GET /za/v1/cards/{cardKey}/code ### Description Retrieves the code associated with a specified card. ### Method GET ### Endpoint /za/v1/cards/{cardKey}/code ### Parameters #### Path Parameters - **cardKey** (string) - Required - The unique identifier of the card. ```