SyncteraRubySdk::SpendControlsApi
All URIs are relative to https://api.synctera.com/v0
| Method | HTTP request | Description |
|---|---|---|
| create_spend_control | POST /spend_controls | Create Spend Control |
| get_spend_control | GET /spend_controls/spend_control_id | Get Spend Control |
| list_spend_controls | GET /spend_controls | List Spend Controls |
| update_spend_control | PATCH /spend_controls/spend_control_id | Update Spend Control |
create_spend_control
create_spend_control(spend_control)
Create Spend Control
Create a spend control
Examples
require 'time'
require 'synctera_ruby_sdk'
# setup authorization
SyncteraRubySdk.configure do |config|
# Configure Bearer authorization (api_key): bearerAuth
config.access_token = 'YOUR_BEARER_TOKEN'
end
api_instance = SyncteraRubySdk::SpendControlsApi.new
spend_control = SyncteraRubySdk::SpendControl.new({action_case: false, action_decline: false, amount_limit: 3.56, is_active: true, name: 'name_example', time_range: SyncteraRubySdk::SpendControlRollingWindowDays.new({time_range_type: 'ROLLING_WINDOW_DAYS', days: 37})}) # SpendControl | Details of the spend control to create
begin
# Create Spend Control
result = api_instance.create_spend_control(spend_control)
p result
rescue SyncteraRubySdk::ApiError => e
puts "Error when calling SpendControlsApi->create_spend_control: #{e}"
end
Using the create_spend_control_with_http_info variant
This returns an Array which contains the response data, status code and headers.
, Integer, Hash)> create_spend_control_with_http_info(spend_control)
begin
# Create Spend Control
data, status_code, headers = api_instance.create_spend_control_with_http_info(spend_control)
p status_code # => 2xx
p headers # => { ... }
p data # => <SpendControlResponse>
rescue SyncteraRubySdk::ApiError => e
puts "Error when calling SpendControlsApi->create_spend_control_with_http_info: #{e}"
end
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| spend_control | SpendControl | Details of the spend control to create |
Return type
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: application/json, application/problem+json
get_spend_control
get_spend_control(spend_control_id)
Get Spend Control
Get spend control
Examples
require 'time'
require 'synctera_ruby_sdk'
# setup authorization
SyncteraRubySdk.configure do |config|
# Configure Bearer authorization (api_key): bearerAuth
config.access_token = 'YOUR_BEARER_TOKEN'
end
api_instance = SyncteraRubySdk::SpendControlsApi.new
spend_control_id = '38400000-8cf0-11bd-b23e-10b96e4ef00d' # String |
begin
# Get Spend Control
result = api_instance.get_spend_control(spend_control_id)
p result
rescue SyncteraRubySdk::ApiError => e
puts "Error when calling SpendControlsApi->get_spend_control: #{e}"
end
Using the get_spend_control_with_http_info variant
This returns an Array which contains the response data, status code and headers.
, Integer, Hash)> get_spend_control_with_http_info(spend_control_id)
begin
# Get Spend Control
data, status_code, headers = api_instance.get_spend_control_with_http_info(spend_control_id)
p status_code # => 2xx
p headers # => { ... }
p data # => <SpendControlResponse>
rescue SyncteraRubySdk::ApiError => e
puts "Error when calling SpendControlsApi->get_spend_control_with_http_info: #{e}"
end
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| spend_control_id | String |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json, application/problem+json
list_spend_controls
list_spend_controls(opts)
List Spend Controls
List spend controls
Examples
require 'time'
require 'synctera_ruby_sdk'
# setup authorization
SyncteraRubySdk.configure do |config|
# Configure Bearer authorization (api_key): bearerAuth
config.access_token = 'YOUR_BEARER_TOKEN'
end
api_instance = SyncteraRubySdk::SpendControlsApi.new
opts = {
account_id: '7d943c51-e4ff-4e57-9558-08cab6b963c7', # String | return results matching this account ID
payment_type: SyncteraRubySdk::PaymentType::CARD, # PaymentType |
amount_limit: 789, # Integer | return results matching this amount limit
amount_limit_gte: 56, # Integer | return results with an amount limit greater than or equal to this
amount_limit_lte: 56, # Integer | return results with an amount limit less than or equal to this
num_related_accounts: 56, # Integer | return results that are associated with this many accounts
num_related_accounts_gte: 56, # Integer | return results that are associated with at least this many accounts
num_related_accounts_lte: 56, # Integer | return results that are associated with at most this many accounts
is_active: true, # Boolean | return results that match this active status
name: 'name_example', # String | return results that match this name
direction: SyncteraRubySdk::SpendControlDirection::DEBITS, # SpendControlDirection |
id: ['inner_example'], # Array<String> | return results with these comma-separated IDs
sort_by: ['name:asc'] # Array<String> | Specifies the sort order for returned Spend Controls.
}
begin
# List Spend Controls
result = api_instance.list_spend_controls(opts)
p result
rescue SyncteraRubySdk::ApiError => e
puts "Error when calling SpendControlsApi->list_spend_controls: #{e}"
end
Using the list_spend_controls_with_http_info variant
This returns an Array which contains the response data, status code and headers.
, Integer, Hash)> list_spend_controls_with_http_info(opts)
begin
# List Spend Controls
data, status_code, headers = api_instance.list_spend_controls_with_http_info(opts)
p status_code # => 2xx
p headers # => { ... }
p data # => <SpendControlResponseList>
rescue SyncteraRubySdk::ApiError => e
puts "Error when calling SpendControlsApi->list_spend_controls_with_http_info: #{e}"
end
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| account_id | String | return results matching this account ID | [optional] |
| payment_type | PaymentType | [optional] | |
| amount_limit | Integer | return results matching this amount limit | [optional] |
| amount_limit_gte | Integer | return results with an amount limit greater than or equal to this | [optional] |
| amount_limit_lte | Integer | return results with an amount limit less than or equal to this | [optional] |
| num_related_accounts | Integer | return results that are associated with this many accounts | [optional] |
| num_related_accounts_gte | Integer | return results that are associated with at least this many accounts | [optional] |
| num_related_accounts_lte | Integer | return results that are associated with at most this many accounts | [optional] |
| is_active | Boolean | return results that match this active status | [optional] |
| name | String | return results that match this name | [optional] |
| direction | SpendControlDirection | [optional] | |
| id | Array<String> | return results with these comma-separated IDs | [optional] |
| sort_by | Array<String> | Specifies the sort order for returned Spend Controls. | [optional] |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json, application/problem+json
update_spend_control
update_spend_control(spend_control_id, spend_control_update_request)
Update Spend Control
Update spend control
Examples
require 'time'
require 'synctera_ruby_sdk'
# setup authorization
SyncteraRubySdk.configure do |config|
# Configure Bearer authorization (api_key): bearerAuth
config.access_token = 'YOUR_BEARER_TOKEN'
end
api_instance = SyncteraRubySdk::SpendControlsApi.new
spend_control_id = '38400000-8cf0-11bd-b23e-10b96e4ef00d' # String |
spend_control_update_request = SyncteraRubySdk::SpendControlUpdateRequest.new # SpendControlUpdateRequest | Fields to update
begin
# Update Spend Control
result = api_instance.update_spend_control(spend_control_id, spend_control_update_request)
p result
rescue SyncteraRubySdk::ApiError => e
puts "Error when calling SpendControlsApi->update_spend_control: #{e}"
end
Using the update_spend_control_with_http_info variant
This returns an Array which contains the response data, status code and headers.
, Integer, Hash)> update_spend_control_with_http_info(spend_control_id, spend_control_update_request)
begin
# Update Spend Control
data, status_code, headers = api_instance.update_spend_control_with_http_info(spend_control_id, spend_control_update_request)
p status_code # => 2xx
p headers # => { ... }
p data # => <SpendControlResponse>
rescue SyncteraRubySdk::ApiError => e
puts "Error when calling SpendControlsApi->update_spend_control_with_http_info: #{e}"
end
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| spend_control_id | String | ||
| spend_control_update_request | SpendControlUpdateRequest | Fields to update |
Return type
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: application/json, application/problem+json