closeAccount
Close account record
Method used to close the Account and cancel all related Cards.
/holdings/accounts/CloseAccount/{externalAccountID}
Usage and SDK Samples
curl -X POST -H "Authorization: [[apiKey]]" "https://virtserver.swaggerhub.com/OptimusCards/Rest/1.0.0/holdings/accounts/CloseAccount/{externalAccountID}?requestID="
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.AccountApi;
import java.io.File;
import java.util.*;
public class AccountApiExample {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure API key authorization: bearer
ApiKeyAuth bearer = (ApiKeyAuth) defaultClient.getAuthentication("bearer");
bearer.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//bearer.setApiKeyPrefix("Token");
AccountApi apiInstance = new AccountApi();
String externalAccountID = externalAccountID_example; // String |
String requestID = requestID_example; // String | Unique request identifier (uuid) prefixed by your Entity identifier provided by Optimus. E.g. OPT-9d8d4b6e-8c5c-447b-95bc-146d3e1dd2f6
CloseAccountRequestBody payload = ; // CloseAccountRequestBody | body Payload
try {
CloseAccountResponse result = apiInstance.closeAccount(externalAccountID, requestID, payload);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AccountApi#closeAccount");
e.printStackTrace();
}
}
}
import io.swagger.client.api.AccountApi;
public class AccountApiExample {
public static void main(String[] args) {
AccountApi apiInstance = new AccountApi();
String externalAccountID = externalAccountID_example; // String |
String requestID = requestID_example; // String | Unique request identifier (uuid) prefixed by your Entity identifier provided by Optimus. E.g. OPT-9d8d4b6e-8c5c-447b-95bc-146d3e1dd2f6
CloseAccountRequestBody payload = ; // CloseAccountRequestBody | body Payload
try {
CloseAccountResponse result = apiInstance.closeAccount(externalAccountID, requestID, payload);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AccountApi#closeAccount");
e.printStackTrace();
}
}
}
Configuration *apiConfig = [Configuration sharedConfig];
// Configure API key authorization: (authentication scheme: bearer)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"Authorization"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"Authorization"];
String *externalAccountID = externalAccountID_example; //
String *requestID = requestID_example; // Unique request identifier (uuid) prefixed by your Entity identifier provided by Optimus. E.g. OPT-9d8d4b6e-8c5c-447b-95bc-146d3e1dd2f6
CloseAccountRequestBody *payload = ; // body Payload
AccountApi *apiInstance = [[AccountApi alloc] init];
// Close account record
[apiInstance closeAccountWith:externalAccountID
requestID:requestID
payload:payload
completionHandler: ^(CloseAccountResponse output, NSError* error) {
if (output) {
NSLog(@"%@", output);
}
if (error) {
NSLog(@"Error: %@", error);
}
}];
var OptimusCardsRestApis = require('optimus_cards_rest_apis');
var defaultClient = OptimusCardsRestApis.ApiClient.instance;
// Configure API key authorization: bearer
var bearer = defaultClient.authentications['bearer'];
bearer.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//bearer.apiKeyPrefix['Authorization'] = "Token"
var api = new OptimusCardsRestApis.AccountApi()
var externalAccountID = externalAccountID_example; // {String}
var requestID = requestID_example; // {String} Unique request identifier (uuid) prefixed by your Entity identifier provided by Optimus. E.g. OPT-9d8d4b6e-8c5c-447b-95bc-146d3e1dd2f6
var payload = ; // {CloseAccountRequestBody} body Payload
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.closeAccount(externalAccountID, requestID, payload, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;
namespace Example
{
public class closeAccountExample
{
public void main()
{
// Configure API key authorization: bearer
Configuration.Default.ApiKey.Add("Authorization", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Configuration.Default.ApiKeyPrefix.Add("Authorization", "Bearer");
var apiInstance = new AccountApi();
var externalAccountID = externalAccountID_example; // String |
var requestID = requestID_example; // String | Unique request identifier (uuid) prefixed by your Entity identifier provided by Optimus. E.g. OPT-9d8d4b6e-8c5c-447b-95bc-146d3e1dd2f6
var payload = new CloseAccountRequestBody(); // CloseAccountRequestBody | body Payload
try
{
// Close account record
CloseAccountResponse result = apiInstance.closeAccount(externalAccountID, requestID, payload);
Debug.WriteLine(result);
}
catch (Exception e)
{
Debug.Print("Exception when calling AccountApi.closeAccount: " + e.Message );
}
}
}
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: bearer
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer');
$api_instance = new Swagger\Client\Api\AccountApi();
$externalAccountID = externalAccountID_example; // String |
$requestID = requestID_example; // String | Unique request identifier (uuid) prefixed by your Entity identifier provided by Optimus. E.g. OPT-9d8d4b6e-8c5c-447b-95bc-146d3e1dd2f6
$payload = ; // CloseAccountRequestBody | body Payload
try {
$result = $api_instance->closeAccount($externalAccountID, $requestID, $payload);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling AccountApi->closeAccount: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::AccountApi;
# Configure API key authorization: bearer
$WWW::SwaggerClient::Configuration::api_key->{'Authorization'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'Authorization'} = "Bearer";
my $api_instance = WWW::SwaggerClient::AccountApi->new();
my $externalAccountID = externalAccountID_example; # String |
my $requestID = requestID_example; # String | Unique request identifier (uuid) prefixed by your Entity identifier provided by Optimus. E.g. OPT-9d8d4b6e-8c5c-447b-95bc-146d3e1dd2f6
my $payload = WWW::SwaggerClient::Object::CloseAccountRequestBody->new(); # CloseAccountRequestBody | body Payload
eval {
my $result = $api_instance->closeAccount(externalAccountID => $externalAccountID, requestID => $requestID, payload => $payload);
print Dumper($result);
};
if ($@) {
warn "Exception when calling AccountApi->closeAccount: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# Configure API key authorization: bearer
swagger_client.configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# swagger_client.configuration.api_key_prefix['Authorization'] = 'Bearer'
# create an instance of the API class
api_instance = swagger_client.AccountApi()
externalAccountID = externalAccountID_example # String |
requestID = requestID_example # String | Unique request identifier (uuid) prefixed by your Entity identifier provided by Optimus. E.g. OPT-9d8d4b6e-8c5c-447b-95bc-146d3e1dd2f6
payload = # CloseAccountRequestBody | body Payload
try:
# Close account record
api_response = api_instance.close_account(externalAccountID, requestID, payload)
pprint(api_response)
except ApiException as e:
print("Exception when calling AccountApi->closeAccount: %s\n" % e)
Parameters
Name | Description |
---|---|
externalAccountID* |
String
Required
|
Name | Description |
---|---|
payload * |
Name | Description |
---|---|
requestID* |
String
Unique request identifier (uuid) prefixed by your Entity identifier provided by Optimus. E.g. OPT-9d8d4b6e-8c5c-447b-95bc-146d3e1dd2f6
Required
|