docs/QuotesBankApi
CybridApiBank::QuotesBankApi
All URIs are relative to https://bank.sandbox.cybrid.app
Method | HTTP request | Description |
---|---|---|
create_quote | POST /api/quotes | Create Quote |
get_quote | GET /api/quotes/{quote_guid} | Get Quote |
list_quotes | GET /api/quotes | Get quotes list |
create_quote
> create_quote(post_quote_bank_model)
Create Quote
Creates a quote. ## Quote creation Quotes can be created for a Bank or a Customer. To create quotes for your Bank, omit the customer_guid
parameter in the request body. To create quotes for your Customers, include the customer_guid
parameter in the request body. ## Failure codes | Code | Description | |——|————-| | invalid_amount | The amount on the invoice is unprocessable | | insufficient_balance | There are insufficient funds to process the quote | | invalid_invoice | The invoice cannot be processed | Required scope: quotes:execute
Examples
require 'time' require 'cybrid_api_bank_ruby' # setup authorization CybridApiBank.configure do |config| # Configure Bearer authorization (JWT): BearerAuth config.access_token = 'YOUR_BEARER_TOKEN' # Configure OAuth2 access token for authorization: oauth2 config.access_token = 'YOUR ACCESS TOKEN' end api_instance = CybridApiBank::QuotesBankApi.new post_quote_bank_model = CybridApiBank::PostQuoteBankModel.new # PostQuoteBankModel | begin # Create Quote result = api_instance.create_quote(post_quote_bank_model) p result rescue CybridApiBank::ApiError => e puts "Error when calling QuotesBankApi->create_quote: #{e}" end
Using the create_quote_with_http_info variant
This returns an Array which contains the response data, status code and headers.
> , Integer, Hash)> create_quote_with_http_info(post_quote_bank_model)
begin # Create Quote data, status_code, headers = api_instance.create_quote_with_http_info(post_quote_bank_model) p status_code # => 2xx p headers # => { ... } p data # => rescue CybridApiBank::ApiError => e puts "Error when calling QuotesBankApi->create_quote_with_http_info: #{e}" end
Parameters
Name | Type | Description | Notes |
---|---|---|---|
post_quote_bank_model | PostQuoteBankModel |
Return type
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: application/json
get_quote
> get_quote(quote_guid)
Get Quote
Retrieves a quote. Required scope: quotes:read
Examples
require 'time' require 'cybrid_api_bank_ruby' # setup authorization CybridApiBank.configure do |config| # Configure Bearer authorization (JWT): BearerAuth config.access_token = 'YOUR_BEARER_TOKEN' # Configure OAuth2 access token for authorization: oauth2 config.access_token = 'YOUR ACCESS TOKEN' end api_instance = CybridApiBank::QuotesBankApi.new quote_guid = 'quote_guid_example' # String | Identifier for the quote. begin # Get Quote result = api_instance.get_quote(quote_guid) p result rescue CybridApiBank::ApiError => e puts "Error when calling QuotesBankApi->get_quote: #{e}" end
Using the get_quote_with_http_info variant
This returns an Array which contains the response data, status code and headers.
> , Integer, Hash)> get_quote_with_http_info(quote_guid)
begin # Get Quote data, status_code, headers = api_instance.get_quote_with_http_info(quote_guid) p status_code # => 2xx p headers # => { ... } p data # => rescue CybridApiBank::ApiError => e puts "Error when calling QuotesBankApi->get_quote_with_http_info: #{e}" end
Parameters
Name | Type | Description | Notes |
---|---|---|---|
quote_guid | String | Identifier for the quote. |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
list_quotes
> list_quotes(opts)
Get quotes list
Retrieves a listing of quotes for all customers of a bank. Required scope: quotes:read
Examples
require 'time' require 'cybrid_api_bank_ruby' # setup authorization CybridApiBank.configure do |config| # Configure Bearer authorization (JWT): BearerAuth config.access_token = 'YOUR_BEARER_TOKEN' # Configure OAuth2 access token for authorization: oauth2 config.access_token = 'YOUR ACCESS TOKEN' end api_instance = CybridApiBank::QuotesBankApi.new opts = { page: 56, # Integer | per_page: 56, # Integer | guid: 'guid_example', # String | Comma separated quote_guids to list quotes for. product_type: 'product_type_example', # String | Comma separated product_types to list accounts for. bank_guid: 'bank_guid_example', # String | Comma separated bank_guids to list quotes for. customer_guid: 'customer_guid_example', # String | Comma separated customer_guids to list quotes for. side: 'side_example' # String | Comma separated sides to list quotes for. } begin # Get quotes list result = api_instance.list_quotes(opts) p result rescue CybridApiBank::ApiError => e puts "Error when calling QuotesBankApi->list_quotes: #{e}" end
Using the list_quotes_with_http_info variant
This returns an Array which contains the response data, status code and headers.
> , Integer, Hash)> list_quotes_with_http_info(opts)
begin # Get quotes list data, status_code, headers = api_instance.list_quotes_with_http_info(opts) p status_code # => 2xx p headers # => { ... } p data # => rescue CybridApiBank::ApiError => e puts "Error when calling QuotesBankApi->list_quotes_with_http_info: #{e}" end
Parameters
Name | Type | Description | Notes |
---|---|---|---|
page | Integer | [optional] | |
per_page | Integer | [optional] | |
guid | String | Comma separated quote_guids to list quotes for. | [optional] |
product_type | String | Comma separated product_types to list accounts for. | [optional] |
bank_guid | String | Comma separated bank_guids to list quotes for. | [optional] |
customer_guid | String | Comma separated customer_guids to list quotes for. | [optional] |
side | String | Comma separated sides to list quotes for. | [optional] |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json