Introduction
Welcome to the Choice API! You can use our Choice API to access Choice API endpoints.
You can view code examples in the dark area to the right, and you can switch the programming language of the examples with the tabs in the top right.
Accounts with Token
Token
using System;
using Newtonsoft.Json;
using System.IO;
using System.Net;
using System.Text;
namespace ChoiceSample
{
public class Account
{
public static void Token()
{
try
{
var request = (HttpWebRequest)WebRequest.Create("https://sandbox.choice.dev/api/v1/token");
var postData = "grant_type=password";
postData += "&username=xxxxxx";
postData += "&password=123456";
var data = Encoding.ASCII.GetBytes(postData);
request.Method = "POST";
request.ContentType = "application/x-www-form-urlencoded";
request.ContentLength = data.Length;
using (var stream = request.GetRequestStream())
{
stream.Write(data, 0, data.Length);
}
try
{
var response = (HttpWebResponse)request.GetResponse();
using (var reader = new StreamReader(response.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)response.StatusCode);
Console.WriteLine();
Console.WriteLine(response.StatusDescription);
Console.WriteLine(result);
}
}
catch (WebException wex)
{
if (wex.Response != null)
{
using (var errorResponse = (HttpWebResponse)wex.Response)
{
using (var reader = new StreamReader(errorResponse.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)errorResponse.StatusCode);
Console.WriteLine();
Console.WriteLine(errorResponse.StatusDescription);
Console.WriteLine(result);
}
}
}
}
}
catch (IOException e)
{
Console.WriteLine(e);
}
}
}
}
cURL Request:
curl --location --request POST 'https://sandbox.choice.dev/api/v1/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'grant_type=password' \
--data-urlencode 'username=xxxxxxxx' \
--data-urlencode 'password=xxxxxxxx'
Json Example Response:
{
"access_token": "eHSN5rTBzqDozgAAlN1UlTMVuIT1zSiAZWCo6EBqB7RFjVMuhmuPNWcYM7ozyMb3uaDe0gyDL_nMPESbuM5I4skBOYcUM4A06NO88CVV3yBYee7mWB1qT-YFu5A3KZJSfRIbTX9GZdrZpi-JuWsx-7GE9GIYrNJ29BpaQscTwxYDr67WiFlCCrsCqWnCPJUjCFRIrTDltz8vM15mlgjiO0y04ZACGOWNNErIVegX062oydV7SqumGJEbS9Av4gdy",
"token_type": "bearer",
"expires_in": 863999
}
This endpoint creates a bearer token.
HTTP Request
POST https://sandbox.choice.dev/api/v1/token
Headers
Key | Value |
---|---|
Content-Type | application/x-www-form-urlencoded |
Body
Parameter | Type | M/C/O | Value |
---|---|---|---|
grant_type | string | Mandatory | password. |
username | string | Mandatory | Username of the user. |
password | string | Mandatory | Password of the user. |
Response
- 200 code (ok).
Change user password
using System;
using Newtonsoft.Json;
using System.IO;
using System.Net;
using System.Text;
namespace ChoiceSample
{
public class Account
{
public static void ChangeUserPassword()
{
try
{
var request = (HttpWebRequest)WebRequest.Create("https://sandbox.choice.dev/api/v1/accounts/ChangePassword");
request.ContentType = "text/json";
request.Method = "POST";
var user = new
{
Username = "JohnDoe",
OldPassword = "123456",
NewPassword = "qwerty",
ConfirmPassword = "qwerty"
};
string json = JsonConvert.SerializeObject(user);
request.Headers.Add("Authorization", "Bearer 1A089D6ziUybPZFQ3mpPyjt9OEx9yrCs7eQIC6V3A0lmXR2N6-seGNK16Gsnl3td6Ilfbr2Xf_EyukFXwnVEO3fYL-LuGw-L3c8WuaoxhPE8MMdlMPILJTIOV3lTGGdxbFXdKd9U03bbJ9TDUkqxHqq8_VyyjDrw7fs0YOob7bg0OovXTeWgIvZaIrSR1WFR06rYJ0DfWn-Inuf7re1-4SMOjY1ZoCelVwduWCBJpw1111cNbWtHJfObV8u1CVf0");
request.ContentType = "application/json";
request.Accept = "application/json";
using (var streamWriter = new StreamWriter(request.GetRequestStream()))
{
streamWriter.Write(json);
streamWriter.Flush();
streamWriter.Close();
}
try
{
var response = (HttpWebResponse)request.GetResponse();
using (var reader = new StreamReader(response.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)response.StatusCode);
Console.WriteLine();
Console.WriteLine(response.StatusDescription);
Console.WriteLine(result);
}
}
catch (WebException wex)
{
if (wex.Response != null)
{
using (var errorResponse = (HttpWebResponse)wex.Response)
{
using (var reader = new StreamReader(errorResponse.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)errorResponse.StatusCode);
Console.WriteLine();
Console.WriteLine(errorResponse.StatusDescription);
Console.WriteLine(result);
}
}
}
}
}
catch (IOException e)
{
Console.WriteLine(e);
}
}
}
}
Json Example Request:
{
"OldPassword": "123456",
"NewPassword": "qwerty",
"ConfirmPassword": "qwerty"
}
Json Example Response:
{
"message": "Success"
}
Json Example Error Response:
{
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"traceId": "00-3fba662b60afd788d7519c426f2811a3-87ec26f5d243621e-00",
"errors": {
"NewPassword": [
"'New password' is required",
"The field New password must be a string or array type with a maximum length of '50'.",
"'New password' length must be between 6 and 50 characters"
],
"OldPassword": [
"The field OldPassword must be a string or array type with a maximum length of '50'."
],
"ConfirmPassword": [
"'Password confirmation' is required",
"The field Password confirmation must be a string or array type with a maximum length of '50'.",
"'Password confirmation' length must be between 6 and 50 characters"
]
}
}
This endpoint changes user's password.
HTTP Request
POST https://sandbox.choice.dev/api/v1/accounts/ChangePassword
Headers using token
Key | Value |
---|---|
Content-Type | "application/json" |
Authorization | Token. Eg: "Bearer eHSN5rTBzqDozgAAlN1UlTMVuIT1zSiAZWCo6E..." |
Headers using API Key
Key | Value |
---|---|
Content-Type | "application/json" |
UserAuthorization | API Key. Eg: "e516b6db-3230-4b1c-ae3f-e5379b774a80" |
Query Parameters
Parameter | Type | M/C/O | Value |
---|---|---|---|
OldPassword | string | Mandatory | User’s old password. Empty strings are not allowed and must have a minimum of 6 characters and a maximum of 50 characters. |
NewPassword | string | Mandatory | User’s new password. Empty strings are not allowed and must have a minimum of 6 characters and a maximum of 50 characters. |
ConfirmPassword | string | Mandatory | User’s new password. Empty strings are not allowed and must have a minimum of 6 characters and a maximum of 50 characters. |
Response
- 200 code (ok).
Reset user password request
using System;
using Newtonsoft.Json;
using System.IO;
using System.Net;
using System.Text;
namespace ChoiceSample
{
public class Account
{
public static void ResetUserPasswordRequest()
{
try
{
var request = (HttpWebRequest)WebRequest.Create("https://sandbox.choice.dev/api/v1/accounts/ResetPasswordRequest");
request.ContentType = "text/json";
request.Method = "POST";
var user = new
{
UserName = "JohnDoe"
};
string json = JsonConvert.SerializeObject(user);
request.ContentType = "application/json";
request.Accept = "application/json";
using (var streamWriter = new StreamWriter(request.GetRequestStream()))
{
streamWriter.Write(json);
streamWriter.Flush();
streamWriter.Close();
}
try
{
var response = (HttpWebResponse)request.GetResponse();
using (var reader = new StreamReader(response.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)response.StatusCode);
Console.WriteLine();
Console.WriteLine(response.StatusDescription);
Console.WriteLine(result);
}
}
catch (WebException wex)
{
if (wex.Response != null)
{
using (var errorResponse = (HttpWebResponse)wex.Response)
{
using (var reader = new StreamReader(errorResponse.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)errorResponse.StatusCode);
Console.WriteLine();
Console.WriteLine(errorResponse.StatusDescription);
Console.WriteLine(result);
}
}
}
}
}
catch (IOException e)
{
Console.WriteLine(e);
}
}
}
}
Json Example Request:
{
"UserName": "JohnDoe"
}
Json Example Response:
{
"message": "Success. Email sent."
}
Json Example Error Response:
{
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"traceId": "00-0c09718351e88815f8b135741b5d5d17-de884a8f302c924d-00",
"errors": {
"UserName": [
"'Username' is required",
"The field Username must be a string or array type with a maximum length of '100'."
]
}
}
This endpoint generates user's password change request.
HTTP Request
POST https://sandbox.choice.dev/api/v1/accounts/ResetPasswordRequest
Headers using token
Key | Value |
---|---|
Content-Type | "application/json" |
Headers using API Key
Key | Value |
---|---|
Content-Type | "application/json" |
Query Parameters
Parameter | Type | M/C/O | Value |
---|---|---|---|
Username | string | Mandatory | User’s username. Empty strings are not allowed and must have a minimum of 6 characters and a maximum of 100 characters. |
Response
- 200 code (ok).
Reset user password
using System;
using Newtonsoft.Json;
using System.IO;
using System.Net;
using System.Text;
namespace ChoiceSample
{
public class Account
{
public static void ResetUserPassword()
{
try
{
var request = (HttpWebRequest)WebRequest.Create("https://sandbox.choice.dev/api/v1/accounts/ResetPassword");
request.ContentType = "text/json";
request.Method = "POST";
var user = new
{
Key = "3a89ad7b706f418291423159b9ab95d0ecd384bcfe814acca35dc759aa22ea0f",
NewPassword = "abcdef",
ConfirmPassword = "abcdef"
};
string json = JsonConvert.SerializeObject(user);
request.ContentType = "application/json";
request.Accept = "application/json";
using (var streamWriter = new StreamWriter(request.GetRequestStream()))
{
streamWriter.Write(json);
streamWriter.Flush();
streamWriter.Close();
}
try
{
var response = (HttpWebResponse)request.GetResponse();
using (var reader = new StreamReader(response.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)response.StatusCode);
Console.WriteLine();
Console.WriteLine(response.StatusDescription);
Console.WriteLine(result);
}
}
catch (WebException wex)
{
if (wex.Response != null)
{
using (var errorResponse = (HttpWebResponse)wex.Response)
{
using (var reader = new StreamReader(errorResponse.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)errorResponse.StatusCode);
Console.WriteLine();
Console.WriteLine(errorResponse.StatusDescription);
Console.WriteLine(result);
}
}
}
}
}
catch (IOException e)
{
Console.WriteLine(e);
}
}
}
}
Json Example Request:
{
"Key": "db92b207a57a48989924788199fbc104e3034780e4904df49d857320bce0e7de",
"NewPassword": "123457",
"ConfirmPassword": "123457"
}
Json Example Response:
{
"message": "Success. Password changed."
}
Json Example Error Response:
{
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"traceId": "00-b8dfd2541cecd0e649f035a2a0bada81-5085fad8cd63e81a-00",
"errors": {
"NewPassword": [
"The field New password must be a string or array type with a maximum length of '50'.",
"'New password' length must be between 6 and 50 characters"
]
}
}
This endpoint resets user's password.
HTTP Request
POST https://sandbox.choice.dev/api/v1/accounts/ResetPassword
Headers using token
Key | Value |
---|---|
Content-Type | "application/json" |
Headers using API Key
Key | Value |
---|---|
Content-Type | "application/json" |
Query Parameters
Parameter | Type | M/C/O | Value |
---|---|---|---|
ResetKey | string | Mandatory | Key sent to user email. |
NewPassword | string | Mandatory | User’s new password. Empty strings are not allowed and must have a minimum of 6 characters and a maximum of 50 characters. |
ConfirmPassword | string | Mandatory | User’s new password. Empty strings are not allowed and must have a minimum of 6 characters and a maximum of 50 characters. |
Response
- 200 code (ok).
Accounts with API Key
API Key
using System;
using Newtonsoft.Json;
using System.IO;
using System.Net;
using System.Text;
namespace ChoiceSample
{
public class Accounts
{
public static void AuthorizationToken()
{
try
{
var request = (HttpWebRequest)WebRequest.Create("https://sandbox.choice.dev/api/v1/accounts/authorizationToken");
request.ContentType = "text/json";
request.Method = "POST";
var accounts = new
{
UserName = "MaxSmart",
Password = "12345678Aa"
};
string json = JsonConvert.SerializeObject(accounts);
request.ContentType = "application/json";
request.Accept = "application/json";
using (var streamWriter = new StreamWriter(request.GetRequestStream()))
{
streamWriter.Write(json);
streamWriter.Flush();
streamWriter.Close();
}
try
{
var response = (HttpWebResponse)request.GetResponse();
using (var reader = new StreamReader(response.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)response.StatusCode);
Console.WriteLine();
Console.WriteLine(response.StatusDescription);
Console.WriteLine(result);
}
}
catch (WebException wex)
{
if (wex.Response != null)
{
using (var errorResponse = (HttpWebResponse)wex.Response)
{
using (var reader = new StreamReader(errorResponse.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)errorResponse.StatusCode);
Console.WriteLine();
Console.WriteLine(errorResponse.StatusDescription);
Console.WriteLine(result);
}
}
}
}
}
catch (IOException e)
{
Console.WriteLine(e);
}
}
}
}
Json Example Request:
{
"UserName":"MaxSmart",
"Password":"12345678Aa"
}
Json Example Response:
{
"message": "Authorization Token: e516b6db-3230-4b1c-ae3f-e5379b774a80"
}
This endpoint creates a API Key.
HTTP Request
POST https://sandbox.choice.dev/api/v1/accounts/authorizationToken
Headers
Key | Value |
---|---|
Content-Type | "application/json" |
Query Parameters
Parameter | Type | M/C/O | Value |
---|---|---|---|
UserName | string | Mandatory | UserName. |
Password | string | Mandatory | Password. |
Response
- 200 code (ok).
Users
Get myself
using System;
using Newtonsoft.Json;
using System.IO;
using System.Net;
using System.Text;
namespace ChoiceSample
{
public class User
{
public static void GetMySelf()
{
try
{
var request = (HttpWebRequest)WebRequest.Create("https://sandbox.choice.dev/api/v1/users/myself");
request.Method = "GET";
request.Headers.Add("Authorization", "Bearer 1A089D6ziUybPZFQ3mpPyjt9OEx9yrCs7eQIC6V3A0lmXR2N6-seGNK16Gsnl3td6Ilfbr2Xf_EyukFXwnVEO3fYL-LuGw-L3c8WuaoxhPE8MMdlMPILJTIOV3lTGGdxbFXdKd9U03bbJ9TDUkqxHqq8_VyyjDrw7fs0YOob7bg0OovXTeWgIvZaIrSR1WFR06rYJ0DfWn-Inuf7re1-4SMOjY1ZoCelVwduWCBJpw1111cNbWtHJfObV8u1CVf0");
try
{
var response = (HttpWebResponse)request.GetResponse();
using (var reader = new StreamReader(response.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)response.StatusCode);
Console.WriteLine();
Console.WriteLine(response.StatusDescription);
Console.WriteLine(result);
}
}
catch (WebException wex)
{
if (wex.Response != null)
{
using (var errorResponse = (HttpWebResponse)wex.Response)
{
using (var reader = new StreamReader(errorResponse.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)errorResponse.StatusCode);
Console.WriteLine();
Console.WriteLine(errorResponse.StatusDescription);
Console.WriteLine(result);
}
}
}
}
}
catch (IOException e)
{
Console.WriteLine(e);
}
}
}
}
Json Example Response:
{
"guid": "961612a5-427b-4bbc-8a11-bfc1b9149243",
"userName": "maxwinston",
"isoNumber": "1000",
"firstName": "Max",
"lastName": "Winston",
"email": "maxwinston@mailinator.com",
"phone": "9177563046",
"status": "User - Active",
"address1": "151 E 33rd ST",
"address2": "Second Floor",
"city": "New York",
"state": "NY",
"zipcode": "10016",
"acceptedTerms": true,
"key": "b91645kh654kjh645kjh645kjh64k5jhce49c2281d4749bf8b648032840fb290",
"roles": [
{
"guid": "d7e97432-01c2-43c6-b0c9-e164be9c18ca",
"roleName": "Merchant Admin",
"permissions": [
{
"name": "Iso Admin"
},
{
"name": "Iso Employee"
},
{
"name": "Merchant Admin"
}
]
}
],
"merchants": [
{
"guid": "123456b6-c9d1-4c1d-9dfa-64768e005fa0",
"mid": "888000002849",
"allowOpenButton": false,
"mainAdmin": "cf9g5h35-5341-4a68-acc9-e29f9d291ac9",
"adminUserGuid": "cf9f5b35-5341-4a68-acc9-e29f9h231ac9",
"recurringBillingSettings": [],
"dba": "Autotest",
"legalName": "Autotest",
"merchantAdmins": [
"cfl3l4l55-5341-4a68-acc9-e29f9d291ac9"
],
"email": "testmerhcantemail@mailinator.com",
"emailBcc": "testmerhcantemail@mailinator.com",
"phone": "4548945658",
"address1": "Ontario Boulevard",
"zipCode": "65591",
"city": "Montreal",
"state": "MO",
"allowTips": true,
"cashDiscount": true,
"defaultCashDiscount": true,
"allowDejavooSplitDialFee": false,
"allowDualPricing": true,
"defaultDualPricing": 3.990,
"defaultDualPricingType": "Percentage",
"allowCurrencyConversion": true,
"surcharge": false,
"defaultAllowsSurcharge": false,
"risk": false,
"requiredCustomerData": false,
"requiredProductData": false,
"alternativeNames": false,
"alternativeBatchNotifications": false,
"debtRepayment": false,
"allowPayByLoan": true,
"loanUserName": "z1D3ol0pB3bl",
"loanPassword": "O0RcJEKJNi8aENqJztpWzxIJlZjOzNbLVdXYm5OIGw=",
"enableAchRiskValidation": false,
"enableIvr": false,
"sendEmail": true,
"ownInvoiceEmails": false,
"status": "Merchant - Active",
"reAttemptRb": false,
"allowDualPricing": false,
"owners": [],
"adminUserRoles": [
{
"guid": "d7e97432-09p2-43c6-b0c9-e164be9c18ca",
"name": "Merchant Admin",
"description": "A user who run all type of transactions and search for all those transactions."
}
],
"merchantProcessorAccounts": [
{
"guid": "73decd85-8013-48d0-8262-7be0f1b7e283",
"accountName": "MPA CC",
"processorMid": "123456789012",
"merchantGuid": "197543b6-c9d1-4c1d-9dfa-64768e005fa0",
"transactionTypeCode": 1,
"processorTransactionType": "Card",
"processorService": 3,
"processorServices": [
0,
1,
2
],
"cvvRequired": false,
"addressVerificationCode": 5255,
"cardTokenization": true,
"cardAccountUpdater": false,
"status": "MerchantProcessorAccount - Active",
"autoClose": false,
"processor": {
"name": "Tk: Tsys; Gtw: Tsys; Ts: Tsys",
"transactionType": "Card",
"description": "Credit Card - Full Capabilities - Tokenization",
"allowAchDebit": false,
"allowAchCredit": false,
"allowCardKeyed": true,
"allowCardInternet": true,
"allowCardSwiped": true,
"allowCardEmv": true,
"allowCardTokenization": true,
"allowCardEnsureBill": false,
"allowCredit": true,
"allowDebit": true,
"allowPrepaid": true,
"allowPayroll": true
},
"devices": [
{
"guid": "c7333335-7956-46a0-b6a6-d4957484dd58",
"merchantProcessorAccountGuid": "r4333355-8013-48d2-8242-75gbbe07e283",
"merchantGuid": "197323b6-c9d1-4c1d-9dfa-65128e005fa0",
"name": "Merchant 1 for Batch Testing",
"thankYouPage": "choice.xyz",
"cancelledPage": "choice.xyz",
"otherPage": "choice.xyz",
"isVirtualTerminal": false,
"chargesFees": false,
"ignoreReceiptResponse": true,
"enableMobileAppAccess": false,
"allowsTips": true,
"allowOpenButton": true,
"autoClose": true,
"timeCloseBatch": 3,
"enableSemiIntegrated": false,
"enableCheckImaging": false,
"acceptsChecks": false,
"processingMethod": "Virtual Terminal keyed entered",
"processorId": "88800000284901",
"processorOperatingUserId": "TA5232104",
"transactionType": "Card",
"wasProcessed": true,
"isMobile": false,
"closeTime": "03:00:00",
"status": "Device - Active",
"serialNumber": "1234567890"
}
],
"webhookExist": false
}
]
}
]
}
Json error example response:
{
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"traceId": "00-2be920374480ac59ebadf4a9a6057706-0680052537eeceae-00",
"errors": {
"guid": [
"The value 'invalid guid' is not valid."
]
}
}
This endpoint get myself.
HTTP Request
GET https://sandbox.choice.dev/api/v1/users/myself
Headers using token
Key | Value |
---|---|
Authorization | Token. Eg: "Bearer eHSN5rTBzqDozgAAlN1UlTMVuIT1zSiAZWCo6E..." |
Headers using API Key
Key | Value |
---|---|
UserAuthorization | API Key. Eg: "e516b6db-3230-4b1c-ae3f-e5379b774a80" |
Response
- 200 code (ok).
Bank Clearing
Create bank clearing
using System;
using Newtonsoft.Json;
using System.IO;
using System.Net;
using System.Text;
namespace ChoiceSample
{
public class BankClearing
{
public static void CreateBankClearing()
{
try
{
var request = (HttpWebRequest)WebRequest.Create("https://sandbox.choice.dev/api/v1/BankClearings");
request.ContentType = "text/json";
request.Method = "POST";
var bankClearing = new
{
DeviceGuid = "a9c0505b-a087-44b1-b9cd-0e7f75715d4d",
Amount = 3.50,
IsBusinessPayment = true,
SendReceipt = true,
CustomData = "order details",
CustomerLabel = "Patient",
CustomerId = "xt147",
BusinessName = "Star Shoes California",
BankAccount = new
{
RoutingNumber = "211274450",
AccountNumber = "441142020",
NameOnAccount = "Joe Black",
Customer = new
{
FirstName = "Joe",
LastName = "Black",
Phone = "4207888807",
City = "Austin",
State = "TX",
Country = "US",
Email = "jblack@mailinator.com",
Address1 = "107 7th Av.",
Address2 = "",
Zip = "10007",
DateOfBirth = "1987-07-07",
DriverLicenseNumber = "12345678",
DriverLicenseExpDate = "2024-10-10",
DriverLicenseState = "TX",
SSN4 = "1210"
}
}
};
string json = JsonConvert.SerializeObject(bankClearing);
request.Headers.Add("Authorization", "Bearer DkpQk2A3K4Lwq6aFzbmkApOZWN28EowdVscW_sxY8_RTFt12xhnIa79bUmA12INI0YqKHwbMU5O5gMU_51E6wllvacKx68-mJ7F6GWnUkR2vFKaA-tdOJEqh0GD_61MGWWlXr9sxRNyH6ZzWqUS0-QdhcPLyFzJL-odqZ46I-Aouf3ixienzOnrL0m-zbExPAOnT58prg2dhB-rfIPBoF25rdokQ1KH4NFujgeF99qwIpObHeQQ25Qok7aJh5Spk");
request.ContentType = "application/json";
request.Accept = "application/json";
using (var streamWriter = new StreamWriter(request.GetRequestStream()))
{
streamWriter.Write(json);
streamWriter.Flush();
streamWriter.Close();
}
try
{
var response = (HttpWebResponse)request.GetResponse();
using (var reader = new StreamReader(response.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)response.StatusCode);
Console.WriteLine();
Console.WriteLine(response.StatusDescription);
Console.WriteLine(result);
}
}
catch (WebException wex)
{
if (wex.Response != null)
{
using (var errorResponse = (HttpWebResponse)wex.Response)
{
using (var reader = new StreamReader(errorResponse.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)errorResponse.StatusCode);
Console.WriteLine();
Console.WriteLine(errorResponse.StatusDescription);
Console.WriteLine(result);
}
}
}
}
}
catch (IOException e)
{
Console.WriteLine(e);
}
}
}
}
Json Example Request:
{
"DeviceGuid" : "a9c0505b-a087-44b1-b9cd-0e7f75715d4d",
"OperationType":"Debit",
"Amount" : 3.50,
"IsBusinessPayment" : true,
"SendReceipt" : true,
"CustomData" : "order details",
"CustomerLabel" : "Patient",
"CustomerId" : "xt147",
"BusinessName" : "Star Shoes California",
"BankAccount":
{
"RoutingNumber" : "211274450",
"AccountNumber" : "441142020",
"NameOnAccount" : "Joe Black",
"Customer":
{
"FirstName" : "Joe",
"LastName" : "Black",
"Phone" : "4207888807",
"City" : "Austin",
"State" : "TX",
"Country" : "US",
"Email" : "jblack@mailinator.com",
"Address1" : "107 7th Av.",
"Address2" : "",
"Zip" : "10007",
"DateOfBirth" : "1987-07-07",
"DriverLicenseNumber" : "12345678",
"DriverLicenseExpDate": "2024-10-10",
"DriverLicenseState" : "TX",
"SSN4" : "1210"
}
}
}
Json Example Response:
{
"guid": "4403e9c1-c2e6-4497-bdbc-178621e149d9",
"status": "Transaction - Approved",
"timeStamp": "2023-06-28T11:56:41.72-05:00",
"deviceGuid": "43f54072-3213-4554-9deb-614b9b9dd7d7",
"deviceName": "deviceach",
"merchantName": "merchtest",
"amount": 3.500,
"grossAmount": 3.500,
"effectiveAmount": 0.000,
"refNumber": "146244",
"isBusinessPayment": true,
"customData": "order details",
"operationType": "Debit",
"settlementType": "ACH",
"customerLabel": "Patient",
"businessName": "Star Shoes California",
"customerID": "xt147",
"isSettled": false,
"processorStatusCode": "HELD",
"processorResponseMessage": "HELD",
"processorResponseMessageForMobile": "HELD",
"wasProcessed": true,
"customerReceipt": "MerchTesting\r\nExample Street 1\r\nExample Street 2\r\nManhattan NY 10012\r\n06/28/2023 04:56:41 PM\r\nDEBIT\r\nApproval Code: 146244\r\n\r\nTotal: $3.50\r\n--------------------------------------\r\nName On Account: Joe Black\r\nRouting Number: 211274450\r\nDDA Last 4 2020\r\n\r\nStatus: SUBMITTED\r\n--------------------------------------\r\nYou authorize the merchant to initiate a debit or credit to the bank account provided, and adjustments for any debit entries in error to our checking and or savings account as indicated in the invoice above, to debit and or credit to the same such account. The authorization remains in effect until terminated or revoked and afford the merchant a reasonable amount of opportunity to act on it\r\n--------------------------------------\r\nCUSTOMER ACKNOWLEDGES RECEIPT OF\\nGOODS AND/OR SERVICES IN THE AMOUNT\\nOF THE TOTAL SHOWN HEREON AND AGREES\\nTO PERFORM THE OBLIGATIONS SET FORTH\\nBY THE CUSTOMER`S AGREEMENT WITH THE\\nISSUER\\n\\n\r\n",
"approvalCode": "146244",
"processorResponseCode": "HELD",
"bankAccount": {
"guid": "678bdfa7-66c0-4992-b50b-06c51cc43df4",
"routingNumber": "211274450",
"accountNumber": "441142020",
"accountNumberLastFour": "2020",
"nameOnAccount": "Joe Black",
"customer": {
"guid": "203266af-b561-4564-98f0-190483b24b62",
"firstName": "Joe",
"lastName": "Black",
"dateOfBirth": "1987-07-07T00:00:00",
"address1": "107 7th Av.",
"zip": "10007",
"city": "Austin",
"state": "TX",
"stateFullName": "Texas",
"country": "US",
"phone": "4207888807",
"email": "jblack@mailinator.com",
"ssN4": "1210",
"driverLicenseNumber": "12345678",
"driverLicenseState": "TX",
"dlStateFullName": "Texas",
"personalPhone": "4207888807",
"displayName": "Joe Black - 4207888807"
}
},
"clearingProcessorUpdate": [
{
"timestamp": "2023-06-28T11:56:42.47-05:00",
"transactionStatusUpdate": " > ",
"settlementStatusUpdate": " > ",
"reportingNotesUpdate": " > ",
"statusMessageUpdate": " > HELD"
}
]
}
Json Example Error Response:
{
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"traceId": "00-4f6edf8424a8f9680741feaf4c5269a9-61bdd6b4fe90dace-00",
"errors": {
"$.DeviceGuid": [
"The DeviceGuid field is required.",
"Unable to parse invalid guid to GUID"
],
"Amount": [
"The amount must be a positive number, can have 3 decimal places at most and the maximun allowed is 999999999999999.99. E.g.: 12 or 12.1 or 12.12",
],
"SequenceNumber": [
"The field SequenceNumber must be a string or array type with a maximum length of '100'."
],
"Currency": [
"The field Currency must be a string with a maximum length of 3."
],
"BankAccount.AccountNumber": [
"The AccountNumber must be between 4 and 20 digits long."
],
"BankAccount.NameOnAccount": [
"Only letters are allowed"
],
"BankAccount.RoutingNumber": [
"The RoutingNumber must be 9 digits long and only numbers are allowed."
],
"BankAccount.Customer.FirstName": [
"Field maximum length must be less than 100",
"The field FirstName is invalid."
],
"BankAccount.Customer.LastName": [
"Field maximum length must be less than 100",
"The field LastName is invalid."
],
"BankAccount.Customer.Address1": [
"Field maximum length must be less than 100",
"The field Address1 is invalid."
],
"BankAccount.Customer.City": [
"Field maximum length must be less than 50"
],
"BankAccount.Customer.State": [
"Field maximum length must be less than 2",
"The field State is invalid."
],
"BankAccount.Customer.Email": [
"Field maximum length must be less than 1000"
],
"BankAccount.Customer.SsN4": [
"Field maximum length must be less than 4",
"The field SsN4 is invalid."
],
"BankAccount.Customer.Zip": [
"The Zip must be between 0 and 10 characters long",
"The field Zip is invalid."
],
"BankAccount.Customer.DriverLicenseNumber": [
"The field DriverLicenseNumber is invalid.",
"Field maximum length must be less than 25",
"Only letters, numbers, asterisc, ampersand, @ and hyphen are allowed"
],
"BankAccount.Customer.DriverLicenseState": [
"The field DriverLicenseState is invalid."
]
}
}
This endpoint creates a bank clearing.
HTTP Request
POST https://sandbox.choice.dev/api/v1/BankClearings
Headers using token
Key | Value |
---|---|
Content-Type | "application/json" |
Authorization | Token. Eg: "Bearer eHSN5rTBzqDozgAAlN1UlTMVuIT1zSiAZWCo6E..." |
Headers using API Key
Key | Value |
---|---|
Content-Type | "application/json" |
UserAuthorization | API Key. Eg: "e516b6db-3230-4b1c-ae3f-e5379b774a80" |
Query Parameters
Parameter | Type | M/C/O | Value |
---|---|---|---|
DeviceGuid | string | Mandatory | Device Guid. |
Amount | decimal | Mandatory | Amount of the transaction. Min. amt.: $0.50. Does not allow empty strings and up to 3 decimal places. Not allow empty strings. The amount must be a positive number, can have 3 decimal places at most.. |
SequenceNumber | string | Optional | Use this number to call timeout reversal endpoint if you don't get a response. It has a max length of 100 characters. |
OperationType | string | Mandatory | (If nothing is indicated, by default it will be Debit). Allowed values: 1. Debit 2. Credit |
IsBusinessPayment | boolean | Optional | True when using company (CCD), false when using individual (PPD). Allowed values: 1. true 2. false |
SendReceipt | boolean | Optional | Set to “FALSE” if you do not want an e-mail receipt to be sent to the customer. Set to “TRUE” or leave empty if you want e-mail to be sent. |
CustomData | string | Optional | order details. |
CustomerLabel | string | Optional | Any name you want to show instead of customer. Eg., Player, Patient, Buyer. Max Length = 100. Not allow special characters. |
CustomerID | string | Optional | Any combination of numbers and letters you use to identify the customer. Max length = 100. Not allow special characters. |
BusinessName | string | Optional | A merchant name you want to use instead of your DBA. Max Length = 100. |
Currency | string | Optional | Currency of the transaction. The Currency field must be a string with a max length of 3 characters. Default value: USD Allowed values: USD, ARS, AUD, BRL, CAD, CHF, EUR, GBP, JPY, MXN, NZD, SGD |
BankAccount | object | Mandatory | Bank Account. |
BankAccount | |||
RoutingNumber | string | Mandatory | Routing's number. Must be 9 characters (example: 490000018). |
AccountNumber | string | Mandatory | Account's number. Must be between 4 and 20 digits long. The AccountNumber must be between 4 and 20 digits. |
NameOnAccount | string | Mandatory | Account's name. Only accepts letters. |
Customer | object | Optional | Customer. |
Customer | |||
FirstName | string | Optional | Customer's first name. Max length = 100. Only accepts letters with a length of 100 characters. |
LastName | string | Optional | Customer's last name. Max length = 100. Only accepts letters up to 100 characters long. |
Phone | string | Optional | Customer's phone number. The phone number must be syntactically correct. Only accepts numbers up to 10 characters. For example, 4152345678. |
City | string | Optional | Customer's city. Max length = 50. Only accepts up to 50 characters: Only accepts up to 50 characters. |
State | string | Optional | Customer's short name state. The ISO 3166-2 CA and US state or province code of a customer. Length = 2. |
Country | string | Optional | Customer's country. The ISO country code of a customer’s country. Length = 2 or 3. |
string | Optional | Customer's valid email address. Max length = 1000. | |
Address1 | string | Optional | Customer's address. Max length = 100. Accepts numbers and letters up to 100 characters |
Address2 | string | Optional | Customer's address line 2. Max length = 100. Accepts numbers and letters up to 100 characters |
Zip | string | Optional | Customer's zipcode. Length = 5. |
DateOfBirth | date | Optional | Customer's date of birth. Allowed format: YYYY-MM-DD. For example: 2002-05-30 |
DriverLicenseNumber | string | Optional | Customer's driver license number. Not allow special characters. Max length = 25. Only letters, numbers, asterisk, ampersand, @, and hyphen. |
DriverLicenseExpDate | string | Optional | Customer's driver expiration date. It is required only if there is a driver license number. |
DriverLicenseState | string | Optional | Customer's driver license short name state. The ISO 3166-2 CA and US state or province code of a customer. Length = 2. It is required only if there is a driver's license number. |
SSN4 | string | Optional | Customer's social security number. Max length = 4. |
Response
- 201 code (created).
Create bank clearing with Bank Account's guid
using System;
using Newtonsoft.Json;
using System.IO;
using System.Net;
using System.Text;
namespace ChoiceSample
{
public class BankClearing
{
public static void CreateBankClearing()
{
try
{
var request = (HttpWebRequest)WebRequest.Create("https://sandbox.choice.dev/api/v1/BankClearings");
request.ContentType = "text/json";
request.Method = "POST";
var bankClearing = new
{
DeviceGuid = "a9c0505b-a087-44b1-b9cd-0e7f75715d4d",
Amount = 3.50,
IsBusinessPayment = true,
SendReceipt = true,
CustomData = "order details",
CustomerLabel = "Patient",
CustomerId = "xt147",
BusinessName = "Star Shoes California",
BankAccount = new
{
RoutingNumber = "211274450",
AccountNumber = "441142020",
NameOnAccount = "Joe Black",
Customer = new
{
FirstName = "Joe",
LastName = "Black",
Phone = "4207888807",
City = "Austin",
State = "TX",
Country = "US",
Email = "jblack@mailinator.com",
Address1 = "107 7th Av.",
Address2 = "",
Zip = "10007",
DateOfBirth = "1987-07-07",
DriverLicenseNumber = "12345678",
DriverLicenseExpDate = "2024-10-10",
DriverLicenseState = "TX",
SSN4 = "1210"
}
}
};
string json = JsonConvert.SerializeObject(bankClearing);
request.Headers.Add("Authorization", "Bearer DkpQk2A3K4Lwq6aFzbmkApOZWN28EowdVscW_sxY8_RTFt12xhnIa79bUmA12INI0YqKHwbMU5O5gMU_51E6wllvacKx68-mJ7F6GWnUkR2vFKaA-tdOJEqh0GD_61MGWWlXr9sxRNyH6ZzWqUS0-QdhcPLyFzJL-odqZ46I-Aouf3ixienzOnrL0m-zbExPAOnT58prg2dhB-rfIPBoF25rdokQ1KH4NFujgeF99qwIpObHeQQ25Qok7aJh5Spk");
request.ContentType = "application/json";
request.Accept = "application/json";
using (var streamWriter = new StreamWriter(request.GetRequestStream()))
{
streamWriter.Write(json);
streamWriter.Flush();
streamWriter.Close();
}
try
{
var response = (HttpWebResponse)request.GetResponse();
using (var reader = new StreamReader(response.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)response.StatusCode);
Console.WriteLine();
Console.WriteLine(response.StatusDescription);
Console.WriteLine(result);
}
}
catch (WebException wex)
{
if (wex.Response != null)
{
using (var errorResponse = (HttpWebResponse)wex.Response)
{
using (var reader = new StreamReader(errorResponse.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)errorResponse.StatusCode);
Console.WriteLine();
Console.WriteLine(errorResponse.StatusDescription);
Console.WriteLine(result);
}
}
}
}
}
catch (IOException e)
{
Console.WriteLine(e);
}
}
}
}
Json Example Request Step 1:
{
"DeviceGuid" : "a9c0505b-a087-44b1-b9cd-0e7f75715d4d",
"Amount" : 3.50,
"IsBusinessPayment" : true,
"SendReceipt" : true,
"CustomData" : "order details",
"CustomerLabel" : "Patient",
"CustomerId" : "xt147",
"BusinessName" : "Star Shoes California",
"BankAccount":
{
"RoutingNumber" : "211274450",
"AccountNumber" : "441142020",
"NameOnAccount" : "Joe Black",
"Customer":
{
"FirstName" : "Joe",
"LastName" : "Black",
"Phone" : "4207888807",
"City" : "Austin",
"State" : "TX",
"Country" : "US",
"Email" : "jblack@mailinator.com",
"Address1" : "107 7th Av.",
"Address2" : "",
"Zip" : "10007",
"DateOfBirth" : "1987-07-07",
"DriverLicenseNumber" : "12345678",
"DriverLicenseExpDate": "2024-10-10",
"DriverLicenseState" : "TX",
"SSN4" : "1210"
}
}
}
Json Example Response Step 2:
{
"guid": "3cfe81fb-4e31-4a23-9165-1de48c3117e2",
"status": "Transaction - Approved",
"timeStamp": "2023-06-28T12:24:11.31-05:00",
"deviceGuid": "43f54072-3213-4554-9deb-614b9b9dd7d7",
"deviceName": "deviceach",
"merchantName": "merchtest",
"amount": 3.500,
"grossAmount": 3.500,
"effectiveAmount": 0.000,
"refNumber": "146245",
"isBusinessPayment": true,
"customData": "order details",
"operationType": "Debit",
"settlementType": "ACH",
"customerLabel": "Patient",
"businessName": "Star Shoes California",
"customerID": "xt147",
"isSettled": false,
"processorStatusCode": "HELD",
"processorResponseMessage": "HELD",
"processorResponseMessageForMobile": "HELD",
"wasProcessed": true,
"customerReceipt": "MerchTesting\r\nExample Street 1\r\nExample Street 2\r\nManhattan NY 10012\r\n06/28/2023 05:24:11 PM\r\nDEBIT\r\nApproval Code: 146245\r\n\r\nTotal: $3.50\r\n--------------------------------------\r\nName On Account: Joe Black\r\nRouting Number: 211274450\r\nDDA Last 4 2020\r\n\r\nStatus: SUBMITTED\r\n--------------------------------------\r\nYou authorize the merchant to initiate a debit or credit to the bank account provided, and adjustments for any debit entries in error to our checking and or savings account as indicated in the invoice above, to debit and or credit to the same such account. The authorization remains in effect until terminated or revoked and afford the merchant a reasonable amount of opportunity to act on it\r\n--------------------------------------\r\nCUSTOMER ACKNOWLEDGES RECEIPT OF\\nGOODS AND/OR SERVICES IN THE AMOUNT\\nOF THE TOTAL SHOWN HEREON AND AGREES\\nTO PERFORM THE OBLIGATIONS SET FORTH\\nBY THE CUSTOMER`S AGREEMENT WITH THE\\nISSUER\\n\\n\r\n",
"approvalCode": "146245",
"processorResponseCode": "HELD",
"bankAccount": {
"guid": "d4394cfb-1967-429b-92da-9f664c316527",
"routingNumber": "211274450",
"accountNumber": "441142020",
"accountNumberLastFour": "2020",
"nameOnAccount": "Joe Black",
"customer": {
"guid": "203266af-b561-4564-98f0-190483b24b62",
"firstName": "Joe",
"lastName": "Black",
"dateOfBirth": "1987-07-07T00:00:00",
"address1": "107 7th Av.",
"zip": "10007",
"city": "Austin",
"state": "TX",
"stateFullName": "Texas",
"country": "US",
"phone": "4207888807",
"email": "jblack@mailinator.com",
"ssN4": "1210",
"driverLicenseNumber": "12345678",
"driverLicenseState": "TX",
"dlStateFullName": "Texas",
"personalPhone": "4207888807",
"displayName": "Joe Black - 4207888807"
}
},
"clearingProcessorUpdate": [
{
"timestamp": "2023-06-28T12:24:11.89-05:00",
"transactionStatusUpdate": " > ",
"settlementStatusUpdate": " > ",
"reportingNotesUpdate": " > ",
"statusMessageUpdate": " > HELD"
}
]
}
Json Example Request Step 3:
{
"DeviceGuid" : "a9c0505b-a087-44b1-b9cd-0e7f75715d4d",
"Amount": 15.00,
"OrderNumber" : "121212121212",
"BankAccount": {
"GUID": "eb49ec89-ead6-42f5-b335-9002c4a1b923"
}
}
Json Example Response Step 3:
{
"guid": "d7074039-50G6-000a-aKca-d6F23F23e1069",
"status": "Transaction - Approved",
"timeStamp": "2023-06-28T12:25:11.62-05:00",
"deviceGuid": "43f73409-7285-7824-9deb-614M6N1Pd7d7",
"deviceName": "deviceach",
"merchantName": "merchtest",
"amount": 15.000,
"grossAmount": 15.000,
"effectiveAmount": 0.000,
"orderNumber": "121212121212",
"refNumber": "146246",
"isBusinessPayment": false,
"operationType": "Debit",
"settlementType": "ACH",
"isSettled": false,
"processorStatusCode": "HELD",
"processorResponseMessage": "HELD",
"processorResponseMessageForMobile": "HELD",
"wasProcessed": true,
"customerReceipt": "MerchTesting\r\nExample Street 1\r\nExample Street 2\r\nManhattan NY 10012\r\n06/28/2023 05:25:11 PM\r\nDEBIT\r\nApproval Code: 146246\r\nOrder Number: 121212121212\\n\r\n\r\nTotal: $15.00\r\n--------------------------------------\r\nName On Account: Joe Black\r\nRouting Number: 211274450\r\nDDA Last 4 2020\r\n\r\nStatus: SUBMITTED\r\n--------------------------------------\r\nYou authorize the merchant to initiate a debit or credit to the bank account provided, and adjustments for any debit entries in error to our checking and or savings account as indicated in the invoice above, to debit and or credit to the same such account. The authorization remains in effect until terminated or revoked and afford the merchant a reasonable amount of opportunity to act on it\r\n--------------------------------------\r\nCUSTOMER ACKNOWLEDGES RECEIPT OF\\nGOODS AND/OR SERVICES IN THE AMOUNT\\nOF THE TOTAL SHOWN HEREON AND AGREES\\nTO PERFORM THE OBLIGATIONS SET FORTH\\nBY THE CUSTOMER`S AGREEMENT WITH THE\\nISSUER\\n\\n\r\n",
"approvalCode": "146246",
"processorResponseCode": "HELD",
"bankAccount": {
"guid": "31a20c25-b551-4b30-a836-a154d374de9d",
"routingNumber": "211274450",
"accountNumber": "441142020",
"accountNumberLastFour": "2020",
"nameOnAccount": "Joe Black",
"customer": {
"guid": "e280fbad-01dc-495a-8b06-08c9d86e2dad",
"firstName": "Joe",
"lastName": "Black",
"dateOfBirth": "1987-07-07T00:00:00",
"address1": "107 7th Av.",
"address2": "",
"zip": "10007",
"city": "Austin",
"state": "TX",
"stateFullName": "Texas",
"country": "US",
"phone": "4207888807",
"email": "jblack@mailinator.com",
"ssN4": "1210",
"driverLicenseNumber": "12345678",
"driverLicenseState": "TX",
"dlStateFullName": "Texas",
"personalPhone": "4207888807",
"displayName": "Joe Black - 4207888807"
}
},
"clearingProcessorUpdate": [
{
"timestamp": "2023-06-28T12:25:11.99-05:00",
"transactionStatusUpdate": " > ",
"settlementStatusUpdate": " > ",
"reportingNotesUpdate": " > ",
"statusMessageUpdate": " > HELD"
}
]
}
This endpoint creates a bank clearing with bank account's Guid.
HTTP Request
POST https://sandbox.choice.dev/api/v1/BankClearings
Headers using token
Key | Value |
---|---|
Content-Type | "application/json" |
Authorization | Token. Eg: "Bearer eHSN5rTBzqDozgAAlN1UlTMVuIT1zSiAZWCo6E..." |
Headers using API Key
Key | Value |
---|---|
Content-Type | "application/json" |
UserAuthorization | API Key. Eg: "e516b6db-3230-4b1c-ae3f-e5379b774a80" |
Steps
Step 1: Run a Bank Clearing Sale.
Step 2: Save the Bank Account GUID on the ISV database.
Step 3: User the Bank Account GUID (token) to create a bank Clearing Sale.
Response
- 201 code (created).
Get bank clearing
using System;
using Newtonsoft.Json;
using System.IO;
using System.Net;
using System.Text;
namespace ChoiceSample
{
public class BankClearing
{
public static void GetBankClearing()
{
try
{
var request = (HttpWebRequest)WebRequest.Create("https://sandbox.choice.dev/api/v1/BankClearings/4d134bf6-f934-4c1c-ba93-89ca076ed43b");
request.Method = "GET";
request.Headers.Add("Authorization", "Bearer DkpQk2A3K4Lwq6aFzbmkApOZWN28EowdVscW_sxY8_RTFt12xhnIa79bUmA12INI0YqKHwbMU5O5gMU_51E6wllvacKx68-mJ7F6GWnUkR2vFKaA-tdOJEqh0GD_61MGWWlXr9sxRNyH6ZzWqUS0-QdhcPLyFzJL-odqZ46I-Aouf3ixienzOnrL0m-zbExPAOnT58prg2dhB-rfIPBoF25rdokQ1KH4NFujgeF99qwIpObHeQQ25Qok7aJh5Spk");
try
{
var response = (HttpWebResponse)request.GetResponse();
using (var reader = new StreamReader(response.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)response.StatusCode);
Console.WriteLine();
Console.WriteLine(response.StatusDescription);
Console.WriteLine(result);
}
}
catch (WebException wex)
{
if (wex.Response != null)
{
using (var errorResponse = (HttpWebResponse)wex.Response)
{
using (var reader = new StreamReader(errorResponse.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)errorResponse.StatusCode);
Console.WriteLine();
Console.WriteLine(errorResponse.StatusDescription);
Console.WriteLine(result);
}
}
}
}
}
catch (IOException e)
{
Console.WriteLine(e);
}
}
}
}
Json Example Response:
{
"guid": "4d134bf6-f934-4c1c-ba93-89ca076ed43b",
"status": "Transaction - Approved",
"timeStamp": "2023-06-28T12:28:37.54-05:00",
"deviceGuid": "a9c0505b-a087-44b1-b9cd-0e7f75715d4d",
"deviceName": "deviceach",
"merchantName": "merchtest",
"amount": 3.500,
"grossAmount": 3.500,
"effectiveAmount": 0.000,
"refNumber": "146247",
"isBusinessPayment": true,
"customData": "order details",
"operationType": "Debit",
"settlementType": "ACH",
"customerLabel": "Patient",
"businessName": "Star Shoes California",
"customerID": "xt147",
"isSettled": false,
"processorStatusCode": "HELD",
"processorResponseMessage": "HELD",
"processorResponseMessageForMobile": "HELD",
"wasProcessed": true,
"customerReceipt": "MerchTesting\r\nExample Street 1\r\nExample Street 2\r\nManhattan NY 10012\r\n06/28/2023 05:28:37 PM\r\nDEBIT\r\nApproval Code: 146247\r\n\r\nTotal: $3.50\r\n--------------------------------------\r\nName On Account: Joe Black\r\nRouting Number: 211274450\r\nDDA Last 4 2020\r\n\r\nStatus: SUBMITTED\r\n--------------------------------------\r\nYou authorize the merchant to initiate a debit or credit to the bank account provided, and adjustments for any debit entries in error to our checking and or savings account as indicated in the invoice above, to debit and or credit to the same such account. The authorization remains in effect until terminated or revoked and afford the merchant a reasonable amount of opportunity to act on it\r\n--------------------------------------\r\nCUSTOMER ACKNOWLEDGES RECEIPT OF\\nGOODS AND/OR SERVICES IN THE AMOUNT\\nOF THE TOTAL SHOWN HEREON AND AGREES\\nTO PERFORM THE OBLIGATIONS SET FORTH\\nBY THE CUSTOMER`S AGREEMENT WITH THE\\nISSUER\\n\\n\r\n",
"approvalCode": "146247",
"processorResponseCode": "HELD",
"bankAccount": {
"guid": "d4394cfb-1967-429b-92da-9f664c316527",
"routingNumber": "211274450",
"accountNumber": "441142020",
"accountNumberLastFour": "2020",
"nameOnAccount": "Joe Black",
"customer": {
"guid": "22fad359-2b37-470c-b6c1-d8fa66aa184a",
"firstName": "Joe",
"lastName": "Black",
"dateOfBirth": "1987-07-07T00:00:00",
"address1": "107 7th Av.",
"zip": "10007",
"city": "Austin",
"state": "TX",
"stateFullName": "Texas",
"country": "US",
"phone": "4207888807",
"email": "jblack@mailinator.com",
"ssN4": "1210",
"driverLicenseNumber": "12345678",
"driverLicenseState": "TX",
"dlStateFullName": "Texas",
"personalPhone": "4207888807",
"displayName": "Joe Black - 4207888807"
}
},
"clearingProcessorUpdate": [
{
"timestamp": "2023-06-28T12:28:37.89-05:00",
"transactionStatusUpdate": " > ",
"settlementStatusUpdate": " > ",
"reportingNotesUpdate": " > ",
"statusMessageUpdate": " > HELD"
}
]
}
Json Example Error Response:
{
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"traceId": "00-2be920374480ac59ebadf4a9a6057706-0680052537eeceae-00",
"errors": {
"guid": [
"The value 'invalid guid' is not valid."
]
}
}
This endpoint gets a bank clearing.
HTTP Request
GET https://sandbox.choice.dev/api/v1/BankClearings/<guid>
Headers using token
Key | Value |
---|---|
Authorization | Token. Eg: "Bearer eHSN5rTBzqDozgAAlN1UlTMVuIT1zSiAZWCo6E..." |
Headers using API Key
Key | Value |
---|---|
UserAuthorization | API Key. Eg: "e516b6db-3230-4b1c-ae3f-e5379b774a80" |
URL Parameters
Parameter | Description |
---|---|
guid | Bank clearing’s guid to get |
Response
- 200 code (ok).
Timeout Reversal
using System;
using Newtonsoft.Json;
using System.IO;
using System.Net;
using System.Text;
namespace ChoiceSample
{
public class BankClearing
{
public static void TimeoutReversal()
{
try
{
var request = (HttpWebRequest)WebRequest.Create("https://sandbox.choice.dev/api/v1/bankclearings/timeoutreversal");
request.ContentType = "text/json";
request.Method = "POST";
var bankClearing = new
{
DeviceGuid = "b29725af-b067-4a35-9819-bbb31bdf8808",
SequenceNumber = "849741"
};
string json = JsonConvert.SerializeObject(bankClearing);
request.Headers.Add("Authorization", "Bearer 1A089D6ziUybPZFQ3mpPyjt9OEx9yrCs7eQIC6V3A0lmXR2N6-seGNK16Gsnl3td6Ilfbr2Xf_EyukFXwnVEO3fYL-LuGw-L3c8WuaoxhPE8MMdlMPILJTIOV3lTGGdxbFXdKd9U03bbJ9TDUkqxHqq8_VyyjDrw7fs0YOob7bg0OovXTeWgIvZaIrSR1WFR06rYJ0DfWn-Inuf7re1-4SMOjY1ZoCelVwduWCBJpw1111cNbWtHJfObV8u1CVf0");
request.ContentType = "application/json";
request.Accept = "application/json";
using (var streamWriter = new StreamWriter(request.GetRequestStream()))
{
streamWriter.Write(json);
streamWriter.Flush();
streamWriter.Close();
}
try
{
var response = (HttpWebResponse)request.GetResponse();
using (var reader = new StreamReader(response.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)response.StatusCode);
Console.WriteLine();
Console.WriteLine(response.StatusDescription);
Console.WriteLine(result);
}
}
catch (WebException wex)
{
if (wex.Response != null)
{
using (var errorResponse = (HttpWebResponse)wex.Response)
{
using (var reader = new StreamReader(errorResponse.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)errorResponse.StatusCode);
Console.WriteLine();
Console.WriteLine(errorResponse.StatusDescription);
Console.WriteLine(result);
}
}
}
}
}
catch (IOException e)
{
Console.WriteLine(e);
}
}
}
}
Json Example Request:
{
"DeviceGuid": "b29725af-b067-4a35-9819-bbb31bdf8808",
"SequenceNumber": "849741"
}
Json Example Response:
"Device Guid and Sequence Number combination found and voided."
This a feature that allows a user to void a transaction if it never got a response. You must send the device guid of the terminal used to run the transaction and the sequence number. If there was a sale run on that device with that sequence and it was approved, it will be voided. Otherwise you will be informed that a sale was found but it had not been approved or that there was no sale at all with that combination of device guid and sequence number.
HTTP Request
POST https://sandbox.choice.dev/api/v1/bankclearings/timeoutreversal
Headers using token
Key | Value |
---|---|
Content-Type | "application/json" |
Authorization | Token. Eg: "Bearer eHSN5rTBzqDozgAAlN1UlTMVuIT1zSiAZWCo6E..." |
Headers using API Key
Key | Value |
---|---|
Content-Type | "application/json" |
UserAuthorization | API Key. Eg: "e516b6db-3230-4b1c-ae3f-e5379b774a80" |
Query Parameters
Parameter | Type | M/C/O | Value |
---|---|---|---|
DeviceGuid | string | Mandatory | Device's Guid. |
SequenceNumber | string | Mandatory | Sequence Number. Max Length = 100. |
Response
- 201 code (created).
Bank Clearing Void
Create bank clearing void
using System;
using Newtonsoft.Json;
using System.IO;
using System.Net;
using System.Text;
namespace ChoiceSample
{
public class BankClearingVoid
{
public static void CreateBankClearingVoid()
{
try
{
var request = (HttpWebRequest)WebRequest.Create("https://sandbox.choice.dev/api/v1/BankClearingVoids");
request.ContentType = "text/json";
request.Method = "POST";
var bankClearingVoid = new
{
DeviceGuid = "a9c0505b-a087-44b1-b9cd-0e7f75715d4d",
ClearingGuid = "4d134bf6-f934-4c1c-ba93-89ca076ed43b"
};
string json = JsonConvert.SerializeObject(bankClearingVoid);
request.Headers.Add("Authorization", "Bearer DkpQk2A3K4Lwq6aFzbmkApOZWN28EowdVscW_sxY8_RTFt12xhnIa79bUmA12INI0YqKHwbMU5O5gMU_51E6wllvacKx68-mJ7F6GWnUkR2vFKaA-tdOJEqh0GD_61MGWWlXr9sxRNyH6ZzWqUS0-QdhcPLyFzJL-odqZ46I-Aouf3ixienzOnrL0m-zbExPAOnT58prg2dhB-rfIPBoF25rdokQ1KH4NFujgeF99qwIpObHeQQ25Qok7aJh5Spk");
request.ContentType = "application/json";
request.Accept = "application/json";
using (var streamWriter = new StreamWriter(request.GetRequestStream()))
{
streamWriter.Write(json);
streamWriter.Flush();
streamWriter.Close();
}
try
{
var response = (HttpWebResponse)request.GetResponse();
using (var reader = new StreamReader(response.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)response.StatusCode);
Console.WriteLine();
Console.WriteLine(response.StatusDescription);
Console.WriteLine(result);
}
}
catch (WebException wex)
{
if (wex.Response != null)
{
using (var errorResponse = (HttpWebResponse)wex.Response)
{
using (var reader = new StreamReader(errorResponse.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)errorResponse.StatusCode);
Console.WriteLine();
Console.WriteLine(errorResponse.StatusDescription);
Console.WriteLine(result);
}
}
}
}
}
catch (IOException e)
{
Console.WriteLine(e);
}
}
}
}
Json Example Request:
{
"DeviceGuid" : "a9c0505b-a087-44b1-b9cd-0e7f75715d4d",
"ClearingGuid" : "4d134bf6-f934-4c1c-ba93-89ca076ed43b"
}
Json Example Response:
{
"guid": "6da854f8-2327-4561-a223-ea9914116d10",
"status": "Transaction - Approved",
"timeStamp": "2023-06-28T12:47:45.28-05:00",
"deviceGuid": "a9c0505b-a087-44b1-b9cd-0e7f75715d4d",
"clearingGuid": "4d134bf6-f934-4c1c-ba93-89ca076ed43b",
"processorStatusCode": "VOIDED",
"processorResponseMessage": "VOIDED",
"wasProcessed": true,
"relatedClearing": {
"guid": "4d134bf6-f934-4c1c-ba93-89ca076ed43b",
"status": "Transaction - Approved",
"timeStamp": "2023-06-28T12:47:44.26-05:00",
"deviceGuid": "a9c0505b-a087-44b1-b9cd-0e7f75715d4d",
"deviceName": "deviceach",
"merchantName": "merchtest",
"amount": 3.500,
"grossAmount": 3.500,
"effectiveAmount": 0.000,
"refNumber": "146249",
"isBusinessPayment": true,
"customData": "order details",
"operationType": "Debit",
"settlementType": "ACH",
"customerLabel": "Patient",
"businessName": "Star Shoes California",
"customerID": "xt147",
"isSettled": false,
"processorStatusCode": "VOIDED",
"processorResponseMessage": "VOIDED",
"processorResponseMessageForMobile": "VOIDED",
"wasProcessed": true,
"customerReceipt": "MerchTesting\r\nExample Street 1\r\nExample Street 2\r\nManhattan NY 10012\r\n06/28/2023 05:47:44 PM\r\nDEBIT\r\nApproval Code: 146249\r\n\r\nTotal: $3.50\r\n--------------------------------------\r\nName On Account: Joe Black\r\nRouting Number: 211274450\r\nDDA Last 4 2020\r\n\r\nStatus: SUBMITTED\r\n--------------------------------------\r\nYou authorize the merchant to initiate a debit or credit to the bank account provided, and adjustments for any debit entries in error to our checking and or savings account as indicated in the invoice above, to debit and or credit to the same such account. The authorization remains in effect until terminated or revoked and afford the merchant a reasonable amount of opportunity to act on it\r\n--------------------------------------\r\nCUSTOMER ACKNOWLEDGES RECEIPT OF\\nGOODS AND/OR SERVICES IN THE AMOUNT\\nOF THE TOTAL SHOWN HEREON AND AGREES\\nTO PERFORM THE OBLIGATIONS SET FORTH\\nBY THE CUSTOMER`S AGREEMENT WITH THE\\nISSUER\\n\\n\r\n",
"approvalCode": "146249",
"processorResponseCode": "VOIDED",
"bankAccount": {
"guid": "d4394cfb-1967-429b-92da-9f664c316527",
"routingNumber": "211274450",
"accountNumber": "441142020",
"accountNumberLastFour": "2020",
"nameOnAccount": "Joe Black",
"customer": {
"guid": "22fad359-2b37-470c-b6c1-d8fa66aa184a",
"firstName": "Joe",
"lastName": "Black",
"dateOfBirth": "1987-07-07T00:00:00",
"address1": "107 7th Av.",
"zip": "10007",
"city": "Austin",
"state": "TX",
"stateFullName": "Texas",
"country": "US",
"phone": "4207888807",
"email": "jblack@mailinator.com",
"ssN4": "1210",
"driverLicenseNumber": "12345678",
"driverLicenseState": "TX",
"dlStateFullName": "Texas",
"personalPhone": "4207888807",
"displayName": "Joe Black - 4207888807"
}
},
"clearingProcessorUpdate": [
{
"timestamp": "2023-06-28T12:47:44.82-05:00",
"transactionStatusUpdate": " > ",
"settlementStatusUpdate": " > ",
"reportingNotesUpdate": " > ",
"statusMessageUpdate": " > HELD"
}
]
}
}
Json Example Error Response:
{
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"traceId": "00-14245d67b54a4f2b029bbbbc886e1dfe-4e23e190215268a5-00",
"errors": {
"$.DeviceGuid": [
"Unable to parse to GUID"
],
"$.ClearingGuid": [
"Unable to parse Invalid clearing guid to GUID"
]
}
}
This endpoint creates a bank clearing void.
HTTP Request
POST https://sandbox.choice.dev/api/v1/BankClearingVoids
Headers using token
Key | Value |
---|---|
Content-Type | "application/json" |
Authorization | Token. Eg: "Bearer eHSN5rTBzqDozgAAlN1UlTMVuIT1zSiAZWCo6E..." |
Headers using API Key
Key | Value |
---|---|
Content-Type | "application/json" |
UserAuthorization | API Key. Eg: "e516b6db-3230-4b1c-ae3f-e5379b774a80" |
Query Parameters
Parameter | Type | M/C/O | Value |
---|---|---|---|
DeviceGuid | string | Mandatory | Device Guid. |
ClearingGuid | string | Mandatory | Clearing Guid. |
Response
- 201 code (created).
Get bank clearing void
using System;
using Newtonsoft.Json;
using System.IO;
using System.Net;
using System.Text;
namespace ChoiceSample
{
public class BankClearingVoid
{
public static void GetBankClearingVoid()
{
try
{
var request = (HttpWebRequest)WebRequest.Create("https://sandbox.choice.dev/api/v1/BankClearingVoids/6da854f8-2327-4561-a223-ea9914116d10");
request.Method = "GET";
request.Headers.Add("Authorization", "Bearer DkpQk2A3K4Lwq6aFzbmkApOZWN28EowdVscW_sxY8_RTFt12xhnIa79bUmA12INI0YqKHwbMU5O5gMU_51E6wllvacKx68-mJ7F6GWnUkR2vFKaA-tdOJEqh0GD_61MGWWlXr9sxRNyH6ZzWqUS0-QdhcPLyFzJL-odqZ46I-Aouf3ixienzOnrL0m-zbExPAOnT58prg2dhB-rfIPBoF25rdokQ1KH4NFujgeF99qwIpObHeQQ25Qok7aJh5Spk");
try
{
var response = (HttpWebResponse)request.GetResponse();
using (var reader = new StreamReader(response.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)response.StatusCode);
Console.WriteLine();
Console.WriteLine(response.StatusDescription);
Console.WriteLine(result);
}
}
catch (WebException wex)
{
if (wex.Response != null)
{
using (var errorResponse = (HttpWebResponse)wex.Response)
{
using (var reader = new StreamReader(errorResponse.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)errorResponse.StatusCode);
Console.WriteLine();
Console.WriteLine(errorResponse.StatusDescription);
Console.WriteLine(result);
}
}
}
}
}
catch (IOException e)
{
Console.WriteLine(e);
}
}
}
}
Json Example Response:
{
"guid": "6da854f8-2327-4561-a223-ea9914116d10",
"status": "Transaction - Approved",
"timeStamp": "2023-06-28T12:51:22.57-05:00",
"deviceGuid": "a9c0505b-a087-44b1-b9cd-0e7f75715d4d",
"clearingGuid": "4d134bf6-f934-4c1c-ba93-89ca076ed43b",
"processorStatusCode": "VOIDED",
"processorResponseMessage": "VOIDED",
"wasProcessed": true,
"relatedClearing": {
"guid": "4d134bf6-f934-4c1c-ba93-89ca076ed43b",
"status": "Transaction - Approved",
"timeStamp": "2023-06-28T12:51:21.43-05:00",
"deviceGuid": "a9c0505b-a087-44b1-b9cd-0e7f75715d4d",
"deviceName": "deviceach",
"merchantName": "merchtest",
"amount": 3.500,
"grossAmount": 3.500,
"effectiveAmount": 0.000,
"refNumber": "146250",
"isBusinessPayment": true,
"customData": "order details",
"operationType": "Debit",
"settlementType": "ACH",
"customerLabel": "Patient",
"businessName": "Star Shoes California",
"customerID": "xt147",
"isSettled": false,
"processorStatusCode": "VOIDED",
"processorResponseMessage": "VOIDED",
"processorResponseMessageForMobile": "VOIDED",
"wasProcessed": true,
"customerReceipt": "MerchTesting\r\nExample Street 1\r\nExample Street 2\r\nManhattan NY 10012\r\n06/28/2023 05:51:21 PM\r\nDEBIT\r\nApproval Code: 146250\r\n\r\nTotal: $3.50\r\n--------------------------------------\r\nName On Account: Joe Black\r\nRouting Number: 211274450\r\nDDA Last 4 2020\r\n\r\nStatus: SUBMITTED\r\n--------------------------------------\r\nYou authorize the merchant to initiate a debit or credit to the bank account provided, and adjustments for any debit entries in error to our checking and or savings account as indicated in the invoice above, to debit and or credit to the same such account. The authorization remains in effect until terminated or revoked and afford the merchant a reasonable amount of opportunity to act on it\r\n--------------------------------------\r\nCUSTOMER ACKNOWLEDGES RECEIPT OF\\nGOODS AND/OR SERVICES IN THE AMOUNT\\nOF THE TOTAL SHOWN HEREON AND AGREES\\nTO PERFORM THE OBLIGATIONS SET FORTH\\nBY THE CUSTOMER`S AGREEMENT WITH THE\\nISSUER\\n\\n\r\n",
"approvalCode": "146250",
"processorResponseCode": "VOIDED",
"bankAccount": {
"guid": "d4394cfb-1967-429b-92da-9f664c316527",
"routingNumber": "211274450",
"accountNumber": "441142020",
"accountNumberLastFour": "2020",
"nameOnAccount": "Joe Black",
"customer": {
"guid": "22fad359-2b37-470c-b6c1-d8fa66aa184a",
"firstName": "Joe",
"lastName": "Black",
"dateOfBirth": "1987-07-07T00:00:00",
"address1": "107 7th Av.",
"zip": "10007",
"city": "Austin",
"state": "TX",
"country": "US",
"phone": "4207888807",
"email": "jblack@mailinator.com",
"ssN4": "1210",
"driverLicenseNumber": "12345678",
"driverLicenseState": "TX",
"personalPhone": "4207888807",
"displayName": "Joe Black - 4207888807"
}
},
"clearingProcessorUpdate": [
{
"timestamp": "2023-06-28T12:51:21.88-05:00",
"transactionStatusUpdate": " > ",
"settlementStatusUpdate": " > ",
"reportingNotesUpdate": " > ",
"statusMessageUpdate": " > HELD"
}
]
}
}
Json Example Error Response:
{
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"traceId": "00-2be920374480ac59ebadf4a9a6057706-0680052537eeceae-00",
"errors": {
"guid": [
"The value 'invalid guid' is not valid."
]
}
}
This endpoint gets a bank clearing void.
HTTP Request
GET https://sandbox.choice.dev/api/v1/BankClearingVoids/<guid>
Headers using token
Key | Value |
---|---|
Authorization | Token. Eg: "Bearer eHSN5rTBzqDozgAAlN1UlTMVuIT1zSiAZWCo6E..." |
Headers using API Key
Key | Value |
---|---|
UserAuthorization | API Key. Eg: "e516b6db-3230-4b1c-ae3f-e5379b774a80" |
URL Parameters
Parameter | Description |
---|---|
guid | Bank clearing void’s guid to get |
Response
- 200 code (ok).
Bank Clearing Return
Create bank clearing return
using System;
using Newtonsoft.Json;
using System.IO;
using System.Net;
using System.Text;
namespace ChoiceSample
{
public class BankClearingReturn
{
public static void CreateBankClearingReturn()
{
try
{
var request = (HttpWebRequest)WebRequest.Create("https://sandbox.choice.dev/api/v1/BankClearingReturns");
request.ContentType = "text/json";
request.Method = "POST";
var bankClearingReturn = new
{
DeviceGuid = "a9c0505b-a087-44b1-b9cd-0e7f75715d4d",
ClearingGuid = "8c7d4ce1-1cd2-4c92-ac24-86bf7ae1c0ed"
};
string json = JsonConvert.SerializeObject(bankClearingReturn);
request.Headers.Add("Authorization", "Bearer DkpQk2A3K4Lwq6aFzbmkApOZWN28EowdVscW_sxY8_RTFt12xhnIa79bUmA12INI0YqKHwbMU5O5gMU_51E6wllvacKx68-mJ7F6GWnUkR2vFKaA-tdOJEqh0GD_61MGWWlXr9sxRNyH6ZzWqUS0-QdhcPLyFzJL-odqZ46I-Aouf3ixienzOnrL0m-zbExPAOnT58prg2dhB-rfIPBoF25rdokQ1KH4NFujgeF99qwIpObHeQQ25Qok7aJh5Spk");
request.ContentType = "application/json";
request.Accept = "application/json";
using (var streamWriter = new StreamWriter(request.GetRequestStream()))
{
streamWriter.Write(json);
streamWriter.Flush();
streamWriter.Close();
}
try
{
var response = (HttpWebResponse)request.GetResponse();
using (var reader = new StreamReader(response.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)response.StatusCode);
Console.WriteLine();
Console.WriteLine(response.StatusDescription);
Console.WriteLine(result);
}
}
catch (WebException wex)
{
if (wex.Response != null)
{
using (var errorResponse = (HttpWebResponse)wex.Response)
{
using (var reader = new StreamReader(errorResponse.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)errorResponse.StatusCode);
Console.WriteLine();
Console.WriteLine(errorResponse.StatusDescription);
Console.WriteLine(result);
}
}
}
}
}
catch (IOException e)
{
Console.WriteLine(e);
}
}
}
}
Json Example Request:
{
"DeviceGuid" : "a9c0505b-a087-44b1-b9cd-0e7f75715d4d",
"ClearingGuid" : "8c7d4ce1-1cd2-4c92-ac24-86bf7ae1c0ed"
}
Json Example Response:
{
"Guid": "411c38e4-yt56-4f13-8c1f-34geert345h5",
"DeviceGuid": "5mkmny86i-b486-4297-8c5c-34geert345h5",
"ClearingGuid": "3ef644ef-f0c7-404b-bffe-34geert345h5",
"timeStamp": "2023-06-20T09:22:54.41-05:00",
"Status": "Transaction - Approved",
"ProcessorStatusCode": "SUBMITTED",
"ProcessorResponseMessage": "SUBMITTED",
"RefNumber": "144626",
"WasProcessed": true,
"RelatedClearing": {
"Guid": "3ef644ef-f0c7-404b-bffe-34geert345h5",
"Status": "Transaction - Approved",
"timeStamp": "2023-06-09T14:26:35.42-05:00",
"DeviceGuid": "5cfb3061-b486-4297-8c5c-34geert345h5",
"DeviceName": "Test",
"MerchantName": "Test Corp",
"Amount": 7120.1,
"GrossAmount": 7120.1,
"EffectiveAmount": 0.0,
"RefNumber": "143239",
"IsBusinessPayment": false,
"CustomData": "{\"orderId\":\"ad9f1dca022846ac8525de36db4eb36b\",\"orderNumber\":\"221\",\"employeeName\":\"Testing Edkins\",\"registerNumber\":\"01\",\"taxAmount\":0,\"customField\":\"56194\"}",
"OperationType": "Debit",
"SettlementType": "ACH",
"IsSettled": true,
"ProcessorStatusCode": "SETTLED",
"ProcessorResponseMessage": "Transaction Settled",
"ProcessorResponseMessageForMobile": "Transaction Settled",
"WasProcessed": true,
"CustomerReceipt": "Test Corp\r\n575 Dimm st\r\n\r\nHillsborough NC 22278\r\n06/09/2023 07:26:35 PM\r\nDEBIT\r\nApproval Code: 543239\r\nSubTotal: $7,120.10\r\n--------------------------------------\r\nCash Discount: -$248.49\r\n--------------------------------------\r\nTotal: $7,120.10\r\n--------------------------------------\r\nName On Account: Max Testing\r\nRouting Number: 021202337\r\nDDA Last 4 8061\r\n\r\nStatus: SUBMITTED\r\n--------------------------------------\r\nCUSTOMER ACKNOWLEDGES RECEIPT OF\\nGOODS AND/OR SERVICES IN THE AMOUNT\\nOF THE TOTAL SHOWN HEREON AND AGREES\\nTO PERFORM THE OBLIGATIONS SET FORTH\\nBY THE CUSTOMER`S AGREEMENT WITH THE\\nISSUER\\n\\n\r\n--------------------------------------\r\nYou authorize the merchant to initiate a debit or credit to the bank account provided, and adjustments for any debit entries in error to our checking and or savings account as indicated in the invoice above, to debit and or credit to the same such account. The authorization remains in effect until terminated or revoked and afford the merchant a reasonable amount of opportunity to act on it\r\n",
"ProcessorTransactionStatus": "Debit Sent",
"ProcessorSettlementStatus": "Credit Sent",
"SequenceNumber": "ttqHcM8sj20PIFr5hpkg",
"ApprovalCode": "143239",
"ProcessorResponseCode": "SETTLED",
"BankAccount": {
"Guid": "3c3a6e82-1234-4578-903e-015887fcc836",
"RoutingNumber": "021000037",
"AccountNumber": "652000061",
"AccountNumberLastFour": "8061",
"NameOnAccount": "Max Test"
},
"ClearingProcessorUpdate": [
{
"timestamp": "2023-06-09T14:26:35.74-05:00",
"TransactionStatusUpdate": " > ",
"SettlementStatusUpdate": " > ",
"ReportingNotesUpdate": " > ",
"StatusMessageUpdate": " > SUBMITTED"
}
]
},
"Amount": 7120.1
}
Json Example Error Response:
{
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"traceId": "00-a62cc28334fde7edd4fee244793a85b7-8ccbd6f6d677391d-00",
"errors": {
"$.DeviceGuid": [
"Unable to parse Invalid device guid to GUID"
],
"$.ClearingGuid": [
"Unable to parse Invalid clearing guid to GUID"
]
}
}
This endpoint creates a bank clearing return.
HTTP Request
POST https://sandbox.choice.dev/api/v1/BankClearingReturns
Headers using token
Key | Value |
---|---|
Content-Type | "application/json" |
Authorization | Token. Eg: "Bearer eHSN5rTBzqDozgAAlN1UlTMVuIT1zSiAZWCo6E..." |
Headers using API Key
Key | Value |
---|---|
Content-Type | "application/json" |
UserAuthorization | API Key. Eg: "e516b6db-3230-4b1c-ae3f-e5379b774a80" |
Query Parameters
Parameter | Type | M/C/O | Value |
---|---|---|---|
DeviceGuid | string | Mandatory | Device Guid. |
ClearingGuid | string | Mandatory | Clearing Guid. |
Response
- 201 code (created).
Get bank clearing return
using System;
using Newtonsoft.Json;
using System.IO;
using System.Net;
using System.Text;
namespace ChoiceSample
{
public class BankClearingReturn
{
public static void GetBankClearingReturn()
{
try
{
var request = (HttpWebRequest)WebRequest.Create("https://sandbox.choice.dev/api/v1/BankClearingReturns/f76fda9b-3632-441b-aa8c-f98ff4389ade");
request.Method = "GET";
request.Headers.Add("Authorization", "Bearer DkpQk2A3K4Lwq6aFzbmkApOZWN28EowdVscW_sxY8_RTFt12xhnIa79bUmA12INI0YqKHwbMU5O5gMU_51E6wllvacKx68-mJ7F6GWnUkR2vFKaA-tdOJEqh0GD_61MGWWlXr9sxRNyH6ZzWqUS0-QdhcPLyFzJL-odqZ46I-Aouf3ixienzOnrL0m-zbExPAOnT58prg2dhB-rfIPBoF25rdokQ1KH4NFujgeF99qwIpObHeQQ25Qok7aJh5Spk");
try
{
var response = (HttpWebResponse)request.GetResponse();
using (var reader = new StreamReader(response.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)response.StatusCode);
Console.WriteLine();
Console.WriteLine(response.StatusDescription);
Console.WriteLine(result);
}
}
catch (WebException wex)
{
if (wex.Response != null)
{
using (var errorResponse = (HttpWebResponse)wex.Response)
{
using (var reader = new StreamReader(errorResponse.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)errorResponse.StatusCode);
Console.WriteLine();
Console.WriteLine(errorResponse.StatusDescription);
Console.WriteLine(result);
}
}
}
}
}
catch (IOException e)
{
Console.WriteLine(e);
}
}
}
}
Json Example Response:
{
"Guid": "411c38e4-yt56-4f13-8c1f-34geert345h5",
"DeviceGuid": "5mkmny86i-b486-4297-8c5c-34geert345h5",
"ClearingGuid": "3ef644ef-f0c7-404b-bffe-34geert345h5",
"timeStamp": "2023-06-20T09:22:54.41-05:00",
"Status": "Transaction - Approved",
"ProcessorStatusCode": "SUBMITTED",
"ProcessorResponseMessage": "SUBMITTED",
"RefNumber": "144626",
"WasProcessed": true,
"RelatedClearing": {
"Guid": "3ef644ef-f0c7-404b-bffe-34geert345h5",
"Status": "Transaction - Approved",
"timeStamp": "2023-06-09T14:26:35.42-05:00",
"DeviceGuid": "5cfb3061-b486-4297-8c5c-34geert345h5",
"DeviceName": "Test",
"MerchantName": "Test Corp",
"Amount": 7120.1,
"GrossAmount": 7120.1,
"EffectiveAmount": 0.0,
"RefNumber": "143239",
"IsBusinessPayment": false,
"CustomData": "{\"orderId\":\"ad9f1dca022846ac8525de36db4eb36b\",\"orderNumber\":\"221\",\"employeeName\":\"Testing Edkins\",\"registerNumber\":\"01\",\"taxAmount\":0,\"customField\":\"56194\"}",
"OperationType": "Debit",
"SettlementType": "ACH",
"IsSettled": true,
"ProcessorStatusCode": "SETTLED",
"ProcessorResponseMessage": "Transaction Settled",
"ProcessorResponseMessageForMobile": "Transaction Settled",
"WasProcessed": true,
"CustomerReceipt": "Test Corp\r\n575 Dimm st\r\n\r\nHillsborough NC 22278\r\n06/09/2023 07:26:35 PM\r\nDEBIT\r\nApproval Code: 543239\r\nSubTotal: $7,120.10\r\n--------------------------------------\r\nCash Discount: -$248.49\r\n--------------------------------------\r\nTotal: $7,120.10\r\n--------------------------------------\r\nName On Account: Max Testing\r\nRouting Number: 021202337\r\nDDA Last 4 8061\r\n\r\nStatus: SUBMITTED\r\n--------------------------------------\r\nCUSTOMER ACKNOWLEDGES RECEIPT OF\\nGOODS AND/OR SERVICES IN THE AMOUNT\\nOF THE TOTAL SHOWN HEREON AND AGREES\\nTO PERFORM THE OBLIGATIONS SET FORTH\\nBY THE CUSTOMER`S AGREEMENT WITH THE\\nISSUER\\n\\n\r\n--------------------------------------\r\nYou authorize the merchant to initiate a debit or credit to the bank account provided, and adjustments for any debit entries in error to our checking and or savings account as indicated in the invoice above, to debit and or credit to the same such account. The authorization remains in effect until terminated or revoked and afford the merchant a reasonable amount of opportunity to act on it\r\n",
"ProcessorTransactionStatus": "Debit Sent",
"ProcessorSettlementStatus": "Credit Sent",
"SequenceNumber": "ttqHcM8sj20PIFr5hpkg",
"ApprovalCode": "143239",
"ProcessorResponseCode": "SETTLED",
"BankAccount": {
"Guid": "3c3a6e82-1234-4578-903e-015887fcc836",
"RoutingNumber": "021000037",
"AccountNumber": "652000061",
"AccountNumberLastFour": "8061",
"NameOnAccount": "Max Test"
},
"ClearingProcessorUpdate": [
{
"timestamp": "2023-06-09T14:26:35.74-05:00",
"TransactionStatusUpdate": " > ",
"SettlementStatusUpdate": " > ",
"ReportingNotesUpdate": " > ",
"StatusMessageUpdate": " > SUBMITTED"
}
]
},
"Amount": 7120.1
}
Json Example Error Response:
{
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"traceId": "00-2be920374480ac59ebadf4a9a6057706-0680052537eeceae-00",
"errors": {
"guid": [
"The value 'invalid guid' is not valid."
]
}
}
This endpoint gets a bank clearing return.
HTTP Request
GET https://sandbox.choice.dev/api/v1/BankClearingReturns/<guid>
Headers using token
Key | Value |
---|---|
Authorization | Token. Eg: "Bearer eHSN5rTBzqDozgAAlN1UlTMVuIT1zSiAZWCo6E..." |
Headers using API Key
Key | Value |
---|---|
UserAuthorization | API Key. Eg: "e516b6db-3230-4b1c-ae3f-e5379b774a80" |
URL Parameters
Parameter | Description |
---|---|
guid | Bank clearing return’s guid to get |
Response
- 200 code (ok).
Bank Clearing Verify
Create bank clearing verify
using System;
using Newtonsoft.Json;
using System.IO;
using System.Net;
using System.Text;
namespace ChoiceSample
{
public class BankClearingVerify
{
public static void CreateBankClearingVerify()
{
try
{
var request = (HttpWebRequest)WebRequest.Create("https://sandbox.choice.dev/api/v1/BankClearings/Verify");
request.ContentType = "text/json";
request.Method = "POST";
var verify = new
{
DeviceGuid = "b29725af-b067-4a35-9819-bbb31bdf8808",
RoutingNumber = "211274450",
AccountNumber = "12345678",
AccountOwnership = "Personal",
FirstName = "Jhon",
LastName = "Doe"
};
string json = JsonConvert.SerializeObject(verify);
request.Headers.Add("Authorization", "Bearer 1A089D6ziUybPZFQ3mpPyjt9OEx9yrCs7eQIC6V3A0lmXR2N6-seGNK16Gsnl3td6Ilfbr2Xf_EyukFXwnVEO3fYL-LuGw-L3c8WuaoxhPE8MMdlMPILJTIOV3lTGGdxbFXdKd9U03bbJ9TDUkqxHqq8_VyyjDrw7fs0YOob7bg0OovXTeWgIvZaIrSR1WFR06rYJ0DfWn-Inuf7re1-4SMOjY1ZoCelVwduWCBJpw1111cNbWtHJfObV8u1CVf0");
request.ContentType = "application/json";
request.Accept = "application/json";
using (var streamWriter = new StreamWriter(request.GetRequestStream()))
{
streamWriter.Write(json);
streamWriter.Flush();
streamWriter.Close();
}
try
{
var response = (HttpWebResponse)request.GetResponse();
using (var reader = new StreamReader(response.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)response.StatusCode);
Console.WriteLine();
Console.WriteLine(response.StatusDescription);
Console.WriteLine(result);
}
}
catch (WebException wex)
{
if (wex.Response != null)
{
using (var errorResponse = (HttpWebResponse)wex.Response)
{
using (var reader = new StreamReader(errorResponse.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)errorResponse.StatusCode);
Console.WriteLine();
Console.WriteLine(errorResponse.StatusDescription);
Console.WriteLine(result);
}
}
}
}
}
catch (IOException e)
{
Console.WriteLine(e);
}
}
}
}
using System;
using Newtonsoft.Json;
using System.IO;
using System.Net;
using System.Text;
namespace ChoiceSample
{
public class BankClearingVerify
{
public static void CreateBankClearingVerify()
{
try
{
var request = (HttpWebRequest)WebRequest.Create("https://sandbox.choice.dev/api/v1/BankClearings/Verify");
request.ContentType = "text/json";
request.Method = "POST";
var verify = new
{
DeviceGuid = "C96771A9-76F0-4CB3-B737-1B6A839036E7",
RoutingNumber = "061103852",
AccountNumber = "123978002",
AccountOwnership = "Business",
BusinessName= "MyBusinessName"
};
string json = JsonConvert.SerializeObject(verify);
request.Headers.Add("Authorization", "Bearer 1A089D6ziUybPZFQ3mpPyjt9OEx9yrCs7eQIC6V3A0lmXR2N6-seGNK16Gsnl3td6Ilfbr2Xf_EyukFXwnVEO3fYL-LuGw-L3c8WuaoxhPE8MMdlMPILJTIOV3lTGGdxbFXdKd9U03bbJ9TDUkqxHqq8_VyyjDrw7fs0YOob7bg0OovXTeWgIvZaIrSR1WFR06rYJ0DfWn-Inuf7re1-4SMOjY1ZoCelVwduWCBJpw1111cNbWtHJfObV8u1CVf0");
request.ContentType = "application/json";
request.Accept = "application/json";
using (var streamWriter = new StreamWriter(request.GetRequestStream()))
{
streamWriter.Write(json);
streamWriter.Flush();
streamWriter.Close();
}
try
{
var response = (HttpWebResponse)request.GetResponse();
using (var reader = new StreamReader(response.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)response.StatusCode);
Console.WriteLine();
Console.WriteLine(response.StatusDescription);
Console.WriteLine(result);
}
}
catch (WebException wex)
{
if (wex.Response != null)
{
using (var errorResponse = (HttpWebResponse)wex.Response)
{
using (var reader = new StreamReader(errorResponse.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)errorResponse.StatusCode);
Console.WriteLine();
Console.WriteLine(errorResponse.StatusDescription);
Console.WriteLine(result);
}
}
}
}
}
catch (IOException e)
{
Console.WriteLine(e);
}
}
}
}
Json Example Request:
{
"DeviceGuid": "b29725af-b067-4a35-9819-bbb31bdf8808",
"RoutingNumber": "211274450",
"AccountNumber": "12345678",
"AccountOwnership": "Personal",
"FirstName": "Jhon",
"LastName": "Doe"
}
Json Example Response:
{
"bankAccountGuid": "9b674e26-fe76-4a0e-bde4-8ed596jjy214",
"routingNumber": "211274450",
"accountNumber": "12345678",
"responseCode": "2",
"responseValue": "Format Error",
"responseDescription": "2 - Invalid Account or Account format is suspicious"
}
Json Example Error Response:
{
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"traceId": "00-a62cc28334fde7edd4fee244793a85b7-8ccbd6f6d677391d-00",
"errors": {
"$.DeviceGuid": [
"Unable to parse Invalid device guid to GUID"
],
"$.ClearingGuid": [
"Unable to parse Invalid clearing guid to GUID"
]
}
}
This endpoint creates a bank clearing verify.
HTTP Request
POST https://sandbox.choice.dev/api/v1/BankClearings/Verify
Headers using token
Key | Value |
---|---|
Content-Type | "application/json" |
Authorization | Token. Eg: "Bearer eHSN5rTBzqDozgAAlN1UlTMVuIT1zSiAZWCo6E..." |
Headers using API Key
Key | Value |
---|---|
Content-Type | "application/json" |
UserAuthorization | API Key. Eg: "e516b6db-3230-4b1c-ae3f-e5379b774a80" |
Query Parameters
Parameter | Type | M/C/O | Value |
---|---|---|---|
DeviceGuid | string | Mandatory | Device’s Guid. |
RoutingNumber | string | Mandatory | Routing's number. Must be 9 characters (example: 490000018). |
AccountNumber | string | Mandatory | Account's number. Must be between 4 and 20 digits long. Accepts only numbers between 4 and 20 characters. |
AccountOwnership | string | Mandatory | Allowed values: 1. Personal 2. Business |
FirstName | string | Mandatory when AccountOwnership('Personal') is provided | User’s first name. |
LastName | string | Mandatory when AccountOwnership('Personal') is provided | User’s last name. |
BusinessName | string | Mandatory when AccountOwnership('Business') is provided | User’s business name. Accepts up to 50 characters. |
Response
- 200 code (ok).
Sale
Create sale
using System;
using Newtonsoft.Json;
using System.IO;
using System.Net;
using System.Text;
namespace ChoiceSample
{
public class Sale
{
public static void CreateSale()
{
try
{
var request = (HttpWebRequest)WebRequest.Create("https://sandbox.choice.dev/api/v1/sales");
request.ContentType = "text/json";
request.Method = "POST";
var sale = new
{
DeviceGuid = "b29725af-b067-4a35-9819-bbb31bdf8808",
Amount = 19.74,
TipAmount = 0.74,
DualPricingFeeAmount = 3.00,
OrderNumber = "11518",
OrderDate = "2017-02-03",
SendReceipt = true,
CustomData = "order details",
CustomerLabel = "Patient",
CustomerId = "xt147",
StatementDescription = "Value stated by the user",
BusinessName = "Star Shoes California",
AssociateCustomerCard = true,
SemiIntegrated = false
Card = new
{
CardNumber = "5306764208460213",
CardHolderName = "John Doe",
Cvv2 = "998",
ExpirationDate = "2207",
Customer = new
{
FirstName = "John",
LastName = "Doe",
Phone = "9177563007",
City = "New York",
State = "NY",
Country = "US",
Email = "johnd@mailinator.com",
Address1 = "107 7th Av.",
Address2 = "",
Zip = "10007",
DateOfBirth = "1987-07-07",
DriverLicenseNumber = "12345678",
DriverLicenseState = "TX",
SSN4 = "1210"
}
}
};
string json = JsonConvert.SerializeObject(sale);
request.Headers.Add("Authorization", "Bearer 1A089D6ziUybPZFQ3mpPyjt9OEx9yrCs7eQIC6V3A0lmXR2N6-seGNK16Gsnl3td6Ilfbr2Xf_EyukFXwnVEO3fYL-LuGw-L3c8WuaoxhPE8MMdlMPILJTIOV3lTGGdxbFXdKd9U03bbJ9TDUkqxHqq8_VyyjDrw7fs0YOob7bg0OovXTeWgIvZaIrSR1WFR06rYJ0DfWn-Inuf7re1-4SMOjY1ZoCelVwduWCBJpw1111cNbWtHJfObV8u1CVf0");
request.ContentType = "application/json";
request.Accept = "application/json";
using (var streamWriter = new StreamWriter(request.GetRequestStream()))
{
streamWriter.Write(json);
streamWriter.Flush();
streamWriter.Close();
}
try
{
var response = (HttpWebResponse)request.GetResponse();
using (var reader = new StreamReader(response.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)response.StatusCode);
Console.WriteLine();
Console.WriteLine(response.StatusDescription);
Console.WriteLine(result);
}
}
catch (WebException wex)
{
if (wex.Response != null)
{
using (var errorResponse = (HttpWebResponse)wex.Response)
{
using (var reader = new StreamReader(errorResponse.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)errorResponse.StatusCode);
Console.WriteLine();
Console.WriteLine(errorResponse.StatusDescription);
Console.WriteLine(result);
}
}
}
}
}
catch (IOException e)
{
Console.WriteLine(e);
}
}
}
}
-----------------------------------------------------------
using System;
using Newtonsoft.Json;
using System.IO;
using System.Net;
using System.Text;
namespace ChoiceSample
{
public class Sale
{
public static void CreateSale()
{
try
{
var request = (HttpWebRequest)WebRequest.Create("https://sandbox.choice.dev/api/v1/sales");
request.ContentType = "text/json";
request.Method = "POST";
var sale = new
{
DeviceGuid = "b29725af-b067-4a35-9819-bbb31bdf8808",
Amount = 19.74,
TipAmount = 0.74,
DualPricingFeeAmount = 3.00,
PromptConsumer = true,
OrderNumber = "11518",
OrderDate = "2017-02-03",
SendReceipt = true,
CustomData = "order details",
CustomerLabel = "Patient",
CustomerId = "xt147",
StatementDescription = "Value stated by the user",
BusinessName = "Star Shoes California",
AssociateCustomerCard = true,
SemiIntegrated = true
};
string json = JsonConvert.SerializeObject(sale);
request.Headers.Add("Authorization", "Bearer 1A089D6ziUybPZFQ3mpPyjt9OEx9yrCs7eQIC6V3A0lmXR2N6-seGNK16Gsnl3td6Ilfbr2Xf_EyukFXwnVEO3fYL-LuGw-L3c8WuaoxhPE8MMdlMPILJTIOV3lTGGdxbFXdKd9U03bbJ9TDUkqxHqq8_VyyjDrw7fs0YOob7bg0OovXTeWgIvZaIrSR1WFR06rYJ0DfWn-Inuf7re1-4SMOjY1ZoCelVwduWCBJpw1111cNbWtHJfObV8u1CVf0");
request.ContentType = "application/json";
request.Accept = "application/json";
using (var streamWriter = new StreamWriter(request.GetRequestStream()))
{
streamWriter.Write(json);
streamWriter.Flush();
streamWriter.Close();
}
try
{
var response = (HttpWebResponse)request.GetResponse();
using (var reader = new StreamReader(response.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)response.StatusCode);
Console.WriteLine();
Console.WriteLine(response.StatusDescription);
Console.WriteLine(result);
}
}
catch (WebException wex)
{
if (wex.Response != null)
{
using (var errorResponse = (HttpWebResponse)wex.Response)
{
using (var reader = new StreamReader(errorResponse.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)errorResponse.StatusCode);
Console.WriteLine();
Console.WriteLine(errorResponse.StatusDescription);
Console.WriteLine(result);
}
}
}
}
}
catch (IOException e)
{
Console.WriteLine(e);
}
}
}
}
Json Example Request:
{
"DeviceGuid": "b29725af-b067-4a35-9819-bbb31bdf8808",
"Amount": 19.74,
"dualPricingFeeAmount": 0.40,
"OrderNumber": "11518",
"OrderDate": "2020-11-24",
"SendReceipt": true,
"CustomData": "order details",
"CustomerLabel": "Patient",
"CustomerId": "xt147",
"StatementDescription": "Value stated by the user",
"BusinessName": "Star Shoes California",
"AssociateCustomerCard": true,
"Card": {
"CardNumber": "5306764208460213",
"CardHolderName": "John Doe",
"Cvv2": "998",
"ExpirationDate": "2207",
"Customer": {
"FirstName": "John",
"LastName": "Doe",
"Phone": "9177563007",
"City": "New York",
"State": "NY",
"Country": "US",
"Email": "johnd@mailinator.com",
"Address1": "107 7th Av.",
"Address2": "",
"Zip": "10007",
"DateOfBirth": "1987-07-07",
"SSN4": "1210"
}
}
}
Json Example Request for Semi-Integrated Sale:
{
"DeviceGuid": "b29725af-b067-4a35-9819-bbb31bdf8808",
"Amount": 19.74,
"DualPricingFeeAmount": 0.40,
"PromptConsumer": true,
"OrderNumber": "11518",
"OrderDate": "2020-11-24",
"SendReceipt": true,
"CustomData": "order details",
"CustomerLabel": "Patient",
"CustomerId": "xt147",
"StatementDescription": "Value stated by the user",
"BusinessName": "Star Shoes California",
"AssociateCustomerCard": true,
"SemiIntegrated": true
}
Json Example Response:
{
"guid": "1dde1960-3dea-472c-836e-402840967e7b",
"status": "Transaction - Approved",
"batchStatus": "Batch - Open",
"timeStamp": "2023-06-28T13:01:06.52-05:00",
"deviceGuid": "b29725af-b067-4a35-9819-bbb31bdf8808",
"amount": 20.900,
"currencyQuote": 1.000,
"currency": "USD",
"effectiveAmount": 20.900,
"dualPricingFeeAmount": 0.400,
"grossAmount": 20.500,
"orderNumber": "11518",
"orderDate": "2020-11-24T00:00:00.00-06:00",
"cardDataSource": "INTERNET",
"customerLabel": "Patient",
"businessName": "Star Shoes California",
"customerID": "xt147",
"batchGuid": "014db6d5-e627-472b-8f7d-02901693725f",
"processorStatusCode": "A0000",
"processorResponseMessage": "Success, HostRef#: 317918751384",
"wasProcessed": true,
"authCode": "VTLMC1",
"refNumber": "33488047",
"customerReceipt": "Value stated by the user \\n 8320 S HARDY DR \\n TEMPE AZ 85284\\n06/28/2023 14:06:06 \\n\\nCREDIT - SALE\\nTransaction - Approved\\n\\nJohn Doe\\nCard Number: **** **** **** 0213\\nCard Type: Mastercard\\nRef #: 33488047\\nAuth Code: VTLMC1\\n\\nTxn Amt $20.50\\nCash Discount $0.00\\n\\nTotal Amt $20.90\\n\\nOrder Number: 11518\\nCustomer Red Id: xt147\\nOrder Date: 11/24/2020 12:00:00 AM\\nOrder Details: order details\\n\\nCUSTOMER ACKNOWLEDGES RECEIPT OF \\n GOODS AND/OR SERVICES IN THE AMOUNT \\n OF THE TOTAL SHOWN HEREON AND AGREES \\n TO PERFORM THE OBLIGATIONS SET FORTH \\n BY THE CUSTOMER`S AGREEMENT WITH THE \\n ISSUER\\n APPROVED \\n\\n \\n \\n\\n Customer Copy\\n",
"statementDescription": "Value stated by the user",
"customData": "order details",
"generatedBy": "merchadmtest",
"card": {
"first6": "530676",
"last4": "0213",
"cardNumber": "1zcGT7J4pkGh0213",
"cardNumberHashed": "1iyRPx5Pb41Bm/fFgMJiHVB+reM7mRKxHMl8feDVH7I=",
"cardHolderName": "John Doe",
"cardType": "Mastercard",
"expirationDate": "2025-01",
"customer": {
"guid": "b70c80d2-4b07-423e-83be-33b93a64b6dd",
"merchantGuid": "cd3d0150-819c-33b9-8efd-2fa248keqcce",
"firstName": "John",
"lastName": "Doe",
"dateOfBirth": "1987-07-07T00:00:00",
"address1": "107 7th Av.",
"zip": "10007",
"city": "New York",
"state": "NY",
"stateFullName": "New York",
"country": "US",
"phone": "9177563007",
"email": "johnd@mailinator.com",
"ssN4": "1210",
"driverLicenseNumber": "12345678",
"driverLicenseState": "TX",
"driverLicenseExpirationDate": "2030-12-12T00:00:00",
"dlStateFullName": "Texas",
"personalPhone": "9177563007",
"status": "Active",
"displayName": "John Doe - 9177563007"
}
},
"associateCustomerCard": true,
"sequenceNumber": "546",
"addressVerificationCode": "N",
"addressVerificationResult": "No Match",
"cvvVerificationCode": "M",
"cvvVerificationResult": "Passed",
"hostedPaymentPageGuid": "00000000-0000-0000-0000-000000000000"
}
Json Example Response for Cash Sale:
{
"guid": "5d8ad876-cff8-4179-831f-65fad59c8faa",
"status": "Transaction - Approved",
"timeStamp": "2023-08-14T16:06:39.28+00:00",
"amount": 50.000,
"grossAmount": 50.000,
"effectiveAmount": 50.000,
"deviceGuid": "14c8bee4-a00b-4976-9a4a-adb13e2faf71",
"processorResponseMessage": "Cash Sale Processed",
"wasProcessed": true,
"authCode": "TA55496",
"refNumber": "42603996"
}
Json Example Error Response:
{
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"traceId": "00-80ef7316ffe8e0708bfa9b776b0dfd24-9cd052939354564c-00",
"errors": {
"$.DeviceGuid": [
"Unable to parse {{DEVICECCw}} to GUID"
],
"$.Amount": [
"Amount should be equal or greater than zero",
"Unable to parse asdasd to Decimal",
"The JSON value could not be converted to System.Decimal. Path: $.Amount | LineNumber: 2 | BytePositionInLine: 59.",
"Amount can have 3 decimal places at most."
],
"$.dualPricingFeeAmount": [
"Amount should be equal or greater than zero",
"Unable to parse asdsada to Decimal",
"The JSON value could not be converted to System.Decimal. Path: $.Amount | LineNumber: 2 | BytePositionInLine: 59.",
"dualPricingFeeAmount can have 3 decimal places at most."
],
"$.grossAmount": [
"Amount should be equal or greater than zero",
"Unable to parse asdsada to Decimal",
"The JSON value could not be converted to System.Decimal. Path: $.Amount | LineNumber: 2 | BytePositionInLine: 59.",
"GrossAmount can have 3 decimal places at most."
],
"OrderNumber": [
"Field maximum length must be less than 20"
],
"BusinessName": [
"Field maximum length must be less than 100"
],
"CustomerLabel": [
"Field maximum length must be less than 100"
],
"SequenceNumber": [
"Field maximum length must be less than 100"
],
"StatementDescription": [
"Field maximum length must be less than 50"
],
"Currency": [
"The field Currency is invalid."
],
"$.AssociateCustomerCard": [
"The JSON value could not be converted to System.Nullable`1[System.Boolean]. Path: $.AssociateCustomerCard | LineNumber: 15 | BytePositionInLine: 36."
],
"Card": [
"'Card' is required"
],
"Card.CardNumber": [
"The field CardNumber must be between 13 and 16 characters. is invalid."
],
"Card.CardHolderName": [
"The CardHolderName must be between 0 and 30 digits long",
"The JSON value could not be converted to System.String. Path: $.Card.CardHolderName | LineNumber: 17 | BytePositionInLine: 32.",
],
"Card.Cvv2": [
"The field Cvv2 is invalid."
],
"Card.ExpirationDate": [
"Card has expired. Expiration date: 1902"
],
"Card.Customer.Phone": [
"Invalid phone number. Must be 10 digits numbers only no special characters.",
"The field Phone is invalid."
],
"Card.Customer.LastName": [
"The field LastName is invalid.",
"Field maximum length must be less than 100"
],
"Card.Customer.FirstName": [
"The field FirstName is invalid.",
"Field maximum length must be less than 100"
],
"$.Card.Customer.DateOfBirth": [
"The JSON value could not be converted to System.Nullable`1[System.DateTime]. Path: $.Card.Customer.DateOfBirth | LineNumber: 30 | BytePositionInLine: 46."
],
"Card.ExpirationDate": [
"Card has expired. Expiration date: 1902"
],
"Card.Customer.Zip": [
"The Zip must be between 0 and 10 characters long"
],
"Card.Customer.SsN4": [
"Field maximum length must be less than 4",
"The field SsN4 is invalid."
],
"Card.Customer.Phone": [
"Field maximum length must be less than 10",
"Invalid phone number. Must be 10 digits numbers only no special characters.",
"The field Phone is invalid."
],
"Card.Customer.State": [
"Field maximum length must be less than 2",
"The field State is invalid.",
],
"Card.Customer.Country": [
"The field Country is invalid."
],
"Card.Customer.LastName": [
"Field maximum length must be less than 100",
"The field LastName is invalid."
],
"Card.Customer.FirstName": [
"Field maximum length must be less than 100",
"The field FirstName is invalid."
],
"Card.Customer.DriverLicenseState": [
"The field DriverLicenseState is invalid.",
],
"Card.Customer.DriverLicenseNumber": [
"The field DriverLicenseNumber is invalid.",
"Field maximum length must be less than 25",
"Only letters, numbers, asterisc, ampersand, @ and hyphen are allowed"
],
"$.EnhancedData.ShippingCharges": [
"Amount should be equal or greater than zero",
"Unable to parse gh to Decimal"
],
"$.EnhancedData.SaleTax": [
"Amount should be equal or greater than zero",
"Unable to parse gh to Decimal"
],
"$.EnhancedData.ShippingCharges": [
"Amount should be equal or greater than zero",
"Unable to parse gh to Decimal"
],
"$.EnhancedData.AdditionalTaxDetailTaxAmount": [
"Amount should be equal or greater than zero",
"Unable to parse to Decimal"
],
"$.EnhancedData.AdditionalTaxDetailTaxRate": [
"Amount should be equal or greater than zero",
"Unable to parse sfsdfsdfsdfsdf2 to Decimal"
],
"$.EnhancedData.DutyCharges": [
"Amount should be equal or greater than zero",
"Unable to parse sfsdfsdfsdfsdf2 to Decimal"
],
"$.EnhancedData.AdditionalAmount": [
"Amount should be equal or greater than zero",
"Unable to parse AdditionalAmount to Decimal"
],
"$.EnhancedData.Price": [
"Amount should be equal or greater than zero",
"Unable to parse asdasdasd to Decimal"
],
"EnhancedData.ShipToZip": [
"The ShipToZip must be between 5 and 10 characters long",
"The field ShipToZip is invalid."
],
"EnhancedData.VatInvoice": [
"Field maximum length must be less than 100"
],
"EnhancedData.ProductCode": [
"Field maximum length must be less than 50"
],
"EnhancedData.ProductName": [
"Field maximum length must be less than 50"
],
"EnhancedData.ShipFromZip": [
"The ShipFromZip must be between 5 and 10 characters long",
"The field ShipFromZip is invalid."
],
"EnhancedData.CustomerRefId": [
"Field maximum length must be less than 17"
],
"EnhancedData.PurchaseOrder": [
"Field maximum length must be less than 100"
],
"EnhancedData.MeasurementUnit": [
"Field maximum length must be less than 100"
],
"EnhancedData.ChargeDescriptor": [
"Field maximum length must be less than 160"
],
"EnhancedData.AdditionalAmountType": [
"The field AdditionalAmountType is invalid."
],
"EnhancedData.SummaryCommodityCode": [
"Field maximum length must be less than 100"
],
"EnhancedData.SupplierReferenceNumber": [
"Field maximum length must be less than 10"
]
}
}
The Sale transaction is used to charge a credit card. When running a sale you’re authorizing an amount on a credit card that will make the settlement of that amount at the end of the day. The sale is just like running an AuthOnly and a Capture all together.
This endpoint creates a sale.
HTTP Request
POST https://sandbox.choice.dev/api/v1/sales
Headers using token
Key | Value |
---|---|
Content-Type | "application/json" |
Authorization | Token. Eg: "Bearer eHSN5rTBzqDozgAAlN1UlTMVuIT1zSiAZWCo6E..." |
Headers using API Key
Key | Value |
---|---|
Content-Type | "application/json" |
UserAuthorization | API Key. Eg: "e516b6db-3230-4b1c-ae3f-e5379b774a80" |
Query Parameters
Parameter | Type | M/C/O | Value |
---|---|---|---|
DeviceGuid | string | Mandatory | Device's Guid. |
Amount | decimal | Mandatory | Amount of the transaction. Min. amt.: $0.50. Does not allow empty strings and up to 3 decimal places. |
TipAmount | decimal | Optional | Tip Amount of the transaction. Should be equal or greater than zero and only accepts numbers and up to 3 decimal places. |
DualPricingFeeAmount | decimal | Optional | Charge dual pricing. Should be equal or greater than zero and only accepts numbers and up to 3 decimal places. |
PromptConsumer | boolean | Optional | Applies only for Semi Integrated transactions, default value is true and if not sent would also be set as true. Value of true, prompts the consumer on the device to choose cash price or regular price. |
SequenceNumber | string | Optional | Use this number to call timeout reversal endpoint if you don't get a response. Max Length = 100. |
OrderNumber | string | Optional | Merchant's order number. The value sent on this element will be returned as InvoiceNumber. Max Length = 20. |
OrderDate | date | Optional | Order Date. |
SendReceipt | boolean | Optional | Set to “FALSE” if you do not want an e-mail receipt to be sent to the customer. Set to “TRUE” or leave empty if you want e-mail to be sent. |
CustomData | string | Optional | order details. Max Length = 100. |
CustomerLabel | string | Optional | Any name you want to show instead of customer. Eg., Player, Patient, Buyer. Max Length = 100. |
CustomerID | string | Optional | Any combination of numbers and letters you use to identify the customer. Max length = 100. Not allow special characters. Max Length = 100. |
BusinessName | string | Optional | A merchant name you want to use instead of your DBA. |
AssociateCustomerCard | boolean | Optional | An option to know if you want use to save customer and card token. |
SemiIntegrated | boolean | Optional | Only when physical terminal used on semi integrated mode, send value True. |
Currency | string | Optional | Currency of the transaction.Default value: USD Allowed values: USD, ARS, AUD, BRL, CAD, CHF, EUR, GBP, JPY, MXN, NZD, SGD |
Card | object | Mandatory | Card. |
EnhancedData | object | Optional | EnhancedData. |
Card | |||
CardNumber | string | Mandatory | Card number. Must be between 13 and 16 characters. (example: 4532538795426624) or token (example: FfL7exC7Xe2y6624). |
CardHolderName | string | Optional | Cardholder's name. Must be between 0 and 30 digits long. |
Cvv2 | string | Optional | This is the three or four digit CVV code at the back side of the credit and debit card. |
ExpirationDate | date | Optional with Token | Card's expiry date in the YYMM format. |
Customer | object | Optional | Customer. |
Customer | |||
FirstName | string | Optional | Customer's first name. Max length = 100. |
LastName | string | Optional | Customer's last name. Max length = 100. |
Phone | string | Optional | Customer's phone number. The phone number must be syntactically correct. For example, 4152345678. Must be 10 digits numbers only, no special characters. |
City | string | Optional | Customer's city. Max length = 50. |
State | string | Optional | Customer's short name state. The ISO 3166-2 CA and US state or province code of a customer. Length = 2. |
Country | string | Optional | Customer's country. The ISO country code of a customer’s country. Length = 2 or 3. |
string | Optional | Customer's valid email address. Max length = 1000. | |
Address1 | string | Optional | Customer's address. Max length = 100. |
Address2 | string | Optional | Customer's address line 2. Max length = 100. |
Zip | strings | Optional | Customer's zipcode. Length = 5. Max length = 10. |
DateOfBirth | date | Optional | Customer's date of birth. Allowed format: YYYY-MM-DD. For example: 2002-05-30 |
SSN4 | string | Mandatory when DOB is not submitted | Customer's social security number. Max length = 4. |
EnhancedData | |||
SaleTax | decimal | Optional | Transaction's amount. Should be equal or greater than zero. |
SaleTaxZipCode | decimal | Optional | Sale Tax's zipcode. Length = 5.. |
SaleTaxZipCodePercentage | decimal | Optional | Sale Tax ZipCode Percentage. |
AdditionalTaxDetailTaxCategory | string | Optional | Tax Category. Not allow special characters. |
AdditionalTaxDetailTaxType | string | Optional | Tax Type. Not allow special characters. |
AdditionalTaxDetailTaxAmount | decimal | Optional | Tax Amount. Should be equal or greater than zero. |
AdditionalTaxDetailTaxRate | decimal | Optional | Tax Rate. Should be equal or greater than zero. |
PurchaseOrder | string | Optional | Purchase Order. Max length = 100. Not allow special characters. |
ShippingCharges | decimal | Optional | Shipping Charges. Should be equal or greater than zero. |
DutyCharges | decimal | Optional | Duty Charges. Should be equal or greater than zero. |
CustomerVATNumber | string | Optional | Customer VAT Number. Not allow special characters. Max length = 100. |
VATInvoice | string | Optional | VAT Invoice. Not allow special characters. Max length = 100. |
SummaryCommodityCode | string | Optional | Summary Commodity Code. Not allow special characters. Max length = 100. |
ShipToZip | string | Optional | Ship To Zip. Must be between 5 and 10 characters long. Not allow letters or special characters. |
ShipFromZip | string | Optional | Ship From Zip. Must be between 5 and 10 characters long. Not allow letters or special characters. |
DestinationCountryCode | string | Optional | Destination Country Code. Not allow special characters. |
SupplierReferenceNumber | string | Optional | Supplier Reference Number. Not allow special characters. Max length = 10. |
CustomerRefID | string | Optional | Customer Ref ID. Max length = 17. |
ChargeDescriptor | string | Optional | Charge Descriptor. Not allow special characters. Max length = 160. |
AdditionalAmount | decimal | Optional | Additional Amount. Should be equal or greater than zero. Only accepts numbers and up to 3 decimal places. |
AdditionalAmountType | string | Optional | Additional Amount Type. |
ProductName | string | Optional | Product Name. Max length = 50. |
ProductCode | string | Optional | Product Code. Max length = 50. |
AddPrice | string | Optional | Price. Should be equal or greater than zero. Only accepts numbers and up to 3 decimal places. |
MeasurementUnit | string | Optional | Measurement Unit. Only accepts numbers and up to 3 decimal places. Max length = 100. |
Response
- 201 code (created).
Get sale
using System;
using Newtonsoft.Json;
using System.IO;
using System.Net;
using System.Text;
namespace ChoiceSample
{
public class Sale
{
public static void GetSale()
{
try
{
var request = (HttpWebRequest)WebRequest.Create("https://sandbox.choice.dev/api/v1/sales/1dde1960-3dea-472c-836e-402840967e7b");
request.Method = "GET";
request.Headers.Add("Authorization", "Bearer 1A089D6ziUybPZFQ3mpPyjt9OEx9yrCs7eQIC6V3A0lmXR2N6-seGNK16Gsnl3td6Ilfbr2Xf_EyukFXwnVEO3fYL-LuGw-L3c8WuaoxhPE8MMdlMPILJTIOV3lTGGdxbFXdKd9U03bbJ9TDUkqxHqq8_VyyjDrw7fs0YOob7bg0OovXTeWgIvZaIrSR1WFR06rYJ0DfWn-Inuf7re1-4SMOjY1ZoCelVwduWCBJpw1111cNbWtHJfObV8u1CVf0");
try
{
var response = (HttpWebResponse)request.GetResponse();
using (var reader = new StreamReader(response.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)response.StatusCode);
Console.WriteLine();
Console.WriteLine(response.StatusDescription);
Console.WriteLine(result);
}
}
catch (WebException wex)
{
if (wex.Response != null)
{
using (var errorResponse = (HttpWebResponse)wex.Response)
{
using (var reader = new StreamReader(errorResponse.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)errorResponse.StatusCode);
Console.WriteLine();
Console.WriteLine(errorResponse.StatusDescription);
Console.WriteLine(result);
}
}
}
}
}
catch (IOException e)
{
Console.WriteLine(e);
}
}
}
}
Json Example Response:
{
"guid": "1dde1960-3dea-472c-836e-402840967e7b",
"status": "Transaction - Approved",
"batchStatus": "Batch - Open",
"timeStamp": "2023-06-28T13:16:15.26-05:00",
"deviceGuid": "b29725af-b067-4a35-9819-bbb31bdf8808",
"amount": 20.540,
"currencyQuote": 1.000,
"currency": "USD",
"effectiveAmount": 20.540,
"dualPricingFeeAmount": 0.400,
"grossAmount": 20.140,
"orderNumber": "11518",
"orderDate": "2020-11-24T00:00:00.00-06:00",
"cardDataSource": "INTERNET",
"customerLabel": "Patient",
"businessName": "Star Shoes California",
"customerID": "xt147",
"batchGuid": "014db6d5-e627-472b-8f7d-02901693725f",
"semiIntegrated": false,
"processorStatusCode": "A0000",
"processorResponseMessage": "Success, HostRef#: 317918501066",
"wasProcessed": true,
"authCode": "VTLMC1",
"refNumber": "33488489",
"customerReceipt": "Value stated by the user \\n 8320 S HARDY DR \\n TEMPE AZ 85284\\n06/28/2023 14:06:15 \\n\\nCREDIT - SALE\\nTransaction - Approved\\n\\nJohn Doe\\nCard Number: **** **** **** 0213\\nCard Type: Mastercard\\nRef #: 33488489\\nAuth Code: VTLMC1\\n\\nTxn Amt $20.14\\nCash Discount $0.00\\n\\nTotal Amt $20.54\\n\\nOrder Number: 11518\\nCustomer Red Id: xt147\\nOrder Date: 11/24/2020 12:00:00 AM\\nOrder Details: order details\\n\\nCUSTOMER ACKNOWLEDGES RECEIPT OF \\n GOODS AND/OR SERVICES IN THE AMOUNT \\n OF THE TOTAL SHOWN HEREON AND AGREES \\n TO PERFORM THE OBLIGATIONS SET FORTH \\n BY THE CUSTOMER`S AGREEMENT WITH THE \\n ISSUER\\n APPROVED \\n\\n \\n \\n\\n Customer Copy\\n",
"statementDescription": "Value stated by the user",
"customData": "order details",
"generatedBy": "merchadmtest",
"card": {
"first6": "530676",
"last4": "0213",
"cardNumber": "1zcGT7J4pkGh0213",
"cardNumberHashed": "1iyRPx5Pb41Bm/fFgMJiHVB+reM7mRKxHMl8feDVH7I=",
"cardHolderName": "John Doe",
"cardType": "Mastercard",
"expirationDate": "2025-01",
"customer": {
"guid": "b70c80d2-4b07-423e-83be-33b93a64b6dd",
"merchantGuid": "cd3d5432-819c-44b9-8efd-2fa248fcacce",
"firstName": "John",
"lastName": "Doe",
"dateOfBirth": "1987-07-07T00:00:00",
"address1": "107 7th Av.",
"zip": "10007",
"city": "New York",
"state": "NY",
"stateFullName": "New York",
"country": "US",
"phone": "9177563007",
"email": "johnd@mailinator.com",
"ssN4": "1210",
"driverLicenseNumber": "12345678",
"driverLicenseExpirationDate": "2030-12-12T00:00:00",
"personalPhone": "9177563007",
"status": "Active",
"displayName": "John Doe - 9177563007"
}
},
"associateCustomerCard": true,
"eciFlag": "",
"addressVerificationCode": "N",
"addressVerificationResult": "No Match",
"cvvVerificationCode": "M",
"cvvVerificationResult": "Passed",
"hostedPaymentPageGuid": "00000000-0000-0000-0000-000000000000"
}
Json Example Error Response:
{
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"traceId": "00-2be920374480ac59ebadf4a9a6057706-0680052537eeceae-00",
"errors": {
"guid": [
"The value 'invalid guid' is not valid."
]
}
}
This endpoint gets a sale.
HTTP Request
GET https://sandbox.choice.dev/api/v1/sales/<guid>
Headers using token
Key | Value |
---|---|
Authorization | Token. Eg: "Bearer eHSN5rTBzqDozgAAlN1UlTMVuIT1zSiAZWCo6E..." |
Headers using API Key
Key | Value |
---|---|
UserAuthorization | API Key. Eg: "e516b6db-3230-4b1c-ae3f-e5379b774a80" |
URL Parameters
Parameter | Description |
---|---|
guid | Sale’s guid to get |
Response
- 200 code (ok).
Create Tip Adjustment
using System;
using Newtonsoft.Json;
using System.IO;
using System.Net;
using System.Text;
namespace ChoiceSample
{
public class Sale
{
public static void CreateTipAdjustment()
{
try
{
var request = (HttpWebRequest)WebRequest.Create("https://sandbox.choice.dev/api/v1/sales/TipAdjustment");
request.ContentType = "text/json";
request.Method = "POST";
var tipAdjustment = new
{
DeviceGuid = "b29725af-b067-4a35-9819-bbb31bdf8808",
TipAmount = 3.00,
SaleGuid = "1dde1960-3dea-472c-836e-402840967e7b"
};
string json = JsonConvert.SerializeObject(tipAdjustment);
request.Headers.Add("Authorization", "Bearer 1A089D6ziUybPZFQ3mpPyjt9OEx9yrCs7eQIC6V3A0lmXR2N6-seGNK16Gsnl3td6Ilfbr2Xf_EyukFXwnVEO3fYL-LuGw-L3c8WuaoxhPE8MMdlMPILJTIOV3lTGGdxbFXdKd9U03bbJ9TDUkqxHqq8_VyyjDrw7fs0YOob7bg0OovXTeWgIvZaIrSR1WFR06rYJ0DfWn-Inuf7re1-4SMOjY1ZoCelVwduWCBJpw1111cNbWtHJfObV8u1CVf0");
request.ContentType = "application/json";
request.Accept = "application/json";
using (var streamWriter = new StreamWriter(request.GetRequestStream()))
{
streamWriter.Write(json);
streamWriter.Flush();
streamWriter.Close();
}
try
{
var response = (HttpWebResponse)request.GetResponse();
using (var reader = new StreamReader(response.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)response.StatusCode);
Console.WriteLine();
Console.WriteLine(response.StatusDescription);
Console.WriteLine(result);
}
}
catch (WebException wex)
{
if (wex.Response != null)
{
using (var errorResponse = (HttpWebResponse)wex.Response)
{
using (var reader = new StreamReader(errorResponse.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)errorResponse.StatusCode);
Console.WriteLine();
Console.WriteLine(errorResponse.StatusDescription);
Console.WriteLine(result);
}
}
}
}
}
catch (IOException e)
{
Console.WriteLine(e);
}
}
}
}
Json Example Request:
{
"DeviceGuid" : "b29725af-b067-4a35-9819-bbb31bdf8808",
"TipAmount" : 3.00,
"SaleGuid" : "1dde1960-3dea-472c-836e-402840967e7b"
}
Json Example Response:
{
"guid": "dbd023d0-733c-4317-9e7f-a67a45a56637",
"tipAmount": 3.000,
"status": "Transaction - Approved",
"timeStamp": "2023-06-28T13:24:31.75-05:00",
"deviceGuid": "b29725af-b067-4a35-9819-bbb31bdf8808",
"saleGuid": "1dde1960-3dea-472c-836e-402840967e7b",
"saleReferenceNumber": "33488629",
"customerReceipt": "Valuestatedbytheuser\\n8320SHARDYDR\\nTEMPEAZ85284\\n06/28/202311:24:31\\n\\nCREDIT-SALE\\n\\nCARD#:************0213\\nCARDTYPE:MASTERCARD\\nEntryMode:MANUAL\\n\\nTRANSACTIONID:33488629\\nInvoicenumber:11518\\nAUTHCODE:VTLMC1\\nSubtotal:$20.54\\n--------------------------------------\\nTip:$03.00\\n--------------------------------------\\nTotal:$23.54\\n--------------------------------------\\n\\n\\n\\nJohnDoe\\n\\nCUSTOMERACKNOWLEDGESRECEIPTOF\\nGOODSAND/ORSERVICESINTHEAMOUNT\\nOFTHETOTALSHOWNHEREONANDAGREES\\nTOPERFORMTHEOBLIGATIONSSETFORTH\\nBYTHECUSTOMER`SAGREEMENTWITHTHE\\nISSUER\\nAPPROVED\\n\\n\\n\\n\\nCustomerCopy",
"processorStatusCode": "A0000",
"wasProcessed": true,
"sale": {
"guid": "1dde1960-3dea-472c-836e-402840967e7b",
"status": "Transaction - Approved",
"batchStatus": "Batch - Open",
"timeStamp": "2023-06-28T13:24:29.97-05:00",
"deviceGuid": "b29725af-b067-4a35-9819-bbb31bdf8808",
"amount": 20.540,
"currencyQuote": 1.000,
"currency": "USD",
"effectiveAmount": 23.540,
"dualPricingFeeAmount": 0.400,
"grossAmount": 20.140,
"orderNumber": "11518",
"orderDate": "2020-11-24T00:00:00.00-06:00",
"cardDataSource": "INTERNET",
"customerLabel": "Patient",
"businessName": "Star Shoes California",
"customerID": "xt147",
"batchGuid": "014db6d5-e627-472b-8f7d-02901693725f",
"semiIntegrated": false,
"processorStatusCode": "A0000",
"processorResponseMessage": "Success, HostRef#: 317918501989",
"wasProcessed": true,
"authCode": "VTLMC1",
"refNumber": "33488629",
"customerReceipt": "Valuestatedbytheuser\\n8320SHARDYDR\\nTEMPEAZ85284\\n06/28/202311:24:31\\n\\nCREDIT-SALE\\n\\nCARD#:************0213\\nCARDTYPE:MASTERCARD\\nEntryMode:MANUAL\\n\\nTRANSACTIONID:33488629\\nInvoicenumber:11518\\nAUTHCODE:VTLMC1\\nSubtotal:$20.54\\n--------------------------------------\\nTip:$03.00\\n--------------------------------------\\nTotal:$23.54\\n--------------------------------------\\n\\n\\n\\nJohnDoe\\n\\nCUSTOMERACKNOWLEDGESRECEIPTOF\\nGOODSAND/ORSERVICESINTHEAMOUNT\\nOFTHETOTALSHOWNHEREONANDAGREES\\nTOPERFORMTHEOBLIGATIONSSETFORTH\\nBYTHECUSTOMER`SAGREEMENTWITHTHE\\nISSUER\\nAPPROVED\\n\\n\\n\\n\\nCustomerCopy",
"statementDescription": "Value stated by the user",
"customData": "order details",
"generatedBy": "merchadmtest",
"card": {
"first6": "530676",
"last4": "0213",
"cardNumber": "1zcGT7J4pkGh0213",
"cardNumberHashed": "1iyRPx5Pb41Bm/fFgMJiHVB+reM7mRKxHMl8feDVH7I=",
"cardHolderName": "John Doe",
"cardType": "Mastercard",
"expirationDate": "2025-01",
"customer": {
"guid": "b70c80d2-4b07-423e-83be-33b93a64b6dd",
"merchantGuid": "cd3d0150-759b-22l9-8efd-2fa248fcacce",
"firstName": "John",
"lastName": "Doe",
"dateOfBirth": "1987-07-07T00:00:00",
"address1": "107 7th Av.",
"zip": "10007",
"city": "New York",
"state": "NY",
"stateFullName": "New York",
"country": "US",
"phone": "9177563007",
"email": "johnd@mailinator.com",
"ssN4": "1210",
"driverLicenseNumber": "12345678",
"driverLicenseState": "TX",
"driverLicenseExpirationDate": "2030-12-12T00:00:00",
"dlStateFullName": "Texas",
"personalPhone": "9177563007",
"status": "Active",
"displayName": "John Doe - 9177563007"
}
},
"associateCustomerCard": true,
"eciFlag": "",
"addressVerificationCode": "N",
"addressVerificationResult": "No Match",
"cvvVerificationCode": "M",
"cvvVerificationResult": "Passed",
"hostedPaymentPageGuid": "00000000-0000-0000-0000-000000000000"
}
}
Json Example Error Response:
{
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"traceId": "00-3806be1e15be98d0d5324d30ad60b558-756ade8fffaee186-00",
"errors": {
"$.DeviceGuid": [
"The JSON value could not be converted to System.Nullable`1[System.Guid]. Path: $.DeviceGuid | LineNumber: 1 | BytePositionInLine: 32."
],
"$.TipAmount": [
"Unable to parse dsfsdf to Decimal"
],
"$.SaleGuid": [
"The JSON value could not be converted to System.Nullable`1[System.Guid]. Path: $.SaleGuid | LineNumber: 3 | BytePositionInLine: 36."
]
}
}
This endpoint creates a tip adjustment.
HTTP Request
POST https://sandbox.choice.dev/api/v1/sales/TipAdjustment
Headers using token
Key | Value |
---|---|
Content-Type | "application/json" |
Authorization | Token. Eg: "Bearer eHSN5rTBzqDozgAAlN1UlTMVuIT1zSiAZWCo6E..." |
Headers using API Key
Key | Value |
---|---|
Content-Type | "application/json" |
UserAuthorization | API Key. Eg: "e516b6db-3230-4b1c-ae3f-e5379b774a80" |
Query Parameters
Parameter | Type | M/C/O | Value |
---|---|---|---|
DeviceGuid | string | Mandatory | Device's Guid. |
TipAmount | decimal | Mandatory | Tip Amount. |
SaleGuid | string | Mandatory when SaleReferenceNumber field are not sent | Sale's Guid. |
SaleReferenceNumber | string | Mandatory when SaleGuid field are not sent | Sale Reference Number. |
Response
- 201 code (created).
Sales by batch
using System;
using Newtonsoft.Json;
using System.IO;
using System.Net;
using System.Text;
namespace ChoiceSample
{
public class Sale
{
public static void GetSaleByBatch()
{
try
{
var request = (HttpWebRequest)WebRequest.Create("https://sandbox.choice.dev/api/v1/sales/Batch/14db6d5-e627-472b-8f7d-02901693725f");
request.Method = "GET";
request.Headers.Add("Authorization", "Bearer 1A089D6ziUybPZFQ3mpPyjt9OEx9yrCs7eQIC6V3A0lmXR2N6-seGNK16Gsnl3td6Ilfbr2Xf_EyukFXwnVEO3fYL-LuGw-L3c8WuaoxhPE8MMdlMPILJTIOV3lTGGdxbFXdKd9U03bbJ9TDUkqxHqq8_VyyjDrw7fs0YOob7bg0OovXTeWgIvZaIrSR1WFR06rYJ0DfWn-Inuf7re1-4SMOjY1ZoCelVwduWCBJpw1111cNbWtHJfObV8u1CVf0");
try
{
var response = (HttpWebResponse)request.GetResponse();
using (var reader = new StreamReader(response.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)response.StatusCode);
Console.WriteLine();
Console.WriteLine(response.StatusDescription);
Console.WriteLine(result);
}
}
catch (WebException wex)
{
if (wex.Response != null)
{
using (var errorResponse = (HttpWebResponse)wex.Response)
{
using (var reader = new StreamReader(errorResponse.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)errorResponse.StatusCode);
Console.WriteLine();
Console.WriteLine(errorResponse.StatusDescription);
Console.WriteLine(result);
}
}
}
}
}
catch (IOException e)
{
Console.WriteLine(e);
}
}
}
}
Json Example Response:
[
{
"guid": "4bc828c2-fc98-4018-80e2-5f6af466cbdf",
"status": "Transaction - Approved",
"batchStatus": "Batch - Closed",
"timeStamp": "2023-04-03T11:45:53.91-05:00",
"deviceGuid": "397eb067-2ebf-4934-bbb4-ace4e4a6194e",
"amount": 20.540,
"currency": "USD",
"effectiveAmount": 0.000,
"dualPricingFeeAmount": 0.400,
"grossAmount": 20.140,
"orderNumber": "11518",
"orderDate": "2020-11-24T00:00:00.00-06:00",
"cardDataSource": "INTERNET",
"customerLabel": "Patient",
"businessName": "Star Shoes California",
"customerID": "xt147",
"batchGuid": "b6a4cc29-b3a5-477a-b244-210a41f2b2ab",
"semiIntegrated": false,
"processorStatusCode": "A0000",
"processorResponseMessage": "Success, HostRef#: 309316501990",
"wasProcessed": true,
"authCode": "VTLMC1",
"refNumber": "28212321",
"customerReceipt": "Value stated by the user \\n 8320 S HARDY DR \\n TEMPE AZ 85284\\n04/03/2023 12:04:53 \\n\\nCREDIT - SALE\\nTransaction - Approved\\n\\nJohn Doe\\nCard Number: **** **** **** 0213\\nCard Type: Mastercard\\nRef #: 28212321\\nAuth Code: VTLMC1\\n\\nTxn Amt $20.14\\nCash Discount $0.00\\n\\nTotal Amt $20.54\\n\\nOrderNumber: 11518\\nOrderDate: 11/24/2020 12:00:00 AM\\nOrderDetails: order details\\n\\nCUSTOMER ACKNOWLEDGES RECEIPT OF \\n GOODS AND/OR SERVICES IN THE AMOUNT \\n OF THE TOTAL SHOWN HEREON AND AGREES \\n TO PERFORM THE OBLIGATIONS SET FORTH \\n BY THE CUSTOMER`S AGREEMENT WITH THE \\n ISSUER\\n APPROVED \\n\\n \\n \\n\\n Customer Copy\\n",
"statementDescription": "Value stated by the user",
"customData": "order details",
"generatedBy": "merchadmtest",
"card": {
"first6": "530676",
"last4": "0213",
"cardNumber": "1zcGT7J4pkGh0213",
"cardHolderName": "John Doe",
"cardType": "Mastercard",
"expirationDate": "2025-01"
},
"relatedVoid": {
"guid": "9a36400b-6dbf-4b14-8ec5-c0280d370fed",
"batchStatus": "Batch - Closed",
"timeStamp": "2023-04-03T11:45:59.36-05:00",
"deviceGuid": "397eb067-2ebf-4934-bbb4-ace4e4a6194e",
"status": "Transaction - Approved",
"processorStatusCode": "A0000",
"wasProcessed": true,
"batchGuid": "b6a4cc29-b3a5-477a-b244-210a41f2b2ab",
"authCode": "VTLMC1",
"refNumber": "28212321",
"invoiceNumber": "11518",
"customerReceipt": " Value stated by the user \\n 8320 S HARDY DR \\n TEMPE AZ 85284 \\n04/03/2023 09:45:58\\n\\n CREDIT - VOID \\n\\nCARD # : **** **** **** 0213\\nCARD TYPE :MASTERCARD\\nEntry Mode : MANUAL\\n\\nTRANSACTION ID : 28212321 \\nInvoice number : 11518 \\nAUTH CODE : VTLMC1\\nVoid Amount: $20.54\\n--------------------------------------\\n\\n\\n\\n John Doe \\n\\n CUSTOMER ACKNOWLEDGES RECEIPT OF \\n GOODS AND/OR SERVICES IN THE AMOUNT \\n OF THE TOTAL SHOWN HEREON AND AGREES \\n TO PERFORM THE OBLIGATIONS SET FORTH \\n BY THE CUSTOMER`S AGREEMENT WITH THE \\n ISSUER\\n APPROVED \\n\\n \\n \\n\\n Customer Copy "
},
"associateCustomerCard": true,
"eciFlag": "",
"sequenceNumber": "7790001",
"addressVerificationCode": "N",
"addressVerificationResult": "No Match",
"cvvVerificationCode": "M",
"cvvVerificationResult": "Passed",
"hostedPaymentPageGuid": "00000000-0000-0000-0000-000000000000"
}
]
Json example error response:
{
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"traceId": "00-546395b993d26b2f474b0d8cf1293767-b4c0d1b3c046a431-00",
"errors": {
"guid": [
"The value 'invalid guid' is not valid."
]
}
}
This endpoint searches all sales by batch.
HTTP Request
GET https://sandbox.choice.dev/api/v1/sales/Batch/<guid>
Headers using token
Key | Value |
---|---|
Authorization | Token. Eg: "Bearer eHSN5rTBzqDozgAAlN1UlTMVuIT1zSiAZWCo6E..." |
Headers using API Key
Key | Value |
---|---|
UserAuthorization | API Key. Eg: "e516b6db-3230-4b1c-ae3f-e5379b774a80" |
URL Parameters
Parameter | Description |
---|---|
guid | Batch’s guid to get |
Response
- 200 code (ok).
Timeout Reversal
using System;
using Newtonsoft.Json;
using System.IO;
using System.Net;
using System.Text;
namespace ChoiceSample
{
public class Sale
{
public static void TimeoutReversal()
{
try
{
var request = (HttpWebRequest)WebRequest.Create("https://sandbox.choice.dev/api/v1/sales/timeoutreversal");
request.ContentType = "text/json";
request.Method = "POST";
var sale = new
{
DeviceGuid = "b29725af-b067-4a35-9819-bbb31bdf8808",
SequenceNumber = "849741"
};
string json = JsonConvert.SerializeObject(sale);
request.Headers.Add("Authorization", "Bearer 1A089D6ziUybPZFQ3mpPyjt9OEx9yrCs7eQIC6V3A0lmXR2N6-seGNK16Gsnl3td6Ilfbr2Xf_EyukFXwnVEO3fYL-LuGw-L3c8WuaoxhPE8MMdlMPILJTIOV3lTGGdxbFXdKd9U03bbJ9TDUkqxHqq8_VyyjDrw7fs0YOob7bg0OovXTeWgIvZaIrSR1WFR06rYJ0DfWn-Inuf7re1-4SMOjY1ZoCelVwduWCBJpw1111cNbWtHJfObV8u1CVf0");
request.ContentType = "application/json";
request.Accept = "application/json";
using (var streamWriter = new StreamWriter(request.GetRequestStream()))
{
streamWriter.Write(json);
streamWriter.Flush();
streamWriter.Close();
}
try
{
var response = (HttpWebResponse)request.GetResponse();
using (var reader = new StreamReader(response.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)response.StatusCode);
Console.WriteLine();
Console.WriteLine(response.StatusDescription);
Console.WriteLine(result);
}
}
catch (WebException wex)
{
if (wex.Response != null)
{
using (var errorResponse = (HttpWebResponse)wex.Response)
{
using (var reader = new StreamReader(errorResponse.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)errorResponse.StatusCode);
Console.WriteLine();
Console.WriteLine(errorResponse.StatusDescription);
Console.WriteLine(result);
}
}
}
}
}
catch (IOException e)
{
Console.WriteLine(e);
}
}
}
}
Json Example Request:
{
"DeviceGuid": "b29725af-b067-4a35-9819-bbb31bdf8808",
"SequenceNumber": "849741"
}
Json Example Response:
"Device Guid and Sequence Number combination found and voided."
Json Example Error Response:
{
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"traceId": "00-a6e6f0490dfc58508e80cb1aad71b3e8-f57ae29dc45672dc-00",
"errors": {
"$.DeviceGuid": [
"Unable to parse {{DEVICECefC}} to GUID"
]
}
}
This a feature that allows a user to void a transaction if it never got a response. You must send the device guid of the terminal used to run the transaction and the sequence number. If there was a sale run on that device with that sequence and it was approved, it will be voided. Otherwise you will be informed that a sale was found but it had not been approved or that there was no sale at all with that combination of device guid and sequence number.
HTTP Request
POST https://sandbox.choice.dev/api/v1/sales/timeoutreversal
Headers using token
Key | Value |
---|---|
Content-Type | "application/json" |
Authorization | Token. Eg: "Bearer eHSN5rTBzqDozgAAlN1UlTMVuIT1zSiAZWCo6E..." |
Headers using API Key
Key | Value |
---|---|
Content-Type | "application/json" |
UserAuthorization | API Key. Eg: "e516b6db-3230-4b1c-ae3f-e5379b774a80" |
Query Parameters
Parameter | Type | M/C/O | Value |
---|---|---|---|
DeviceGuid | string | Mandatory | Device's Guid. |
SequenceNumber | string | Mandatory | Sequence Number. Max Length = 100. |
Response
- 201 code (created).
EBT Transactions
Create EBT Cash Benefit Purchases
using System;
using Newtonsoft.Json;
using System.IO;
using System.Net;
using System.Text;
namespace ChoiceSample
{
public class EbtCashBenefitPurchases
{
public static void CreateEbtCashBenefitPurchases()
{
try
{
var request = (HttpWebRequest)WebRequest.Create("https://sandbox.choice.dev/api/v1/EbtCashBenefitPurchases");
request.ContentType = "text/json";
request.Method = "POST";
var EbtCashBenefitPurchases = new
{
DeviceGuid = "b29725af-b067-4a35-9819-bbb31bdf8808",
Amount = 26.00,
dualPricingFeeAmount = 0.40,
GrossAmount = 26.40,
CustomData = "order details",
Card = new
{
CardNumber: "4539808036544136",
ExpirationDate: "3012",
CardDataSource: "MANUAL",
Pin = "86085F76523FA7F1",
PinKSN = "5B076002128020D0",
Customer = new
{
FirstName = "John",
LastName = "Doe",
Phone = "9177563007",
City = "New York",
State = "NY",
Country = "US",
Email = "johnd@mailinator.com",
Address1 = "107 7th Av.",
Zip = "10007",
}
}
};
string json = JsonConvert.SerializeObject(EbtCashBenefitPurchases);
request.Headers.Add("Authorization", "Bearer 1A089D6ziUybPZFQ3mpPyjt9OEx9yrCs7eQIC6V3A0lmXR2N6-seGNK16Gsnl3td6Ilfbr2Xf_EyukFXwnVEO3fYL-LuGw-L3c8WuaoxhPE8MMdlMPILJTIOV3lTGGdxbFXdKd9U03bbJ9TDUkqxHqq8_VyyjDrw7fs0YOob7bg0OovXTeWgIvZaIrSR1WFR06rYJ0DfWn-Inuf7re1-4SMOjY1ZoCelVwduWCBJpw1111cNbWtHJfObV8u1CVf0");
request.ContentType = "application/json";
request.Accept = "application/json";
using (var streamWriter = new StreamWriter(request.GetRequestStream()))
{
streamWriter.Write(json);
streamWriter.Flush();
streamWriter.Close();
}
try
{
var response = (HttpWebResponse)request.GetResponse();
using (var reader = new StreamReader(response.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)response.StatusCode);
Console.WriteLine();
Console.WriteLine(response.StatusDescription);
Console.WriteLine(result);
}
}
catch (WebException wex)
{
if (wex.Response != null)
{
using (var errorResponse = (HttpWebResponse)wex.Response)
{
using (var reader = new StreamReader(errorResponse.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)errorResponse.StatusCode);
Console.WriteLine();
Console.WriteLine(errorResponse.StatusDescription);
Console.WriteLine(result);
}
}
}
}
}
catch (IOException e)
{
Console.WriteLine(e);
}
}
}
}
Json Example Request:
{
"DeviceGuid": "b29725af-b067-4a35-9819-bbb31bdf8808",
"Amount": "26.00",
"DualPricingFeeAmount": 0.40,
"GrossAmount":"26.40",
"CustomData": "order details",
"Card": {
"CardNumber": "4539808036544136",
"ExpirationDate": "3012",
"CardDataSource": "MANUAL",
"Pin": "86085F76523FA7F1",
"PinKSN": "5B076002128020D0",
"Customer": {
"FirstName": "Javier",
"LastName": "Choice Tech",
"Phone": "9177563046",
"City": "New York",
"State": "NY",
"Country": "US",
"Email": "javier@mailinator.com",
"Address1": "110 10th Av.",
"Zip": "10010"
}
}
}
Json Example Response:
{
"effectiveAmount": 26.000,
"balanceAmount": 1234.560,
"guid": "698abf6a-c18d-4551-a0ff-610813f43500",
"status": "Transaction - Approved",
"batchStatus": "Batch - Open",
"timeStamp": "2023-06-28T13:37:08.00-05:00",
"deviceGuid": "397eb067-2ebf-4934-bbb4-ace4e4a6194e",
"amount": 26.000,
"grossAmount": 26.000,
"batchGuid": "9fca53a2-5d5b-44f0-bff3-b04f577405ce",
"semiIntegrated": false,
"processorStatusCode": "A0000",
"processorResponseMessage": "Success, HostRef#: 317933489053",
"wasProcessed": true,
"authCode": "TAS766",
"refNumber": "33489053",
"invoiceNumber": "33489053",
"customerReceipt": "CHOICE MERCHANT SOLUTIONS \\n 8320 S HARDY DR \\n TEMPE AZ 85284\\n06/28/2023 14:06:08 \\n\\nDEBIT - SALE\\nTransaction - Approved\\n\\nCard Number: **** **** **** 4136\\nCard Type: n/a\\nRef #: 33489053\\nAuth Code: TAS766\\n\\nTxn Amt $25.60\\nCash Discount $0.00\\n\\nTotal Amt $26.00\\n\\nOrder Details: order details\\n\\nCUSTOMER ACKNOWLEDGES RECEIPT OF \\n GOODS AND/OR SERVICES IN THE AMOUNT \\n OF THE TOTAL SHOWN HEREON AND AGREES \\n TO PERFORM THE OBLIGATIONS SET FORTH \\n BY THE CUSTOMER`S AGREEMENT WITH THE \\n ISSUER\\n APPROVED \\n\\n \\n \\n\\n Customer Copy\\n",
"customData": "order details",
"generatedBy": "merchadmtest",
"card": {
"first6": "453980",
"last4": "4136",
"cardNumber": "r3ryoBPiaEKp4136",
"cardNumberHashed": "5zmMP7xvO7DUi03uFL/Nm+r49UVhzubW5KQflSaYmrY=",
"cardType": "Visa",
"expirationDate": "2030-12",
"pin": "86085F76523FA7F1",
"pinKsn": "5B076002128020D0",
"cardDataSource": "INTERNET",
"customer": {
"guid": "c5ed7b38-782d-4efa-be03-2be1efb63f68",
"merchantGuid": "cd3d0150-819c-44b9-8efd-2fa248fcacce",
"firstName": "Javier",
"lastName": "Choice Tech",
"address1": "110 10th Av.",
"zip": "10010",
"city": "New York",
"state": "NY",
"country": "US",
"phone": "9177563046",
"email": "javier@mailinator.com",
"personalPhone": "9177563046",
"status": "Active",
"displayName": "Javier Choice Tech - 9177563046"
}
}
}
Json Example Error Response:
{
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"traceId": "00-7ab42f4987cd8222f11254253d7a9468-aa69591b47795f7a-00",
"errors": {
"DeviceGuid": [
"The field DeviceGuid is invalid."
],
"Amount": [
"Amount can have 3 decimal places at most.",
"Unable to parse letters to Decimal"
],
"Card.CardNumber": [
"The field CardNumber must be between 13 and 16 characters. is invalid."
],
"Card.CardHolderName": [
"The CardHolderName must be between 0 and 30 digits long"
],
"Card.Cvv2": [
"The field Cvv2 is invalid."
],
"Card.Pin": [
"The Pin must be between 4 and 20 digits long"
],
"Card.PinKsn": [
"The PinKsn should be 20 digits long"
],
"Card.ExpirationDate": [
"The field ExpirationDate is invalid."
],
"Card.Customer.FirstName": [
"Field maximum length must be less than 100",
"The field FirstName is invalid."
],
"Card.Customer.LastName": [
"Field maximum length must be less than 100",
"The field LastName is invalid."
],
"Card.Customer.Address1": [
"Field maximum length must be less than 100",
"The field Address1 is invalid."
],
"Card.Customer.City": [
"Field maximum length must be less than 50"
],
"Card.Customer.State": [
"Field maximum length must be less than 2",
"The field State is invalid."
],
"Card.Customer.Email": [
"Field maximum length must be less than 1000"
],
"Card.Customer.SsN4": [
"Field maximum length must be less than 4",
"The field SsN4 is invalid."
],
"Card.Customer.Zip": [
"The Zip must be between 0 and 10 characters long",
"The field Zip is invalid."
],
"Card.Customer.DriverLicenseNumber": [
"The field DriverLicenseNumber is invalid.",
"Field maximum length must be less than 25",
"Only letters, numbers, asterisc, ampersand, @ and hyphen are allowed"
],
"Card.Customer.DriverLicenseState": [
"The field DriverLicenseState is invalid."
],
"Card.Customer.Phone": [
"Field maximum length must be less than 10",
"Invalid phone number. Must be 10 digits numbers only no special characters."
],
"Card.Customer.Country": [
"Field maximum length must be less than 50",
"The field Country is invalid."
]
}
}
The EBT transaction is used to charge a credit card. When running a EBT transaction you’re authorizing an amount on a credit card that will make the settlement of that amount at the end of the day. The sale is just like running an AuthOnly and a Capture all together.
This endpoint creates a EBT transaction.
HTTP Request
POST https://sandbox.choice.dev/api/v1/EbtCashBenefitPurchases
Headers using token
Key | Value |
---|---|
Content-Type | "application/json" |
Authorization | Token. Eg: "Bearer eHSN5rTBzqDozgAAlN1UlTMVuIT1zSiAZWCo6E..." |
Headers using API Key
Key | Value |
---|---|
Content-Type | "application/json" |
UserAuthorization | API Key. Eg: "e516b6db-3230-4b1c-ae3f-e5379b774a80" |
Query Parameters
Parameter | Type | M/C/O | Value |
---|---|---|---|
DeviceGuid | string | Mandatory | Device's Guid. |
Amount | decimal | Mandatory | Amount of the transaction. Min. amt.: $0.50. Does not allow empty strings and up to 3 decimal places. |
DualPricingFeeAmount | decimal | Optional | Charge dual pricing. Should be equal or greater than zero and only accepts numbers and up to 3 decimal places. |
GrossAmount | Decimal | mandatory if dual pricing fee amount is used | Total amount of "amount" and dual pricing fee amount. |
CustomData | string | Optional | order details. |
Card | object | Mandatory | Card. |
Card | |||
CardNumber | string | Mandatory | Card number. Must be between 13 and 16 characters. (example: 4532538795426624) or token (example: FfL7exC7Xe2y6624). |
CardHolderName | string | Optional | Cardholder's name. Must be between 0 and 30 digits long. |
PIN | string | Mandatory | Identifies the PIN for the terminal. Must between 4 and 20 digits long. |
PinKsn | string | Mandatory | The KSN for DUKPT PIN encryption. Max length = 20. Note: Required only if the PIN is encrypted using DUKPT. |
Cvv2 | string | Optional | This is the three or four digit CVV code at the back side of the credit and debit card. |
ExpirationDate | date | Optional with Token | Card's expiry date in the YYMM format. |
Customer | object | Optional | Customer. |
Customer | |||
FirstName | string | Optional | Customer's first name. Max length = 100. |
LastName | string | Optional | Customer's last name. Max length = 100. |
Phone | string | Optional | Customer's phone number. The phone number must be syntactically correct. For example, 4152345678. Must be 10 digits numbers only, no special characters. |
City | string | Optional | Customer's city. Max length = 50. |
State | string | Optional | Customer's short name state. The ISO 3166-2 CA and US state or province code of a customer. Length = 2. |
Country | string | Optional | Customer's country. The ISO country code of a customer’s country. Length = 2 or 3. |
string | Optional | Customer's valid email address. Max length = 1000. | |
Address1 | string | Optional | Customer's address. Max length = 100. |
Address2 | string | Optional | Customer's address line 2. Max length = 100. |
Zip | strings | Optional | Customer's zipcode. Length = 5. Max length = 10. |
DateOfBirth | date | Optional | Customer's date of birth. Allowed format: YYYY-MM-DD. For example: 2002-05-30 |
DriverLicenseNumber | string | Optional | Customer's driver license number. Not allow special characters. Max length = 25. |
DriverLicenseState | string | Mandatory when DriverLicenseNumber is provided | Customer's driver license short name state. The ISO 3166-2 CA and US state or province code of a customer. Length = 2. |
SSN4 | string | Mandatory when DOB is not submitted | Customer's social security number. Max length = 4. |
Response
- 201 code (created).
Create EBT Food Stamp Purchases
using System;
using Newtonsoft.Json;
using System.IO;
using System.Net;
using System.Text;
namespace ChoiceSample
{
public class ebtFoodStampPurchases
{
public static void CreateebtFoodStampPurchases()
{
try
{
var request = (HttpWebRequest)WebRequest.Create("https://sandbox.choice.dev/api/v1/ebtFoodStampPurchases");
request.ContentType = "text/json";
request.Method = "POST";
var ebtFoodStampPurchases = new
{
DeviceGuid = "b29725af-b067-4a35-9819-bbb31bdf8808",
Amount = 19.74,
CustomData = "order details",
Card = new
{
CardNumber = "4539808036544136",
ExpirationDate = "3012",
CardDataSource = "MANUAL",
Pin = "86085F76523FA7F1",
PinKSN = "5B076002128020D0",
FcsID = "0534962",
{
FirstName = "John",
LastName = "Doe",
Phone = "9177563007",
City = "New York",
State = "NY",
Country = "US",
Email = "johnd@mailinator.com",
Address1 = "107 7th Av.",
Zip = "10007",
}
}
};
string json = JsonConvert.SerializeObject(ebtFoodStampPurchases);
request.Headers.Add("Authorization", "Bearer 1A089D6ziUybPZFQ3mpPyjt9OEx9yrCs7eQIC6V3A0lmXR2N6-seGNK16Gsnl3td6Ilfbr2Xf_EyukFXwnVEO3fYL-LuGw-L3c8WuaoxhPE8MMdlMPILJTIOV3lTGGdxbFXdKd9U03bbJ9TDUkqxHqq8_VyyjDrw7fs0YOob7bg0OovXTeWgIvZaIrSR1WFR06rYJ0DfWn-Inuf7re1-4SMOjY1ZoCelVwduWCBJpw1111cNbWtHJfObV8u1CVf0");
request.ContentType = "application/json";
request.Accept = "application/json";
using (var streamWriter = new StreamWriter(request.GetRequestStream()))
{
streamWriter.Write(json);
streamWriter.Flush();
streamWriter.Close();
}
try
{
var response = (HttpWebResponse)request.GetResponse();
using (var reader = new StreamReader(response.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)response.StatusCode);
Console.WriteLine();
Console.WriteLine(response.StatusDescription);
Console.WriteLine(result);
}
}
catch (WebException wex)
{
if (wex.Response != null)
{
using (var errorResponse = (HttpWebResponse)wex.Response)
{
using (var reader = new StreamReader(errorResponse.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)errorResponse.StatusCode);
Console.WriteLine();
Console.WriteLine(errorResponse.StatusDescription);
Console.WriteLine(result);
}
}
}
}
}
catch (IOException e)
{
Console.WriteLine(e);
}
}
}
}
Json Example Request:
{
"DeviceGuid": "b29725af-b067-4a35-9819-bbb31bdf8808",
"Amount": "26.00",
"CustomData": "order details",
"Card": {
"CardNumber": "4539808036544136",
"ExpirationDate": "3012",
"CardDataSource": "MANUAL",
"Pin": "86085F76523FA7F1",
"PinKSN": "5B076002128020D0",
"FcsID": "0534962",
"Customer": {
"FirstName": "Javier",
"LastName": "Choice Tech",
"Phone": "9177563046",
"City": "New York",
"State": "NY",
"Country": "US",
"Email": "javier@mailinator.com",
"Address1": "110 10th Av.",
"Zip": "10010"
}
}
}
Json Example Response:
{
"effectiveAmount": 26.000,
"balanceAmount": 6543.210,
"guid": "80395a36-7f52-4a0c-9a14-1781c302c8f2",
"status": "Transaction - Approved",
"batchStatus": "Batch - Open",
"timeStamp": "2023-06-28T13:40:43.03-05:00",
"deviceGuid": "397eb067-2ebf-4934-bbb4-ace4e4a6194e",
"amount": 26.000,
"batchGuid": "9fca53a2-5d5b-44f0-bff3-b04f577405ce",
"semiIntegrated": false,
"processorStatusCode": "A0000",
"processorResponseMessage": "Success, HostRef#: 317933489155",
"wasProcessed": true,
"authCode": "TAS767",
"refNumber": "33489155",
"invoiceNumber": "33489155",
"customerReceipt": "CHOICE MERCHANT SOLUTIONS \\n 8320 S HARDY DR \\n TEMPE AZ 85284\\n06/28/2023 14:06:43 \\n\\nDEBIT - SALE\\nTransaction - Approved\\n\\nCard Number: **** **** **** 4136\\nCard Type: n/a\\nRef #: 33489155\\nAuth Code: TAS767\\n\\nTxn Amt $26.00\\n\\nTotal Amt $26.00\\n\\nOrder Details: order details\\n\\nCUSTOMER ACKNOWLEDGES RECEIPT OF \\n GOODS AND/OR SERVICES IN THE AMOUNT \\n OF THE TOTAL SHOWN HEREON AND AGREES \\n TO PERFORM THE OBLIGATIONS SET FORTH \\n BY THE CUSTOMER`S AGREEMENT WITH THE \\n ISSUER\\n APPROVED \\n\\n \\n \\n\\n Customer Copy\\n",
"customData": "order details",
"generatedBy": "merchadmtest",
"card": {
"first6": "453980",
"last4": "4136",
"cardNumber": "r3ryoBPiaEKp4136",
"cardNumberHashed": "5zmMP7xvO7DUi03uFL/Nm+r49UVhzubW5KQflSaYmrY=",
"cardType": "Visa",
"expirationDate": "2030-12",
"pin": "86085F76523FA7F1",
"pinKsn": "5B076002128020D0",
"fcsId": "0534962",
"cardDataSource": "INTERNET",
"customer": {
"guid": "c5ed7b38-782d-4efa-be03-2be1efb63f68",
"merchantGuid": "cd3d0150-819c-44b9-8efd-2fa248fcacce",
"firstName": "Javier",
"lastName": "Choice Tech",
"address1": "110 10th Av.",
"zip": "10010",
"city": "New York",
"state": "NY",
"country": "US",
"phone": "9177563046",
"email": "javier@mailinator.com",
"personalPhone": "9177563046",
"status": "Active",
"displayName": "Javier Choice Tech - 9177563046"
}
}
}
Json Example Error Response:
{
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"traceId": "00-80ef7316ffe8e0708bfa9b776b0dfd24-9cd052939354564c-00",
"errors": {
"$.DeviceGuid": [
"Unable to parse {{DEVICECCw}} to GUID"
],
"$.Amount": [
"Amount should be equal or greater than zero",
"Unable to parse asdasd to Decimal",
"The JSON value could not be converted to System.Decimal. Path: $.Amount | LineNumber: 2 | BytePositionInLine: 59.",
"Amount can have 3 decimal places at most."
],
"Card": [
"'Card' is required"
],
"Card.CardNumber": [
"The field CardNumber must be between 13 and 16 characters. is invalid."
],
"Card.CardHolderName": [
"The CardHolderName must be between 0 and 30 digits long",
"The JSON value could not be converted to System.String. Path: $.Card.CardHolderName | LineNumber: 17 | BytePositionInLine: 32.",
],
"Card.Cvv2": [
"The field Cvv2 is invalid."
],
"Card.ExpirationDate": [
"Card has expired. Expiration date: 1902"
],
"Card.Pin": [
"The Pin must be between 4 and 20 digits long"
],
"Card.PinKsn": [
"The PinKsn should be 20 digits long"
],
"Card.Customer.LastName": [
"The field LastName is invalid.",
"Field maximum length must be less than 100"
],
"Card.Customer.FirstName": [
"The field FirstName is invalid.",
"Field maximum length must be less than 100"
],
"Card.Customer.Phone": [
"Field maximum length must be less than 10",
"Invalid phone number. Must be 10 digits numbers only no special characters.",
"The field Phone is invalid."
],
"Card.Customer.City": [
"Field maximum length must be less than 50"
],
"Card.Customer.State": [
"Field maximum length must be less than 2",
"The field State is invalid."
],
"Card.Customer.Country": [
"Field maximum length must be less than 50",
"The field Country is invalid."
],
"Card.Customer.Email": [
"Field maximum length must be less than 1000",
"The field Email is invalid."
],
"Card.Customer.Zip": [
"The Zip must be between 0 and 10 characters long",
"The field Zip is invalid."
],
"Card.Customer.Address1": [
"Field maximum length must be less than 100"
],
"Card.Customer.Address2": [
"Field maximum length must be less than 100"
],
"$.Card.Customer.DateOfBirth": [
"The JSON value could not be converted to System.Nullable`1[System.DateTime]. Path: $.Card.Customer.DateOfBirth | LineNumber: 22 | BytePositionInLine: 40."
],
"Card.Customer.DriverLicenseNumber": [
"The field DriverLicenseNumber is invalid.",
"Field maximum length must be less than 25",
"Only letters, numbers, asterisc, ampersand, @ and hyphen are allowed"
],
"Card.Customer.DriverLicenseState": [
"The field DriverLicenseState is invalid."
],
"Card.Customer.SsN4": [
"Field maximum length must be less than 4",
"The field SsN4 is invalid."
]
}
}
The EBT transaction is used to charge a credit card. When running a EBT transaction you’re authorizing an amount on a credit card that will make the settlement of that amount at the end of the day. The sale is just like running an AuthOnly and a Capture all together.
This endpoint creates a EBT transaction.
HTTP Request
POST https://sandbox.choice.dev/api/v1/ebtFoodStampPurchases
Headers using token
Key | Value |
---|---|
Content-Type | "application/json" |
Authorization | Token. Eg: "Bearer eHSN5rTBzqDozgAAlN1UlTMVuIT1zSiAZWCo6E..." |
Headers using API Key
Key | Value |
---|---|
Content-Type | "application/json" |
UserAuthorization | API Key. Eg: "e516b6db-3230-4b1c-ae3f-e5379b774a80" |
Query Parameters
Parameter | Type | M/C/O | Value |
---|---|---|---|
DeviceGuid | string | Mandatory | Device's Guid. |
Amount | decimal | Mandatory | Amount of the transaction. Min. amt.: $0.50. Does not allow empty strings and up to 3 decimal places. |
CustomData | string | Optional | order details. |
SemiIntegrated | boolean | Optional | Only when physical terminal used on semi integrated mode, send value True. |
Card | object | Mandatory | Card. |
Card | |||
CardNumber | string | Mandatory | Card number. Must be between 13 and 16 characters. (example: 4532538795426624) or token (example: FfL7exC7Xe2y6624). |
CardHolderName | string | Optional | Cardholder's name. Must be between 0 and 30 digits long. |
PIN | string | Mandatory | Identifies the PIN for the terminal. Must between 4 and 20 digits long. |
PinKsn | string | Mandatory | The KSN for DUKPT PIN encryption. Max length = 20. Note: Required only if the PIN is encrypted using DUKPT. |
Cvv2 | string | Optional | This is the three or four digit CVV code at the back side of the credit and debit card. |
ExpirationDate | date | Optional with Token | Card's expiry date in the YYMM format. |
FcsID | string | Optional | The Food and Consumer Service (FCS) ID number. |
Customer | object | Optional | Customer. |
Customer | |||
FirstName | string | Optional | Customer's first name. Max length = 100. |
LastName | string | Optional | Customer's last name. Max length = 100. |
Phone | string | Optional | Customer's phone number. The phone number must be syntactically correct. For example, 4152345678. Must be 10 digits numbers only, no special characters. |
City | string | Optional | Customer's city. Max length = 50. |
State | string | Optional | Customer's short name state. The ISO 3166-2 CA and US state or province code of a customer. Length = 2. |
Country | string | Optional | Customer's country. The ISO country code of a customer’s country. Length = 2 or 3. |
string | Optional | Customer's valid email address. Max length = 1000. | |
Address1 | string | Optional | Customer's address. Max length = 100. |
Address2 | string | Optional | Customer's address line 2. Max length = 100. |
Zip | strings | Optional | Customer's zipcode. Length = 5. Max length = 10. |
DateOfBirth | date | Optional | Customer's date of birth. Allowed format: YYYY-MM-DD. For example: 2002-05-30 |
DriverLicenseNumber | string | Optional | Customer's driver license number. Not allow special characters. Max length = 25. |
DriverLicenseState | string | Mandatory when DriverLicenseNumber is provided | Customer's driver license short name state. The ISO 3166-2 CA and US state or province code of a customer. Length = 2. |
SSN4 | string | Mandatory when DOB is not submitted | Customer's social security number. Max length = 4. |
Response
- 201 code (created).
Create EBT Electronic Vouchers
using System;
using Newtonsoft.Json;
using System.IO;
using System.Net;
using System.Text;
namespace ChoiceSample
{
public class ebtElectronicVouchers
{
public static void CreateebtebtElectronicVouchers()
{
try
{
var request = (HttpWebRequest)WebRequest.Create("https://sandbox.choice.dev/api/v1/ebtElectronicVouchers");
request.ContentType = "text/json";
request.Method = "POST";
var ebtElectronicVouchers = new
{
DeviceGuid = "b29725af-b067-4a35-9819-bbb31bdf8808",
Amount = 19.74,
EbtVoucherNumber = "123456789012345",
EbtVoucherApprovalCode = "123456",
Card = new
{
CardNumber = "4539808036544136",
ExpirationDate = "3012",
CardDataSource = "MANUAL"
FcsID = "1234567"
Customer = new
{
FirstName = "John",
LastName = "Doe",
Phone = "9177563007",
City = "New York",
State = "NY",
Country = "US",
Email = "johnd@mailinator.com",
Address1 = "107 7th Av.",
Zip = "10007"
}
}
};
string json = JsonConvert.SerializeObject(ebtElectronicVouchers);
request.Headers.Add("Authorization", "Bearer 1A089D6ziUybPZFQ3mpPyjt9OEx9yrCs7eQIC6V3A0lmXR2N6-seGNK16Gsnl3td6Ilfbr2Xf_EyukFXwnVEO3fYL-LuGw-L3c8WuaoxhPE8MMdlMPILJTIOV3lTGGdxbFXdKd9U03bbJ9TDUkqxHqq8_VyyjDrw7fs0YOob7bg0OovXTeWgIvZaIrSR1WFR06rYJ0DfWn-Inuf7re1-4SMOjY1ZoCelVwduWCBJpw1111cNbWtHJfObV8u1CVf0");
request.ContentType = "application/json";
request.Accept = "application/json";
using (var streamWriter = new StreamWriter(request.GetRequestStream()))
{
streamWriter.Write(json);
streamWriter.Flush();
streamWriter.Close();
}
try
{
var response = (HttpWebResponse)request.GetResponse();
using (var reader = new StreamReader(response.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)response.StatusCode);
Console.WriteLine();
Console.WriteLine(response.StatusDescription);
Console.WriteLine(result);
}
}
catch (WebException wex)
{
if (wex.Response != null)
{
using (var errorResponse = (HttpWebResponse)wex.Response)
{
using (var reader = new StreamReader(errorResponse.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)errorResponse.StatusCode);
Console.WriteLine();
Console.WriteLine(errorResponse.StatusDescription);
Console.WriteLine(result);
}
}
}
}
}
catch (IOException e)
{
Console.WriteLine(e);
}
}
}
}
Json Example Request:
{
"deviceGuid" : "8B2572A8-D269-4A55-A909-1D51ED397A94",
"Amount": 7.00,
"EbtVoucherNumber":"123456789012345",
"EbtVoucherApprovalCode":"123456",
"Card": {
"CardNumber": "4539808036544136",
"ExpirationDate": "3012",
"CardDataSource": "MANUAL",
"FcsID": "1234567",
"Customer": {
"FirstName": "Javier",
"LastName": "Choice Tech",
"Phone": "9177563046",
"City": "New York",
"State": "NY",
"Country": "US",
"Email": "javier@mailinator.com",
"Address1": "110 10th Av.",
"Zip": "10010" }
}
}
Json Example Response:
{
"effectiveAmount": 7.000,
"balanceAmount": 1234.560,
"ebtVoucherNumber": "123456789012345",
"ebtVoucherApprovalCode": "123456",
"guid": "f51d28f8-6b15-4be6-9131-266eab0a277d",
"status": "Transaction - Approved",
"batchStatus": "Batch - Open",
"timeStamp": "2023-06-28T13:42:32.49-05:00",
"deviceGuid": "397eb067-2ebf-4934-bbb4-ace4e4a6194e",
"amount": 7.000,
"batchGuid": "9fca53a2-5d5b-44f0-bff3-b04f577405ce",
"semiIntegrated": false,
"processorStatusCode": "A0000",
"processorResponseMessage": "Success, HostRef#: 317933489225",
"wasProcessed": true,
"authCode": "TAS768",
"refNumber": "33489225",
"invoiceNumber": "33489225",
"customerReceipt": "CHOICE MERCHANT SOLUTIONS \\n 8320 S HARDY DR \\n TEMPE AZ 85284\\n06/28/2023 14:06:32 \\n\\nDEBIT - SALE\\nTransaction - Approved\\n\\nCard Number: **** **** **** \\nCard Type: n/a\\nRef #: 33489225\\nAuth Code: TAS768\\n\\nTxn Amt $7.00\\n\\nTotal Amt $7.00\\n\\n\\nCUSTOMER ACKNOWLEDGES RECEIPT OF \\n GOODS AND/OR SERVICES IN THE AMOUNT \\n OF THE TOTAL SHOWN HEREON AND AGREES \\n TO PERFORM THE OBLIGATIONS SET FORTH \\n BY THE CUSTOMER`S AGREEMENT WITH THE \\n ISSUER\\n APPROVED \\n\\n \\n \\n\\n Customer Copy\\n",
"generatedBy": "merchadmtest",
"card": {
"first6": "453980",
"last4": "4136",
"cardNumber": "CARD NOT TOKENIZED",
"cardNumberHashed": "5zmMP7xvO7DUi03uFL/Nm+r49UVhzubW5KQflSaYmrY=",
"cardType": "Visa",
"expirationDate": "2030-12",
"fcsId": "1234567",
"cardDataSource": "INTERNET",
"customer": {
"guid": "c5ed7b38-782d-4efa-be03-2be1efb63f68",
"merchantGuid": "cd3d0150-819c-44b9-8efd-2fa248fcacce",
"firstName": "Javier",
"lastName": "Choice Tech",
"address1": "110 10th Av.",
"zip": "10010",
"city": "New York",
"state": "NY",
"country": "US",
"phone": "9177563046",
"email": "javier@mailinator.com",
"personalPhone": "9177563046",
"status": "Active",
"displayName": "Javier Choice Tech - 9177563046"
}
}
}
Json Example Error Response:
{
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"traceId": "00-6de3825602400c856c40a443dcebaf68-729d1ac910f537b1-00",
"errors": {
"DeviceGuid": [
"The field DeviceGuid is invalid."
],
"Amount": [
"Amount can have 3 decimal places at most.",
"Unable to parse letters to Decimal"
],
"Card.CardNumber": [
"The field CardNumber must be between 13 and 16 characters. is invalid."
],
"Card.CardHolderName": [
"The CardHolderName must be between 0 and 30 digits long"
],
"Card.Cvv2": [
"The field Cvv2 is invalid."
],
"Card.ExpirationDate": [
"The field ExpirationDate is invalid."
],
"Card.Customer.FirstName": [
"Field maximum length must be less than 100",
"The field FirstName is invalid."
],
"Card.Customer.LastName": [
"Field maximum length must be less than 100",
"The field LastName is invalid."
],
"Card.Customer.Address1": [
"Field maximum length must be less than 100",
"The field Address1 is invalid."
],
"Card.Customer.City": [
"Field maximum length must be less than 50"
],
"Card.Customer.State": [
"Field maximum length must be less than 2",
"The field State is invalid."
],
"Card.Customer.Email": [
"Field maximum length must be less than 1000"
],
"Card.Customer.SsN4": [
"Field maximum length must be less than 4",
"The field SsN4 is invalid."
],
"Card.Customer.Zip": [
"The Zip must be between 0 and 10 characters long",
"The field Zip is invalid."
],
"Card.Customer.DriverLicenseNumber": [
"The field DriverLicenseNumber is invalid.",
"Field maximum length must be less than 25",
"Only letters, numbers, asterisc, ampersand, @ and hyphen are allowed"
],
"Card.Customer.DriverLicenseState": [
"The field DriverLicenseState is invalid."
],
"Card.Customer.Phone": [
"Field maximum length must be less than 10",
"Invalid phone number. Must be 10 digits numbers only no special characters."
],
"Card.Customer.Country": [
"Field maximum length must be less than 50",
"The field Country is invalid."
]
}
}
The EBT transaction is used to charge a credit card. When running a EBT transaction you’re authorizing an amount on a credit card that will make the settlement of that amount at the end of the day. The sale is just like running an AuthOnly and a Capture all together.
This endpoint creates a EBT transaction.
HTTP Request
POST https://sandbox.choice.dev/api/v1/ebtElectronicVouchers
Headers using token
Key | Value |
---|---|
Content-Type | "application/json" |
Authorization | Token. Eg: "Bearer eHSN5rTBzqDozgAAlN1UlTMVuIT1zSiAZWCo6E..." |
Headers using API Key
Key | Value |
---|---|
Content-Type | "application/json" |
UserAuthorization | API Key. Eg: "e516b6db-3230-4b1c-ae3f-e5379b774a80" |
Query Parameters
Parameter | Type | M/C/O | Value |
---|---|---|---|
DeviceGuid | string | Mandatory | Device's Guid. |
Amount | decimal | Mandatory | Amount of the transaction. Min. amt.: $0.50. Does not allow empty strings and up to 3 decimal places. |
CustomData | string | Optional | order details. |
EbtVoucherApprovalCode | string | optional | Voucher's approval code |
EbtVoucherNumber | string | optional | Voucher designated number |
Card | object | Mandatory | Card. |
Card | |||
CardNumber | string | Mandatory | Card number. Must be between 13 and 16 characters. (example: 4532538795426624) or token (example: FfL7exC7Xe2y6624). |
CardHolderName | string | Optional | Cardholder's name. Must be between 0 and 30 digits long. |
Cvv2 | string | Optional | This is the three or four digit CVV code at the back side of the credit and debit card. |
ExpirationDate | date | Optional with Token | Card's expiry date in the YYMM format. |
FcsID | string | Optional | The Food and Consumer Service (FCS) ID number. |
Customer | object | Optional | Customer. |
Customer | |||
FirstName | string | Optional | Customer's first name. Max length = 100. |
LastName | string | Optional | Customer's last name. Max length = 100. |
Phone | string | Optional | Customer's phone number. The phone number must be syntactically correct. For example, 4152345678. Must be 10 digits numbers only, no special characters. |
City | string | Optional | Customer's city. Max length = 50. |
State | string | Optional | Customer's short name state. The ISO 3166-2 CA and US state or province code of a customer. Length = 2. |
Country | string | Optional | Customer's country. The ISO country code of a customer’s country. Length = 2 or 3. |
string | Optional | Customer's valid email address. Max length = 1000. | |
Address1 | string | Optional | Customer's address. Max length = 100. |
Address2 | string | Optional | Customer's address line 2. Max length = 100. |
Zip | strings | Optional | Customer's zipcode. Length = 5. Max length = 10. |
DateOfBirth | date | Optional | Customer's date of birth. Allowed format: YYYY-MM-DD. For example: 2002-05-30 |
DriverLicenseNumber | string | Optional | Customer's driver license number. Not allow special characters. Max length = 25. |
DriverLicenseState | string | Mandatory when DriverLicenseNumber is provided | Customer's driver license short name state. The ISO 3166-2 CA and US state or province code of a customer. Length = 2. |
SSN4 | string | Mandatory when DOB is not submitted | Customer's social security number. Max length = 4. |
Response
- 201 code (created).
Get EBT Cash Benefit Purchases
using System;
using Newtonsoft.Json;
using System.IO;
using System.Net;
using System.Text;
namespace ChoiceSample
{
public class EbtCashBenefitPurchases
{
public static void GetEbtCashBenefitPurchases()
{
try
{
var request = (HttpWebRequest)WebRequest.Create("https://sandbox.choice.dev/api/v1/EbtCashBenefitPurchases/1dde1960-3dea-472c-836e-402840967e7b");
request.Method = "GET";
request.Headers.Add("Authorization", "Bearer 1A089D6ziUybPZFQ3mpPyjt9OEx9yrCs7eQIC6V3A0lmXR2N6-seGNK16Gsnl3td6Ilfbr2Xf_EyukFXwnVEO3fYL-LuGw-L3c8WuaoxhPE8MMdlMPILJTIOV3lTGGdxbFXdKd9U03bbJ9TDUkqxHqq8_VyyjDrw7fs0YOob7bg0OovXTeWgIvZaIrSR1WFR06rYJ0DfWn-Inuf7re1-4SMOjY1ZoCelVwduWCBJpw1111cNbWtHJfObV8u1CVf0");
try
{
var response = (HttpWebResponse)request.GetResponse();
using (var reader = new StreamReader(response.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)response.StatusCode);
Console.WriteLine();
Console.WriteLine(response.StatusDescription);
Console.WriteLine(result);
}
}
catch (WebException wex)
{
if (wex.Response != null)
{
using (var errorResponse = (HttpWebResponse)wex.Response)
{
using (var reader = new StreamReader(errorResponse.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)errorResponse.StatusCode);
Console.WriteLine();
Console.WriteLine(errorResponse.StatusDescription);
Console.WriteLine(result);
}
}
}
}
}
catch (IOException e)
{
Console.WriteLine(e);
}
}
}
}
Json Example Error Response:
{
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"traceId": "00-748b29ad1ba57334d858725a19e3c374-5a93d63a64aa3a32-00",
"errors": {
"guid": [
"The value 'wrongGuid' is not valid."
]
}
}
This endpoint gets a EBT Cash Benefit Purchases.
HTTP Request
GET https://sandbox.choice.dev/api/v1/EbtCashBenefitPurchases/<guid>
Headers using token
Key | Value |
---|---|
Authorization | Token. Eg: "Bearer eHSN5rTBzqDozgAAlN1UlTMVuIT1zSiAZWCo6E..." |
Headers using API Key
Key | Value |
---|---|
UserAuthorization | API Key. Eg: "e516b6db-3230-4b1c-ae3f-e5379b774a80" |
URL Parameters
Parameter | Description |
---|---|
guid | EBT Cash Benefit Purchases guid to get |
Response
- 200 code (ok).
Get EBT Food Stamp Purchases
using System;
using Newtonsoft.Json;
using System.IO;
using System.Net;
using System.Text;
namespace ChoiceSample
{
public class ebtFoodStampPurchases
{
public static void GetebtFoodStampPurchases()
{
try
{
var request = (HttpWebRequest)WebRequest.Create("https://sandbox.choice.dev/api/v1/ebtFoodStampPurchases/1dde1960-3dea-472c-836e-402840967e7b");
request.Method = "GET";
request.Headers.Add("Authorization", "Bearer 1A089D6ziUybPZFQ3mpPyjt9OEx9yrCs7eQIC6V3A0lmXR2N6-seGNK16Gsnl3td6Ilfbr2Xf_EyukFXwnVEO3fYL-LuGw-L3c8WuaoxhPE8MMdlMPILJTIOV3lTGGdxbFXdKd9U03bbJ9TDUkqxHqq8_VyyjDrw7fs0YOob7bg0OovXTeWgIvZaIrSR1WFR06rYJ0DfWn-Inuf7re1-4SMOjY1ZoCelVwduWCBJpw1111cNbWtHJfObV8u1CVf0");
try
{
var response = (HttpWebResponse)request.GetResponse();
using (var reader = new StreamReader(response.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)response.StatusCode);
Console.WriteLine();
Console.WriteLine(response.StatusDescription);
Console.WriteLine(result);
}
}
catch (WebException wex)
{
if (wex.Response != null)
{
using (var errorResponse = (HttpWebResponse)wex.Response)
{
using (var reader = new StreamReader(errorResponse.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)errorResponse.StatusCode);
Console.WriteLine();
Console.WriteLine(errorResponse.StatusDescription);
Console.WriteLine(result);
}
}
}
}
}
catch (IOException e)
{
Console.WriteLine(e);
}
}
}
}
Json Example Response:
{
"effectiveAmount": 26.000,
"balanceAmount": 6543.210,
"guid": "d6c8c5a1-afce-486d-9ba8-de759988a4a1",
"status": "Transaction - Approved",
"batchStatus": "Batch - Open",
"timeStamp": "2023-06-28T13:44:52.39-05:00",
"deviceGuid": "397eb067-2ebf-4934-bbb4-ace4e4a6194e",
"amount": 26.000,
"batchGuid": "9fca53a2-5d5b-44f0-bff3-b04f577405ce",
"semiIntegrated": false,
"processorStatusCode": "A0000",
"processorResponseMessage": "Success, HostRef#: 317933489303",
"wasProcessed": true,
"authCode": "TAS770",
"refNumber": "33489303",
"invoiceNumber": "33489303",
"customerReceipt": "CHOICE MERCHANT SOLUTIONS \\n 8320 S HARDY DR \\n TEMPE AZ 85284\\n06/28/2023 14:06:52 \\n\\nDEBIT - SALE\\nTransaction - Approved\\n\\nCard Number: **** **** **** 4136\\nCard Type: n/a\\nRef #: 33489303\\nAuth Code: TAS770\\n\\nTxn Amt $26.00\\n\\nTotal Amt $26.00\\n\\nOrder Details: order details\\n\\nCUSTOMER ACKNOWLEDGES RECEIPT OF \\n GOODS AND/OR SERVICES IN THE AMOUNT \\n OF THE TOTAL SHOWN HEREON AND AGREES \\n TO PERFORM THE OBLIGATIONS SET FORTH \\n BY THE CUSTOMER`S AGREEMENT WITH THE \\n ISSUER\\n APPROVED \\n\\n \\n \\n\\n Customer Copy\\n",
"customData": "order details",
"generatedBy": "merchadmtest",
"card": {
"first6": "453980",
"last4": "4136",
"cardNumber": "r3ryoBPiaEKp4136",
"cardNumberHashed": "5zmMP7xvO7DUi03uFL/Nm+r49UVhzubW5KQflSaYmrY=",
"cardType": "Visa",
"expirationDate": "2030-12",
"pin": "86085F76523FA7F1",
"pinKsn": "5B076002128020D0",
"fcsId": "0534962",
"cardDataSource": "INTERNET",
"customer": {
"guid": "c5ed7b38-782d-4efa-be03-2be1efb63f68",
"merchantGuid": "cd3d0150-819c-44b9-8efd-2fa248fcacce",
"firstName": "Javier",
"lastName": "Choice Tech",
"address1": "110 10th Av.",
"zip": "10010",
"city": "New York",
"state": "NY",
"country": "US",
"phone": "9177563046",
"email": "javier@mailinator.com",
"personalPhone": "9177563046",
"status": "Active",
"displayName": "Javier Choice Tech - 9177563046"
}
}
}
Json Example Error Response:
{
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"traceId": "00-748b29ad1ba57334d858725a19e3c374-5a93d63a64aa3a32-00",
"errors": {
"guid": [
"The value 'wrongGuid' is not valid."
]
}
}
This endpoint gets a EBT Food Stamp Purchases.
HTTP Request
GET https://sandbox.choice.dev/api/v1/ebtFoodStampPurchases/<guid>
Headers using token
Key | Value |
---|---|
Authorization | Token. Eg: "Bearer eHSN5rTBzqDozgAAlN1UlTMVuIT1zSiAZWCo6E..." |
Headers using API Key
Key | Value |
---|---|
UserAuthorization | API Key. Eg: "e516b6db-3230-4b1c-ae3f-e5379b774a80" |
URL Parameters
Parameter | Description |
---|---|
guid | EBT Food Stamp Purchases guid to get |
Response
- 200 code (ok).
Get EBT Electronic Vouchers
using System;
using Newtonsoft.Json;
using System.IO;
using System.Net;
using System.Text;
namespace ChoiceSample
{
public class ebtElectronicVouchers
{
public static void GetebtElectronicVouchers()
{
try
{
var request = (HttpWebRequest)WebRequest.Create("https://sandbox.choice.dev/api/v1ebtElectronicVouchers/1dde1960-3dea-472c-836e-402840967e7b");
request.Method = "GET";
request.Headers.Add("Authorization", "Bearer 1A089D6ziUybPZFQ3mpPyjt9OEx9yrCs7eQIC6V3A0lmXR2N6-seGNK16Gsnl3td6Ilfbr2Xf_EyukFXwnVEO3fYL-LuGw-L3c8WuaoxhPE8MMdlMPILJTIOV3lTGGdxbFXdKd9U03bbJ9TDUkqxHqq8_VyyjDrw7fs0YOob7bg0OovXTeWgIvZaIrSR1WFR06rYJ0DfWn-Inuf7re1-4SMOjY1ZoCelVwduWCBJpw1111cNbWtHJfObV8u1CVf0");
try
{
var response = (HttpWebResponse)request.GetResponse();
using (var reader = new StreamReader(response.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)response.StatusCode);
Console.WriteLine();
Console.WriteLine(response.StatusDescription);
Console.WriteLine(result);
}
}
catch (WebException wex)
{
if (wex.Response != null)
{
using (var errorResponse = (HttpWebResponse)wex.Response)
{
using (var reader = new StreamReader(errorResponse.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)errorResponse.StatusCode);
Console.WriteLine();
Console.WriteLine(errorResponse.StatusDescription);
Console.WriteLine(result);
}
}
}
}
}
catch (IOException e)
{
Console.WriteLine(e);
}
}
}
}
Json Example Response:
{
"effectiveAmount": 7.000,
"balanceAmount": 1234.560,
"ebtVoucherNumber": "123456789012345",
"ebtVoucherApprovalCode": "123456",
"guid": "a4cf4aea-3a34-440f-92a7-e6d026d543d7",
"status": "Transaction - Approved",
"batchStatus": "Batch - Open",
"timeStamp": "2023-06-28T13:45:56.35-05:00",
"deviceGuid": "397eb067-2ebf-4934-bbb4-ace4e4a6194e",
"amount": 7.000,
"batchGuid": "9fca53a2-5d5b-44f0-bff3-b04f577405ce",
"semiIntegrated": false,
"processorStatusCode": "A0000",
"processorResponseMessage": "Success, HostRef#: 317933489361",
"wasProcessed": true,
"authCode": "TAS771",
"refNumber": "33489361",
"invoiceNumber": "33489361",
"customerReceipt": "CHOICE MERCHANT SOLUTIONS \\n 8320 S HARDY DR \\n TEMPE AZ 85284\\n06/28/2023 14:06:56 \\n\\nDEBIT - SALE\\nTransaction - Approved\\n\\nCard Number: **** **** **** \\nCard Type: n/a\\nRef #: 33489361\\nAuth Code: TAS771\\n\\nTxn Amt $7.00\\n\\nTotal Amt $7.00\\n\\n\\nCUSTOMER ACKNOWLEDGES RECEIPT OF \\n GOODS AND/OR SERVICES IN THE AMOUNT \\n OF THE TOTAL SHOWN HEREON AND AGREES \\n TO PERFORM THE OBLIGATIONS SET FORTH \\n BY THE CUSTOMER`S AGREEMENT WITH THE \\n ISSUER\\n APPROVED \\n\\n \\n \\n\\n Customer Copy\\n",
"generatedBy": "merchadmtest",
"card": {
"first6": "453980",
"last4": "4136",
"cardNumber": "CARD NOT TOKENIZED",
"cardNumberHashed": "5zmMP7xvO7DUi03uFL/Nm+r49UVhzubW5KQflSaYmrY=",
"cardType": "Visa",
"expirationDate": "2030-12",
"fcsId": "1234567",
"cardDataSource": "INTERNET",
"customer": {
"guid": "c5ed7b38-782d-4efa-be03-2be1efb63f68",
"merchantGuid": "cd3d0150-819c-44b9-8efd-2fa248fcacce",
"firstName": "Javier",
"lastName": "Choice Tech",
"address1": "110 10th Av.",
"zip": "10010",
"city": "New York",
"state": "NY",
"country": "US",
"phone": "9177563046",
"email": "javier@mailinator.com",
"personalPhone": "9177563046",
"status": "Active",
"displayName": "Javier Choice Tech - 9177563046"
}
}
}
Json Example Error Response:
{
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"traceId": "00-748b29ad1ba57334d858725a19e3c374-5a93d63a64aa3a32-00",
"errors": {
"guid": [
"The value 'wrongGuid' is not valid."
]
}
}
This endpoint gets a EBT Electronic Vouchers.
HTTP Request
GET https://sandbox.choice.dev/api/v1/ebtElectronicVouchers/<guid>
Headers using token
Key | Value |
---|---|
Authorization | Token. Eg: "Bearer eHSN5rTBzqDozgAAlN1UlTMVuIT1zSiAZWCo6E..." |
Headers using API Key
Key | Value |
---|---|
UserAuthorization | API Key. Eg: "e516b6db-3230-4b1c-ae3f-e5379b774a80" |
URL Parameters
Parameter | Description |
---|---|
guid | EBT Electronic Vouchers guid to get |
Response
- 200 code (ok).
AuthOnly
Create AuthOnly
using System;
using Newtonsoft.Json;
using System.IO;
using System.Net;
using System.Text;
namespace ChoiceSample
{
public class AuthOnly
{
public static void CreateAuthOnly()
{
try
{
var request = (HttpWebRequest)WebRequest.Create("https://sandbox.choice.dev/api/v1/AuthOnlys");
request.ContentType = "text/json";
request.Method = "POST";
var authOnly = new
{
DeviceGuid = "7290ed47-3066-49db-a904-3d23924c46be",
Amount = 10.00,
DualPricingFeeAmount = 0.40,
OrderNumber = "11518",
OrderDate = "2020-11-24",
SendReceipt = true,
CustomData = "order details",
CustomerLabel = "Patient",
CustomerId = "xt147",
AssociateCustomerCard = true,
Card = new
{
CardNumber = "5486477674539426",
CardHolderName = "John Doe",
Cvv2 = "998",
ExpirationDate = "2012",
Customer = new
{
FirstName = "John",
LastName = "Doe",
Phone = "9177563006",
City = "New York",
State = "NY",
Country = "US",
Email = "johnd@mailinator.com",
Address1 = "106 6th Av.",
Address2 = "",
Zip = "10006",
DateOfBirth = "1986-06-06",
DriverLicenseNumber = "12345678",
DriverLicenseExpDate = "2025-10-10"
DriverLicenseState = "TX",
SSN4 = "1210"
}
}
};
string json = JsonConvert.SerializeObject(authOnly);
request.Headers.Add("Authorization", "Bearer 1A089D6ziUybPZFQ3mpPyjt9OEx9yrCs7eQIC6V3A0lmXR2N6-seGNK16Gsnl3td6Ilfbr2Xf_EyukFXwnVEO3fYL-LuGw-L3c8WuaoxhPE8MMdlMPILJTIOV3lTGGdxbFXdKd9U03bbJ9TDUkqxHqq8_VyyjDrw7fs0YOob7bg0OovXTeWgIvZaIrSR1WFR06rYJ0DfWn-Inuf7re1-4SMOjY1ZoCelVwduWCBJpw1111cNbWtHJfObV8u1CVf0");
request.ContentType = "application/json";
request.Accept = "application/json";
using (var streamWriter = new StreamWriter(request.GetRequestStream()))
{
streamWriter.Write(json);
streamWriter.Flush();
streamWriter.Close();
}
try
{
var response = (HttpWebResponse)request.GetResponse();
using (var reader = new StreamReader(response.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)response.StatusCode);
Console.WriteLine();
Console.WriteLine(response.StatusDescription);
Console.WriteLine(result);
}
}
catch (WebException wex)
{
if (wex.Response != null)
{
using (var errorResponse = (HttpWebResponse)wex.Response)
{
using (var reader = new StreamReader(errorResponse.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)errorResponse.StatusCode);
Console.WriteLine();
Console.WriteLine(errorResponse.StatusDescription);
Console.WriteLine(result);
}
}
}
}
}
catch (IOException e)
{
Console.WriteLine(e);
}
}
}
}
-----------------------------------------------------------
using System;
using Newtonsoft.Json;
using System.IO;
using System.Net;
using System.Text;
namespace ChoiceSample
{
public class AuthOnly
{
public static void CreateAuthOnly()
{
try
{
var request = (HttpWebRequest)WebRequest.Create("https://sandbox.choice.dev/api/v1/AuthOnlys");
request.ContentType = "text/json";
request.Method = "POST";
var authOnly = new
{
DeviceGuid = "7290ed47-3066-49db-a904-3d23924c46be",
Amount = 10.00,
DualPricingFeeAmount = 0.40,
PromptConsumer = true,
OrderNumber = "11518",
OrderDate = "2020-11-24",
SendReceipt = true,
CustomData = "order details",
CustomerLabel = "Patient",
CustomerId = "xt147",
AssociateCustomerCard = true,
SemiIntegrated = true
};
string json = JsonConvert.SerializeObject(authOnly);
request.Headers.Add("Authorization", "Bearer 1A089D6ziUybPZFQ3mpPyjt9OEx9yrCs7eQIC6V3A0lmXR2N6-seGNK16Gsnl3td6Ilfbr2Xf_EyukFXwnVEO3fYL-LuGw-L3c8WuaoxhPE8MMdlMPILJTIOV3lTGGdxbFXdKd9U03bbJ9TDUkqxHqq8_VyyjDrw7fs0YOob7bg0OovXTeWgIvZaIrSR1WFR06rYJ0DfWn-Inuf7re1-4SMOjY1ZoCelVwduWCBJpw1111cNbWtHJfObV8u1CVf0");
request.ContentType = "application/json";
request.Accept = "application/json";
using (var streamWriter = new StreamWriter(request.GetRequestStream()))
{
streamWriter.Write(json);
streamWriter.Flush();
streamWriter.Close();
}
try
{
var response = (HttpWebResponse)request.GetResponse();
using (var reader = new StreamReader(response.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)response.StatusCode);
Console.WriteLine();
Console.WriteLine(response.StatusDescription);
Console.WriteLine(result);
}
}
catch (WebException wex)
{
if (wex.Response != null)
{
using (var errorResponse = (HttpWebResponse)wex.Response)
{
using (var reader = new StreamReader(errorResponse.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)errorResponse.StatusCode);
Console.WriteLine();
Console.WriteLine(errorResponse.StatusDescription);
Console.WriteLine(result);
}
}
}
}
}
catch (IOException e)
{
Console.WriteLine(e);
}
}
}
}
Json Example Request:
{
"DeviceGuid" : "b29725af-b067-4a35-9819-bbb31bdf8808",
"Amount" : 10.00,
"DualPricingFeeAmount": 0.40,
"OrderNumber" : "11518",
"OrderDate" : "2020-11-24",
"SendReceipt" : true,
"CustomData" : "order details",
"CustomerLabel" : "Patient",
"CustomerId" : "xt147",
"AssociateCustomerCard" : true,
"Card":
{
"CardNumber" : "5486477674539426",
"CardHolderName" : "John Doe",
"Cvv2" : "998",
"ExpirationDate" : "2012",
"Customer":
{
"FirstName" : "John",
"LastName" : "Doe",
"Phone" : "9177563006",
"City" : "New York",
"State" : "NY",
"Country" : "US",
"Email" : "johnd@mailinator.com",
"Address1" : "106 6th Av.",
"Address2" : "",
"Zip" : "10006",
"DateOfBirth" : "1986-06-06",
"DriverLicenseExpDate": "2024-10-10",
"DriverLicenseNumber" : "12345678",
"DriverLicenseState" : "TX",
"SSN4" : "1210"
}
}
}
Json Example Request For Semi-Integrated Sale:
{
"DeviceGuid" : "b29725af-b067-4a35-9819-bbb31bdf8808",
"Amount" : 10.00,
"DualPricingFeeAmount": 0.40,
"PromptConsumer": true,
"OrderNumber" : "11518",
"OrderDate" : "2020-11-24",
"SendReceipt" : true,
"CustomData" : "order details",
"CustomerLabel" : "Patient",
"CustomerId" : "xt147",
"AssociateCustomerCard" : true,
"SemiIntegrated": true
}
Json Example Response:
{
"guid": "493cffed-232a-4896-b9ca-36b543d7da13",
"status": "Transaction - Approved",
"timeStamp": "2023-06-28T13:47:46.72-05:00",
"amount": 10.400,
"grossAmount": 10.000,
"effectiveAmount": 10.400,
"dualPricingFeeAmount": 0.400,
"orderNumber": "11518",
"orderDate": "2020-11-24T00:00:00",
"deviceGuid": "b29725af-b067-4a35-9819-bbb31bdf8808",
"customData": "order details",
"cardDataSource": "INTERNET",
"customerLabel": "Patient",
"customerID": "xt147",
"batchGuid": "014db6d5-e627-472b-8f7d-02901693725f",
"sendReceipt": true,
"allowCardEmv": false,
"processorStatusCode": "A0000",
"processorResponseMessage": "Success, HostRef#: 317918504768",
"wasProcessed": true,
"authCode": "VTLMC1",
"refNumber": "33489445",
"invoiceNumber": "",
"customerReceipt": "CHOICE MERCHANT SOLUTIONS \\n 8320 S HARDY DR \\n TEMPE AZ 85284\\n06/28/2023 14:06:46 \\n\\nCREDIT - AUTH ONLY\\nTransaction - Approved\\n\\nJohn Doe\\nCard Number: **** **** **** 9426\\nCard Type: Mastercard\\nRef #: 33489445\\nAuth Code: VTLMC1\\n\\nTxn Amt $10.00\\nCash Discount $0.00\\n\\nTotal Authorized Amt $10.40\\n\\nOrder Number: 11518\\nOrder Date: 11/24/2020 12:00:00 AM\\nOrder Details: order details\\n\\nCUSTOMER ACKNOWLEDGES RECEIPT OF \\n GOODS AND/OR SERVICES IN THE AMOUNT \\n OF THE TOTAL SHOWN HEREON AND AGREES \\n TO PERFORM THE OBLIGATIONS SET FORTH \\n BY THE CUSTOMER`S AGREEMENT WITH THE \\n ISSUER\\n APPROVED \\n\\n \\n \\n\\n Customer Copy\\n",
"enhancedData": {},
"card": {
"first6": "548647",
"last4": "9426",
"cardNumber": "inkpSUbbYay59426",
"cardNumberHashed": "OzF5YGq3YeBLnEeMpD5PXixZz2guba1nrzeZcnS+W1Q=",
"cardHolderName": "John Doe",
"cardType": "Mastercard",
"expirationDate": "2025-12",
"customer": {
"guid": "1dea1f06-efb8-4062-8a3a-1a64aabd10e8",,
"merchantGuid": "cd3d0150-987j-66m8-5hyt-2fa248fcacce",
"firstName": "John",
"lastName": "Doe",
"dateOfBirth": "1987-07-07T00:00:00",
"address1": "107 7th Av.",
"zip": "10007",
"city": "New York",
"state": "NY",
"stateFullName": "New York",
"country": "US",
"phone": "9177563007",
"email": "johnd@mailinator.com",
"ssN4": "1210",
"driverLicenseNumber": "12345678",
"driverLicenseState": "TX",
"driverLicenseExpirationDate": "2030-12-12T00:00:00",
"dlStateFullName": "Texas",
"personalPhone": "9177563007",
"status": "Active",
"displayName": "John Doe - 9177563007"
}
},
"associateCustomerCard": true,
"sequenceNumber": "224",
"addressVerificationCode": "N",
"addressVerificationResult": "No Match",
"cvvVerificationCode": "M",
"cvvVerificationResult": "Passed"
}
Json Example Response For Cash Sale:
{
"guid": "5d8ad876-cff8-4179-831f-65fad59c8faa",
"status": "Transaction - Approved",
"timeStamp": "2023-08-14T16:06:39.28+00:00",
"amount": 50.000,
"grossAmount": 50.000,
"effectiveAmount": 50.000,
"deviceGuid": "14c8bee4-a00b-4976-9a4a-adb13e2faf71",
"processorResponseMessage": "Cash Sale Processed",
"wasProcessed": true,
"authCode": "TA55496",
"refNumber": "42603996"
}
Json Example Error Response:
{
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"traceId": "00-54cbeac4191938ca6b2795b591012337-3b071e38900c1ba0-00",
"errors": {
"Amount": [
"Amount can have 3 decimal places at most.",
"Unable to parse letters to Decimal"
],
"DeviceGuid": [
"The field DeviceGuid is invalid."
],
"DualPricingFeeAmount": [
"DualPricingFeeAmount can have 3 decimal places at most.",
"Unable to parse letters to Decimal"
],
"SequenceNumber": [
"Field maximum length must be less than 100"
],
"OrderNumber": [
"Field maximum length must be less than 20",
"The field OrderNumber is invalid."
],
"CustomerLabel": [
"Field maximum length must be less than 100",
"The field CustomerLabel is invalid."
],
"CustomerId": [
"Field maximum length must be less than 100",
"The field CustomerId is invalid."
],
"Currency": [
"The field Currency is invalid."
],
"Card.CardNumber": [
"The field CardNumber must be between 13 and 16 characters. is invalid."
],
"Card.CardHolderName": [
"The CardHolderName must be between 0 and 30 digits long"
],
"Card.Cvv2": [
"The field Cvv2 is invalid."
],
"Card.ExpirationDate": [
"The field ExpirationDate is invalid."
],
"Card.Customer.FirstName": [
"Field maximum length must be less than 100",
"The field FirstName is invalid."
],
"Card.Customer.LastName": [
"Field maximum length must be less than 100",
"The field LastName is invalid."
],
"Card.Customer.Address1": [
"Field maximum length must be less than 100",
"The field Address1 is invalid."
],
"Card.Customer.City": [
"Field maximum length must be less than 50"
],
"Card.Customer.State": [
"Field maximum length must be less than 2",
"The field State is invalid."
],
"Card.Customer.Email": [
"Field maximum length must be less than 1000"
],
"Card.Customer.SsN4": [
"Field maximum length must be less than 4",
"The field SsN4 is invalid."
],
"Card.Customer.Zip": [
"The Zip must be between 0 and 10 characters long",
"The field Zip is invalid."
],
"Card.Customer.DriverLicenseNumber": [
"The field DriverLicenseNumber is invalid.",
"Field maximum length must be less than 25",
"Only letters, numbers, asterisc, ampersand, @ and hyphen are allowed"
],
"Card.Customer.DriverLicenseState": [
"The field DriverLicenseState is invalid."
],
"Card.Customer.Phone": [
"Field maximum length must be less than 10",
"Invalid phone number. Must be 10 digits numbers only no special characters."
],
"Card.Customer.Country": [
"Field maximum length must be less than 50",
"The field Country is invalid."
],
"EnhancedData.SaleTax": [
"SaleTax can have 3 decimal places at most."
],
"EnhancedData.AdditionalTaxDetailTaxType": [
"The field AdditionalTaxDetailTaxType is invalid."
],
"EnhancedData.AdditionalTaxDetailTaxAmount": [
"AdditionalTaxDetailTaxAmount can have 3 decimal places at most."
],
"EnhancedData.AdditionalTaxDetailTaxRate": [
"AdditionalTaxDetailTaxRate can have 3 decimal places at most."
],
"EnhancedData.PurchaseOrder": [
"Field maximum length must be less than 100",
"The field PurchaseOrder is invalid."
],
"EnhancedData.ShippingCharges": [
"ShippingCharges can have 3 decimal places at most."
],
"EnhancedData.DutyCharges": [
"DutyCharges can have 3 decimal places at most."
],
"EnhancedData.CustomerVatNumber": [
"Field maximum length must be less than 100",
"The field CustomerVatNumber is invalid."
],
"EnhancedData.VatInvoice": [
"Field maximum length must be less than 100",
"The field VatInvoice is invalid."
],
"EnhancedData.SummaryCommodityCode": [
"Field maximum length must be less than 100",
"The field SummaryCommodityCode is invalid."
],
"EnhancedData.ShipToZip": [
"The ShipToZip must be between 5 and 10 characters long",
"The field ShipToZip is invalid."
],
"EnhancedData.ShipFromZip": [
"The ShipFromZip must be between 5 and 10 characters long",
"The field ShipFromZip is invalid."
],
"EnhancedData.SupplierReferenceNumber": [
"Field maximum length must be less than 10",
"The field SupplierReferenceNumber is invalid."
],
"EnhancedData.CustomerRefId": [
"Field maximum length must be less than 17"
],
"EnhancedData.ChargeDescriptor": [
"Field maximum length must be less than 160",
"The field ChargeDescriptor is invalid."
],
"EnhancedData.ProductName": [
"Field maximum length must be less than 50",
"Product Name only allows numbers, letters, dash '-' and underscore '_'"
],
"EnhancedData.ProductCode": [
"Field maximum length must be less than 50"
],
"EnhancedData.Price": [
"Price shouldn't be greater than $999,999,999",
"Price can have 3 decimal places at most."
],
"EnhancedData.MeasurementUnit": [
"Field maximum length must be less than 100",
"The field MeasurementUnit is invalid."
]
}
}
You could use the AuthOnly transaction to authorize an amount on a credit card without making the actual settlement of that amount. In this case, you actually reserve an amount for a certain period against the credit limit of the card holder. The sale will be completed only if you run a successful capture later.
This endpoint creates an AuthOnly.
HTTP Request
POST https://sandbox.choice.dev/api/v1/AuthOnlys
Headers using token
Key | Value |
---|---|
Content-Type | "application/json" |
Authorization | Token. Eg: "Bearer eHSN5rTBzqDozgAAlN1UlTMVuIT1zSiAZWCo6E..." |
Headers using API Key
Key | Value |
---|---|
Content-Type | "application/json" |
UserAuthorization | API Key. Eg: "e516b6db-3230-4b1c-ae3f-e5379b774a80" |
Query Parameters
Parameter | Type | M/C/O | Value |
---|---|---|---|
DeviceGuid | string | Mandatory | Device's Guid. |
Amount | decimal | Mandatory | Amount of the transaction. Min. amt.: $0.50. Does not allow empty strings and up to 3 decimal places. |
DualPricingFeeAmount | decimal | Optional | Charge dual pricing. Should be equal or greater than zero and only accepts numbers and up to 3 decimal places. |
PromptConsumer | boolean | Optional | Applies only for Semi Integrated transactions, default value is true and if not sent would also be set as true. Value of true, prompts the consumer on the device to choose cash price or regular price. |
SequenceNumber | string | Optional | Use this number to call timeout reversal endpoint if you don't get a response. Max Length = 100. |
OrderNumber | string | Optional | Merchant's order number. The value sent on this element will be returned as InvoiceNumber. Length = 17. Max length = 20. Not allow special characters. |
OrderDate | date | Optional | Order Date. |
SendReceipt | boolean | Optional | Set to “FALSE” if you do not want an e-mail receipt to be sent to the customer. Set to “TRUE” or leave empty if you want e-mail to be sent. |
CustomData | string | Optional | order details. |
CustomerLabel | string | Optional | Any name you want to show instead of customer. Eg., Player, Patient, Buyer. Max Length = 100. Not allow special characters. |
CustomerID | string | Optional | Any combination of numbers and letters you use to identify the customer. Max length = 100. Not allow special characters. |
AssociateCustomerCard | boolean | Optional | An option to know if you want use to save customer and card token. |
SemiIntegrated | boolean | Optional | Only when physical terminal used on semi integrated mode, send value True. |
Currency | string | Optional | Currency of the transaction.Default value: USD Allowed values: USD, ARS, AUD, BRL, CAD, CHF, EUR, GBP, JPY, MXN, NZD, SGD |
Card | object | Mandatory | Card. |
EnhancedData | object | Optional | EnhancedData. |
Card | |||
CardNumber | string | Mandatory | Card number. Must be between 13 and 16 characters. (example: 4532538795426624) or token (example: FfL7exC7Xe2y6624). |
CardHolderName | string | Optional | Cardholder's name. Must be between 0 and 30 digits long. |
Cvv2 | string | Optional | This is the three or four digit CVV code at the back side of the credit and debit card. |
ExpirationDate | date | Optional with Token | Card's expiry date in the YYMM format. |
Customer | object | Optional | Customer. |
Customer | |||
FirstName | string | Optional | Customer's first name. Max length = 100. |
LastName | string | Optional | Customer's last name. Max length = 100. |
Phone | string | Optional | Customer's phone number. The phone number must be syntactically correct. For example, 4152345678. Must be 10 digits numbers only, no special characters. |
City | string | Optional | Customer's city. Max length = 50. |
State | string | Optional | Customer's short name state. The ISO 3166-2 CA and US state or province code of a customer. Length = 2. |
Country | string | Optional | Customer's country. The ISO country code of a customer’s country. Length = 2 or 3. |
string | Optional | Customer's valid email address. Max length = 1000. | |
Address1 | string | Optional | Customer's address. Max length = 100. |
Address2 | string | Optional | Customer's address line 2. Max length = 100. |
Zip | string | Optional | Customer's zipcode. Length = 5. |
DateOfBirth | date | Optional | Customer's date of birth. Allowed format: YYYY-MM-DD. For example: 2002-05-30 |
SSN4 | string | Mandatory when DOB is not submitted | Customer's social security number. Max length = 4. |
EnhancedData | |||
SaleTax | decimal | Optional | Transaction's amount. Should be equal or greater than zero. |
AdditionalTaxDetailTaxCategory | string | Optional | Tax Category. Not allow special characters. |
AdditionalTaxDetailTaxType | string | Optional | Tax Type. Not allow special characters. It only accepts numbers and up to 3 decimal places. |
AdditionalTaxDetailTaxAmount | decimal | Optional | Tax Amount. Should be equal or greater than zero. It only accepts numbers and up to 3 decimal places. |
AdditionalTaxDetailTaxRate | decimal | Optional | Tax Rate. Should be equal or greater than zero. It only accepts numbers and up to 3 decimal places. |
PurchaseOrder | string | Optional | Purchase Order. Max length = 100. Not allow special characters. |
ShippingCharges | decimal | Optional | Shipping Charges. Should be equal or greater than zero. |
DutyCharges | decimal | Optional | Duty Charges. Should be equal or greater than zero. |
CustomerVATNumber | string | Optional | Customer VAT Number. Not allow special characters. Max length = 100. |
VATInvoice | string | Optional | VAT Invoice. Not allow special characters. Max length = 100. |
SummaryCommodityCode | string | Optional | Summary Commodity Code. Not allow special characters. Max length = 100. |
ShipToZip | string | Optional | Ship To Zip. Must be between 5 and 10 characters long. Not allow letters or special characters. |
ShipFromZip | string | Optional | Ship From Zip. Must be between 5 and 10 characters long. Not allow letters or special characters. |
DestinationCountryCode | string | Optional | Destination Country Code. Not allow special characters. |
SupplierReferenceNumber | string | Optional | Supplier Reference Number. Not allow special characters. Max length = 10. |
CustomerRefID | string | Optional | Customer Ref ID. Max length = 17. |
ChargeDescriptor | string | Optional | Charge Descriptor. Not allow special characters. Max length = 160. |
AdditionalAmount | decimal | Optional | Additional Amount. Should be equal or greater than zero. Only accepts numbers and up to 3 decimal places. |
AdditionalAmountType | string | Optional | Additional Amount Type. |
ProductName | string | Optional | Product Name. Max length = 50. |
ProductCode | string | Optional | Product Code. Max length = 50. |
AddPrice | string | Optional | Price. Should be equal or greater than zero. Only accepts numbers and up to 3 decimal places. |
MeasurementUnit | string | Optional | Measurement Unit. Only accepts numbers and up to 3 decimal places. Max length = 100. |
Response
- 201 code (created).
Create Incremental Auth
using System;
using Newtonsoft.Json;
using System.IO;
using System.Net;
using System.Text;
namespace ChoiceSample
{
public class AuthOnly
{
public static void CreateIncrementalAuth()
{
try
{
var request = (HttpWebRequest)WebRequest.Create("https://sandbox.choice.dev/api/v1/AuthOnlys");
request.ContentType = "text/json";
request.Method = "POST";
var authOnly = new
{
DeviceGuid = "7290ed47-3066-49db-a904-3d23924c46be",
Amount = 2.00,
AuthOnlyGuid = "72g0ed47-3056-49db-a904-3d23926646be"
};
string json = JsonConvert.SerializeObject(authOnly);
request.Headers.Add("Authorization", "Bearer 1A089D6ziUybPZFQ3mpPyjt9OEx9yrCs7eQIC6V3A0lmXR2N6-seGNK16Gsnl3td6Ilfbr2Xf_EyukFXwnVEO3fYL-LuGw-L3c8WuaoxhPE8MMdlMPILJTIOV3lTGGdxbFXdKd9U03bbJ9TDUkqxHqq8_VyyjDrw7fs0YOob7bg0OovXTeWgIvZaIrSR1WFR06rYJ0DfWn-Inuf7re1-4SMOjY1ZoCelVwduWCBJpw1111cNbWtHJfObV8u1CVf0");
request.ContentType = "application/json";
request.Accept = "application/json";
using (var streamWriter = new StreamWriter(request.GetRequestStream()))
{
streamWriter.Write(json);
streamWriter.Flush();
streamWriter.Close();
}
try
{
var response = (HttpWebResponse)request.GetResponse();
using (var reader = new StreamReader(response.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)response.StatusCode);
Console.WriteLine();
Console.WriteLine(response.StatusDescription);
Console.WriteLine(result);
}
}
catch (WebException wex)
{
if (wex.Response != null)
{
using (var errorResponse = (HttpWebResponse)wex.Response)
{
using (var reader = new StreamReader(errorResponse.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)errorResponse.StatusCode);
Console.WriteLine();
Console.WriteLine(errorResponse.StatusDescription);
Console.WriteLine(result);
}
}
}
}
}
catch (IOException e)
{
Console.WriteLine(e);
}
}
}
}
Json Example Request:
{
"DeviceGuid" : "b29725af-b067-4a35-9819-bbb31bdf8808",
"Amount" : 2.00,
"AuthOnlyGuid" : "m29d25af-b067-4a35-9c19-bbb31jyf820d"
}
Json Example Response:
{
"guid": "2ac72740-5a12-4cab-a60c-8ac2b713254f",
"status": "Transaction - Approved",
"authOnlyGuid": "4f005bc2-a3ad-48d0-b433-704a834bfe7a",
"amount": 2.000,
"deviceGuid": "397eb067-2ebf-4934-bbb4-ace4e4a6194e",
"totalAmount": 2.000,
"timeStamp": "2023-06-28T13:50:52.84-05:00",
"processorStatusCode": "VTLMC1",
"processorResponseMessage": "STA: PASS | R.MSG: Success | TASK#: 34536301 | AUTHCODE: VTLMC1 | HOSTREF#: 317918750122 | TAMT: 2.00 | PAMT: 2.00 | VERIFCVV: | AVC: 0 | CHVC: | CT: M",
"wasProcessed": true,
"authCode": "VTLMC1",
"refNumber": "33489631",
"customerReceipt": "CHOICE MERCHANT SOLUTIONS \\n 8320 S HARDY DR \\n TEMPE AZ 85284\\n06/28/2023 14:06:52 \\n\\nCREDIT - AUTH ONLY\\nTransaction - Approved\\n\\nJohn Doe\\nCard Number: **** **** **** 9426\\nCard Type: Mastercard\\nRef #: 33489629\\nAuth Code: VTLMC1\\n\\nTxn Amt $10.00\\nCash Discount $0.00\\n\\nTotal Incremental Amt $2.00\\nTotal Authorized Amt $12.40\\n\\nOrder Number: 11518\\nOrder Date: 11/24/2020 12:00:00 AM\\nOrder Details: order details\\n\\nCUSTOMER ACKNOWLEDGES RECEIPT OF \\n GOODS AND/OR SERVICES IN THE AMOUNT \\n OF THE TOTAL SHOWN HEREON AND AGREES \\n TO PERFORM THE OBLIGATIONS SET FORTH \\n BY THE CUSTOMER`S AGREEMENT WITH THE \\n ISSUER\\n APPROVED \\n\\n \\n \\n\\n Customer Copy\\n"
}
Json Example Error Response:
{
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"traceId": "00-22562aa5d40d1b82a6a442037a8bea0b-b9580e83c8223b55-00",
"errors": {
"$.DeviceGuid": [
"Unable to parse {{invalidDevice}} to GUID"
],
"$.AuthOnlyGuid": [
"Unable to parse {{invalidGuid}} to GUID"
]
}
}
You could use the IncrementalAuth transaction to increase an amount on a authOnly transactions existing.
This endpoint creates an Incremental Auth.
HTTP Request
POST https://sandbox.choice.dev/api/v1/IncrementalAuth
Headers using token
Key | Value |
---|---|
Content-Type | "application/json" |
Authorization | Token. Eg: "Bearer eHSN5rTBzqDozgAAlN1UlTMVuIT1zSiAZWCo6E..." |
Headers using API Key
Key | Value |
---|---|
Content-Type | "application/json" |
UserAuthorization | API Key. Eg: "e516b6db-3230-4b1c-ae3f-e5379b774a80" |
Query Parameters
Parameter | Type | M/C/O | Value |
---|---|---|---|
DeviceGuid | string | Mandatory | Device's Guid. |
AuthOnlyGuid | string | Mandatory | AuthOnly's Guid for increasing |
Amount | decimal | Mandatory | Amount of the transaction. Does not allow empty strings and up to 3 decimal places. |
Response
- 201 code (created).
Get AuthOnly
using System;
using Newtonsoft.Json;
using System.IO;
using System.Net;
using System.Text;
namespace ChoiceSample
{
public class AuthOnly
{
public static void GetAuthOnly()
{
try
{
var request = (HttpWebRequest)WebRequest.Create("https://sandbox.choice.dev/api/v1/AuthOnlys/493cffed-232a-4896-b9ca-36b543d7da13");
request.Method = "GET";
request.Headers.Add("Authorization", "Bearer 1A089D6ziUybPZFQ3mpPyjt9OEx9yrCs7eQIC6V3A0lmXR2N6-seGNK16Gsnl3td6Ilfbr2Xf_EyukFXwnVEO3fYL-LuGw-L3c8WuaoxhPE8MMdlMPILJTIOV3lTGGdxbFXdKd9U03bbJ9TDUkqxHqq8_VyyjDrw7fs0YOob7bg0OovXTeWgIvZaIrSR1WFR06rYJ0DfWn-Inuf7re1-4SMOjY1ZoCelVwduWCBJpw1111cNbWtHJfObV8u1CVf0");
try
{
var response = (HttpWebResponse)request.GetResponse();
using (var reader = new StreamReader(response.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)response.StatusCode);
Console.WriteLine();
Console.WriteLine(response.StatusDescription);
Console.WriteLine(result);
}
}
catch (WebException wex)
{
if (wex.Response != null)
{
using (var errorResponse = (HttpWebResponse)wex.Response)
{
using (var reader = new StreamReader(errorResponse.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)errorResponse.StatusCode);
Console.WriteLine();
Console.WriteLine(errorResponse.StatusDescription);
Console.WriteLine(result);
}
}
}
}
}
catch (IOException e)
{
Console.WriteLine(e);
}
}
}
}
Json Example Response:
{
"guid": "493cffed-232a-4896-b9ca-36b543d7da13",
"status": "Transaction - Approved",
"timeStamp": "2023-06-28T13:51:59.46-05:00",
"amount": 10.400,
"grossAmount": 10.000,
"effectiveAmount": 10.400,
"dualPricingFeeAmount": 0.400,
"orderNumber": "11518",
"orderDate": "2020-11-24T00:00:00",
"deviceGuid": "b29725af-b067-4a35-9819-bbb31bdf8808",
"customData": "order details",
"cardDataSource": "INTERNET",
"customerLabel": "Patient",
"customerID": "xt147",
"batchGuid": "00000000-0000-0000-0000-000000000000",
"sendReceipt": true,
"allowCardEmv": false,
"processorStatusCode": "A0000",
"processorResponseMessage": "Success, HostRef#: 317918750268",
"wasProcessed": true,
"authCode": "VTLMC1",
"refNumber": "33489691",
"invoiceNumber": "",
"customerReceipt": "CHOICE MERCHANT SOLUTIONS \\n 8320 S HARDY DR \\n TEMPE AZ 85284\\n06/28/2023 14:06:59 \\n\\nCREDIT - AUTH ONLY\\nTransaction - Approved\\n\\nJohn Doe\\nCard Number: **** **** **** 9426\\nCard Type: Mastercard\\nRef #: 33489691\\nAuth Code: VTLMC1\\n\\nTxn Amt $10.00\\nCash Discount $0.00\\n\\nTotal Authorized Amt $10.40\\n\\nOrder Number: 11518\\nOrder Date: 11/24/2020 12:00:00 AM\\nOrder Details: order details\\n\\nCUSTOMER ACKNOWLEDGES RECEIPT OF \\n GOODS AND/OR SERVICES IN THE AMOUNT \\n OF THE TOTAL SHOWN HEREON AND AGREES \\n TO PERFORM THE OBLIGATIONS SET FORTH \\n BY THE CUSTOMER`S AGREEMENT WITH THE \\n ISSUER\\n APPROVED \\n\\n \\n \\n\\n Customer Copy\\n",
"enhancedData": {},
"card": {
"first6": "548647",
"last4": "9426",
"cardNumber": "inkpSUbbYay59426",
"cardNumberHashed": "OzF5YGq3YeBLnEeMpD5PXixZz2guba1nrzeZcnS+W1Q=",
"cardHolderName": "John Doe",
"cardType": "Mastercard",
"expirationDate": "2025-12",
"customer": {
"guid": "1dea1f06-efb8-4062-8a3a-1a64aabd10e8",
"merchantGuid": "cd3d0150-819c-44b9-9nju-2fa248fcacce",
"firstName": "John",
"lastName": "Doe",
"dateOfBirth": "1987-07-07T00:00:00",
"address1": "107 7th Av.",
"zip": "10007",
"city": "New York",
"state": "NY",
"stateFullName": "New York",
"country": "US",
"phone": "9177563007",
"email": "johnd@mailinator.com",
"ssN4": "1210",
"driverLicenseNumber": "12345678",
"driverLicenseState": "TX",
"driverLicenseExpirationDate": "2030-12-12T00:00:00",
"dlStateFullName": "Texas",
"personalPhone": "9177563007",
"status": "Active",
"displayName": "John Doe - 9177563007"
}
},
"associateCustomerCard": true,
"sequenceNumber": "820001",
"addressVerificationCode": "N",
"addressVerificationResult": "No Match",
"cvvVerificationCode": "M",
"cvvVerificationResult": "Passed"
}
Json Example Error Response:
{
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"traceId": "00-5495f1fc8f00492441a3b2540d309096-3c5ac05d4e3bf6d2-00",
"errors": {
"guid": [
"The value 'wrongGuid' is not valid."
]
}
}
This endpoint gets an AuthOnly.
HTTP Request
GET https://sandbox.choice.dev/api/v1/AuthOnlys/<guid>
Headers using token
Key | Value |
---|---|
Authorization | Token. Eg: "Bearer eHSN5rTBzqDozgAAlN1UlTMVuIT1zSiAZWCo6E..." |
Headers using API Key
Key | Value |
---|---|
UserAuthorization | API Key. Eg: "e516b6db-3230-4b1c-ae3f-e5379b774a80" |
URL Parameters
Parameter | Description |
---|---|
guid | AuthOnly’s guid to get |
Response
- 200 code (ok).
Timeout Reversal
using System;
using Newtonsoft.Json;
using System.IO;
using System.Net;
using System.Text;
namespace ChoiceSample
{
public class Sale
{
public static void TimeoutReversal()
{
try
{
var request = (HttpWebRequest)WebRequest.Create("https://sandbox.choice.dev/api/v1/AuthOnlys/timeoutreversal");
request.ContentType = "text/json";
request.Method = "POST";
var sale = new
{
DeviceGuid = "b29725af-b067-4a35-9819-bbb31bdf8808",
SequenceNumber = "849741"
};
string json = JsonConvert.SerializeObject(sale);
request.Headers.Add("Authorization", "Bearer 1A089D6ziUybPZFQ3mpPyjt9OEx9yrCs7eQIC6V3A0lmXR2N6-seGNK16Gsnl3td6Ilfbr2Xf_EyukFXwnVEO3fYL-LuGw-L3c8WuaoxhPE8MMdlMPILJTIOV3lTGGdxbFXdKd9U03bbJ9TDUkqxHqq8_VyyjDrw7fs0YOob7bg0OovXTeWgIvZaIrSR1WFR06rYJ0DfWn-Inuf7re1-4SMOjY1ZoCelVwduWCBJpw1111cNbWtHJfObV8u1CVf0");
request.ContentType = "application/json";
request.Accept = "application/json";
using (var streamWriter = new StreamWriter(request.GetRequestStream()))
{
streamWriter.Write(json);
streamWriter.Flush();
streamWriter.Close();
}
try
{
var response = (HttpWebResponse)request.GetResponse();
using (var reader = new StreamReader(response.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)response.StatusCode);
Console.WriteLine();
Console.WriteLine(response.StatusDescription);
Console.WriteLine(result);
}
}
catch (WebException wex)
{
if (wex.Response != null)
{
using (var errorResponse = (HttpWebResponse)wex.Response)
{
using (var reader = new StreamReader(errorResponse.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)errorResponse.StatusCode);
Console.WriteLine();
Console.WriteLine(errorResponse.StatusDescription);
Console.WriteLine(result);
}
}
}
}
}
catch (IOException e)
{
Console.WriteLine(e);
}
}
}
}
Json Example Request:
{
"DeviceGuid": "b29725af-b067-4a35-9819-bbb31bdf8808",
"SequenceNumber": "849741"
}
Json Example Response:
"Device Guid and Sequence Number combination found and voided."
Json Example Error Response:
{
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"traceId": "00-5495f1fc8f00492441a3b2540d309096-3c5ac05d4e3bf6d2-00",
"errors": {
"guid": [
"The value 'wrongGuid' is not valid."
]
}
}
This a feature that allows a user to void a transaction if it never got a response. You must send the device guid of the terminal used to run the transaction and the sequence number. If there was a sale run on that device with that sequence and it was approved, it will be voided. Otherwise you will be informed that a sale was found but it had not been approved or that there was no sale at all with that combination of device guid and sequence number.
HTTP Request
POST https://sandbox.choice.dev/api/v1/AuthOnlys/timeoutreversal
Headers using token
Key | Value |
---|---|
Content-Type | "application/json" |
Authorization | Token. Eg: "Bearer eHSN5rTBzqDozgAAlN1UlTMVuIT1zSiAZWCo6E..." |
Headers using API Key
Key | Value |
---|---|
Content-Type | "application/json" |
UserAuthorization | API Key. Eg: "e516b6db-3230-4b1c-ae3f-e5379b774a80" |
Query Parameters
Parameter | Type | M/C/O | Value |
---|---|---|---|
DeviceGuid | string | Mandatory | Device's Guid. |
SequenceNumber | string | Mandatory | Sequence Number. Max Length = 100. |
Response
- 201 code (created).
Capture
Create capture
using System;
using Newtonsoft.Json;
using System.IO;
using System.Net;
using System.Text;
namespace ChoiceSample
{
public class Capture
{
public static void CreateCapture()
{
try
{
var request = (HttpWebRequest)WebRequest.Create("https://sandbox.choice.dev/api/v1/Captures");
request.ContentType = "text/json";
request.Method = "POST";
var capture = new
{
DeviceGuid = "b29725af-b067-4a35-9819-bbb31bdf8808",
AuthOnlyGuid = "493cffed-232a-4896-b9ca-36b543d7da13",
NewAmount = 10.00
};
string json = JsonConvert.SerializeObject(capture);
request.Headers.Add("Authorization", "Bearer 1A089D6ziUybPZFQ3mpPyjt9OEx9yrCs7eQIC6V3A0lmXR2N6-seGNK16Gsnl3td6Ilfbr2Xf_EyukFXwnVEO3fYL-LuGw-L3c8WuaoxhPE8MMdlMPILJTIOV3lTGGdxbFXdKd9U03bbJ9TDUkqxHqq8_VyyjDrw7fs0YOob7bg0OovXTeWgIvZaIrSR1WFR06rYJ0DfWn-Inuf7re1-4SMOjY1ZoCelVwduWCBJpw1111cNbWtHJfObV8u1CVf0");
request.ContentType = "application/json";
request.Accept = "application/json";
using (var streamWriter = new StreamWriter(request.GetRequestStream()))
{
streamWriter.Write(json);
streamWriter.Flush();
streamWriter.Close();
}
try
{
var response = (HttpWebResponse)request.GetResponse();
using (var reader = new StreamReader(response.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)response.StatusCode);
Console.WriteLine();
Console.WriteLine(response.StatusDescription);
Console.WriteLine(result);
}
}
catch (WebException wex)
{
if (wex.Response != null)
{
using (var errorResponse = (HttpWebResponse)wex.Response)
{
using (var reader = new StreamReader(errorResponse.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)errorResponse.StatusCode);
Console.WriteLine();
Console.WriteLine(errorResponse.StatusDescription);
Console.WriteLine(result);
}
}
}
}
}
catch (IOException e)
{
Console.WriteLine(e);
}
}
}
}
Json Example Request:
{
"DeviceGuid" : "b29725af-b067-4a35-9819-bbb31bdf8808",
"AuthOnlyGuid" : "493cffed-232a-4896-b9ca-36b543d7da13",
"NewAmount" : 10.00,
"SemiIntegrated": true
}
Json Example Response:
{
"guid": "284dd923-a266-4d0f-80bd-e8441154c742",
"status": "Transaction - Approved",
"timeStamp": "2023-06-28T13:53:54.79-05:00",
"deviceGuid": "b29725af-b067-4a35-9819-bbb31bdf8808",
"authOnlyGuid": "493cffed-232a-4896-b9ca-36b543d7da13",
"saleGuid": "61e6769f-ead3-4e58-906a-24a86a1110be",
"authOnlyReferenceNumber": "33489799",
"newAmount": 10.400,
"grossAmount": 10.000,
"effectiveAmount": 10.400,
"dualPricingFeeAmount": 0.400,
"processorStatusCode": "A0000",
"processorResponseMessage": "Success, HostRef#: | TAMT: 10.4",
"wasProcessed": true,
"authCode": "VTLMC1",
"refNumber": "33489799",
"invoiceNumber": "",
"customerReceipt": "CHOICE MERCHANT SOLUTIONS \\n 8320 S HARDY DR \\n TEMPE AZ 85284 \\n06/28/2023 11:53:54\\n\\n CREDIT - SALE \\n\\nCARD # : **** **** **** 9426\\nCARD TYPE :MASTERCARD\\nEntry Mode : MANUAL\\n\\nTRANSACTION ID : 33489799 \\nInvoice number : 11518 \\nAUTH CODE : VTLMC1\\nSubtotal: $10.40\\n--------------------------------------\\nTotal: $10.40\\n--------------------------------------\\n\\n\\n\\n John Doe \\n\\n CUSTOMER ACKNOWLEDGES RECEIPT OF \\n GOODS AND/OR SERVICES IN THE AMOUNT \\n OF THE TOTAL SHOWN HEREON AND AGREES \\n TO PERFORM THE OBLIGATIONS SET FORTH \\n BY THE CUSTOMER`S AGREEMENT WITH THE \\n ISSUER\\n APPROVED \\n\\n \\n \\n\\n Customer Copy",
"authOnly": {
"guid": "bc0fadd8-406e-4120-9d06-f83e739b54c0",
"status": "Transaction - Approved",
"timeStamp": "2023-06-28T13:53:52.67-05:00",
"amount": 10.400,
"grossAmount": 10.000,
"effectiveAmount": 10.400,
"dualPricingFeeAmount": 0.400,
"orderNumber": "11518",
"orderDate": "2020-11-24T00:00:00",
"deviceGuid": "397eb067-2ebf-4934-bbb4-ace4e4a6194e",
"customData": "order details",
"cardDataSource": "INTERNET",
"customerLabel": "Patient",
"customerID": "xt147",
"batchGuid": "00000000-0000-0000-0000-000000000000",
"sendReceipt": true,
"allowCardEmv": false,
"processorStatusCode": "A0000",
"processorResponseMessage": "Success, HostRef#: 317918750507",
"wasProcessed": true,
"authCode": "VTLMC1",
"refNumber": "33489799",
"invoiceNumber": "",
"customerReceipt": "CHOICE MERCHANT SOLUTIONS \\n 8320 S HARDY DR \\n TEMPE AZ 85284\\n06/28/2023 14:06:52 \\n\\nCREDIT - AUTH ONLY\\nTransaction - Approved\\n\\nJohn Doe\\nCard Number: **** **** **** 9426\\nCard Type: Mastercard\\nRef #: 33489799\\nAuth Code: VTLMC1\\n\\nTxn Amt $10.00\\nCash Discount $0.00\\n\\nTotal Authorized Amt $10.40\\n\\nOrder Number: 11518\\nOrder Date: 11/24/2020 12:00:00 AM\\nOrder Details: order details\\n\\nCUSTOMER ACKNOWLEDGES RECEIPT OF \\n GOODS AND/OR SERVICES IN THE AMOUNT \\n OF THE TOTAL SHOWN HEREON AND AGREES \\n TO PERFORM THE OBLIGATIONS SET FORTH \\n BY THE CUSTOMER`S AGREEMENT WITH THE \\n ISSUER\\n APPROVED \\n\\n \\n \\n\\n Customer Copy\\n",
"enhancedData": {},
"card": {
"first6": "548647",
"last4": "9426",
"cardNumber": "inkpSUbbYay59426",
"cardNumberHashed": "OzF5YGq3YeBLnEeMpD5PXixZz2guba1nrzeZcnS+W1Q=",
"cardHolderName": "John Doe",
"cardType": "Mastercard",
"expirationDate": "2025-12",
"customer": {
"guid": "0d701720-5407-4d95-ad35-29d7dc2c876b",
"merchantGuid": "cd3d0150-819c-44b9-8efd-2fa248fcacce",
"firstName": "John",
"lastName": "Doe",
"dateOfBirth": "1987-07-07T00:00:00",
"address1": "107 7th Av.",
"zip": "10007",
"city": "New York",
"state": "NY",
"stateFullName": "New York",
"country": "US",
"phone": "9177563007",
"email": "johnd@mailinator.com",
"ssN4": "1210",
"driverLicenseNumber": "12345678",
"driverLicenseState": "TX",
"driverLicenseExpirationDate": "2030-12-12T00:00:00",
"dlStateFullName": "Texas",
"personalPhone": "9177563007",
"status": "Active",
"displayName": "John Doe - 9177563007"
}
},
"associateCustomerCard": true,
"sequenceNumber": "300001",
"addressVerificationCode": "N",
"addressVerificationResult": "No Match",
"cvvVerificationCode": "M",
"cvvVerificationResult": "Passed"
},
"relatedSale": {
"guid": "61e6769f-ead3-4e58-906a-24a86a1110be",
"status": "Transaction - Approved",
"batchStatus": "Batch - Open",
"timeStamp": "2023-06-28T13:53:54.79-05:00",
"deviceGuid": "397eb067-2ebf-4934-bbb4-ace4e4a6194e",
"amount": 10.400,
"effectiveAmount": 10.400,
"dualPricingFeeAmount": 0.400,
"grossAmount": 10.000,
"cardDataSource": "INTERNET",
"batchGuid": "9fca53a2-5d5b-44f0-bff3-b04f577405ce",
"processorStatusCode": "A0000",
"processorResponseMessage": "Success, HostRef#: | TAMT: 10.4",
"wasProcessed": true,
"authCode": "VTLMC1",
"refNumber": "33489799",
"customerReceipt": "CHOICE MERCHANT SOLUTIONS \\n 8320 S HARDY DR \\n TEMPE AZ 85284 \\n06/28/2023 11:53:54\\n\\n CREDIT - SALE \\n\\nCARD # : **** **** **** 9426\\nCARD TYPE :MASTERCARD\\nEntry Mode : MANUAL\\n\\nTRANSACTION ID : 33489799 \\nInvoice number : 11518 \\nAUTH CODE : VTLMC1\\nSubtotal: $10.40\\n--------------------------------------\\nTotal: $10.40\\n--------------------------------------\\n\\n\\n\\n John Doe \\n\\n CUSTOMER ACKNOWLEDGES RECEIPT OF \\n GOODS AND/OR SERVICES IN THE AMOUNT \\n OF THE TOTAL SHOWN HEREON AND AGREES \\n TO PERFORM THE OBLIGATIONS SET FORTH \\n BY THE CUSTOMER`S AGREEMENT WITH THE \\n ISSUER\\n APPROVED \\n\\n \\n \\n\\n Customer Copy",
"generatedBy": "merchadmtest",
"card": {
"first6": "548647",
"last4": "9426",
"cardNumber": "inkpSUbbYay59426",
"cardNumberHashed": "OzF5YGq3YeBLnEeMpD5PXixZz2guba1nrzeZcnS+W1Q=",
"cardHolderName": "John Doe",
"cardType": "Mastercard",
"expirationDate": "2025-12",
"customer": {
"guid": "0d701720-5407-4d95-ad35-29d7dc2c876b",
"merchantGuid": "cd3d0150-819c-44b9-8efd-2fa248fcacce",
"firstName": "John",
"lastName": "Doe",
"dateOfBirth": "1987-07-07T00:00:00",
"address1": "107 7th Av.",
"zip": "10007",
"city": "New York",
"state": "NY",
"stateFullName": "New York",
"country": "US",
"phone": "9177563007",
"email": "johnd@mailinator.com",
"ssN4": "1210",
"driverLicenseNumber": "12345678",
"driverLicenseState": "TX",
"driverLicenseExpirationDate": "2030-12-12T00:00:00",
"dlStateFullName": "Texas",
"personalPhone": "9177563007",
"status": "Active",
"displayName": "John Doe - 9177563007"
}
},
"hostedPaymentPageGuid": "00000000-0000-0000-0000-000000000000"
}
}
Json Example Error Response:
{
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"traceId": "00-f68d0721a8ba8297ec49f34b747734f3-3847f3b8e10c085a-00",
"errors": {
"DeviceGuid": [
"The field DeviceGuid is invalid."
]
}
}
The Capture transaction is used to collect the money that you had asked during the AuthOnly transaction. You need to provide the AuthOnlyGuid that you received when you ran the AuthOnly.
This endpoint creates a capture.
HTTP Request
POST https://sandbox.choice.dev/api/v1/Captures
Headers using token
Key | Value |
---|---|
Content-Type | "application/json" |
Authorization | Token. Eg: "Bearer eHSN5rTBzqDozgAAlN1UlTMVuIT1zSiAZWCo6E..." |
Headers using API Key
Key | Value |
---|---|
Content-Type | "application/json" |
UserAuthorization | API Key. Eg: "e516b6db-3230-4b1c-ae3f-e5379b774a80" |
Query Parameters
Parameter | Type | M/C/O | Value |
---|---|---|---|
DeviceGuid | string | Mandatory | Device’s Guid. |
AuthOnlyGuid | string | Mandatory | AuthOnly’s Guid. |
NewAmount | decimal | Optional | Transaction's new amount. Min. amt.: $0.50 |
Response
- 201 code (created).
Get capture
using System;
using Newtonsoft.Json;
using System.IO;
using System.Net;
using System.Text;
namespace ChoiceSample
{
public class Capture
{
public static void GetCapture()
{
try
{
var request = (HttpWebRequest)WebRequest.Create("https://sandbox.choice.dev/api/v1/Captures/284dd923-a266-4d0f-80bd-e8441154c742");
request.Method = "GET";
request.Headers.Add("Authorization", "Bearer 1A089D6ziUybPZFQ3mpPyjt9OEx9yrCs7eQIC6V3A0lmXR2N6-seGNK16Gsnl3td6Ilfbr2Xf_EyukFXwnVEO3fYL-LuGw-L3c8WuaoxhPE8MMdlMPILJTIOV3lTGGdxbFXdKd9U03bbJ9TDUkqxHqq8_VyyjDrw7fs0YOob7bg0OovXTeWgIvZaIrSR1WFR06rYJ0DfWn-Inuf7re1-4SMOjY1ZoCelVwduWCBJpw1111cNbWtHJfObV8u1CVf0");
try
{
var response = (HttpWebResponse)request.GetResponse();
using (var reader = new StreamReader(response.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)response.StatusCode);
Console.WriteLine();
Console.WriteLine(response.StatusDescription);
Console.WriteLine(result);
}
}
catch (WebException wex)
{
if (wex.Response != null)
{
using (var errorResponse = (HttpWebResponse)wex.Response)
{
using (var reader = new StreamReader(errorResponse.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)errorResponse.StatusCode);
Console.WriteLine();
Console.WriteLine(errorResponse.StatusDescription);
Console.WriteLine(result);
}
}
}
}
}
catch (IOException e)
{
Console.WriteLine(e);
}
}
}
}
Json Example Response:
{
"guid": "cc7dcd9f-3a6e-43cb-8c78-8b03a03f2016",
"status": "Transaction - Approved",
"timeStamp": "2023-06-28T13:55:45.32-05:00",
"deviceGuid": "397eb067-2ebf-4934-bbb4-ace4e4a6194e",
"authOnlyGuid": "20724d1f-4193-4720-9b64-2c71f7d4ff1f",
"saleGuid": "c17c69aa-571f-4956-b620-11fdce37b84a",
"authOnlyReferenceNumber": "33489917",
"newAmount": 10.400,
"grossAmount": 10.000,
"effectiveAmount": 10.400,
"dualPricingFeeAmount": 0.400,
"processorStatusCode": "A0000",
"processorResponseMessage": "Success, HostRef#: | TAMT: 10.4",
"wasProcessed": true,
"authCode": "VTLMC1",
"refNumber": "33489917",
"invoiceNumber": "",
"customerReceipt": "CHOICE MERCHANT SOLUTIONS \\n 8320 S HARDY DR \\n TEMPE AZ 85284 \\n06/28/2023 11:55:45\\n\\n CREDIT - SALE \\n\\nCARD # : **** **** **** 9426\\nCARD TYPE :MASTERCARD\\nEntry Mode : MANUAL\\n\\nTRANSACTION ID : 33489917 \\nInvoice number : 11518 \\nAUTH CODE : VTLMC1\\nSubtotal: $10.40\\n--------------------------------------\\nTotal: $10.40\\n--------------------------------------\\n\\n\\n\\n John Doe \\n\\n CUSTOMER ACKNOWLEDGES RECEIPT OF \\n GOODS AND/OR SERVICES IN THE AMOUNT \\n OF THE TOTAL SHOWN HEREON AND AGREES \\n TO PERFORM THE OBLIGATIONS SET FORTH \\n BY THE CUSTOMER`S AGREEMENT WITH THE \\n ISSUER\\n APPROVED \\n\\n \\n \\n\\n Customer Copy",
"authOnly": {
"guid": "20724d1f-4193-4720-9b64-2c71f7d4ff1f",
"status": "Transaction - Approved",
"timeStamp": "2023-06-28T13:55:44.02-05:00",
"amount": 10.400,
"grossAmount": 10.000,
"effectiveAmount": 10.400,
"dualPricingFeeAmount": 0.400,
"orderNumber": "11518",
"orderDate": "2020-11-24T00:00:00",
"deviceGuid": "397eb067-2ebf-4934-bbb4-ace4e4a6194e",
"customData": "order details",
"cardDataSource": "INTERNET",
"customerLabel": "Patient",
"customerID": "xt147",
"batchGuid": "00000000-0000-0000-0000-000000000000",
"sendReceipt": true,
"allowCardEmv": false,
"processorStatusCode": "A0000",
"processorResponseMessage": "Success, HostRef#: 317918750755",
"wasProcessed": true,
"authCode": "VTLMC1",
"refNumber": "33489917",
"invoiceNumber": "",
"customerReceipt": "CHOICE MERCHANT SOLUTIONS \\n 8320 S HARDY DR \\n TEMPE AZ 85284\\n06/28/2023 14:06:44 \\n\\nCREDIT - AUTH ONLY\\nTransaction - Approved\\n\\nJohn Doe\\nCard Number: **** **** **** 9426\\nCard Type: Mastercard\\nRef #: 33489917\\nAuth Code: VTLMC1\\n\\nTxn Amt $10.00\\nCash Discount $0.00\\n\\nTotal Authorized Amt $10.40\\n\\nOrder Number: 11518\\nOrder Date: 11/24/2020 12:00:00 AM\\nOrder Details: order details\\n\\nCUSTOMER ACKNOWLEDGES RECEIPT OF \\n GOODS AND/OR SERVICES IN THE AMOUNT \\n OF THE TOTAL SHOWN HEREON AND AGREES \\n TO PERFORM THE OBLIGATIONS SET FORTH \\n BY THE CUSTOMER`S AGREEMENT WITH THE \\n ISSUER\\n APPROVED \\n\\n \\n \\n\\n Customer Copy\\n",
"enhancedData": {},
"card": {
"first6": "548647",
"last4": "9426",
"cardNumber": "inkpSUbbYay59426",
"cardNumberHashed": "OzF5YGq3YeBLnEeMpD5PXixZz2guba1nrzeZcnS+W1Q=",
"cardHolderName": "John Doe",
"cardType": "Mastercard",
"expirationDate": "2025-12",
"customer": {
"guid": "0d701720-5407-4d95-ad35-29d7dc2c876b",
"merchantGuid": "cd3d0150-819c-44b9-8efd-2fa248fcacce",
"firstName": "John",
"lastName": "Doe",
"dateOfBirth": "1987-07-07T00:00:00",
"address1": "107 7th Av.",
"zip": "10007",
"city": "New York",
"state": "NY",
"stateFullName": "New York",
"country": "US",
"phone": "9177563007",
"email": "johnd@mailinator.com",
"ssN4": "1210",
"driverLicenseNumber": "12345678",
"driverLicenseState": "TX",
"driverLicenseExpirationDate": "2030-12-12T00:00:00",
"dlStateFullName": "Texas",
"personalPhone": "9177563007",
"status": "Active",
"displayName": "John Doe - 9177563007"
}
},
"associateCustomerCard": true,
"sequenceNumber": "8560001",
"addressVerificationCode": "N",
"addressVerificationResult": "No Match",
"cvvVerificationCode": "M",
"cvvVerificationResult": "Passed"
},
"relatedSale": {
"guid": "c17c69aa-571f-4956-b620-11fdce37b84a",
"status": "Transaction - Approved",
"batchStatus": "Batch - Open",
"timeStamp": "2023-06-28T13:55:45.32-05:00",
"deviceGuid": "397eb067-2ebf-4934-bbb4-ace4e4a6194e",
"amount": 10.400,
"effectiveAmount": 10.400,
"dualPricingFeeAmount": 0.400,
"grossAmount": 10.000,
"cardDataSource": "INTERNET",
"batchGuid": "9fca53a2-5d5b-44f0-bff3-b04f577405ce",
"processorStatusCode": "A0000",
"processorResponseMessage": "Success, HostRef#: | TAMT: 10.4",
"wasProcessed": true,
"authCode": "VTLMC1",
"refNumber": "33489917",
"customerReceipt": "CHOICE MERCHANT SOLUTIONS \\n 8320 S HARDY DR \\n TEMPE AZ 85284 \\n06/28/2023 11:55:45\\n\\n CREDIT - SALE \\n\\nCARD # : **** **** **** 9426\\nCARD TYPE :MASTERCARD\\nEntry Mode : MANUAL\\n\\nTRANSACTION ID : 33489917 \\nInvoice number : 11518 \\nAUTH CODE : VTLMC1\\nSubtotal: $10.40\\n--------------------------------------\\nTotal: $10.40\\n--------------------------------------\\n\\n\\n\\n John Doe \\n\\n CUSTOMER ACKNOWLEDGES RECEIPT OF \\n GOODS AND/OR SERVICES IN THE AMOUNT \\n OF THE TOTAL SHOWN HEREON AND AGREES \\n TO PERFORM THE OBLIGATIONS SET FORTH \\n BY THE CUSTOMER`S AGREEMENT WITH THE \\n ISSUER\\n APPROVED \\n\\n \\n \\n\\n Customer Copy",
"generatedBy": "merchadmtest",
"card": {
"first6": "548647",
"last4": "9426",
"cardNumber": "inkpSUbbYay59426",
"cardNumberHashed": "OzF5YGq3YeBLnEeMpD5PXixZz2guba1nrzeZcnS+W1Q=",
"cardHolderName": "John Doe",
"cardType": "Mastercard",
"expirationDate": "2025-12",
"customer": {
"guid": "0d701720-5407-4d95-ad35-29d7dc2c876b",
"merchantGuid": "cd3d0150-819c-44b9-8efd-2fa248fcacce",
"firstName": "John",
"lastName": "Doe",
"dateOfBirth": "1987-07-07T00:00:00",
"address1": "107 7th Av.",
"zip": "10007",
"city": "New York",
"state": "NY",
"stateFullName": "New York",
"country": "US",
"phone": "9177563007",
"email": "johnd@mailinator.com",
"ssN4": "1210",
"driverLicenseNumber": "12345678",
"driverLicenseState": "TX",
"driverLicenseExpirationDate": "2030-12-12T00:00:00",
"dlStateFullName": "Texas",
"personalPhone": "9177563007",
"status": "Active",
"displayName": "John Doe - 9177563007"
}
},
"hostedPaymentPageGuid": "00000000-0000-0000-0000-000000000000"
}
}
Json Example Error Response:
{
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"traceId": "00-f68d0721a8ba8297ec49f34b747734f3-3847f3b8e10c085a-00",
"errors": {
"DeviceGuid": [
"The field 'wrongGuid' is invalid."
]
}
}
This endpoint gets a capture.
HTTP Request
GET https://sandbox.choice.dev/api/v1/Captures/<guid>
Headers using token
Key | Value |
---|---|
Authorization | Token. Eg: "Bearer eHSN5rTBzqDozgAAlN1UlTMVuIT1zSiAZWCo6E..." |
Headers using API Key
Key | Value |
---|---|
UserAuthorization | API Key. Eg: "e516b6db-3230-4b1c-ae3f-e5379b774a80" |
URL Parameters
Parameter | Description |
---|---|
guid | Capture’s guid to get |
Response
- 200 code (ok).
Void
Create void
using System;
using Newtonsoft.Json;
using System.IO;
using System.Net;
using System.Text;
namespace ChoiceSample
{
public class Void
{
public static void CreateVoid()
{
try
{
var request = (HttpWebRequest)WebRequest.Create("https://sandbox.choice.dev/api/v1/void");
request.ContentType = "text/json";
request.Method = "POST";
var void1 = new
{
DeviceGuid = "b29725af-b067-4a35-9819-bbb31bdf8808",
SaleGuid = "c7a9a2a6-08bb-42c5-acc6-f20d39c7f5de",
VoidReason = "DEVICE_TIMEOUT"
};
string json = JsonConvert.SerializeObject(void1);
request.Headers.Add("Authorization", "Bearer 1A089D6ziUybPZFQ3mpPyjt9OEx9yrCs7eQIC6V3A0lmXR2N6-seGNK16Gsnl3td6Ilfbr2Xf_EyukFXwnVEO3fYL-LuGw-L3c8WuaoxhPE8MMdlMPILJTIOV3lTGGdxbFXdKd9U03bbJ9TDUkqxHqq8_VyyjDrw7fs0YOob7bg0OovXTeWgIvZaIrSR1WFR06rYJ0DfWn-Inuf7re1-4SMOjY1ZoCelVwduWCBJpw1111cNbWtHJfObV8u1CVf0");
request.ContentType = "application/json";
request.Accept = "application/json";
using (var streamWriter = new StreamWriter(request.GetRequestStream()))
{
streamWriter.Write(json);
streamWriter.Flush();
streamWriter.Close();
}
try
{
var response = (HttpWebResponse)request.GetResponse();
using (var reader = new StreamReader(response.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)response.StatusCode);
Console.WriteLine();
Console.WriteLine(response.StatusDescription);
Console.WriteLine(result);
}
}
catch (WebException wex)
{
if (wex.Response != null)
{
using (var errorResponse = (HttpWebResponse)wex.Response)
{
using (var reader = new StreamReader(errorResponse.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)errorResponse.StatusCode);
Console.WriteLine();
Console.WriteLine(errorResponse.StatusDescription);
Console.WriteLine(result);
}
}
}
}
}
catch (IOException e)
{
Console.WriteLine(e);
}
}
}
}
Json Example Request:
{
"DeviceGuid" : "b29725af-b067-4a35-9819-bbb31bdf8808",
"SaleGuid": "c7a9a2a6-08bb-42c5-acc6-f20d39c7f5de",
"VoidReason": "DEVICE_TIMEOUT",
"SemiIntegrated": true
}
Json Example Response:
{
"guid": "240410b2-4cf4-4d70-908f-eec4bd68fa96",
"batchStatus": "Batch - Open",
"timeStamp": "2023-06-28T13:57:13.97-05:00",
"deviceGuid": "397eb067-2ebf-4934-bbb4-ace4e4a6194e",
"saleGuid": "d892f30e-ad1a-4e5f-8fea-a63fbb28ddcd",
"status": "Transaction - Approved",
"voidReason": "DEVICE_TIMEOUT",
"processorStatusCode": "A0000",
"wasProcessed": true,
"batchGuid": "9fca53a2-5d5b-44f0-bff3-b04f577405ce",
"authCode": "VTLMC1",
"refNumber": "33489989",
"invoiceNumber": "11518",
"customerReceipt": " Value stated by the user \\n 8320 S HARDY DR \\n TEMPE AZ 85284 \\n06/28/2023 11:57:13\\n\\n CREDIT - VOID \\n\\nCARD # : **** **** **** 0213\\nCARD TYPE :MASTERCARD\\nEntry Mode : MANUAL\\n\\nTRANSACTION ID : 33489989 \\nInvoice number : 11518 \\nAUTH CODE : VTLMC1\\nVoid Amount: $20.54\\n--------------------------------------\\n\\n\\n\\n John Doe \\n\\n CUSTOMER ACKNOWLEDGES RECEIPT OF \\n GOODS AND/OR SERVICES IN THE AMOUNT \\n OF THE TOTAL SHOWN HEREON AND AGREES \\n TO PERFORM THE OBLIGATIONS SET FORTH \\n BY THE CUSTOMER`S AGREEMENT WITH THE \\n ISSUER\\n APPROVED \\n\\n \\n \\n\\n Customer Copy ",
"sale": {
"guid": "d892f30e-ad1a-4e5f-8fea-a63fbb28ddcd",
"status": "Transaction - Approved",
"batchStatus": "Batch - Open",
"timeStamp": "2023-06-28T13:57:11.30-05:00",
"deviceGuid": "397eb067-2ebf-4934-bbb4-ace4e4a6194e",
"amount": 20.540,
"currencyQuote": 1.000,
"currency": "USD",
"effectiveAmount": 0.000,
"dualPricingFeeAmount": 0.400,
"grossAmount": 20.140,
"orderNumber": "11518",
"orderDate": "2020-11-24T00:00:00.00-06:00",
"cardDataSource": "INTERNET",
"customerLabel": "Patient",
"businessName": "Star Shoes California",
"customerID": "xt147",
"batchGuid": "9fca53a2-5d5b-44f0-bff3-b04f577405ce",
"semiIntegrated": false,
"processorStatusCode": "A0000",
"processorResponseMessage": "Success, HostRef#: 317918750942",
"wasProcessed": true,
"authCode": "VTLMC1",
"refNumber": "33489989",
"customerReceipt": "Value stated by the user \\n 8320 S HARDY DR \\n TEMPE AZ 85284\\n06/28/2023 14:06:11 \\n\\nCREDIT - SALE\\nTransaction - Approved\\n\\nJohn Doe\\nCard Number: **** **** **** 0213\\nCard Type: Mastercard\\nRef #: 33489989\\nAuth Code: VTLMC1\\n\\nTxn Amt $20.14\\nCash Discount $0.00\\n\\nTotal Amt $20.54\\n\\nOrder Number: 11518\\nCustomer Red Id: xt147\\nOrder Date: 11/24/2020 12:00:00 AM\\nOrder Details: order details\\n\\nCUSTOMER ACKNOWLEDGES RECEIPT OF \\n GOODS AND/OR SERVICES IN THE AMOUNT \\n OF THE TOTAL SHOWN HEREON AND AGREES \\n TO PERFORM THE OBLIGATIONS SET FORTH \\n BY THE CUSTOMER`S AGREEMENT WITH THE \\n ISSUER\\n APPROVED \\n\\n \\n \\n\\n Customer Copy\\n",
"statementDescription": "Value stated by the user",
"customData": "order details",
"generatedBy": "merchadmtest",
"card": {
"first6": "530676",
"last4": "0213",
"cardNumber": "1zcGT7J4pkGh0213",
"cardNumberHashed": "1iyRPx5Pb41Bm/fFgMJiHVB+reM7mRKxHMl8feDVH7I=",
"cardHolderName": "John Doe",
"cardType": "Mastercard",
"expirationDate": "2025-01",
"customer": {
"guid": "0d701720-5407-4d95-ad35-29d7dc2c876b",
"merchantGuid": "cd3d0150-819c-44b9-8efd-2fa248fcacce",
"firstName": "John",
"lastName": "Doe",
"dateOfBirth": "1987-07-07T00:00:00",
"address1": "107 7th Av.",
"zip": "10007",
"city": "New York",
"state": "NY",
"stateFullName": "New York",
"country": "US",
"phone": "9177563007",
"email": "johnd@mailinator.com",
"ssN4": "1210",
"driverLicenseNumber": "12345678",
"driverLicenseState": "TX",
"driverLicenseExpirationDate": "2030-12-12T00:00:00",
"dlStateFullName": "Texas",
"personalPhone": "9177563007",
"status": "Active",
"displayName": "John Doe - 9177563007"
}
},
"associateCustomerCard": true,
"eciFlag": "",
"addressVerificationCode": "N",
"addressVerificationResult": "No Match",
"cvvVerificationCode": "M",
"cvvVerificationResult": "Passed",
"hostedPaymentPageGuid": "00000000-0000-0000-0000-000000000000"
},
"semiIntegrated": false
}
Json Example Error Response:
{
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"traceId": "00-315d4e8941d534dbb8830a273fc3dcb8-b24e3b6f74c6d688-00",
"errors": {
"DeviceGuid": [
"The field DeviceGuid is invalid."
],
"VoidReason": [
"The field VoidReason is invalid."
],
"SaleReferenceNumber": [
"The field SaleReferenceNumber is invalid."
],
"AuthOnlyReferenceNumber": [
"The field AuthOnlyReferenceNumber is invalid."
]
}
}
You can run a Void when you need to cancel a sale that has not been settled yet or an authOnly. To void a sale you need to provide the SaleGuid or SaleReferenceNumber that you received when you ran the Sale. To void an authOnly you need to provide the AuthOnlyGuid or AuthOnlyReferenceNumber that you received when you ran the authOnly.
This endpoint creates a void.
HTTP Request
POST https://sandbox.choice.dev/api/v1/void
Headers using token
Key | Value |
---|---|
Content-Type | "application/json" |
Authorization | Token. Eg: "Bearer eHSN5rTBzqDozgAAlN1UlTMVuIT1zSiAZWCo6E..." |
Headers using API Key
Key | Value |
---|---|
Content-Type | "application/json" |
UserAuthorization | API Key. Eg: "e516b6db-3230-4b1c-ae3f-e5379b774a80" |
Query Parameters
Parameter | Type | M/C/O | Value |
---|---|---|---|
DeviceGuid | string | Mandatory | Device’s Guid. |
SaleGuid | string | Mandatory when SaleReferenceNumber, EbtFoodStampPurchasesGuid, EbtCashBenefitPurchasesGuid, AuthOnlyGuid and AuthOnlyReferenceNumber field are not sent | Sale’s Guid. |
SaleReferenceNumber | string | Mandatory when SaleGuid, EbtFoodStampPurchasesGuid, EbtCashBenefitPurchasesGuid, AuthOnlyGuid and AuthOnlyReferenceNumber field are not sent | SaleReferenceNumber.Not allow special characters. |
AuthOnlyGuid | string | Mandatory when SaleGuid, SaleReferenceNumber EbtFoodStampPurchasesGuid, EbtCashBenefitPurchasesGuid, and AuthOnlyReferenceNumber field are not sent | AuthOnlyGuid’s Guid. |
AuthOnlyReferenceNumber | string | Mandatory when SaleGuid, EbtFoodStampPurchasesGuid, EbtCashBenefitPurchasesGuid, SaleReferenceNumber and AuthOnlyGuid field are not sent | AuthOnlyReferenceNumber. Not allow special characters. |
EbtFoodStampPurchasesGuid | string | Mandatory when SaleGuid, SaleReferenceNumber, EbtCashBenefitPurchasesGuid and AuthOnlyGuid field are not sent | EbtFoodStampPurchasesGuid. |
EbtCashBenefitPurchasesGuid | string | Mandatory when SaleGuid, SaleReferenceNumber, EbtFoodStampPurchasesGuid and AuthOnlyGuid field are not sent | EbtCashBenefitPurchasesGuid. |
VoidReason | string | Optional | Indicates the reason the transaction was voided. Allowed values: 1. POST_AUTH_USER_DECLINE 2. DEVICE_TIMEOUT 3. DEVICE_UNAVAILABLE 4. PARTIAL_REVERSAL 5. TORN_TRANSACTION 6. POST_AUTH_CHIP_DECLINE |
Note: Send either SaleGuid, SaleReferenceNumber, EbtFoodStampPurchasesGuid, EbtCashBenefitPurchasesGuid, AuthOnlyGuid or AuthOnlyReferenceNumber field in a request.
Response
- 201 code (created).
Get void
using System;
using Newtonsoft.Json;
using System.IO;
using System.Net;
using System.Text;
namespace ChoiceSample
{
public class Void
{
public static void GetVoid()
{
try
{
var request = (HttpWebRequest)WebRequest.Create("https://sandbox.choice.dev/api/v1/void/1e0f6e4b-2eb4-475f-b2c3-d49746ac244f");
request.Method = "GET";
request.Headers.Add("Authorization", "Bearer 1A089D6ziUybPZFQ3mpPyjt9OEx9yrCs7eQIC6V3A0lmXR2N6-seGNK16Gsnl3td6Ilfbr2Xf_EyukFXwnVEO3fYL-LuGw-L3c8WuaoxhPE8MMdlMPILJTIOV3lTGGdxbFXdKd9U03bbJ9TDUkqxHqq8_VyyjDrw7fs0YOob7bg0OovXTeWgIvZaIrSR1WFR06rYJ0DfWn-Inuf7re1-4SMOjY1ZoCelVwduWCBJpw1111cNbWtHJfObV8u1CVf0");
try
{
var response = (HttpWebResponse)request.GetResponse();
using (var reader = new StreamReader(response.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)response.StatusCode);
Console.WriteLine();
Console.WriteLine(response.StatusDescription);
Console.WriteLine(result);
}
}
catch (WebException wex)
{
if (wex.Response != null)
{
using (var errorResponse = (HttpWebResponse)wex.Response)
{
using (var reader = new StreamReader(errorResponse.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)errorResponse.StatusCode);
Console.WriteLine();
Console.WriteLine(errorResponse.StatusDescription);
Console.WriteLine(result);
}
}
}
}
}
catch (IOException e)
{
Console.WriteLine(e);
}
}
}
}
Json Example Response:
{
"guid": "b2641225-0f30-4bc2-93f5-242ce38caba2",
"batchStatus": "Batch - Open",
"timeStamp": "2023-06-28T13:58:43.99-05:00",
"deviceGuid": "397eb067-2ebf-4934-bbb4-ace4e4a6194e",
"saleGuid": "39da0157-b080-452c-b65a-3cd9b1ef2bde",
"status": "Transaction - Approved",
"voidReason": "DEVICE_TIMEOUT",
"processorStatusCode": "A0000",
"wasProcessed": true,
"batchGuid": "9fca53a2-5d5b-44f0-bff3-b04f577405ce",
"authCode": "VTLMC1",
"refNumber": "33490035",
"invoiceNumber": "11518",
"customerReceipt": " Value stated by the user \\n 8320 S HARDY DR \\n TEMPE AZ 85284 \\n06/28/2023 11:58:43\\n\\n CREDIT - VOID \\n\\nCARD # : **** **** **** 0213\\nCARD TYPE :MASTERCARD\\nEntry Mode : MANUAL\\n\\nTRANSACTION ID : 33490035 \\nInvoice number : 11518 \\nAUTH CODE : VTLMC1\\nVoid Amount: $20.54\\n--------------------------------------\\n\\n\\n\\n John Doe \\n\\n CUSTOMER ACKNOWLEDGES RECEIPT OF \\n GOODS AND/OR SERVICES IN THE AMOUNT \\n OF THE TOTAL SHOWN HEREON AND AGREES \\n TO PERFORM THE OBLIGATIONS SET FORTH \\n BY THE CUSTOMER`S AGREEMENT WITH THE \\n ISSUER\\n APPROVED \\n\\n \\n \\n\\n Customer Copy ",
"sale": {
"guid": "39da0157-b080-452c-b65a-3cd9b1ef2bde",
"status": "Transaction - Approved",
"batchStatus": "Batch - Open",
"timeStamp": "2023-06-28T13:58:41.87-05:00",
"deviceGuid": "397eb067-2ebf-4934-bbb4-ace4e4a6194e",
"amount": 20.540,
"currencyQuote": 1.000,
"currency": "USD",
"effectiveAmount": 0.000,
"dualPricingFeeAmount": 0.400,
"grossAmount": 20.140,
"orderNumber": "11518",
"orderDate": "2020-11-24T00:00:00.00-06:00",
"cardDataSource": "INTERNET",
"customerLabel": "Patient",
"businessName": "Star Shoes California",
"customerID": "xt147",
"batchGuid": "9fca53a2-5d5b-44f0-bff3-b04f577405ce",
"semiIntegrated": false,
"processorStatusCode": "A0000",
"processorResponseMessage": "Success, HostRef#: 317918752140",
"wasProcessed": true,
"authCode": "VTLMC1",
"refNumber": "33490035",
"customerReceipt": "Value stated by the user \\n 8320 S HARDY DR \\n TEMPE AZ 85284\\n06/28/2023 14:06:41 \\n\\nCREDIT - SALE\\nTransaction - Approved\\n\\nJohn Doe\\nCard Number: **** **** **** 0213\\nCard Type: Mastercard\\nRef #: 33490035\\nAuth Code: VTLMC1\\n\\nTxn Amt $20.14\\nCash Discount $0.00\\n\\nTotal Amt $20.54\\n\\nOrder Number: 11518\\nCustomer Red Id: xt147\\nOrder Date: 11/24/2020 12:00:00 AM\\nOrder Details: order details\\n\\nCUSTOMER ACKNOWLEDGES RECEIPT OF \\n GOODS AND/OR SERVICES IN THE AMOUNT \\n OF THE TOTAL SHOWN HEREON AND AGREES \\n TO PERFORM THE OBLIGATIONS SET FORTH \\n BY THE CUSTOMER`S AGREEMENT WITH THE \\n ISSUER\\n APPROVED \\n\\n \\n \\n\\n Customer Copy\\n",
"statementDescription": "Value stated by the user",
"customData": "order details",
"generatedBy": "merchadmtest",
"card": {
"first6": "530676",
"last4": "0213",
"cardNumber": "1zcGT7J4pkGh0213",
"cardNumberHashed": "1iyRPx5Pb41Bm/fFgMJiHVB+reM7mRKxHMl8feDVH7I=",
"cardHolderName": "John Doe",
"cardType": "Mastercard",
"expirationDate": "2025-01",
"customer": {
"guid": "0d701720-5407-4d95-ad35-29d7dc2c876b",
"merchantGuid": "cd3d0150-819c-44b9-8efd-2fa248fcacce",
"firstName": "John",
"lastName": "Doe",
"dateOfBirth": "1987-07-07T00:00:00",
"address1": "107 7th Av.",
"zip": "10007",
"city": "New York",
"state": "NY",
"stateFullName": "New York",
"country": "US",
"phone": "9177563007",
"email": "johnd@mailinator.com",
"ssN4": "1210",
"driverLicenseNumber": "12345678",
"driverLicenseState": "TX",
"driverLicenseExpirationDate": "2030-12-12T00:00:00",
"dlStateFullName": "Texas",
"personalPhone": "9177563007",
"status": "Active",
"displayName": "John Doe - 9177563007"
}
},
"associateCustomerCard": true,
"eciFlag": "",
"addressVerificationCode": "N",
"addressVerificationResult": "No Match",
"cvvVerificationCode": "M",
"cvvVerificationResult": "Passed",
"hostedPaymentPageGuid": "00000000-0000-0000-0000-000000000000"
},
"semiIntegrated": false
}
Json Example Error Response:
{
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"traceId": "00-546395b993d26b2f474b0d8cf1293767-b4c0d2c4c046a431-00",
"errors": {
"guid": [
"The value 'invalid guid' is not valid."
]
}
}
This endpoint gets a void.
HTTP Request
GET https://sandbox.choice.dev/api/v1/void/<guid>
Headers using token
Key | Value |
---|---|
Authorization | Token. Eg: "Bearer eHSN5rTBzqDozgAAlN1UlTMVuIT1zSiAZWCo6E..." |
Headers using API Key
Key | Value |
---|---|
UserAuthorization | API Key. Eg: "e516b6db-3230-4b1c-ae3f-e5379b774a80" |
URL Parameters
Parameter | Description |
---|---|
guid | Void’s guid to get |
Response
- 200 code (ok).
Return
Create return
using System;
using Newtonsoft.Json;
using System.IO;
using System.Net;
using System.Text;
namespace ChoiceSample
{
public class Return
{
public static void CreateReturn()
{
try
{
var request = (HttpWebRequest)WebRequest.Create("https://sandbox.choice.dev/api/v1/returns");
request.ContentType = "text/json";
request.Method = "POST";
var returns = new
{
DeviceGuid = "b29725af-b067-4a35-9819-bbb31bdf8808",
SaleGuid = "b4084e11-884d-468c-84d9-614c5b986fde",
Amount = 19.74
};
string json = JsonConvert.SerializeObject(returns);
request.Headers.Add("Authorization", "Bearer 1A089D6ziUybPZFQ3mpPyjt9OEx9yrCs7eQIC6V3A0lmXR2N6-seGNK16Gsnl3td6Ilfbr2Xf_EyukFXwnVEO3fYL-LuGw-L3c8WuaoxhPE8MMdlMPILJTIOV3lTGGdxbFXdKd9U03bbJ9TDUkqxHqq8_VyyjDrw7fs0YOob7bg0OovXTeWgIvZaIrSR1WFR06rYJ0DfWn-Inuf7re1-4SMOjY1ZoCelVwduWCBJpw1111cNbWtHJfObV8u1CVf0");
request.ContentType = "application/json";
request.Accept = "application/json";
using (var streamWriter = new StreamWriter(request.GetRequestStream()))
{
streamWriter.Write(json);
streamWriter.Flush();
streamWriter.Close();
}
try
{
var response = (HttpWebResponse)request.GetResponse();
using (var reader = new StreamReader(response.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)response.StatusCode);
Console.WriteLine();
Console.WriteLine(response.StatusDescription);
Console.WriteLine(result);
}
}
catch (WebException wex)
{
if (wex.Response != null)
{
using (var errorResponse = (HttpWebResponse)wex.Response)
{
using (var reader = new StreamReader(errorResponse.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)errorResponse.StatusCode);
Console.WriteLine();
Console.WriteLine(errorResponse.StatusDescription);
Console.WriteLine(result);
}
}
}
}
}
catch (IOException e)
{
Console.WriteLine(e);
}
}
}
}
Json Example Request:
{
"DeviceGuid" : "b29725af-b067-4a35-9819-bbb31bdf8808",
"SaleGuid": "b4084e11-884d-468c-84d9-614c5b986fde",
"Amount": 19.74
}
Json Example Response:
{
"guid": "9517fa8f-e164-40b0-95db-f72954cf8d87",
"batchStatus": "Batch - Open",
"timeStamp": "2023-06-28T13:59:42.84-05:00",
"deviceGuid": "397eb067-2ebf-4934-bbb4-ace4e4a6194e",
"saleGuid": "91861125-e5c1-4a79-88f4-485b55e0eaed",
"status": "Transaction - Approved",
"amount": 19.740,
"batchGuid": "9fca53a2-5d5b-44f0-bff3-b04f577405ce",
"processorStatusCode": "A0014",
"wasProcessed": true,
"authCode": "VTLMC1",
"refNumber": "33490083",
"invoiceNumber": "",
"customerReceipt": "Value stated by the user \\n 8320 S HARDY DR \\n TEMPE AZ 85284\\n06/28/2023 14:06:42 \\n\\nCREDIT - VOID\\nTransaction - Approved\\n\\nJohn Doe\\nCard Number: **** **** **** 0213\\nCard Type: Mastercard\\nRef #: 33490083\\nAuth Code: VTLMC1\\n\\nTxn Amt $19.74\\n\\nTotal Amt $19.74\\n\\nOrder Number: 11518\\nOrder Date: 11/24/2020 12:00:00 AM\\n\\nCUSTOMER ACKNOWLEDGES RECEIPT OF \\n GOODS AND/OR SERVICES IN THE AMOUNT \\n OF THE TOTAL SHOWN HEREON AND AGREES \\n TO PERFORM THE OBLIGATIONS SET FORTH \\n BY THE CUSTOMER`S AGREEMENT WITH THE \\n ISSUER\\n APPROVED \\n\\n \\n \\n\\n Customer Copy\\n",
"sale": {
"guid": "91861125-e5c1-4a79-88f4-485b55e0eaed",
"status": "Transaction - Approved",
"batchStatus": "Batch - Open",
"timeStamp": "2023-06-28T13:59:42.34-05:00",
"deviceGuid": "397eb067-2ebf-4934-bbb4-ace4e4a6194e",
"amount": 20.540,
"currencyQuote": 1.000,
"currency": "USD",
"effectiveAmount": 0.800,
"dualPricingFeeAmount": 0.400,
"grossAmount": 20.140,
"orderNumber": "11518",
"orderDate": "2020-11-24T00:00:00.00-06:00",
"cardDataSource": "INTERNET",
"customerLabel": "Patient",
"businessName": "Star Shoes California",
"customerID": "xt147",
"batchGuid": "9fca53a2-5d5b-44f0-bff3-b04f577405ce",
"semiIntegrated": false,
"processorStatusCode": "A0000",
"processorResponseMessage": "Success, HostRef#: 317918752268",
"wasProcessed": true,
"authCode": "VTLMC1",
"refNumber": "33490079",
"customerReceipt": "Value stated by the user \\n 8320 S HARDY DR \\n TEMPE AZ 85284\\n06/28/2023 14:06:42 \\n\\nCREDIT - SALE\\nTransaction - Approved\\n\\nJohn Doe\\nCard Number: **** **** **** 0213\\nCard Type: Mastercard\\nRef #: 33490079\\nAuth Code: VTLMC1\\n\\nTxn Amt $20.14\\nCash Discount $0.00\\n\\nTotal Amt $20.54\\n\\nOrder Number: 11518\\nCustomer Red Id: xt147\\nOrder Date: 11/24/2020 12:00:00 AM\\nOrder Details: order details\\n\\nCUSTOMER ACKNOWLEDGES RECEIPT OF \\n GOODS AND/OR SERVICES IN THE AMOUNT \\n OF THE TOTAL SHOWN HEREON AND AGREES \\n TO PERFORM THE OBLIGATIONS SET FORTH \\n BY THE CUSTOMER`S AGREEMENT WITH THE \\n ISSUER\\n APPROVED \\n\\n \\n \\n\\n Customer Copy\\n",
"statementDescription": "Value stated by the user",
"customData": "order details",
"generatedBy": "merchadmtest",
"card": {
"first6": "530676",
"last4": "0213",
"cardNumber": "1zcGT7J4pkGh0213",
"cardNumberHashed": "1iyRPx5Pb41Bm/fFgMJiHVB+reM7mRKxHMl8feDVH7I=",
"cardHolderName": "John Doe",
"cardType": "Mastercard",
"expirationDate": "2025-01",
"customer": {
"guid": "0d701720-5407-4d95-ad35-29d7dc2c876b",
"merchantGuid": "cd3d0150-819c-44b9-8efd-2fa248fcacce",
"firstName": "John",
"lastName": "Doe",
"dateOfBirth": "1987-07-07T00:00:00",
"address1": "107 7th Av.",
"zip": "10007",
"city": "New York",
"state": "NY",
"stateFullName": "New York",
"country": "US",
"phone": "9177563007",
"email": "johnd@mailinator.com",
"ssN4": "1210",
"driverLicenseNumber": "12345678",
"driverLicenseState": "TX",
"driverLicenseExpirationDate": "2030-12-12T00:00:00",
"dlStateFullName": "Texas",
"personalPhone": "9177563007",
"status": "Active",
"displayName": "John Doe - 9177563007"
}
},
"associateCustomerCard": true,
"eciFlag": "",
"addressVerificationCode": "N",
"addressVerificationResult": "No Match",
"cvvVerificationCode": "M",
"cvvVerificationResult": "Passed",
"hostedPaymentPageGuid": "00000000-0000-0000-0000-000000000000"
},
"currency": "USD",
"generatedBy": "merchadmtest"
}
Json Example Error Response:
{
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"traceId": "00-de875c3cd1b91a6e834ba6038b1aa233-05bb7d71b2329021-00",
"errors": {
"Amount": [
"Amount can have 3 decimal places at most."
]
}
}
You can run a Return transaction when you need to refund either a partial or the full amount of a sale that has been settled. The Return amount doesn’t need to be the same as the total amount originally charged in the sale. To refund a sale you need to provide the SaleGuid or SaleReferenceNumber that you received when you ran the Sale.
This endpoint creates a return.
HTTP Request
POST https://sandbox.choice.dev/api/v1/returns
Headers using token
Key | Value |
---|---|
Content-Type | "application/json" |
Authorization | Token. Eg: "Bearer eHSN5rTBzqDozgAAlN1UlTMVuIT1zSiAZWCo6E..." |
Headers using API Key
Key | Value |
---|---|
Content-Type | "application/json" |
UserAuthorization | API Key. Eg: "e516b6db-3230-4b1c-ae3f-e5379b774a80" |
Query Parameters
Parameter | Type | M/C/O | Value |
---|---|---|---|
DeviceGuid | string | Mandatory | Device’s Guid. |
SaleGuid | string | Mandatory when SaleReferenceNumber field is not sent | Sale’s Guid. |
SaleReferenceNumber | string | Mandatory when SaleGuid field is not sent | SaleReferenceNumber. |
Amount | decimal | Mandatory | Transaction's amount. Min. amt.: $0.50. Does not allow empty strings and up to 3 decimal places. |
Note: Send either SaleGuid or SaleReferenceNumber field in a request.
Response
- 201 code (created).
Get return
using System;
using Newtonsoft.Json;
using System.IO;
using System.Net;
using System.Text;
namespace ChoiceSample
{
public class Return
{
public static void GetReturn()
{
try
{
var request = (HttpWebRequest)WebRequest.Create("https://sandbox.choice.dev/api/v1/returns/9fb17f4e-b508-48d3-bd77-bb6813b42620");
request.Method = "GET";
request.Headers.Add("Authorization", "Bearer 1A089D6ziUybPZFQ3mpPyjt9OEx9yrCs7eQIC6V3A0lmXR2N6-seGNK16Gsnl3td6Ilfbr2Xf_EyukFXwnVEO3fYL-LuGw-L3c8WuaoxhPE8MMdlMPILJTIOV3lTGGdxbFXdKd9U03bbJ9TDUkqxHqq8_VyyjDrw7fs0YOob7bg0OovXTeWgIvZaIrSR1WFR06rYJ0DfWn-Inuf7re1-4SMOjY1ZoCelVwduWCBJpw1111cNbWtHJfObV8u1CVf0");
try
{
var response = (HttpWebResponse)request.GetResponse();
using (var reader = new StreamReader(response.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)response.StatusCode);
Console.WriteLine();
Console.WriteLine(response.StatusDescription);
Console.WriteLine(result);
}
}
catch (WebException wex)
{
if (wex.Response != null)
{
using (var errorResponse = (HttpWebResponse)wex.Response)
{
using (var reader = new StreamReader(errorResponse.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)errorResponse.StatusCode);
Console.WriteLine();
Console.WriteLine(errorResponse.StatusDescription);
Console.WriteLine(result);
}
}
}
}
}
catch (IOException e)
{
Console.WriteLine(e);
}
}
}
}
Json Example Response:
{
"guid": "312b57d4-51ba-49ef-a229-2476f226834c",
"batchStatus": "Batch - Open",
"timeStamp": "2023-06-28T14:00:49.82-05:00",
"deviceGuid": "397eb067-2ebf-4934-bbb4-ace4e4a6194e",
"saleGuid": "4cb0582e-cfb7-4ae2-8c74-4f54f84efd7f",
"status": "Transaction - Approved",
"amount": 19.740,
"batchGuid": "9fca53a2-5d5b-44f0-bff3-b04f577405ce",
"processorStatusCode": "A0014",
"wasProcessed": true,
"authCode": "VTLMC1",
"refNumber": "33490161",
"invoiceNumber": "",
"customerReceipt": "Value stated by the user \\n 8320 S HARDY DR \\n TEMPE AZ 85284\\n06/28/2023 15:06:49 \\n\\nCREDIT - VOID\\nTransaction - Approved\\n\\nJohn Doe\\nCard Number: **** **** **** 0213\\nCard Type: Mastercard\\nRef #: 33490161\\nAuth Code: VTLMC1\\n\\nTxn Amt $19.74\\n\\nTotal Amt $19.74\\n\\nOrder Number: 11518\\nOrder Date: 11/24/2020 12:00:00 AM\\n\\nCUSTOMER ACKNOWLEDGES RECEIPT OF \\n GOODS AND/OR SERVICES IN THE AMOUNT \\n OF THE TOTAL SHOWN HEREON AND AGREES \\n TO PERFORM THE OBLIGATIONS SET FORTH \\n BY THE CUSTOMER`S AGREEMENT WITH THE \\n ISSUER\\n APPROVED \\n\\n \\n \\n\\n Customer Copy\\n",
"sale": {
"guid": "4cb0582e-cfb7-4ae2-8c74-4f54f84efd7f",
"status": "Transaction - Approved",
"batchStatus": "Batch - Open",
"timeStamp": "2023-06-28T14:00:49.36-05:00",
"deviceGuid": "397eb067-2ebf-4934-bbb4-ace4e4a6194e",
"amount": 20.540,
"currencyQuote": 1.000,
"currency": "USD",
"effectiveAmount": 0.800,
"dualPricingFeeAmount": 0.400,
"grossAmount": 20.140,
"orderNumber": "11518",
"orderDate": "2020-11-24T00:00:00.00-06:00",
"cardDataSource": "INTERNET",
"customerLabel": "Patient",
"businessName": "Star Shoes California",
"customerID": "xt147",
"batchGuid": "9fca53a2-5d5b-44f0-bff3-b04f577405ce",
"semiIntegrated": false,
"processorStatusCode": "A0000",
"processorResponseMessage": "Success, HostRef#: 317919752363",
"wasProcessed": true,
"authCode": "VTLMC1",
"refNumber": "33490159",
"customerReceipt": "Value stated by the user \\n 8320 S HARDY DR \\n TEMPE AZ 85284\\n06/28/2023 15:06:49 \\n\\nCREDIT - SALE\\nTransaction - Approved\\n\\nJohn Doe\\nCard Number: **** **** **** 0213\\nCard Type: Mastercard\\nRef #: 33490159\\nAuth Code: VTLMC1\\n\\nTxn Amt $20.14\\nCash Discount $0.00\\n\\nTotal Amt $20.54\\n\\nOrder Number: 11518\\nCustomer Red Id: xt147\\nOrder Date: 11/24/2020 12:00:00 AM\\nOrder Details: order details\\n\\nCUSTOMER ACKNOWLEDGES RECEIPT OF \\n GOODS AND/OR SERVICES IN THE AMOUNT \\n OF THE TOTAL SHOWN HEREON AND AGREES \\n TO PERFORM THE OBLIGATIONS SET FORTH \\n BY THE CUSTOMER`S AGREEMENT WITH THE \\n ISSUER\\n APPROVED \\n\\n \\n \\n\\n Customer Copy\\n",
"statementDescription": "Value stated by the user",
"customData": "order details",
"generatedBy": "merchadmtest",
"card": {
"first6": "530676",
"last4": "0213",
"cardNumber": "1zcGT7J4pkGh0213",
"cardNumberHashed": "1iyRPx5Pb41Bm/fFgMJiHVB+reM7mRKxHMl8feDVH7I=",
"cardHolderName": "John Doe",
"cardType": "Mastercard",
"expirationDate": "2025-01",
"customer": {
"guid": "0d701720-5407-4d95-ad35-29d7dc2c876b",
"merchantGuid": "cd3d0150-819c-44b9-8efd-2fa248fcacce",
"firstName": "John",
"lastName": "Doe",
"dateOfBirth": "1987-07-07T00:00:00",
"address1": "107 7th Av.",
"zip": "10007",
"city": "New York",
"state": "NY",
"stateFullName": "New York",
"country": "US",
"phone": "9177563007",
"email": "johnd@mailinator.com",
"ssN4": "1210",
"driverLicenseNumber": "12345678",
"driverLicenseState": "TX",
"driverLicenseExpirationDate": "2030-12-12T00:00:00",
"dlStateFullName": "Texas",
"personalPhone": "9177563007",
"status": "Active",
"displayName": "John Doe - 9177563007"
}
},
"associateCustomerCard": true,
"eciFlag": "",
"addressVerificationCode": "N",
"addressVerificationResult": "No Match",
"cvvVerificationCode": "M",
"cvvVerificationResult": "Passed",
"hostedPaymentPageGuid": "00000000-0000-0000-0000-000000000000"
},
"currency": "USD",
"generatedBy": "merchadmtest"
}
Json Example Error Response:
{
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"traceId": "00-5495f1fc8f00492441a3b2540d309096-3c5ac05d4e3bf6d2-00",
"errors": {
"guid": [
"The value 'wrongGuid' is not valid."
]
}
}
This endpoint gets a return.
HTTP Request
GET https://sandbox.choice.dev/api/v1/returns/<guid>
Headers using token
Key | Value |
---|---|
Authorization | Token. Eg: "Bearer eHSN5rTBzqDozgAAlN1UlTMVuIT1zSiAZWCo6E..." |
Headers using API Key
Key | Value |
---|---|
UserAuthorization | API Key. Eg: "e516b6db-3230-4b1c-ae3f-e5379b774a80" |
URL Parameters
Parameter | Description |
---|---|
guid | Return’s guid to get |
Response
- 200 code (ok).
Return EBT
Create return EBT
using System;
using Newtonsoft.Json;
using System.IO;
using System.Net;
using System.Text;
namespace ChoiceSample
{
public class ReturnEBT
{
public static void CreateReturnEBT()
{
try
{
var request = (HttpWebRequest)WebRequest.Create("https://sandbox.choice.dev/api/v1/ebtReturn");
request.ContentType = "text/json";
request.Method = "POST";
var returns = new
{
DeviceGuid = "b29725af-b067-4a35-9819-bbb31bdf8808",
SaleGuid = "b4084e11-884d-468c-84d9-614c5b986fde",
Amount = 19.74
};
string json = JsonConvert.SerializeObject(ReturnEBT);
request.Headers.Add("Authorization", "Bearer 1A089D6ziUybPZFQ3mpPyjt9OEx9yrCs7eQIC6V3A0lmXR2N6-seGNK16Gsnl3td6Ilfbr2Xf_EyukFXwnVEO3fYL-LuGw-L3c8WuaoxhPE8MMdlMPILJTIOV3lTGGdxbFXdKd9U03bbJ9TDUkqxHqq8_VyyjDrw7fs0YOob7bg0OovXTeWgIvZaIrSR1WFR06rYJ0DfWn-Inuf7re1-4SMOjY1ZoCelVwduWCBJpw1111cNbWtHJfObV8u1CVf0");
request.ContentType = "application/json";
request.Accept = "application/json";
using (var streamWriter = new StreamWriter(request.GetRequestStream()))
{
streamWriter.Write(json);
streamWriter.Flush();
streamWriter.Close();
}
try
{
var response = (HttpWebResponse)request.GetResponse();
using (var reader = new StreamReader(response.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)response.StatusCode);
Console.WriteLine();
Console.WriteLine(response.StatusDescription);
Console.WriteLine(result);
}
}
catch (WebException wex)
{
if (wex.Response != null)
{
using (var errorResponse = (HttpWebResponse)wex.Response)
{
using (var reader = new StreamReader(errorResponse.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)errorResponse.StatusCode);
Console.WriteLine();
Console.WriteLine(errorResponse.StatusDescription);
Console.WriteLine(result);
}
}
}
}
}
catch (IOException e)
{
Console.WriteLine(e);
}
}
}
}
Json Example Request:
{
"DeviceGuid" : "b29725af-b067-4a35-9819-bbb31bdf8808",
"ebtElectronicVoucherGuid": "b4084e11-884d-468c-84d9-614c5b986fde",
"Amount": 19.74,
"card" : {
"ExpirationDate": "3012",
"Track2Data": "4761739001010267=22121011317125989",
"cardHolderName": "ExampleName",
"pin": "1234567890234567",
"pinKsn": "1234567890234567",
"isSwiped": "true",
"fcsID": "1234567"
}
}
Json Example Response:
{
"guid": "9c0f41fe-afd1-46be-ada6-ba1a01b9b5af",
"deviceGuid": "397eb067-2ebf-4934-bbb4-ace4e4a6194e",
"ebtElectronicVoucherGuid": "9f849828-0231-44f9-9e10-27237c146c6c",
"batchGuid": "9fca53a2-5d5b-44f0-bff3-b04f577405ce",
"timeStamp": "2023-06-28T14:01:58.49-05:00",
"batchStatus": "Batch - Open",
"status": "Transaction - Approved",
"amount": 7.000,
"processorStatusCode": "A0000",
"wasProcessed": true,
"authCode": "TAS775",
"refNumber": "33490221",
"generatedBy": "merchadmtest",
"ebtElectronicVoucher": {
"effectiveAmount": 0.000,
"balanceAmount": 1234.560,
"ebtVoucherNumber": "123456789012345",
"ebtVoucherApprovalCode": "123456",
"guid": "9f849828-0231-44f9-9e10-27237c146c6c",
"status": "Transaction - Approved",
"batchStatus": "Batch - Open",
"timeStamp": "2023-06-28T14:01:54.00-05:00",
"deviceGuid": "397eb067-2ebf-4934-bbb4-ace4e4a6194e",
"amount": 7.000,
"batchGuid": "9fca53a2-5d5b-44f0-bff3-b04f577405ce",
"semiIntegrated": false,
"processorStatusCode": "A0000",
"processorResponseMessage": "Success, HostRef#: 317933490219",
"wasProcessed": true,
"authCode": "TAS774",
"refNumber": "33490219",
"invoiceNumber": "33490219",
"customerReceipt": "CHOICE MERCHANT SOLUTIONS \\n 8320 S HARDY DR \\n TEMPE AZ 85284\\n06/28/2023 15:06:53 \\n\\nDEBIT - SALE\\nTransaction - Approved\\n\\nCard Number: **** **** **** \\nCard Type: n/a\\nRef #: 33490219\\nAuth Code: TAS774\\n\\nTxn Amt $7.00\\n\\nTotal Amt $7.00\\n\\n\\nCUSTOMER ACKNOWLEDGES RECEIPT OF \\n GOODS AND/OR SERVICES IN THE AMOUNT \\n OF THE TOTAL SHOWN HEREON AND AGREES \\n TO PERFORM THE OBLIGATIONS SET FORTH \\n BY THE CUSTOMER`S AGREEMENT WITH THE \\n ISSUER\\n APPROVED \\n\\n \\n \\n\\n Customer Copy\\n",
"generatedBy": "merchadmtest",
"card": {
"first6": "453980",
"last4": "4136",
"cardNumber": "CARD NOT TOKENIZED",
"cardNumberHashed": "5zmMP7xvO7DUi03uFL/Nm+r49UVhzubW5KQflSaYmrY=",
"cardType": "Visa",
"expirationDate": "2030-12",
"fcsId": "1234567",
"cardDataSource": "INTERNET",
"customer": {
"guid": "c5ed7b38-782d-4efa-be03-2be1efb63f68",
"merchantGuid": "cd3d0150-819c-44b9-8efd-2fa248fcacce",
"firstName": "Javier",
"lastName": "Choice Tech",
"address1": "110 10th Av.",
"zip": "10010",
"city": "New York",
"state": "NY",
"country": "US",
"phone": "9177563046",
"email": "javier@mailinator.com",
"personalPhone": "9177563046",
"status": "Active",
"displayName": "Javier Choice Tech - 9177563046"
}
}
}
}
Json Example Error Response:
{
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"traceId": "00-cdabd02f676530772de5e84e209fb890-c1e59fba1963af05-00",
"errors": {
"Amount": [
"Amount can have 3 decimal places at most."
],
"Card.CardNumber": [
"The field CardNumber must be between 13 and 16 characters. is invalid."
],
"Card.CardHolderName": [
"The CardHolderName must be between 0 and 30 digits long"
],
"Card.Cvv2": [
"The field Cvv2 is invalid."
],
"Card.ExpirationDate": [
"The field ExpirationDate is invalid."
]
}
}
To be able to make a return, it is mandatory to have previously made a close batch. You can run a Return transaction when you need to refund either a partial or the full amount of a sale that has been settled. The Return amount doesn’t need to be the same as the total amount originally charged in the sale. To refund a sale you need to provide the SaleGuid or SaleReferenceNumber that you received when you ran the Sale.
This endpoint creates a EBT return.
HTTP Request
POST https://sandbox.choice.dev/api/v1/ebtReturn
Headers using token
Key | Value |
---|---|
Content-Type | "application/json" |
Authorization | Token. Eg: "Bearer eHSN5rTBzqDozgAAlN1UlTMVuIT1zSiAZWCo6E..." |
Headers using API Key
Key | Value |
---|---|
Content-Type | "application/json" |
UserAuthorization | API Key. Eg: "e516b6db-3230-4b1c-ae3f-e5379b774a80" |
Query Parameters
Parameter | Type | M/C/O | Value |
---|---|---|---|
DeviceGuid | string | Mandatory | Device’s Guid. |
ebtElectronicVoucherGuid | string | Mandatory depending on the corresponding EBT transaction | EBT Electronic Voucher Guid Guid. |
ebtFoodStampPurchasesGuid | string | Mandatory depending on the corresponding EBT transaction | EBT Food Stamp Purchases Guid. |
ebtCashBenefitPurchasesGuid | string | Mandatory depending on the corresponding EBT transaction | EBT Cash Benefit Purchases Guid. |
Amount | decimal | Mandatory | Transaction's amount. Min. amt.: $0.50. Does not allow empty strings and up to 3 decimal places. |
Card | object | Mandatory | Card. |
Card | |||
CardNumber | string | Mandatory | Card number. Must be between 13 and 16 characters. (example: 4532538795426624) or token (example: FfL7exC7Xe2y6624). |
CardHolderName | string | Optional | Cardholder's name. Must be between 0 and 30 digits long. |
Cvv2 | string | Optional | This is the three or four digit CVV code at the back side of the credit and debit card. |
ExpirationDate | date | Optional with Token | Card's expiry date in the YYMM format. |
Response
- 201 code (created).
Get return EBT
using System;
using Newtonsoft.Json;
using System.IO;
using System.Net;
using System.Text;
namespace ChoiceSample
{
public class ReturnEBT
{
public static void GetReturnEBT()
{
try
{
var request = (HttpWebRequest)WebRequest.Create("https://sandbox.choice.dev/api/v1/ebtReturns/9fb17f4e-b508-48d3-bd77-bb6813b42620");
request.Method = "GET";
request.Headers.Add("Authorization", "Bearer 1A089D6ziUybPZFQ3mpPyjt9OEx9yrCs7eQIC6V3A0lmXR2N6-seGNK16Gsnl3td6Ilfbr2Xf_EyukFXwnVEO3fYL-LuGw-L3c8WuaoxhPE8MMdlMPILJTIOV3lTGGdxbFXdKd9U03bbJ9TDUkqxHqq8_VyyjDrw7fs0YOob7bg0OovXTeWgIvZaIrSR1WFR06rYJ0DfWn-Inuf7re1-4SMOjY1ZoCelVwduWCBJpw1111cNbWtHJfObV8u1CVf0");
try
{
var response = (HttpWebResponse)request.GetResponse();
using (var reader = new StreamReader(response.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)response.StatusCode);
Console.WriteLine();
Console.WriteLine(response.StatusDescription);
Console.WriteLine(result);
}
}
catch (WebException wex)
{
if (wex.Response != null)
{
using (var errorResponse = (HttpWebResponse)wex.Response)
{
using (var reader = new StreamReader(errorResponse.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)errorResponse.StatusCode);
Console.WriteLine();
Console.WriteLine(errorResponse.StatusDescription);
Console.WriteLine(result);
}
}
}
}
}
catch (IOException e)
{
Console.WriteLine(e);
}
}
}
}
Json Example Response:
{
"guid": "0a24ccb5-79cf-45ae-ba2c-eab835638f29",
"deviceGuid": "397eb067-2ebf-4934-bbb4-ace4e4a6194e",
"ebtElectronicVoucherGuid": "b87358d0-b7c8-455b-b950-be7cf3887d79",
"batchGuid": "9fca53a2-5d5b-44f0-bff3-b04f577405ce",
"timeStamp": "2023-06-28T14:03:04.35-05:00",
"batchStatus": "Batch - Open",
"status": "Transaction - Approved",
"amount": 7.000,
"processorStatusCode": "A0000",
"wasProcessed": true,
"authCode": "TAS777",
"refNumber": "33490267",
"generatedBy": "merchadmtest",
"ebtElectronicVoucher": {
"effectiveAmount": 0.000,
"balanceAmount": 1234.560,
"ebtVoucherNumber": "123456789012345",
"ebtVoucherApprovalCode": "123456",
"guid": "b87358d0-b7c8-455b-b950-be7cf3887d79",
"status": "Transaction - Approved",
"batchStatus": "Batch - Open",
"timeStamp": "2023-06-28T14:03:02.17-05:00",
"deviceGuid": "397eb067-2ebf-4934-bbb4-ace4e4a6194e",
"amount": 7.000,
"batchGuid": "9fca53a2-5d5b-44f0-bff3-b04f577405ce",
"semiIntegrated": false,
"processorStatusCode": "A0000",
"processorResponseMessage": "Success, HostRef#: 317933490265",
"wasProcessed": true,
"authCode": "TAS776",
"refNumber": "33490265",
"invoiceNumber": "33490265",
"customerReceipt": "CHOICE MERCHANT SOLUTIONS \\n 8320 S HARDY DR \\n TEMPE AZ 85284\\n06/28/2023 15:06:02 \\n\\nDEBIT - SALE\\nTransaction - Approved\\n\\nCard Number: **** **** **** \\nCard Type: n/a\\nRef #: 33490265\\nAuth Code: TAS776\\n\\nTxn Amt $7.00\\n\\nTotal Amt $7.00\\n\\n\\nCUSTOMER ACKNOWLEDGES RECEIPT OF \\n GOODS AND/OR SERVICES IN THE AMOUNT \\n OF THE TOTAL SHOWN HEREON AND AGREES \\n TO PERFORM THE OBLIGATIONS SET FORTH \\n BY THE CUSTOMER`S AGREEMENT WITH THE \\n ISSUER\\n APPROVED \\n\\n \\n \\n\\n Customer Copy\\n",
"generatedBy": "merchadmtest",
"card": {
"first6": "453980",
"last4": "4136",
"cardNumber": "CARD NOT TOKENIZED",
"cardNumberHashed": "5zmMP7xvO7DUi03uFL/Nm+r49UVhzubW5KQflSaYmrY=",
"cardType": "Visa",
"expirationDate": "2030-12",
"fcsId": "1234567",
"cardDataSource": "INTERNET",
"customer": {
"guid": "c5ed7b38-782d-4efa-be03-2be1efb63f68",
"merchantGuid": "cd3d0150-819c-44b9-8efd-2fa248fcacce",
"firstName": "Javier",
"lastName": "Choice Tech",
"address1": "110 10th Av.",
"zip": "10010",
"city": "New York",
"state": "NY",
"country": "US",
"phone": "9177563046",
"email": "javier@mailinator.com",
"personalPhone": "9177563046",
"status": "Active",
"displayName": "Javier Choice Tech - 9177563046"
}
}
}
}
Json Example Error Response:
{
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"traceId": "00-5495f1fc8f00492441a3b2540d309096-3c5ac05d4e3bf6d2-00",
"errors": {
"guid": [
"The value 'wrongGuid' is not valid."
]
}
}
This endpoint gets a return EBT.
HTTP Request
GET https://sandbox.choice.dev/api/v1/ebtReturns/<guid>
Headers using token
Key | Value |
---|---|
Authorization | Token. Eg: "Bearer eHSN5rTBzqDozgAAlN1UlTMVuIT1zSiAZWCo6E..." |
Headers using API Key
Key | Value |
---|---|
UserAuthorization | API Key. Eg: "e516b6db-3230-4b1c-ae3f-e5379b774a80" |
URL Parameters
Parameter | Description |
---|---|
guid | Return’s guid to get |
Response
- 200 code (ok).
Verify
Create verify
using System;
using Newtonsoft.Json;
using System.IO;
using System.Net;
using System.Text;
namespace ChoiceSample
{
public class Verify
{
public static void CreateVerify()
{
try
{
var request = (HttpWebRequest)WebRequest.Create("https://sandbox.choice.dev/api/v1/Verify");
request.ContentType = "text/json";
request.Method = "POST";
var verify = new
{
DeviceGuid = "b29725af-b067-4a35-9819-bbb31bdf8808",
Card = new
{
CardNumber = "4532922657097402",
CardHolderName = "Justin Troudeau",
Cvv2 = "999",
ExpirationDate = "2012",
Customer = new
{
FirstName = "Justin",
LastName = "Troudeau",
Phone = "9177563051",
City = "New York",
State = "NY",
Country = "US",
Email = "justint@mailinator.com",
Address1 = "111 11th Av.",
Address2 = "",
Zip = "10011",
DateOfBirth = "1991-11-11",
DriverLicenseNumber = "12345678",
DriverLicenseState = "TX",
SSN4 = "1210"
}
}
};
string json = JsonConvert.SerializeObject(verify);
request.Headers.Add("Authorization", "Bearer 1A089D6ziUybPZFQ3mpPyjt9OEx9yrCs7eQIC6V3A0lmXR2N6-seGNK16Gsnl3td6Ilfbr2Xf_EyukFXwnVEO3fYL-LuGw-L3c8WuaoxhPE8MMdlMPILJTIOV3lTGGdxbFXdKd9U03bbJ9TDUkqxHqq8_VyyjDrw7fs0YOob7bg0OovXTeWgIvZaIrSR1WFR06rYJ0DfWn-Inuf7re1-4SMOjY1ZoCelVwduWCBJpw1111cNbWtHJfObV8u1CVf0");
request.ContentType = "application/json";
request.Accept = "application/json";
using (var streamWriter = new StreamWriter(request.GetRequestStream()))
{
streamWriter.Write(json);
streamWriter.Flush();
streamWriter.Close();
}
try
{
var response = (HttpWebResponse)request.GetResponse();
using (var reader = new StreamReader(response.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)response.StatusCode);
Console.WriteLine();
Console.WriteLine(response.StatusDescription);
Console.WriteLine(result);
}
}
catch (WebException wex)
{
if (wex.Response != null)
{
using (var errorResponse = (HttpWebResponse)wex.Response)
{
using (var reader = new StreamReader(errorResponse.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)errorResponse.StatusCode);
Console.WriteLine();
Console.WriteLine(errorResponse.StatusDescription);
Console.WriteLine(result);
}
}
}
}
}
catch (IOException e)
{
Console.WriteLine(e);
}
}
}
}
Json Example Request:
{
"DeviceGuid" : "b29725af-b067-4a35-9819-bbb31bdf8808",
"Card":
{
"CardNumber" : "4532922657097402",
"CardHolderName" : "Justin Troudeau",
"Cvv2" : "999",
"ExpirationDate" : "2012",
"Customer":
{
"FirstName" : "Justin",
"LastName" : "Troudeau",
"Phone" : "9177563051",
"City" : "New York",
"State" : "NY",
"Country" : "US",
"Email" : "justint@mailinator.com",
"Address1" : "111 11th Av.",
"Address2" : "",
"Zip" : "10011",
"DateOfBirth" : "1991-11-11",
"DriverLicenseNumber" : "12345678",
"DriverLicenseState" : "TX",
"SSN4" : "1210"
}
}
}
Json Example Response:
{
"guid": "95eef4fc-bc5f-4982-8a7d-463a157953ad",
"status": "Transaction - Approved",
"timeStamp": "2023-06-28T14:04:20.23-05:00",
"deviceGuid": "397eb067-2ebf-4934-bbb4-ace4e4a6194e",
"card": {
"first6": "453292",
"last4": "7402",
"cardNumber": "hNDbeGr7VBgY7402",
"cardNumberHashed": "aovVE7DlGvPWcCaOBkpyYjxMwqLQKVYbAzkn3/KiJNE=",
"cardHolderName": "Justin Troudeau",
"cardType": "Visa",
"expirationDate": "2025-12",
"customer": {
"guid": "f187a416-aff9-4d72-8b5f-725a0acfcf0e",
"merchantGuid": "cd3d0150-819c-44b9-8efd-2fa248fcacce",
"firstName": "Justin",
"lastName": "Troudeau",
"dateOfBirth": "1991-11-11T00:00:00",
"address1": "111 11th Av.",
"zip": "10011",
"city": "New York",
"state": "NY",
"stateFullName": "New York",
"country": "US",
"phone": "9177563051",
"email": "justint@mailinator.com",
"ssN4": "1210",
"driverLicenseNumber": "12345678",
"driverLicenseState": "TX",
"dlStateFullName": "Texas",
"personalPhone": "9177563051",
"status": "Active",
"displayName": "Justin Troudeau - 9177563051"
}
},
"cardDataSource": "INTERNET",
"processorStatusCode": "A0000",
"wasProcessed": true
}
Json Example Error Response:
{
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"traceId": "00-f7b4fbbb7f311ed1265ca490b109d9de-172e4fbb04986ded-00",
"errors": {
"Card": [
"The Card field is required."
],
"Card.CardNumber": [
"The field CardNumber must be between 13 and 16 characters. is invalid."
],
"Card.CardHolderName": [
"The CardHolderName must be between 0 and 30 digits long"
],
"Card.Cvv2": [
"The field Cvv2 is invalid."
],
"Card.ExpirationDate": [
"The field ExpirationDate is invalid."
],
"Card.Customer.FirstName": [
"Field maximum length must be less than 100",
"The field FirstName is invalid."
],
"Card.Customer.LastName": [
"Field maximum length must be less than 100",
"The field LastName is invalid."
],
"Card.Customer.Address1": [
"Field maximum length must be less than 100",
"The field Address1 is invalid."
],
"Card.Customer.City": [
"Field maximum length must be less than 50"
],
"Card.Customer.State": [
"Field maximum length must be less than 2",
"The field State is invalid."
],
"Card.Customer.Email": [
"Field maximum length must be less than 1000"
],
"Card.Customer.SsN4": [
"Field maximum length must be less than 4",
"The field SsN4 is invalid."
],
"Card.Customer.Zip": [
"The Zip must be between 0 and 10 characters long",
"The field Zip is invalid."
],
"Card.Customer.DriverLicenseNumber": [
"The field DriverLicenseNumber is invalid.",
"Field maximum length must be less than 25",
"Only letters, numbers, asterisc, ampersand, @ and hyphen are allowed"
],
"Card.Customer.DriverLicenseState": [
"The field DriverLicenseState is invalid."
],
"Card.Customer.Phone": [
"Field maximum length must be less than 10",
"Invalid phone number. Must be 10 digits numbers only no special characters."
],
"Card.Customer.Country": [
"Field maximum length must be less than 50",
"The field Country is invalid."
]
}
}
The Verify transaction is used when you want to know if the card data you have is valid and it’s ready to run other transactions like Auth Only or Sale. Therefore we are talking about a $0.00 amount transaction, no money is moved.
This endpoint creates a verify.
HTTP Request
POST https://sandbox.choice.dev/api/v1/Verify
Headers using token
Key | Value |
---|---|
Content-Type | "application/json" |
Authorization | Token. Eg: "Bearer eHSN5rTBzqDozgAAlN1UlTMVuIT1zSiAZWCo6E..." |
Headers using API Key
Key | Value |
---|---|
Content-Type | "application/json" |
UserAuthorization | API Key. Eg: "e516b6db-3230-4b1c-ae3f-e5379b774a80" |
Query Parameters
Parameter | Type | M/C/O | Value |
---|---|---|---|
DeviceGuid | string | Mandatory | Device’s Guid. |
Card | |||
CardNumber | string | Mandatory | Card number. Must be between 13 and 16 characters. (example: 4532538795426624) or token (example: FfL7exC7Xe2y6624). |
CardHolderName | string | Optional | Cardholder's name. Must be between 0 and 30 digits long. |
Cvv2 | string | Optional | This is the three or four digit CVV code at the back side of the credit and debit card. |
ExpirationDate | date | Optional with Token | Card's expiry date in the YYMM format. |
Customer | object | Optional | Customer. |
Customer | |||
FirstName | string | Optional | Customer's first name. Max length = 100. |
LastName | string | Optional | Customer's last name. Max length = 100. |
Phone | string | Optional | Customer's phone number. The phone number must be syntactically correct. For example, 4152345678. Must be 10 digits numbers only, no special characters. |
City | string | Optional | Customer's city. Max length = 50. |
State | string | Optional | Customer's short name state. The ISO 3166-2 CA and US state or province code of a customer. Length = 2. |
Country | string | Optional | Customer's country. The ISO country code of a customer’s country. Length = 2 or 3. |
string | Optional | Customer's valid email address. Max length = 1000. | |
Address1 | string | Optional | Customer's address. Max length = 100. |
Address2 | string | Optional | Customer's address line 2. Max length = 100. |
Zip | string | Optional | Customer's zipcode. Length = 5. |
DateOfBirth | date | Optional | Customer's date of birth. Allowed format: YYYY-MM-DD. For example: 2002-05-30 |
DriverLicenseNumber | string | Optional | Customer's driver license number. Not allow special characters. Max length = 25. |
DriverLicenseState | string | Mandatory when DriverLicenseNumber is provided | Customer's driver license short name state. The ISO 3166-2 CA and US state or province code of a customer. Length = 2. |
SSN4 | string | Mandatory when DOB is not submitted | Customer's social security number. Max length = 4. |
Response
- 201 code (created).
Get verify
using System;
using Newtonsoft.Json;
using System.IO;
using System.Net;
using System.Text;
namespace ChoiceSample
{
public class Verify
{
public static void GetVerify()
{
try
{
var request = (HttpWebRequest)WebRequest.Create("https://sandbox.choice.dev/api/v1/Verify/496b8523-7b36-42a4-9026-2b70cf684249");
request.Method = "GET";
request.Headers.Add("Authorization", "Bearer 1A089D6ziUybPZFQ3mpPyjt9OEx9yrCs7eQIC6V3A0lmXR2N6-seGNK16Gsnl3td6Ilfbr2Xf_EyukFXwnVEO3fYL-LuGw-L3c8WuaoxhPE8MMdlMPILJTIOV3lTGGdxbFXdKd9U03bbJ9TDUkqxHqq8_VyyjDrw7fs0YOob7bg0OovXTeWgIvZaIrSR1WFR06rYJ0DfWn-Inuf7re1-4SMOjY1ZoCelVwduWCBJpw1111cNbWtHJfObV8u1CVf0");
try
{
var response = (HttpWebResponse)request.GetResponse();
using (var reader = new StreamReader(response.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)response.StatusCode);
Console.WriteLine();
Console.WriteLine(response.StatusDescription);
Console.WriteLine(result);
}
}
catch (WebException wex)
{
if (wex.Response != null)
{
using (var errorResponse = (HttpWebResponse)wex.Response)
{
using (var reader = new StreamReader(errorResponse.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)errorResponse.StatusCode);
Console.WriteLine();
Console.WriteLine(errorResponse.StatusDescription);
Console.WriteLine(result);
}
}
}
}
}
catch (IOException e)
{
Console.WriteLine(e);
}
}
}
}
Json Example Response:
{
"guid": "513bdd0f-5be8-4717-b4b5-644bb536c058",
"status": "Transaction - Approved",
"timeStamp": "2023-06-28T14:04:23.36-05:00",
"deviceGuid": "397eb067-2ebf-4934-bbb4-ace4e4a6194e",
"card": {
"first6": "453292",
"last4": "7402",
"cardNumber": "hNDbeGr7VBgY7402",
"cardNumberHashed": "aovVE7DlGvPWcCaOBkpyYjxMwqLQKVYbAzkn3/KiJNE=",
"cardHolderName": "Justin Troudeau",
"cardType": "Visa",
"expirationDate": "2025-12",
"customer": {
"guid": "f187a416-aff9-4d72-8b5f-725a0acfcf0e",
"merchantGuid": "cd3d0150-819c-44b9-8efd-2fa248fcacce",
"firstName": "Justin",
"lastName": "Troudeau",
"dateOfBirth": "1991-11-11T00:00:00",
"address1": "111 11th Av.",
"zip": "10011",
"city": "New York",
"state": "NY",
"country": "US",
"phone": "9177563051",
"email": "justint@mailinator.com",
"ssN4": "1210",
"driverLicenseNumber": "12345678",
"personalPhone": "9177563051",
"status": "Active",
"displayName": "Justin Troudeau - 9177563051"
}
},
"cardDataSource": "INTERNET",
"processorStatusCode": "A0000",
"wasProcessed": true
}
Json Example Error Response:
{
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"traceId": "00-5495f1fc8f00492441a3b2540d309096-3c5ac05d4e3bf6d2-00",
"errors": {
"guid": [
"The value 'wrongGuid' is not valid."
]
}
}
This endpoint gets a verify.
HTTP Request
GET https://sandbox.choice.dev/api/v1/Verify/<guid>
Headers using token
Key | Value |
---|---|
Authorization | Token. Eg: "Bearer eHSN5rTBzqDozgAAlN1UlTMVuIT1zSiAZWCo6E..." |
Headers using API Key
Key | Value |
---|---|
UserAuthorization | API Key. Eg: "e516b6db-3230-4b1c-ae3f-e5379b774a80" |
URL Parameters
Parameter | Description |
---|---|
guid | Verify’s guid to get |
Response
- 200 code (ok).
Tokenization
Create tokenization
using System;
using Newtonsoft.Json;
using System.IO;
using System.Net;
using System.Text;
namespace ChoiceSample
{
public class Tokenization
{
public static void CreateTokenization()
{
try
{
var request = (HttpWebRequest)WebRequest.Create("https://sandbox.choice.dev/api/v1/tokenization");
request.ContentType = "text/json";
request.Method = "POST";
var tokenization = new
{
DeviceGuid = "F050E264-EABF-433E-8C81-916DFE110159",
Card = new
{
CardNumber = "4024007194311436",
CardHolderName = "John Doe",
ExpirationDate = "2507",
Customer = new
{
FirstName = "John",
LastName = "Doe"
}
}
};
string json = JsonConvert.SerializeObject(tokenization);
request.Headers.Add("Authorization", "Bearer 1A089D6ziUybPZFQ3mpPyjt9OEx9yrCs7eQIC6V3A0lmXR2N6-seGNK16Gsnl3td6Ilfbr2Xf_EyukFXwnVEO3fYL-LuGw-L3c8WuaoxhPE8MMdlMPILJTIOV3lTGGdxbFXdKd9U03bbJ9TDUkqxHqq8_VyyjDrw7fs0YOob7bg0OovXTeWgIvZaIrSR1WFR06rYJ0DfWn-Inuf7re1-4SMOjY1ZoCelVwduWCBJpw1111cNbWtHJfObV8u1CVf0");
request.ContentType = "application/json";
request.Accept = "application/json";
using (var streamWriter = new StreamWriter(request.GetRequestStream()))
{
streamWriter.Write(json);
streamWriter.Flush();
streamWriter.Close();
}
try
{
var response = (HttpWebResponse)request.GetResponse();
using (var reader = new StreamReader(response.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)response.StatusCode);
Console.WriteLine();
Console.WriteLine(response.StatusDescription);
Console.WriteLine(result);
}
}
catch (WebException wex)
{
if (wex.Response != null)
{
using (var errorResponse = (HttpWebResponse)wex.Response)
{
using (var reader = new StreamReader(errorResponse.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)errorResponse.StatusCode);
Console.WriteLine();
Console.WriteLine(errorResponse.StatusDescription);
Console.WriteLine(result);
}
}
}
}
}
catch (IOException e)
{
Console.WriteLine(e);
}
}
}
}
Json Example Request:
{
"DeviceGuid": "F050E264-EABF-433E-8C81-916DFE110159",
"Card": {
"CardNumber": "4024007194311436",
"CardHolderName": "John Doe",
"ExpirationDate": "2507",
"Customer": {
"FirstName": "John",
"LastName": "Doe"
}
}
}
Json Example Response:
{
"guid": "a2b8842a-a248-4759-ad71-9607a472e7cc",
"status": "Transaction - Approved",
"timeStamp": "2021-07-16T15:36:07.31",
"deviceGuid": "F050E264-EABF-433E-8C81-916DFE110159",
"cardDataSource": "INTERNET",
"processorStatusCode": "A0000",
"card": {
"first6": "402400",
"last4": "1436",
"cardNumber": "XR6ngXrNGdD31436",
"cardHolderName": "John Doe",
"cardType": "Visa",
"expirationDate": "2025-07"
}
}
Json Example Error Response:
{
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"traceId": "00-1e6f082a8f7d73cfefb5b1b35aaa3952-4d73978c4c4b8ff9-00",
"errors": {
"Card": [
"The Card field is required."
],
"Card.CardHolderName": [
"The CardHolderName must be between 0 and 30 digits long"
],
"Card.ExpirationDate": [
"ExpirationDate Must be in the format of YYMM"
],
"Card.Customer.LastName": [
"Field maximum length must be less than 100",
"The field LastName is invalid."
],
"Card.Customer.FirstName": [
"Field maximum length must be less than 100",
"The field FirstName is invalid."
]
}
}
The Tokenization service is used when you want to obtain a tokenized value of the card number but no validation to be performed at the issuing bank.
This endpoint creates a tokenization.
HTTP Request
POST https://sandbox.choice.dev/api/v1/tokenization
Headers using token
Key | Value |
---|---|
Content-Type | "application/json" |
Authorization | Token. Eg: "Bearer eHSN5rTBzqDozgAAlN1UlTMVuIT1zSiAZWCo6E..." |
Headers using API Key
Key | Value |
---|---|
Content-Type | "application/json" |
UserAuthorization | API Key. Eg: "e516b6db-3230-4b1c-ae3f-e5379b774a80" |
Query Parameters
Parameter | Type | M/C/O | Value |
---|---|---|---|
DeviceGuid | string | Mandatory | Device’s Guid. |
Card | |||
CardNumber | string | Mandatory | Card number. Must be between 13 and 16 characters. |
CardHolderName | string | Optional | Cardholder's name. Must be between 0 and 30 digits long |
ExpirationDate | date | Mandatory | Card's expiry date in the YYMM format. |
Customer | object | Optional | Customer. |
Customer | |||
FirstName | string | Optional | Customer's first name. Only letters. Max length = 100. |
LastName | string | Optional | Customer's last name. Only letters. Max length = 100. |
Response
- 201 code (created).
Recurring Billing
Create recurring billing
using System;
using Newtonsoft.Json;
using System.IO;
using System.Net;
using System.Text;
namespace ChoiceSample
{
public class RecurringBilling
{
public static void CreateRecurringBilling()
{
try
{
var request = (HttpWebRequest)WebRequest.Create("https://sandbox.choice.dev/api/v1/recurringBillings");
request.ContentType = "text/json";
request.Method = "POST";
var recurringBilling = new
{
DeviceGuid = "b29725af-b067-4a35-9819-bbb31bdf8808",
Amount = 10.50,
Interval = "monthly",
IntervalValue = "april, may, june",
StartDate = "2021-05-13T00:00:01.000Z",
EndDate = "2023-04-01T00:00:01.000Z",
PaymentCount = "",
ScheduleNotes = "Cable",
Description = "Description",
Card = new
{
CardNumber = "4556395004716019",
CardHolderName = "John Doe",
Cvv2 = "999",
ExpirationDate = "2012",
Customer = new
{
FirstName = "John",
LastName = "Doe",
Phone = "9865123654",
City = "New York",
State = "NY",
Country = "US",
Email = "johnd@mailinator.com",
Address1 = "12th Ave. 5472",
Address2 = "",
Zip = "10003",
DateOfBirth = "1989-10-01T00:00:01.000Z",
DriverLicenseNumber = "12345678",
DriverLicenseExpDate = "2024-10-10",
DriverLicenseState = "TX",
SSN4 = "1210"
}
}
};
string json = JsonConvert.SerializeObject(recurringBilling);
request.Headers.Add("Authorization", "Bearer 1A089D6ziUybPZFQ3mpPyjt9OEx9yrCs7eQIC6V3A0lmXR2N6-seGNK16Gsnl3td6Ilfbr2Xf_EyukFXwnVEO3fYL-LuGw-L3c8WuaoxhPE8MMdlMPILJTIOV3lTGGdxbFXdKd9U03bbJ9TDUkqxHqq8_VyyjDrw7fs0YOob7bg0OovXTeWgIvZaIrSR1WFR06rYJ0DfWn-Inuf7re1-4SMOjY1ZoCelVwduWCBJpw1111cNbWtHJfObV8u1CVf0");
request.ContentType = "application/json";
request.Accept = "application/json";
using (var streamWriter = new StreamWriter(request.GetRequestStream()))
{
streamWriter.Write(json);
streamWriter.Flush();
streamWriter.Close();
}
try
{
var response = (HttpWebResponse)request.GetResponse();
using (var reader = new StreamReader(response.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)response.StatusCode);
Console.WriteLine();
Console.WriteLine(response.StatusDescription);
Console.WriteLine(result);
}
}
catch (WebException wex)
{
if (wex.Response != null)
{
using (var errorResponse = (HttpWebResponse)wex.Response)
{
using (var reader = new StreamReader(errorResponse.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)errorResponse.StatusCode);
Console.WriteLine();
Console.WriteLine(errorResponse.StatusDescription);
Console.WriteLine(result);
}
}
}
}
}
catch (IOException e)
{
Console.WriteLine(e);
}
}
}
}
Json Example Request:
{
"DeviceGuid" : "b29725af-b067-4a35-9819-bbb31bdf8808",
"Amount" : 10.50,
"Interval" : "monthly",
"IntervalValue" : "april, may, june",
"StartDate" : "2021-05-13",
"EndDate" : "2023-04-01",
"PaymentCount" : "",
"ScheduleNotes" : "Cable",
"Description" : "Description",
"Card":
{
"CardNumber" : "4556395004716019",
"CardHolderName" : "John Doe",
"Cvv2" : "999",
"ExpirationDate" : "2012",
"Customer":
{
"FirstName" : "John",
"LastName" : "Doe",
"Phone" : "9865123654",
"City" : "New York",
"State" : "NY",
"Country" : "US",
"Email" : "johndoe@mailinator.com",
"Address1" : "12th Ave. 5472",
"Address2" : "",
"Zip" : "10003",
"DateOfBirth" : "1989-10-01T00:00:01.000Z",
"DriverLicenseNumber" : "12345678",
"DriverLicenseExpDate":"2024-10-10",
"DriverLicenseState" : "TX",
"SSN4" : "1210"
}
}
}
Json Example Response:
{
"guid": "a0acdb65-8817-4079-b8e4-66078dcebbac",
"deviceGuid": "397eb067-2ebf-4934-bbb4-ace4e4a6194e",
"status": "RecurringBilling - Active",
"interval": "monthly",
"intervalValue": "april, may, june",
"amount": 10.500,
"recurringBillingNumber": "65968078",
"createdDate": "2023-06-28T14:10:09.27-05:00",
"startDate": "2024-05-13T00:00:00.00-05:00",
"endDate": "2024-07-01T00:00:00.00-05:00",
"scheduleNotes": "Cable",
"description": "Description",
"merchantProductListGuid": "00000000-0000-0000-0000-000000000000",
"invoiceGuid": "00000000-0000-0000-0000-000000000000",
"merchantProductListTotalAmount": 0.000,
"merchantGuid": "cd3d0150-819c-44b9-8efd-2fa248fcacce",
"processorStatusCode": "OK",
"processorResponseMessage": "Recurring billing scheduled. Payment Count: 2. First payment: Monday, May 13, 2024. Last payment: Thursday, June 13, 2024.",
"wasProcessed": true,
"card": {
"first6": "455639",
"last4": "6019",
"cardNumber": "7hEtLJIhooTE6019",
"cardNumberHashed": "wLJfShYSYRTsa1IDvxa7FRgNGLgGd0e6mCRj8C7EoPk=",
"cardHolderName": "John Doe",
"cardType": "Visa",
"expirationDate": "2025-12",
"cardDataSource": "INTERNET",
"customer": {
"guid": "0d701720-5407-4d95-ad35-29d7dc2c876b",
"merchantGuid": "cd3d0150-819c-44b9-8efd-2fa248fcacce",
"firstName": "John",
"lastName": "Doe",
"dateOfBirth": "1987-07-07T00:00:00",
"address1": "107 7th Av.",
"zip": "10007",
"city": "New York",
"state": "NY",
"stateFullName": "New York",
"country": "US",
"phone": "9177563007",
"email": "johnd@mailinator.com",
"ssN4": "1210",
"driverLicenseNumber": "12345678",
"driverLicenseState": "TX",
"driverLicenseExpirationDate": "2030-12-12T00:00:00",
"dlStateFullName": "Texas",
"personalPhone": "9177563007",
"status": "Active",
"displayName": "John Doe - 9177563007"
}
},
"merchantProcessorAccountGuid": "596c06da-7c03-431c-a50d-3c77f1bd1a15",
"startDateParsed": "2024-05-13",
"endDateParsed": "2024-07-01",
"customer": {
"guid": "0d701720-5407-4d95-ad35-29d7dc2c876b",
"merchantGuid": "cd3d0150-819c-44b9-8efd-2fa248fcacce",
"firstName": "John",
"lastName": "Doe",
"dateOfBirth": "1987-07-07T00:00:00",
"address1": "107 7th Av.",
"zip": "10007",
"city": "New York",
"state": "NY",
"stateFullName": "New York",
"country": "US",
"phone": "9177563007",
"email": "johnd@mailinator.com",
"ssN4": "1210",
"driverLicenseNumber": "12345678",
"driverLicenseState": "TX",
"driverLicenseExpirationDate": "2030-12-12T00:00:00",
"dlStateFullName": "Texas",
"personalPhone": "9177563007",
"status": "Active",
"displayName": "John Doe - 9177563007"
},
"scheduleAndPayments": [
{
"scheduledPaymentDate": "2024-05-13T00:00:00.00-05:00",
"scheduledPaymentDateDayOfWeek": "Monday",
"scheduledPaymentNumber": 1,
"scheduledWasProcessed": false
},
{
"scheduledPaymentDate": "2024-06-13T00:00:00.00-05:00",
"scheduledPaymentDateDayOfWeek": "Thursday",
"scheduledPaymentNumber": 2,
"scheduledWasProcessed": false
}
]
}
Json Example Error Response:
{
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"traceId": "00-1a77db26404f2e8d70f0673ffb26765b-783ede07eea154f0-00",
"errors": {
"$.DeviceGuid": [
"The JSON value could not be converted to System.Nullable`1[System.Guid]. Path: $.DeviceGuid | LineNumber: 1 | BytePositionInLine: 33."
],
"$.Amount": [
"Amount should be equal or greater than zero",
"Unable to parse testText to Decimal",
"The JSON value could not be converted to System.Decimal. Path: $.Amount | LineNumber: 2 | BytePositionInLine: 59.",
"Amount can have 3 decimal places at most."
],
"ScheduleNotes": [
"Field maximum length must be less than 200",
"The field ScheduleNotes is invalid."
],
"Description": [
"The field Description is invalid.",
"Field maximum length must be less than 500"
],
"$.InvoiceGuid": [
"The JSON value could not be converted to System.Nullable`1[System.Guid]. Path: $.InvoiceGuid | LineNumber: 6 | BytePositionInLine: 30."
],
"$.MerchantProductListGuid": [
"The JSON value could not be converted to System.Nullable`1[System.Guid]. Path: $.MerchantProductListGuid | LineNumber: 6 | BytePositionInLine: 30."
],
"Card": [
"'Card' is required"
],
"Card.CardNumber": [
"The field CardNumber must be between 13 and 16 characters. is invalid."
],
"Card.CardHolderName": [
"The CardHolderName must be between 0 and 30 digits long",
"The JSON value could not be converted to System.String. Path: $.Card.CardHolderName | LineNumber: 17 | BytePositionInLine: 32.",
],
"Card.Cvv2": [
"The field Cvv2 is invalid."
],
"Card.ExpirationDate": [
"Card has expired. Expiration date: 1902"
],
"Card.Customer.LastName": [
"The field LastName is invalid.",
"Field maximum length must be less than 100"
],
"Card.Customer.FirstName": [
"The field FirstName is invalid.",
"Field maximum length must be less than 100"
],
"Card.Customer.Phone": [
"Field maximum length must be less than 10",
"Invalid phone number. Must be 10 digits numbers only no special characters.",
"The field Phone is invalid."
],
"Card.Customer.City": [
"Field maximum length must be less than 50"
],
"Card.Customer.State": [
"Field maximum length must be less than 2",
"The field State is invalid."
],
"Card.Customer.Country": [
"Field maximum length must be less than 50",
"The field Country is invalid."
],
"Card.Customer.Email": [
"Field maximum length must be less than 1000",
"The field Email is invalid."
],
"Card.Customer.Zip": [
"The Zip must be between 0 and 10 characters long",
"The field Zip is invalid."
],
"Card.Customer.Address1": [
"Field maximum length must be less than 100"
],
"Card.Customer.Address2": [
"Field maximum length must be less than 100"
],
"Card.Customer.DriverLicenseNumber": [
"The field DriverLicenseNumber is invalid.",
"Field maximum length must be less than 25",
"Only letters, numbers, asterisc, ampersand, @ and hyphen are allowed"
],
"Card.Customer.DriverLicenseState": [
"The field DriverLicenseState is invalid."
],
"Card.Customer.SsN4": [
"Field maximum length must be less than 4",
"The field SsN4 is invalid."
],
"EnhancedData.SaleTax": [
"SaleTax should be equal or greater than zero",
"Unable to parse "textTest" to Decimal",
"The JSON value could not be converted to System.Decimal. Path: $.SaleTax | LineNumber: 2 | BytePositionInLine: 59.",
"SaleTax can have 3 decimal places at most.",
],
"EnhancedData.AdditionalTaxDetailTaxCategory": [
"The field AdditionalTaxDetailTaxCategory is invalid."
],
"EnhancedData.Price": [
"Price should be equal or greater than zero",
"Unable to parse "textTest" to Decimal",
"The JSON value could not be converted to System.Decimal. Path: $.Price | LineNumber: 2 | BytePositionInLine: 59.",
"Price can have 3 decimal places at most.",
],
"EnhancedData.ShipToZip": [
"The field ShipToZip is invalid."
],
"EnhancedData.VatInvoice": [
"Field maximum length must be less than 100",
"The field VatInvoice is invalid."
],
"EnhancedData.DutyCharges": [
"DutyCharges should be equal or greater than zero""Unable to parse "textTest" to Decimal",
"The JSON value could not be converted to System.Decimal. Path: $.DutyCharges | LineNumber: 2 | BytePositionInLine: 59.",
"DutyCharges can have 3 decimal places at most.",
],
"EnhancedData.ProductCode": [
"Field maximum length must be less than 50"
],
"EnhancedData.ProductName": [
"Field maximum length must be less than 50",
"Product Name only allows numbers, letters, dash '-' and underscore '_'"
],
"EnhancedData.ShipFromZip": [
"The field ShipFromZip is invalid."
],
"EnhancedData.CustomerRefId": [
"Field maximum length must be less than 17"
],
"EnhancedData.PurchaseOrder": [
"Field maximum length must be less than 100",
"The field PurchaseOrder is invalid."
],
"EnhancedData.MeasurementUnit": [
"Field maximum length must be less than 100",
"The field MeasurementUnit is invalid."
],
"EnhancedData.ShippingCharges": [
"ShippingCharges should be equal or greater than zero",
"Unable to parse "textTest" to Decimal",
"The JSON value could not be converted to System.Decimal. Path: $.ShippingCharges | LineNumber: 2 | BytePositionInLine: 59.",
"ShippingCharges can have 3 decimal places at most.",
],
"EnhancedData.AdditionalAmount": [
"AdditionalAmount should be equal or greater than zero",
"Unable to parse "textTest" to Decimal",
"The JSON value could not be converted to System.Decimal. Path: $.AdditionalAmount | LineNumber: 2 | BytePositionInLine: 59.",
"AdditionalAmount can have 3 decimal places at most.",
],
"EnhancedData.ChargeDescriptor": [
"Field maximum length must be less than 160",
"The field ChargeDescriptor is invalid."
],
"EnhancedData.CustomerVatNumber": [
"Field maximum length must be less than 100",
"The field CustomerVatNumber is invalid."
],
"EnhancedData.AdditionalAmountType": [
"AdditionalAmountType should be equal or greater than zero",
"Unable to parse "textTest" to Decimal",
"The JSON value could not be converted to System.Decimal. Path: $.AdditionalAmountType | LineNumber: 2 | BytePositionInLine: 59.",
"AdditionalAmountType can have 3 decimal places at most.",
],
"EnhancedData.SummaryCommodityCode": [
"Field maximum length must be less than 100",
"The field SummaryCommodityCode is invalid."
],
"EnhancedData.DestinationCountryCode": [
"The field DestinationCountryCode is invalid."
],
"EnhancedData.SupplierReferenceNumber": [
"Field maximum length must be less than 10",
"The field SupplierReferenceNumber is invalid."
],
"EnhancedData.AdditionalTaxDetailTaxRate": [
"AdditionalTaxDetailTaxRate should be equal or greater than zero",
"Unable to parse "textTest" to Decimal",
"The JSON value could not be converted to System.Decimal. Path: $.AdditionalTaxDetailTaxRate | LineNumber: 2 | BytePositionInLine: 59.",
"AdditionalTaxDetailTaxRate can have 3 decimal places at most.",
],
"EnhancedData.AdditionalTaxDetailTaxType": [
"The field AdditionalTaxDetailTaxType is invalid."
],
"EnhancedData.AdditionalTaxDetailTaxAmount": [
"AdditionalTaxDetailTaxAmount should be equal or greater than zero",
"Unable to parse "textTest" to Decimal",
"The JSON value could not be converted to System.Decimal. Path: $.AdditionalTaxDetailTaxAmount | LineNumber: 2 | BytePositionInLine: 59.",
"AdditionalTaxDetailTaxAmount can have 3 decimal places at most.",
],
"EnhancedData.AdditionalTaxDetailTaxCategory": [
"The field AdditionalTaxDetailTaxCategory is invalid."
]
}
}
Recurring billing is a great feature you can use when you want to charge a card or debit from a bank account every a determined period of time. Period can be daily, weekly, biweekly, monthly, yearly, etc. Check the fields to know how to work with each of them.
This endpoint creates a recurring billing.
HTTP Request
POST https://sandbox.choice.dev/api/v1/recurringBillings
Headers using token
Key | Value |
---|---|
Content-Type | "application/json" |
Authorization | Token. Eg: "Bearer eHSN5rTBzqDozgAAlN1UlTMVuIT1zSiAZWCo6E..." |
Headers using API Key
Key | Value |
---|---|
Content-Type | "application/json" |
UserAuthorization | API Key. Eg: "e516b6db-3230-4b1c-ae3f-e5379b774a80" |
Query Parameters
Parameter | Type | M/C/O | Value |
---|---|---|---|
DeviceGuid | string | Optional | Device's Guid. Mandatory when providing a CreditCard or a BankAccount. Not required when providing an InvoiceGuid. |
InvoiceGuid | string | Optional | The Guid of the Invoice you want to make recurring. Do not send amount, nor Card neither Bank Account in this case. |
Amount | decimal | Optional | Transaction's amount. Min. amt.: $0.50. Mandatory when amount is fixed. Up to 3 decimal places. |
Interval | string | Mandatory | Recurring billing interval. A customer can schedule the recurring payment at a desired interval. Allowed values: 1. yearly 2. halfYearly 3. quarterly 4. monthly 5. fortnightly 6. weekly 7. biweekly 8. daily 9. CustomDates 10. each1st 11. each15th 12. 1st15th |
IntervalValue | string | Mandatory for monthly, weekly and custom dates modes | Allowed values: 1.For the yearly, halfYearly , quarterly, fortnightly, biweekly and daily mode, does not need to enter IntervalValue, since they do not have. 2.For the monthly mode, select everyMonth or the months of the year. Example: "Interval" : "monthly", "IntervalValue" : "april, may, june". 3.For weekly mode, select everyWeek or the days of the week. Example: "Interval" : "weekly", "IntervalValue" : "monday, tuesday, wednesday". 4.For CustomDates mode, select a list of dates (yyyy-MM-dd) separated by commas. Example: "Interval" : "CustomDates", "IntervalValue" : "2017-03-12, 2017-04-06, 2017-05-17, 2017-06-12". |
SubIntervalValue | string | Mandatory for monthly | Allowed values: 1.Any day of the month. |
StartDate | date | Mandatory | The first payment date of the recurring billing schedule. Allowed Recurring Billing format: YYYY-MM-DD For example: 2002-05-30 |
EndDate | date | Mandatory when payment count is not submitted | The last payment date of the recurring billing schedule. Allowed Recurring Billing format: YYYY-MM-DD For example: 2002-05-30 Note: Send either EndDate or PaymentCount field in a request. |
PaymentCount | integer | Mandatory when end date is not submitted | The count of payments in a recurring schedule payment, set by a customer. Note: Send either PaymentCount or EndDate field in a request. |
ScheduleNotes | string | Optional | This field provides a place for the user to identify the reason they added or modified the recurring schedule. Only letters and numbers. Max length = 200. |
Description | string | Optional | General description about the recurring billing. Only letters and numbers. Max length = 500. |
DynamicAmount | boolean | Optional | Mandatory and true when providing a merchant product list guid. Not compatible with enhanced data. |
MerchantProductListGuid | string | Optional | MerchantProductList's Guid. Mandatory when providing a dynamic amount. |
SendReceipt | boolean | Optional | Set to “FALSE” if you do not want an e-mail receipt to be sent to the customer. Set to “TRUE” or leave empty if you want e-mail to be sent. |
EnhancedData | object | Optional | EnhancedData. |
EnhancedData | |||
SaleTax | decimal | Optional | Transaction's amount. Should be equal or greater than zero. |
AdditionalTaxDetailTaxCategory | string | Optional | Tax Category. Not allow special characters. |
AdditionalTaxDetailTaxType | string | Optional | Tax Type. Not allow special characters. |
AdditionalTaxDetailTaxAmount | decimal | Optional | Tax Amount. Should be equal or greater than zero. |
AdditionalTaxDetailTaxRate | decimal | Optional | Tax Rate. Should be equal or greater than zero. |
PurchaseOrder | string | Optional | Purchase Order. Max length = 100. Not allow special characters. |
ShippingCharges | decimal | Optional | Shipping Charges. Should be equal or greater than zero. Not allow empty strings or letters. |
DutyCharges | decimal | Optional | Duty Charges. Should be equal or greater than zero. Not allow empty strings or letters. |
CustomerVATNumber | string | Optional | Customer VAT Number. Not allow special characters. Max length = 100. |
VATInvoice | string | Optional | VAT Invoice. Not allow special characters. Max length = 100. |
SummaryCommodityCode | string | Optional | Summary Commodity Code. Not allow special characters. Max length = 100. |
ShipToZip | string | Optional | Ship To Zip. Must be between 5 and 10 characters long. Not allow letters or special characters. |
ShipFromZip | string | Optional | Ship From Zip. Must be between 5 and 10 characters long. Not allow letters or special characters. |
DestinationCountryCode | string | Optional | Destination Country Code. Not allow special characters. |
SupplierReferenceNumber | string | Optional | Supplier Reference Number. Not allow special characters. Max length = 10. |
CustomerRefID | string | Optional | Customer Ref ID. Max length = 17. |
ChargeDescriptor | string | Optional | Charge Descriptor. Not allow special characters. Max length = 160. |
AdditionalAmount | decimal | Optional | Additional Amount. Should be equal or greater than zero. Only accepts numbers and up to 3 decimal places. |
AdditionalAmountType | string | Optional | Additional Amount Type. Be equal or greater than zero. |
ProductName | string | Optional | Product Name. Max length = 50. |
ProductCode | string | Optional | Product Code. Max length = 50. |
AddPrice | string | Optional | Price. Should be equal or greater than zero. Only accepts numbers and up to 3 decimal places. |
MeasurementUnit | string | Optional | Measurement Unit. Only accepts numbers and up to 3 decimal places. Max length = 100. |
Card | Note: Send either Card or BankAccount object in a request. | ||
CardNumber | string | Mandatory | Card number. Must be between 13 and 16 characters. (example: 4532538795426624) or token (example: FfL7exC7Xe2y6624). |
CardHolderName | string | Optional | Cardholder's name. Must be between 0 and 30 digits long. |
Cvv2 | string | Optional | This is the three or four digit CVV code at the back side of the credit and debit card. |
ExpirationDate | date | Optional with Token | Card's expiry date in the YYMM format. |
Customer | object | Optional | Customer. |
BankAccount | Note: Send either BankAccount or Card object in a request. | ||
RoutingNumber | string | Mandatory | Routing's number. Must be 9 characters (example: 490000018). |
AccountNumber | string | Mandatory | Account's number. Must be between 4 and 20 digits long. |
NameOnAccount | string | Mandatory | Account's name. |
Customer | object | Optional | Customer. |
Customer | |||
FirstName | string | Mandatory with bank account Optional with credit card |
Customer's first name. Only letters. Max length = 100. |
LastName | string | Mandatory with bank account Optional with credit card |
Customer's last name. Only letters. Max length = 100. |
Phone | string | Mandatory with bank account Optional with credit card |
Customer's phone number. The phone number must be syntactically correct. For example, 4152345678. |
City | string | Mandatory with bank account Optional with credit card |
Customer's city. Only letters and numbers. Max length = 50. |
State | string | Mandatory with bank account Optional with credit card |
Customer's short name state. The ISO 3166-2 CA and US state or province code of a customer. Length = 2. |
Country | string | Mandatory with bank account Optional with credit card |
Customer's country. The ISO country code of a customer’s country. Length = 2 or 3. |
string | Mandatory with bank account Optional with credit card |
Customer's valid email address. Max length = 1000. | |
Address1 | string | Mandatory with bank account Optional with credit card |
Customer's address. Only letters and numbers. Max length = 100. |
Address2 | string | Optional | Customer's address line 2. Only letters and numbers. Max length = 100. |
Zip | string | Mandatory with bank account Optional with credit card |
Customer's zipcode. Length = 5. |
DateOfBirth | date | With credit card: optional With bank account: mandatory when SSN4 is not submitted |
Customer's date of birth. Allowed format: YYYY-MM-DD. For example: 2002-05-30 |
DriverLicenseNumber | string | With credit card: optional With bank account: optional |
Customer's driver license number. |
DriverLicenseExpDate | string | With credit card: Required With bank account: Required |
Customer's driver license expiration date. It is required only if there is a driver license number. |
DriverLicenseState | string | With credit card: optional With bank account: mandatory when DriverLicenseNumber is provided |
Customer's driver license short name state. The ISO 3166-2 CA and US state or province code of a customer. Length = 2. |
SSN4 | string | With credit card: optional With bank account: mandatory when DOB is not submitted |
Customer's social security number. Only numbers. Max length = 4. |
Response
- 201 code (created).
Update recurring billing
using System;
using Newtonsoft.Json;
using System.IO;
using System.Net;
using System.Text;
namespace ChoiceSample
{
public class RecurringBilling
{
public static void UpdateRecurringBilling()
{
try
{
var request = (HttpWebRequest)WebRequest.Create("https://sandbox.choice.dev/api/v1/recurringBillings/1de7a995-6e4d-4726-afb3-c9972b9b150a");
request.ContentType = "text/json";
request.Method = "PUT";
var recurringBilling = new
{
Amount = 25.40,
Interval = "monthly",
IntervalValue = "january",
StartDate = "2017-04-01T00:00:01.000Z",
EndDate = "2018-06-01T00:00:01.000Z",
PaymentCount = "",
ScheduleNotes = "Cable",
Description = "Description",
Status = "RecurringBilling - Active"
};
string json = JsonConvert.SerializeObject(recurringBilling);
request.Headers.Add("Authorization", "Bearer 1A089D6ziUybPZFQ3mpPyjt9OEx9yrCs7eQIC6V3A0lmXR2N6-seGNK16Gsnl3td6Ilfbr2Xf_EyukFXwnVEO3fYL-LuGw-L3c8WuaoxhPE8MMdlMPILJTIOV3lTGGdxbFXdKd9U03bbJ9TDUkqxHqq8_VyyjDrw7fs0YOob7bg0OovXTeWgIvZaIrSR1WFR06rYJ0DfWn-Inuf7re1-4SMOjY1ZoCelVwduWCBJpw1111cNbWtHJfObV8u1CVf0");
request.ContentType = "application/json";
request.Accept = "application/json";
using (var streamWriter = new StreamWriter(request.GetRequestStream()))
{
streamWriter.Write(json);
streamWriter.Flush();
streamWriter.Close();
}
try
{
var response = (HttpWebResponse)request.GetResponse();
using (var reader = new StreamReader(response.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)response.StatusCode);
Console.WriteLine();
Console.WriteLine(response.StatusDescription);
Console.WriteLine(result);
}
}
catch (WebException wex)
{
if (wex.Response != null)
{
using (var errorResponse = (HttpWebResponse)wex.Response)
{
using (var reader = new StreamReader(errorResponse.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)errorResponse.StatusCode);
Console.WriteLine();
Console.WriteLine(errorResponse.StatusDescription);
Console.WriteLine(result);
}
}
}
}
}
catch (IOException e)
{
Console.WriteLine(e);
}
}
}
}
Json Example Request:
{
"Amount" : 25.40,
"Interval" : "monthly",
"IntervalValue" : "january",
"StartDate" : "2017-04-01T00:00:01.000Z",
"EndDate" : "2018-06-01T00:00:01.000Z",
"PaymentCount" : "",
"ScheduleNotes" : "Cable",
"Description" : "Description",
"Status" : "RecurringBilling - Active"
}
Json Example Response:
{
"guid": "4f63b6c0-12bb-4cc6-8d93-716fa0869209",
"deviceGuid": "397eb067-2ebf-4934-bbb4-ace4e4a6194e",
"status": "RecurringBilling - Active",
"interval": "monthly",
"intervalValue": "april, may, june",
"amount": 25.400,
"recurringBillingNumber": "79427930",
"createdDate": "2023-06-28T14:12:49.04-05:00",
"startDate": "2024-05-13T00:00:00.00-05:00",
"endDate": "2027-06-30T19:00:01.00-05:00",
"scheduleNotes": "Cable",
"description": "Description",
"merchantProductListGuid": "00000000-0000-0000-0000-000000000000",
"invoiceGuid": "00000000-0000-0000-0000-000000000000",
"merchantProductListTotalAmount": 0.000,
"merchantGuid": "cd3d0150-819c-44b9-8efd-2fa248fcacce",
"processorStatusCode": "OK",
"processorResponseMessage": "Recurring billing scheduled. Payment Count: 11. First payment: Monday, May 13, 2024. Last payment: Sunday, June 13, 2027.",
"wasProcessed": true,
"card": {
"first6": "455639",
"last4": "6019",
"cardNumber": "7hEtLJIhooTE6019",
"cardNumberHashed": "wLJfShYSYRTsa1IDvxa7FRgNGLgGd0e6mCRj8C7EoPk=",
"cardHolderName": "John Doe",
"cardType": "Visa",
"expirationDate": "2025-12",
"cardDataSource": "INTERNET",
"customer": {
"guid": "0d701720-5407-4d95-ad35-29d7dc2c876b",
"merchantGuid": "cd3d0150-819c-44b9-8efd-2fa248fcacce",
"firstName": "John",
"lastName": "Doe",
"dateOfBirth": "1987-07-07T00:00:00",
"address1": "107 7th Av.",
"zip": "10007",
"city": "New York",
"state": "NY",
"stateFullName": "New York",
"country": "US",
"phone": "9177563007",
"email": "johnd@mailinator.com",
"ssN4": "1210",
"driverLicenseNumber": "12345678",
"driverLicenseState": "TX",
"driverLicenseExpirationDate": "2030-12-12T00:00:00",
"dlStateFullName": "Texas",
"personalPhone": "9177563007",
"status": "Active",
"displayName": "John Doe - 9177563007"
}
},
"merchantProcessorAccountGuid": "596c06da-7c03-431c-a50d-3c77f1bd1a15",
"startDateParsed": "2024-05-13",
"endDateParsed": "2027-06-30",
"customer": {
"guid": "0d701720-5407-4d95-ad35-29d7dc2c876b",
"merchantGuid": "cd3d0150-819c-44b9-8efd-2fa248fcacce",
"firstName": "John",
"lastName": "Doe",
"dateOfBirth": "1987-07-07T00:00:00",
"address1": "107 7th Av.",
"zip": "10007",
"city": "New York",
"state": "NY",
"stateFullName": "New York",
"country": "US",
"phone": "9177563007",
"email": "johnd@mailinator.com",
"ssN4": "1210",
"driverLicenseNumber": "12345678",
"driverLicenseState": "TX",
"driverLicenseExpirationDate": "2030-12-12T00:00:00",
"dlStateFullName": "Texas",
"personalPhone": "9177563007",
"status": "Active",
"displayName": "John Doe - 9177563007"
},
"scheduleAndPayments": [
{
"scheduledPaymentDate": "2024-05-13T00:00:00.00-05:00",
"scheduledPaymentDateDayOfWeek": "Monday",
"scheduledPaymentNumber": 1,
"scheduledWasProcessed": false
},
{
"scheduledPaymentDate": "2024-06-13T00:00:00.00-05:00",
"scheduledPaymentDateDayOfWeek": "Thursday",
"scheduledPaymentNumber": 2,
"scheduledWasProcessed": false
}
]
}
Json Example Error Response:
{
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"traceId": "00-14aabb6545c2f55830ee5248a8106429-25339569eab50857-00",
"errors": {
"guid": [
"The value 'invalidGuid' is not valid."
],
"Amount": [
"Amount can have 3 decimal places at most."
],
"ScheduleNotes": [
"Field maximum length must be less than 200",
"The field ScheduleNotes is invalid."
],
"Description": [
"Field maximum length must be less than 500",
"The field Description is invalid."
]
}
}
This endpoint updates a recurring billing.
HTTP Request
PUT https://sandbox.choice.dev/api/v1/recurringBillings<guid>
Headers using token
Key | Value |
---|---|
Content-Type | "application/json" |
Authorization | Token. Eg: "Bearer eHSN5rTBzqDozgAAlN1UlTMVuIT1zSiAZWCo6E..." |
Headers using API Key
Key | Value |
---|---|
Content-Type | "application/json" |
UserAuthorization | API Key. Eg: "e516b6db-3230-4b1c-ae3f-e5379b774a80" |
URL Parameters
Parameter | Description |
---|---|
guid | Recurring billings’s guid to update |
Query Parameters
Parameter | Type | M/C/O | Value |
---|---|---|---|
Amount | decimal | Optional | Transaction's amount. Min. amt.: $0.50. Mandatory when amount is fixed. Up to 3 decimal places. |
Interval | string | Optional | Recurring billing interval. A customer can schedule the recurring payment at a desired interval. Allowed values: 1. yearly 2. halfYearly 3. quarterly 4. monthly 5. fortnightly 6. weekly 7. biweekly 8. daily 9. CustomDates 10. each1st 11. each15th 12. 1st15th |
IntervalValue | string | Optional | Allowed values: 1.For the yearly, halfYearly , quarterly, fortnightly, biweekly and daily mode, does not need to enter IntervalValue, since they do not have. 2.For the monthly mode, select everyMonth or the months of the year. Example: "Interval" : "monthly", "IntervalValue" : "april, may, june". 3.For weekly mode, select everyWeek or the days of the week. Example: "Interval" : "weekly", "IntervalValue" : "monday, tuesday, wednesday". 4.For CustomDates mode, select a list of dates (yyyy-MM-dd) separated by commas. Example: "Interval" : "CustomDates", "IntervalValue" : "2017-03-12, 2017-04-06, 2017-05-17, 2017-06-12". |
SubIntervalValue | string | Mandatory for monthly | Allowed values: 1.Any day of the month. |
StartDate | date | Optional | The first payment date of the recurring billing schedule. Allowed Recurring Billing format: YYYY-MM-DD For example: 2002-05-30 |
EndDate | date | Optional | The first payment date of the recurring billing schedule. Allowed Recurring Billing format: YYYY-MM-DD For example: 2002-05-30 Note: Send either EndDate or PaymentCount field in a request. |
PaymentCount | integer | Optional | The count of payments in a recurring schedule payment, set by a customer. Note: Send either PaymentCount or EndDate field in a request. |
ScheduleNotes | string | Optional | This field provides a place for the user to identify the reason they added or modified the recurring schedule. Only letters and numbers. Max length = 200. |
Description | string | Optional | General description about the recurring billing. Only letters and numbers. Max length = 500. |
SendReceipt | boolean | Optional | Set to “FALSE” if you do not want an e-mail receipt to be sent to the customer. Set to “TRUE” or leave empty if you want e-mail to be sent. |
Status | string | Optional | Recurring billing status. Allowed values: 1. RecurringBilling - Active 2. RecurringBilling - Created - Local 3. RecurringBilling - Created - Error: Processor not reached 4. RecurringBilling - Created - Processor Fail 5. RecurringBilling - Deactivated 6. RecurringBilling - Paused 7. RecurringBilling - Finished 8. RecurringBilling - Deleted 9. RecurringBilling - Active Started |
Response
- 200 code (ok).
Get recurring billing
using System;
using Newtonsoft.Json;
using System.IO;
using System.Net;
using System.Text;
namespace ChoiceSample
{
public class RecurringBilling
{
public static void GetRecurringBilling()
{
try
{
var request = (HttpWebRequest)WebRequest.Create("https://sandbox.choice.dev/api/v1/recurringBillings/1de7a995-6e4d-4726-afb3-c9972b9b150a");
request.Method = "GET";
request.Headers.Add("Authorization", "Bearer 1A089D6ziUybPZFQ3mpPyjt9OEx9yrCs7eQIC6V3A0lmXR2N6-seGNK16Gsnl3td6Ilfbr2Xf_EyukFXwnVEO3fYL-LuGw-L3c8WuaoxhPE8MMdlMPILJTIOV3lTGGdxbFXdKd9U03bbJ9TDUkqxHqq8_VyyjDrw7fs0YOob7bg0OovXTeWgIvZaIrSR1WFR06rYJ0DfWn-Inuf7re1-4SMOjY1ZoCelVwduWCBJpw1111cNbWtHJfObV8u1CVf0");
try
{
var response = (HttpWebResponse)request.GetResponse();
using (var reader = new StreamReader(response.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)response.StatusCode);
Console.WriteLine();
Console.WriteLine(response.StatusDescription);
Console.WriteLine(result);
}
}
catch (WebException wex)
{
if (wex.Response != null)
{
using (var errorResponse = (HttpWebResponse)wex.Response)
{
using (var reader = new StreamReader(errorResponse.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)errorResponse.StatusCode);
Console.WriteLine();
Console.WriteLine(errorResponse.StatusDescription);
Console.WriteLine(result);
}
}
}
}
}
catch (IOException e)
{
Console.WriteLine(e);
}
}
}
}
Json Example Response:
{
"guid": "70e84bdc-bc4f-463e-8f20-e817942784e5",
"deviceGuid": "397eb067-2ebf-4934-bbb4-ace4e4a6194e",
"status": "RecurringBilling - Active",
"interval": "monthly",
"intervalValue": "april, may, june",
"amount": 10.500,
"recurringBillingNumber": "82776278",
"createdDate": "2023-06-28T14:14:58.16-05:00",
"startDate": "2024-05-13T00:00:00.00-05:00",
"endDate": "2024-07-01T00:00:00.00-05:00",
"scheduleNotes": "Cable",
"description": "Description",
"merchantProductListGuid": "00000000-0000-0000-0000-000000000000",
"invoiceGuid": "00000000-0000-0000-0000-000000000000",
"merchantProductListTotalAmount": 0.000,
"merchantGuid": "cd3d0150-819c-44b9-8efd-2fa248fcacce",
"processorStatusCode": "OK",
"processorResponseMessage": "Recurring billing scheduled. Payment Count: 2. First payment: Monday, May 13, 2024. Last payment: Thursday, June 13, 2024.",
"wasProcessed": true,
"card": {
"first6": "455639",
"last4": "6019",
"cardNumber": "7hEtLJIhooTE6019",
"cardNumberHashed": "wLJfShYSYRTsa1IDvxa7FRgNGLgGd0e6mCRj8C7EoPk=",
"cardHolderName": "John Doe",
"cardType": "Visa",
"expirationDate": "2025-12",
"cardDataSource": "INTERNET",
"customer": {
"guid": "0d701720-5407-4d95-ad35-29d7dc2c876b",
"merchantGuid": "cd3d0150-819c-44b9-8efd-2fa248fcacce",
"firstName": "John",
"lastName": "Doe",
"dateOfBirth": "1987-07-07T00:00:00",
"address1": "107 7th Av.",
"zip": "10007",
"city": "New York",
"state": "NY",
"stateFullName": "New York",
"country": "US",
"phone": "9177563007",
"email": "johnd@mailinator.com",
"ssN4": "1210",
"driverLicenseNumber": "12345678",
"driverLicenseState": "TX",
"driverLicenseExpirationDate": "2030-12-12T00:00:00",
"dlStateFullName": "Texas",
"personalPhone": "9177563007",
"status": "Active",
"displayName": "John Doe - 9177563007"
}
},
"merchantProcessorAccountGuid": "596c06da-7c03-431c-a50d-3c77f1bd1a15",
"startDateParsed": "2024-05-13",
"endDateParsed": "2024-07-01",
"customer": {
"guid": "0d701720-5407-4d95-ad35-29d7dc2c876b",
"merchantGuid": "cd3d0150-819c-44b9-8efd-2fa248fcacce",
"firstName": "John",
"lastName": "Doe",
"dateOfBirth": "1987-07-07T00:00:00",
"address1": "107 7th Av.",
"zip": "10007",
"city": "New York",
"state": "NY",
"stateFullName": "New York",
"country": "US",
"phone": "9177563007",
"email": "johnd@mailinator.com",
"ssN4": "1210",
"driverLicenseNumber": "12345678",
"driverLicenseState": "TX",
"driverLicenseExpirationDate": "2030-12-12T00:00:00",
"dlStateFullName": "Texas",
"personalPhone": "9177563007",
"status": "Active",
"displayName": "John Doe - 9177563007"
},
"scheduleAndPayments": [
{
"scheduledPaymentDate": "2024-05-13T00:00:00.00-05:00",
"scheduledPaymentDateDayOfWeek": "Monday",
"scheduledPaymentNumber": 1,
"scheduledWasProcessed": false
},
{
"scheduledPaymentDate": "2024-06-13T00:00:00.00-05:00",
"scheduledPaymentDateDayOfWeek": "Thursday",
"scheduledPaymentNumber": 2,
"scheduledWasProcessed": false
}
]
}
Json Example Error Response:
{
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"traceId": "00-5495f1fc8f00492441a3b2540d309096-3c5ac05d4e3bf6d2-00",
"errors": {
"guid": [
"The value 'wrongGuid' is not valid."
]
}
}
This endpoint gets a recurring billing.
HTTP Request
GET https://sandbox.choice.dev/api/v1/recurringBillings/<guid>
Headers using token
Key | Value |
---|---|
Authorization | Token. Eg: "Bearer eHSN5rTBzqDozgAAlN1UlTMVuIT1zSiAZWCo6E..." |
Headers using API Key
Key | Value |
---|---|
UserAuthorization | API Key. Eg: "e516b6db-3230-4b1c-ae3f-e5379b774a80" |
URL Parameters
Parameter | Description |
---|---|
guid | Recurring billings’s guid to get |
Response
- 200 code (ok).
Batch
Close batch
using System;
using Newtonsoft.Json;
using System.IO;
using System.Net;
using System.Text;
namespace ChoiceSample
{
public class Batch
{
public static void CloseBatch()
{
try
{
var request = (HttpWebRequest)WebRequest.Create("https://sandbox.choice.dev/api/v1/Batches/close");
request.ContentType = "text/json";
request.Method = "POST";
var batch = new
{
DeviceGuid = "8257dde1-ded6-4c38-ab71-4338c4aa87ac"
};
string json = JsonConvert.SerializeObject(batch);
request.Headers.Add("Authorization", "Bearer 1A089D6ziUybPZFQ3mpPyjt9OEx9yrCs7eQIC6V3A0lmXR2N6-seGNK16Gsnl3td6Ilfbr2Xf_EyukFXwnVEO3fYL-LuGw-L3c8WuaoxhPE8MMdlMPILJTIOV3lTGGdxbFXdKd9U03bbJ9TDUkqxHqq8_VyyjDrw7fs0YOob7bg0OovXTeWgIvZaIrSR1WFR06rYJ0DfWn-Inuf7re1-4SMOjY1ZoCelVwduWCBJpw1111cNbWtHJfObV8u1CVf0");
request.ContentType = "application/json";
request.Accept = "application/json";
using (var streamWriter = new StreamWriter(request.GetRequestStream()))
{
streamWriter.Write(json);
streamWriter.Flush();
streamWriter.Close();
}
try
{
var response = (HttpWebResponse)request.GetResponse();
using (var reader = new StreamReader(response.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)response.StatusCode);
Console.WriteLine();
Console.WriteLine(response.StatusDescription);
Console.WriteLine(result);
}
}
catch (WebException wex)
{
if (wex.Response != null)
{
using (var errorResponse = (HttpWebResponse)wex.Response)
{
using (var reader = new StreamReader(errorResponse.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)errorResponse.StatusCode);
Console.WriteLine();
Console.WriteLine(errorResponse.StatusDescription);
Console.WriteLine(result);
}
}
}
}
}
catch (IOException e)
{
Console.WriteLine(e);
}
}
}
}
Json Example Request:
{
"DeviceGuid" : "b29725af-b067-4a35-9819-bbb31bdf8808"
}
Json Example Response:
{
"deviceGuid": "397eb067-2ebf-4934-bbb4-ace4e4a6194e",
"guid": "aab41850-1ce6-462d-8c79-af5b85e87bc5",
"status": "PASS",
"responseCode": "A0000",
"responseMessage": "Success",
"closureDate": "2023-06-28T07:16:44.95Z",
"batchInfo": {
"batchNumber": "1687979801",
"siccode": "5999",
"saleCount": 1,
"saleAmount": 20.540,
"returnCount": 0,
"returnAmount": 0.000,
"batchNetAmount": 20.540
}
}
Json Example Error Response:
{
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"traceId": "00-2c83f4778096f65d86cc31ffacd8b5dc-57aa2a2d3549d299-00",
"errors": {
"$.DeviceGuid": [
"Unable to parse to GUID"
]
}
}
Batch is processing all the authorized transactions of the day at the end of the day. However, you can close a batch manually before. You can also get your transactions searched by batch.
This endpoint closes a batch.
HTTP Request
POST https://sandbox.choice.dev/api/v1/Batches/close
Headers using token
Key | Value |
---|---|
Content-Type | "application/json" |
Authorization | Token. Eg: "Bearer eHSN5rTBzqDozgAAlN1UlTMVuIT1zSiAZWCo6E..." |
Headers using API Key
Key | Value |
---|---|
Content-Type | "application/json" |
UserAuthorization | API Key. Eg: "e516b6db-3230-4b1c-ae3f-e5379b774a80" |
Query Parameters
Parameter | Type | M/C/O | Value |
---|---|---|---|
DeviceGuid | string | Mandatory | Device’s Guid. |
SemiIntegrated | boolean | Optional | Only when physical terminal used on semi integrated mode, send value True. |
Response
- 201 code (created).
Search batches
using System;
using Newtonsoft.Json;
using System.IO;
using System.Net;
using System.Text;
namespace ChoiceSample
{
public class Batch
{
public static void SearchBatch()
{
try
{
var request = (HttpWebRequest)WebRequest.Create("https://sandbox.choice.dev/api/v1/Batches/search");
request.ContentType = "text/json";
request.Method = "POST";
var batch = new
{
deviceGuid = "58ccf5a4-1d5d-4546-8202-da5c7ad10711",
startDate = "1/1/1900",
endDate = "12/31/2020"
};
string json = JsonConvert.SerializeObject(batch);
request.Headers.Add("Authorization", "Bearer 1A089D6ziUybPZFQ3mpPyjt9OEx9yrCs7eQIC6V3A0lmXR2N6-seGNK16Gsnl3td6Ilfbr2Xf_EyukFXwnVEO3fYL-LuGw-L3c8WuaoxhPE8MMdlMPILJTIOV3lTGGdxbFXdKd9U03bbJ9TDUkqxHqq8_VyyjDrw7fs0YOob7bg0OovXTeWgIvZaIrSR1WFR06rYJ0DfWn-Inuf7re1-4SMOjY1ZoCelVwduWCBJpw1111cNbWtHJfObV8u1CVf0");
request.ContentType = "application/json";
request.Accept = "application/json";
using (var streamWriter = new StreamWriter(request.GetRequestStream()))
{
streamWriter.Write(json);
streamWriter.Flush();
streamWriter.Close();
}
try
{
var response = (HttpWebResponse)request.GetResponse();
using (var reader = new StreamReader(response.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)response.StatusCode);
Console.WriteLine();
Console.WriteLine(response.StatusDescription);
Console.WriteLine(result);
}
}
catch (WebException wex)
{
if (wex.Response != null)
{
using (var errorResponse = (HttpWebResponse)wex.Response)
{
using (var reader = new StreamReader(errorResponse.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)errorResponse.StatusCode);
Console.WriteLine();
Console.WriteLine(errorResponse.StatusDescription);
Console.WriteLine(result);
}
}
}
}
}
catch (IOException e)
{
Console.WriteLine(e);
}
}
}
}
Json Example Request:
{
"deviceGuid" : "58ccf5a4-1d5d-4546-8202-da5c7ad10711",
"startDate" : "1/1/1900",
"endDate" : "12/31/2020"
}
Json Example Response:
{
"count": 3,
"ret": [
{
"batchGuid": "492af3ef-6919-4391-832d-6a7ac8a8223d",
"batchNumber": "167648",
"closureDate": "2023-02-15T14:54:57.447-06:00",
"batchTotalAmount": 181.600,
"userName": "merchadmtest",
"summary": {
"saleCount": 13,
"saleAmount": 201.340,
"returnCount": 1,
"returnAmount": 19.740
},
"transactions": [
{
"transactionGuid": "7cf0a604-4168-41c5-a2ed-0a3a619f2843",
"transactionType": "Ebt Food Stamp Purchase",
"transactionDatetime": "2023-02-15T17:37:02.19-06:00",
"lastFour": "4136",
"cardType": "Visa",
"amount": 7.000,
"processorResponseMessage": "Success",
"userName": "merchadmtest",
"deviceGuid": "397eb067-2ebf-4934-bbb4-ace4e4a6194e",
"processorResponseCode": "A0000",
"processorAuthCode": "TAS665",
"processorRefNumber": "25887719"
},
{
"transactionGuid": "7860cba6-39ca-4cc3-9479-ea53c3745b21",
"transactionType": "Sale",
"transactionDatetime": "2023-02-15T20:43:25.15-06:00",
"lastFour": "0213",
"cardType": "Mastercard",
"amount": 20.540,
"processorResponseMessage": "Success",
"userName": "merchadmtest",
"deviceGuid": "397eb067-2ebf-4934-bbb4-ace4e4a6194e",
"generatedByRecurringBilling": false,
"orderNumber": "11518",
"orderDate": "2020-11-24T00:00:00",
"processorResponseCode": "A0000",
"processorAuthCode": "VTLMC1",
"processorRefNumber": "25893269",
"cvvVerificationCode": "M",
"addressVerificationCode": "N",
"currencyCode": "USD",
"cardDataSource": "INTERNET",
"generatedByCapture": false,
"softDescriptor": "Value stated by the user",
"dualPricingFeeAmount": 0.400
},
{
"transactionGuid": "df3601af-d031-42d5-92b3-f36e66a30fe9",
"transactionType": "Sale",
"transactionDatetime": "2023-02-15T20:12:23.12-06:00",
"lastFour": "0213",
"cardType": "Mastercard",
"amount": 20.540,
"processorResponseMessage": "Success",
"userName": "merchadmtest",
"deviceGuid": "397eb067-2ebf-4934-bbb4-ace4e4a6194e",
"generatedByRecurringBilling": false,
"orderNumber": "11518",
"orderDate": "2020-11-24T00:00:00",
"processorResponseCode": "A0000",
"processorAuthCode": "VTLMC1",
"processorRefNumber": "25891729",
"cvvVerificationCode": "M",
"addressVerificationCode": "N",
"currencyCode": "USD",
"cardDataSource": "INTERNET",
"generatedByCapture": false,
"softDescriptor": "Value stated by the user",
"dualPricingFeeAmount": 0.400
}
]
}
]
}
This endpoint searches batches in a date range.
HTTP Request
POST https://sandbox.choice.dev/api/v1/Batches/search
Headers using token
Key | Value |
---|---|
Content-Type | "application/json" |
Authorization | Token. Eg: "Bearer eHSN5rTBzqDozgAAlN1UlTMVuIT1zSiAZWCo6E..." |
Headers using API Key
Key | Value |
---|---|
Content-Type | "application/json" |
UserAuthorization | API Key. Eg: "e516b6db-3230-4b1c-ae3f-e5379b774a80" |
Query Parameters
Parameter | Type | M/C/O | Value |
---|---|---|---|
deviceGuid | string | Mandatory | Device's guid. |
startDate | date | Mandatory | Search's start date. Allowed Recurring Billing format: YYYY-MM-DD For example: 2002-05-30 |
endDate | date | Mandatory | Search's end date. Allowed Recurring Billing format: YYYY-MM-DD For example: 2002-05-30 |
Response
- 200 code (ok).
Get batches with transactions
using System;
using Newtonsoft.Json;
using System.IO;
using System.Net;
using System.Text;
namespace ChoiceSample
{
public class Batch
{
public static void GetBatchsWithTransactions()
{
try
{
var request = (HttpWebRequest)WebRequest.Create("https://sandbox.choice.dev/api/v1/Batches/58e8a0ad-d167-4015-a4b1-904b1e7f2b26/Transactions");
request.Method = "GET";
request.Headers.Add("Authorization", "Bearer 1A089D6ziUybPZFQ3mpPyjt9OEx9yrCs7eQIC6V3A0lmXR2N6-seGNK16Gsnl3td6Ilfbr2Xf_EyukFXwnVEO3fYL-LuGw-L3c8WuaoxhPE8MMdlMPILJTIOV3lTGGdxbFXdKd9U03bbJ9TDUkqxHqq8_VyyjDrw7fs0YOob7bg0OovXTeWgIvZaIrSR1WFR06rYJ0DfWn-Inuf7re1-4SMOjY1ZoCelVwduWCBJpw1111cNbWtHJfObV8u1CVf0");
try
{
var response = (HttpWebResponse)request.GetResponse();
using (var reader = new StreamReader(response.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)response.StatusCode);
Console.WriteLine();
Console.WriteLine(response.StatusDescription);
Console.WriteLine(result);
}
}
catch (WebException wex)
{
if (wex.Response != null)
{
using (var errorResponse = (HttpWebResponse)wex.Response)
{
using (var reader = new StreamReader(errorResponse.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)errorResponse.StatusCode);
Console.WriteLine();
Console.WriteLine(errorResponse.StatusDescription);
Console.WriteLine(result);
}
}
}
}
}
catch (IOException e)
{
Console.WriteLine(e);
}
}
}
}
Json Example Response:
[
{
"transactionType": "Sale",
"transactionGuid": "e1ad65e6-7abd-4467-8176-1cdd3c569d53",
"transactionDateTime": "2023-06-28T19:18:13.77-05:00",
"lastFour": "0213",
"cardType": "Mastercard",
"amount": 20.540,
"processorResponseMessage": "STA: PASS | R.MSG: Success | TASK#: 34537155 | AUTHCODE: VTLMC1 | HOSTREF#: 317919501280 | TAMT: 20.54 | PAMT: 20.54 | VERIFCVV: M | AVC: N | CHVC: | CT: M",
"userName": "merchadmtest",
"deviceGuid": "397eb067-2ebf-4934-bbb4-ace4e4a6194e",
"generatedByRecurringBilling": false,
"orderNumber": "11518",
"orderDate": "2020-11-24T00:00:00.00-06:00",
"processorResponseCode": "A0000",
"processorAuthCode": "VTLMC1",
"processorRefNumber": "33490707",
"softDescriptor": "Value stated by the user",
"dualPricingFeeAmount": 0.400,
"cvvVerificationCode": "M",
"addressVerificationCode": "N",
"currencyCode": "USD",
"semiIntegrated": false,
"cardDataSource": "INTERNET",
"generatedByCapture": false
}
]
Json Example Error Response:
{
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"traceId": "00-2c83f4778096f65d86cc31ffacd8b5dc-57aa2a2d3549d299-00",
"errors": {
"$.DeviceGuid": [
"Unable to parse to GUID"
]
}
}
This endpoint gets a batch with its transactions.
HTTP Request
GET https://sandbox.choice.dev/api/v1/Batches/<guid>/Transactions/
Headers using token
Key | Value |
---|---|
Authorization | Token. Eg: "Bearer eHSN5rTBzqDozgAAlN1UlTMVuIT1zSiAZWCo6E..." |
Headers using API Key
Key | Value |
---|---|
UserAuthorization | API Key. Eg: "e516b6db-3230-4b1c-ae3f-e5379b774a80" |
URL Parameters
Parameter | Description |
---|---|
guid | Batch’s guid to get |
Response
- 200 code (ok).
Customer
Create customer
using System;
using Newtonsoft.Json;
using System.IO;
using System.Net;
using System.Text;
namespace ChoiceSample
{
public class Customer
{
public static void CreateCustomer()
{
try
{
var request = (HttpWebRequest)WebRequest.Create("https://sandbox.choice.dev/api/v1/customers");
request.ContentType = "text/json";
request.Method = "POST";
var invoiceCustomer = new
{
MerchantGuid = "24639b5f-f881-45dc-966c-4beece954e6c",
CompanyName = "Incutex",
FirstName = "John",
LastName = "Doe",
Address1 = "108 8th Av.",
Address2 = "8th Floor",
Zip = "10008",
City = "New York",
State = "NY",
PersonalPhone = "9727414574",
WorkPhone = "9177563046",
Fax = "8004578796",
Email = "john.doe@mailinator.com"
};
string json = JsonConvert.SerializeObject(customer);
request.Headers.Add("Authorization", "Bearer 1A089D6ziUybPZFQ3mpPyjt9OEx9yrCs7eQIC6V3A0lmXR2N6-seGNK16Gsnl3td6Ilfbr2Xf_EyukFXwnVEO3fYL-LuGw-L3c8WuaoxhPE8MMdlMPILJTIOV3lTGGdxbFXdKd9U03bbJ9TDUkqxHqq8_VyyjDrw7fs0YOob7bg0OovXTeWgIvZaIrSR1WFR06rYJ0DfWn-Inuf7re1-4SMOjY1ZoCelVwduWCBJpw1111cNbWtHJfObV8u1CVf0");
request.ContentType = "application/json";
request.Accept = "application/json";
using (var streamWriter = new StreamWriter(request.GetRequestStream()))
{
streamWriter.Write(json);
streamWriter.Flush();
streamWriter.Close();
}
try
{
var response = (HttpWebResponse)request.GetResponse();
using (var reader = new StreamReader(response.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)response.StatusCode);
Console.WriteLine();
Console.WriteLine(response.StatusDescription);
Console.WriteLine(result);
}
}
catch (WebException wex)
{
if (wex.Response != null)
{
using (var errorResponse = (HttpWebResponse)wex.Response)
{
using (var reader = new StreamReader(errorResponse.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)errorResponse.StatusCode);
Console.WriteLine();
Console.WriteLine(errorResponse.StatusDescription);
Console.WriteLine(result);
}
}
}
}
}
catch (IOException e)
{
Console.WriteLine(e);
}
}
}
}
Json Example Request:
{
"MerchantGuid" : "24639b5f-f881-45dc-966c-4beece954e6c",
"CompanyName" : "Incutex",
"FirstName": "John",
"LastName": "Doe",
"Address1": "108 8th Av.",
"Address2": "8th Floor",
"Zip": "10008",
"City": "New York",
"State": "NY",
"PersonalPhone" : "9727414574",
"WorkPhone" : "9177563046",
"Fax" : "8004578796",
"Email": "Jack.Doe@mailinator.com"
}
Json Example Response:
{
"guid": "6dd3c199-7b06-43aa-b6f4-d3622d3f85de",
"merchantGuid": "cd3d0150-819c-44b9-8efd-2fa248fcacce",
"firstName": "John",
"lastName": "Doe",
"address1": "108 8th Av.",
"address2": "8th Floor",
"zip": "10008",
"city": "New York",
"state": "NY",
"stateFullName": "New York",
"email": "john.Doe@mailinator.com",
"companyName": "Incutex",
"workPhone": "9177563046",
"fax": "8004578796",
"status": "Active",
"displayName": "John Doe - Incutex - "
}
Json Example Error Response:
{
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"traceId": "00-ed75aea717a6c9e79817f8a04e7860d5-337ecc59546e76f0-00",
"errors": {
"$.MerchantGuid": [
"The JSON value could not be converted to System.Nullable`1[System.Guid]. Path: $.MerchantGuid | LineNumber: 1 | BytePositionInLine: 35."
],
"Fax": [
"Field maximum length must be less than 10",
"The field Fax is invalid."
],
"Zip": [
"The Zip must be between 0 and 10 characters long",
"The field Zip is invalid."
],
"City": [
"Field maximum length must be less than 50",
"The field City is invalid."
],
"Email": [
"Field maximum length must be less than 1000",
"The field Email is invalid."
],
"State": [
"Field maximum length must be less than 2",
"The field State is invalid.",
"The field State is invalid."
],
"Address1": [
"Field maximum length must be less than 100",
"The field Address1 is invalid."
],
"Address2": [
"Field maximum length must be less than 100",
"The field Address2 is invalid."
],
"LastName": [
"Field maximum length must be less than 100",
"The field LastName is invalid."
],
"FirstName": [
"Field maximum length must be less than 100",
"The field FirstName is invalid."
],
"WorkPhone": [
"Field maximum length must be less than 10",
"Invalid phone number. Must be 10 digits numbers only no special characters.",
"The field WorkPhone is invalid."
],
"CompanyName": [
"Field maximum length must be less than 100",
"The field CompanyName is invalid."
]
}
}
This endpoint creates a customer.
HTTP Request
POST https://sandbox.choice.dev/api/v1/customers
Headers using token
Key | Value |
---|---|
Content-Type | "application/json" |
Authorization | Token. Eg: "Bearer eHSN5rTBzqDozgAAlN1UlTMVuIT1zSiAZWCo6E..." |
Headers using API Key
Key | Value |
---|---|
Content-Type | "application/json" |
UserAuthorization | API Key. Eg: "e516b6db-3230-4b1c-ae3f-e5379b774a80" |
Query Parameters
Parameter | Type | M/C/O | Value |
---|---|---|---|
MerchantGuid | string | Mandatory | Merchant’s Guid. |
CompanyName | string | Optional | Company Name. Only letters and numbers. Max length = 100. |
FirstName | string | Optional | User’s first name. Only letters and numbers. Max length = 100. |
LastName | string | Optional | User’s last name. Only letters and numbers. Max length = 100. |
Address1 | string | Optional | User’s address. Max length = 100. |
Address2 | string | Optional | User’s address line 2. Max lenght = 100. |
City | string | Optional | User’s city. Max length = 50. |
State | string | Optional | User’s short name state. The ISO 3166-2 CA and US state or province code of a user. Length = 2. |
Zip | string | Optional | User’s zipcode. Length = 5. |
PersonalPhone | string | Optional | User’s phone number. The phone number must be syntactically correct. For example, 4152345678. |
WorkPhone | string | Optional | User’s phone number. The phone number must be syntactically correct. For example, 4152345678. |
Fax | string | Optional | User’s phone number. The phone number must be syntactically correct. For example, 4152345678. |
string | Optional | User’s valid email address. Max length = 1000. |
Response
- 201 code (created).
Update customer
using System;
using Newtonsoft.Json;
using System.IO;
using System.Net;
using System.Text;
namespace ChoiceSample
{
public class Customer
{
public static void UpdateCustomer()
{
try
{
var request = (HttpWebRequest)WebRequest.Create("https://sandbox.choice.dev/api/v1/customers/33524364-727a-422b-8bbe-5eab1a849e82");
request.ContentType = "text/json";
request.Method = "PUT";
var invoiceCustomer = new
{
CompanyName = "Incutex",
FirstName = "John",
LastName = "Doe",
Address1 = "108 8th Av.",
Address2 = "8th Floor",
Zip = "10008",
City = "New York",
State = "NY",
PersonalPhone = "9727414574",
WorkPhone = "9177563046",
Fax = "8004578796",
Email = "john.doe@mailinator.com"
};
string json = JsonConvert.SerializeObject(customer);
request.Headers.Add("Authorization", "Bearer 1A089D6ziUybPZFQ3mpPyjt9OEx9yrCs7eQIC6V3A0lmXR2N6-seGNK16Gsnl3td6Ilfbr2Xf_EyukFXwnVEO3fYL-LuGw-L3c8WuaoxhPE8MMdlMPILJTIOV3lTGGdxbFXdKd9U03bbJ9TDUkqxHqq8_VyyjDrw7fs0YOob7bg0OovXTeWgIvZaIrSR1WFR06rYJ0DfWn-Inuf7re1-4SMOjY1ZoCelVwduWCBJpw1111cNbWtHJfObV8u1CVf0");
request.ContentType = "application/json";
request.Accept = "application/json";
using (var streamWriter = new StreamWriter(request.GetRequestStream()))
{
streamWriter.Write(json);
streamWriter.Flush();
streamWriter.Close();
}
try
{
var response = (HttpWebResponse)request.GetResponse();
using (var reader = new StreamReader(response.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)response.StatusCode);
Console.WriteLine();
Console.WriteLine(response.StatusDescription);
Console.WriteLine(result);
}
}
catch (WebException wex)
{
if (wex.Response != null)
{
using (var errorResponse = (HttpWebResponse)wex.Response)
{
using (var reader = new StreamReader(errorResponse.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)errorResponse.StatusCode);
Console.WriteLine();
Console.WriteLine(errorResponse.StatusDescription);
Console.WriteLine(result);
}
}
}
}
}
catch (IOException e)
{
Console.WriteLine(e);
}
}
}
}
Json Example Request:
{
"CompanyName" : "Incutex",
"FirstName": "John",
"LastName": "Doe",
"Address1": "108 8th Av.",
"Address2": "8th Floor",
"Zip": "10008",
"City": "New York",
"State": "NY",
"PersonalPhone" : "9727414574",
"WorkPhone" : "9177563046",
"Fax" : "8004578796",
"Email": "john.Doe@mailinator.com"
}
Json Example Response:
{
"guid": "4d9eb3fe-7c03-41ce-872d-89095c21dc84",
"merchantGuid": "cd3d0150-819c-44b9-8efd-2fa248fcacce",
"firstName": "John",
"lastName": "Doe",
"address1": "108 8th Av.",
"address2": "8th Floor",
"zip": "10008",
"city": "New York",
"state": "NY",
"stateFullName": "New York",
"email": "john.Doe@mailinator.com",
"companyName": "Incutex",
"workPhone": "9177563046",
"fax": "8004578796",
"status": "Active",
"displayName": "John Doe - Incutex - "
}
Json Example Error Response:
{
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"traceId": "00-68780c6e1047faf4e7af803e426f41b0-42f4c09ca9720682-00",
"errors": {
"Fax": [
"Field maximum length must be less than 10",
"The field Fax is invalid."
],
"Zip": [
"The Zip must be between 0 and 10 characters long",
"The field Zip is invalid."
],
"City": [
"Field maximum length must be less than 50",
"The field City is invalid."
],
"Email": [
"The field Email is invalid."
],
"State": [
"Field maximum length must be less than 2",
"The field State is invalid.",
"The field State is invalid."
],
"Address1": [
"Field maximum length must be less than 100",
"The field Address1 is invalid."
],
"Address2": [
"Field maximum length must be less than 100",
"The field Address2 is invalid."
],
"LastName": [
"Field maximum length must be less than 100",
"The field LastName is invalid."
],
"FirstName": [
"Field maximum length must be less than 100",
"The field FirstName is invalid."
],
"WorkPhone": [
"Field maximum length must be less than 10",
"Invalid phone number. Must be 10 digits numbers only no special characters.",
"The field WorkPhone is invalid."
],
"CompanyName": [
"Field maximum length must be less than 100",
"The field CompanyName is invalid."
]
}
}
This endpoint updates a customer.
HTTP Request
PUT https://sandbox.choice.dev/api/v1/customers/<guid>
Headers using token
Key | Value |
---|---|
Content-Type | "application/json" |
Authorization | Token. Eg: "Bearer eHSN5rTBzqDozgAAlN1UlTMVuIT1zSiAZWCo6E..." |
Headers using API Key
Key | Value |
---|---|
Content-Type | "application/json" |
UserAuthorization | API Key. Eg: "e516b6db-3230-4b1c-ae3f-e5379b774a80" |
URL Parameters
Parameter | Description |
---|---|
guid | customer’s guid to update |
Query Parameters
Parameter | Type | M/C/O | Value |
---|---|---|---|
CompanyName | string | Optional | Company Name. Only letters and numbers. Max length = 100. |
FirstName | string | Optional | User’s first name. Only letters and numbers. Max length = 100. |
LastName | string | Optional | User’s last name. Only letters and numbers. Max length = 100. |
Address1 | string | Optional | User’s address. Max length = 100. |
Address2 | string | Optional | User’s address line 2. Max length = 100. |
City | string | Optional | User’s city. Max length = 50. |
State | string | Optional | User’s short name state. The ISO 3166-2 CA and US state or province code of a user. Length = 2. |
Zip | string | Optional | User’s zipcode. Length = 5. |
PersonalPhone | string | Optional | User’s phone number. The phone number must be syntactically correct. For example, 4152345678. |
WorkPhone | string | Optional | User’s phone number. The phone number must be syntactically correct. For example, 4152345678. |
Fax | string | Optional | User’s phone number. The phone number must be syntactically correct. For example, 4152345678. |
string | Optional | User’s valid email address. Max length = 1000. |
Response
- 200 code (ok).
Get customer
using System;
using Newtonsoft.Json;
using System.IO;
using System.Net;
using System.Text;
namespace ChoiceSample
{
public class customer
{
public static void GetInvoiceCustomer()
{
try
{
var request = (HttpWebRequest)WebRequest.Create("https://sandbox.choice.dev/api/v1/customers/33524364-727a-422b-8bbe-5eab1a849e82");
request.Method = "GET";
request.Headers.Add("Authorization", "Bearer 1A089D6ziUybPZFQ3mpPyjt9OEx9yrCs7eQIC6V3A0lmXR2N6-seGNK16Gsnl3td6Ilfbr2Xf_EyukFXwnVEO3fYL-LuGw-L3c8WuaoxhPE8MMdlMPILJTIOV3lTGGdxbFXdKd9U03bbJ9TDUkqxHqq8_VyyjDrw7fs0YOob7bg0OovXTeWgIvZaIrSR1WFR06rYJ0DfWn-Inuf7re1-4SMOjY1ZoCelVwduWCBJpw1111cNbWtHJfObV8u1CVf0");
try
{
var response = (HttpWebResponse)request.GetResponse();
using (var reader = new StreamReader(response.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)response.StatusCode);
Console.WriteLine();
Console.WriteLine(response.StatusDescription);
Console.WriteLine(result);
}
}
catch (WebException wex)
{
if (wex.Response != null)
{
using (var errorResponse = (HttpWebResponse)wex.Response)
{
using (var reader = new StreamReader(errorResponse.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)errorResponse.StatusCode);
Console.WriteLine();
Console.WriteLine(errorResponse.StatusDescription);
Console.WriteLine(result);
}
}
}
}
}
catch (IOException e)
{
Console.WriteLine(e);
}
}
}
}
Json Example Response:
{
"guid": "ae113c9e-ca00-47b6-8ca6-6ad23d8b83ae",
"merchantGuid": "cd3d0150-819c-44b9-8efd-2fa248fcacce",
"firstName": "John",
"lastName": "Doe",
"address1": "108 8th Av.",
"address2": "8th Floor",
"zip": "10008",
"city": "New York",
"state": "NY",
"stateFullName": "New York",
"email": "john.Doe@mailinator.com",
"companyName": "Incutex",
"workPhone": "9177563046",
"fax": "8004578796",
"status": "Active",
"displayName": "John Doe - Incutex - "
}
Json Example Error Response:
{
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"traceId": "00-d30ac376279a06d5f89e57e140123bd0-07a076df16418083-00",
"errors": {
"guid": [
"The value '{{testGuid}}' is not valid."
]
}
}
This endpoint gets a customer.
HTTP Request
GET https://sandbox.choice.dev/api/v1/customers/<guid>
Headers using token
Key | Value |
---|---|
Authorization | Token. Eg: "Bearer eHSN5rTBzqDozgAAlN1UlTMVuIT1zSiAZWCo6E..." |
Headers using API Key
Key | Value |
---|---|
UserAuthorization | API Key. Eg: "e516b6db-3230-4b1c-ae3f-e5379b774a80" |
URL Parameters
Parameter | Description |
---|---|
guid | customer’s guid to get |
Response
- 200 code (ok).
Invoice Customer
Create invoice customer
using System;
using Newtonsoft.Json;
using System.IO;
using System.Net;
using System.Text;
namespace ChoiceSample
{
public class InvoiceCustomer
{
public static void CreateInvoiceCustomer()
{
try
{
var request = (HttpWebRequest)WebRequest.Create("https://sandbox.choice.dev/api/v1/Invoice/InvoiceCustomers");
request.ContentType = "text/json";
request.Method = "POST";
var invoiceCustomer = new
{
MerchantGuid = "24639b5f-f881-45dc-966c-4beece954e6c",
CompanyName = "Incutex",
FirstName = "John",
LastName = "Doe",
Address1 = "108 8th Av.",
Address2 = "8th Floor",
Zip = "10008",
City = "New York",
State = "NY",
PersonalPhone = "9727414574",
WorkPhone = "9177563046",
Fax = "8004578796",
Email = "john.doe@mailinator.com"
};
string json = JsonConvert.SerializeObject(invoiceCustomer);
request.Headers.Add("Authorization", "Bearer 1A089D6ziUybPZFQ3mpPyjt9OEx9yrCs7eQIC6V3A0lmXR2N6-seGNK16Gsnl3td6Ilfbr2Xf_EyukFXwnVEO3fYL-LuGw-L3c8WuaoxhPE8MMdlMPILJTIOV3lTGGdxbFXdKd9U03bbJ9TDUkqxHqq8_VyyjDrw7fs0YOob7bg0OovXTeWgIvZaIrSR1WFR06rYJ0DfWn-Inuf7re1-4SMOjY1ZoCelVwduWCBJpw1111cNbWtHJfObV8u1CVf0");
request.ContentType = "application/json";
request.Accept = "application/json";
using (var streamWriter = new StreamWriter(request.GetRequestStream()))
{
streamWriter.Write(json);
streamWriter.Flush();
streamWriter.Close();
}
try
{
var response = (HttpWebResponse)request.GetResponse();
using (var reader = new StreamReader(response.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)response.StatusCode);
Console.WriteLine();
Console.WriteLine(response.StatusDescription);
Console.WriteLine(result);
}
}
catch (WebException wex)
{
if (wex.Response != null)
{
using (var errorResponse = (HttpWebResponse)wex.Response)
{
using (var reader = new StreamReader(errorResponse.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)errorResponse.StatusCode);
Console.WriteLine();
Console.WriteLine(errorResponse.StatusDescription);
Console.WriteLine(result);
}
}
}
}
}
catch (IOException e)
{
Console.WriteLine(e);
}
}
}
}
Json Example Request:
{
"MerchantGuid" : "24639b5f-f881-45dc-966c-4beece954e6c",
"CompanyName" : "Incutex",
"FirstName": "John",
"LastName": "Doe",
"Address1": "108 8th Av.",
"Address2": "8th Floor",
"Zip": "10008",
"City": "New York",
"State": "NY",
"PersonalPhone" : "9727414574",
"WorkPhone" : "9177563046",
"Fax" : "8004578796",
"Email": "john.doe@mailinator.com"
}
Json Example Response:
{
"guid": "b3370c63-48af-41e5-905b-7161a4b92ec5",
"merchantGuid": "cd3d0150-819c-44b9-8efd-2fa248fcacce",
"firstName": "John",
"lastName": "Doe",
"address1": "108 8th Av.",
"address2": "8th Floor",
"zip": "10008",
"city": "New York",
"state": "NY",
"stateFullName": "New York",
"email": "john.doe@mailinator.com",
"companyName": "Incutex",
"workPhone": "9177563046",
"fax": "8004578796",
"status": "Active",
"displayName": "John Doe - Incutex - "
}
Json Example Error Response:
{
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"traceId": "00-926d6b34ca17098110279576019bd0e1-290ceacd25f20639-00",
"errors": {
"guid": [
"The value '{{Testguid}}' is not valid."
],
"$.MerchantGuid": [
"The JSON value could not be converted to System.Nullable`1[System.Guid]. Path: $.MerchantGuid | LineNumber: 1 | BytePositionInLine: 34."
],
"Fax": [
"Field maximum length must be less than 10",
"The field Fax is invalid."
],
"Zip": [
"The Zip must be between 0 and 10 characters long",
"The field Zip is invalid."
],
"City": [
"Field maximum length must be less than 50",
"The field City is invalid."
],
"Email": [
"Field maximum length must be less than 1000",
"The field Email is invalid."
],
"State": [
"Field maximum length must be less than 2",
"The field State is invalid.",
"The field State is invalid."
],
"Address1": [
"Field maximum length must be less than 100",
"The field Address1 is invalid."
],
"Address2": [
"Field maximum length must be less than 100",
"The field Address2 is invalid."
],
"LastName": [
"Field maximum length must be less than 100",
"The field LastName is invalid."
],
"FirstName": [
"Field maximum length must be less than 100",
"The field FirstName is invalid."
],
"WorkPhone": [
"Field maximum length must be less than 10",
"Invalid phone number. Must be 10 digits numbers only no special characters.",
"The field WorkPhone is invalid."
],
"CompanyName": [
"Field maximum length must be less than 100",
"The field CompanyName is invalid."
]
}
}
This endpoint creates a invoice customer.
HTTP Request
POST https://sandbox.choice.dev/api/v1/Invoice/InvoiceCustomers
Headers using token
Key | Value |
---|---|
Content-Type | "application/json" |
Authorization | Token. Eg: "Bearer eHSN5rTBzqDozgAAlN1UlTMVuIT1zSiAZWCo6E..." |
Headers using API Key
Key | Value |
---|---|
Content-Type | "application/json" |
UserAuthorization | API Key. Eg: "e516b6db-3230-4b1c-ae3f-e5379b774a80" |
Query Parameters
Parameter | Type | M/C/O | Value |
---|---|---|---|
MerchantGuid | string | Mandatory | Merchant’s Guid. |
CompanyName | string | Optional | Company Name. Only letters and numbers. Max length = 100. |
FirstName | string | Optional | User’s first name. Only letters and numbers. Max length = 100. |
LastName | string | Optional | User’s last name. Only letters and numbers. Max length = 100. |
Address1 | string | Optional | User’s address. Max length = 100. |
Address2 | string | Optional | User’s address line 2. Max lenght = 100. |
City | string | Optional | User’s city. Max length = 50. |
State | string | Optional | User’s short name state. The ISO 3166-2 CA and US state or province code of a user. Length = 2. |
Zip | string | Optional | User’s zipcode. Length = 5. |
PersonalPhone | string | Optional | User’s phone number. The phone number must be syntactically correct. For example, 4152345678. |
WorkPhone | string | Optional | User’s phone number. The phone number must be syntactically correct. For example, 4152345678. |
Fax | string | Optional | User’s phone number. The phone number must be syntactically correct. For example, 4152345678. |
string | Optional | User’s valid email address. Max length = 1000. |
Response
- 201 code (created).
Update invoice customer
using System;
using Newtonsoft.Json;
using System.IO;
using System.Net;
using System.Text;
namespace ChoiceSample
{
public class InvoiceCustomer
{
public static void UpdateInvoiceCustomer()
{
try
{
var request = (HttpWebRequest)WebRequest.Create("https://sandbox.choice.dev/api/v1/Invoice/InvoiceCustomers/33524364-727a-422b-8bbe-5eab1a849e82");
request.ContentType = "text/json";
request.Method = "PUT";
var invoiceCustomer = new
{
CompanyName = "Incutex",
FirstName = "John",
LastName = "Doe",
Address1 = "108 8th Av.",
Address2 = "8th Floor",
Zip = "10008",
City = "New York",
State = "NY",
PersonalPhone = "9727414574",
WorkPhone = "9177563046",
Fax = "8004578796",
Email = "john.doe@mailinator.com"
};
string json = JsonConvert.SerializeObject(invoiceCustomer);
request.Headers.Add("Authorization", "Bearer 1A089D6ziUybPZFQ3mpPyjt9OEx9yrCs7eQIC6V3A0lmXR2N6-seGNK16Gsnl3td6Ilfbr2Xf_EyukFXwnVEO3fYL-LuGw-L3c8WuaoxhPE8MMdlMPILJTIOV3lTGGdxbFXdKd9U03bbJ9TDUkqxHqq8_VyyjDrw7fs0YOob7bg0OovXTeWgIvZaIrSR1WFR06rYJ0DfWn-Inuf7re1-4SMOjY1ZoCelVwduWCBJpw1111cNbWtHJfObV8u1CVf0");
request.ContentType = "application/json";
request.Accept = "application/json";
using (var streamWriter = new StreamWriter(request.GetRequestStream()))
{
streamWriter.Write(json);
streamWriter.Flush();
streamWriter.Close();
}
try
{
var response = (HttpWebResponse)request.GetResponse();
using (var reader = new StreamReader(response.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)response.StatusCode);
Console.WriteLine();
Console.WriteLine(response.StatusDescription);
Console.WriteLine(result);
}
}
catch (WebException wex)
{
if (wex.Response != null)
{
using (var errorResponse = (HttpWebResponse)wex.Response)
{
using (var reader = new StreamReader(errorResponse.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)errorResponse.StatusCode);
Console.WriteLine();
Console.WriteLine(errorResponse.StatusDescription);
Console.WriteLine(result);
}
}
}
}
}
catch (IOException e)
{
Console.WriteLine(e);
}
}
}
}
Json Example Request:
{
"CompanyName" : "Incutex",
"FirstName": "John",
"LastName": "Doe",
"Address1": "108 8th Av.",
"Address2": "8th Floor",
"Zip": "10008",
"City": "New York",
"State": "NY",
"PersonalPhone" : "9727414574",
"WorkPhone" : "9177563046",
"Fax" : "8004578796",
"Email": "john.doe@mailinator.com"
}
Json Example Response:
{
"guid": "f178c204-8819-4b79-ad1f-0587265bbc54",
"merchantGuid": "cd3d0150-819c-44b9-8efd-2fa248fcacce",
"firstName": "John",
"lastName": "Doe",
"address1": "108 8th Av.",
"address2": "8th Floor",
"zip": "10008",
"city": "New York",
"state": "NY",
"stateFullName": "New York",
"email": "john.doe@mailinator.com",
"companyName": "Incutex",
"workPhone": "9177563046",
"fax": "8004578796",
"status": "Active",
"displayName": "John Doe - Incutex - "
}
Json Example Error Response:
{
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"traceId": "00-926d6b34ca17098110279576019bd0e1-290ceacd25f20639-00",
"errors": {
"guid": [
"The value '{{Testguid}}' is not valid."
],
"$.MerchantGuid": [
"The JSON value could not be converted to System.Nullable`1[System.Guid]. Path: $.MerchantGuid | LineNumber: 1 | BytePositionInLine: 34."
],
"Fax": [
"Field maximum length must be less than 10",
"The field Fax is invalid."
],
"Zip": [
"The Zip must be between 0 and 10 characters long",
"The field Zip is invalid."
],
"City": [
"Field maximum length must be less than 50",
"The field City is invalid."
],
"Email": [
"Field maximum length must be less than 1000",
"The field Email is invalid."
],
"State": [
"Field maximum length must be less than 2",
"The field State is invalid.",
"The field State is invalid."
],
"Address1": [
"Field maximum length must be less than 100",
"The field Address1 is invalid."
],
"Address2": [
"Field maximum length must be less than 100",
"The field Address2 is invalid."
],
"LastName": [
"Field maximum length must be less than 100",
"The field LastName is invalid."
],
"FirstName": [
"Field maximum length must be less than 100",
"The field FirstName is invalid."
],
"WorkPhone": [
"Field maximum length must be less than 10",
"Invalid phone number. Must be 10 digits numbers only no special characters.",
"The field WorkPhone is invalid."
],
"CompanyName": [
"Field maximum length must be less than 100",
"The field CompanyName is invalid."
]
}
}
This endpoint updates a invoice customer.
HTTP Request
PUT https://sandbox.choice.dev/api/v1/Invoice/InvoiceCustomers/<guid>
Headers using token
Key | Value |
---|---|
Content-Type | "application/json" |
Authorization | Token. Eg: "Bearer eHSN5rTBzqDozgAAlN1UlTMVuIT1zSiAZWCo6E..." |
Headers using API Key
Key | Value |
---|---|
Content-Type | "application/json" |
UserAuthorization | API Key. Eg: "e516b6db-3230-4b1c-ae3f-e5379b774a80" |
URL Parameters
Parameter | Description |
---|---|
guid | Invoice customer’s guid to update |
Query Parameters
Parameter | Type | M/C/O | Value |
---|---|---|---|
MerchantGuid | string | Mandatory | Merchant’s Guid. |
CompanyName | string | Optional | Company Name. Max length = 100. |
FirstName | string | Optional | User’s first name. Only letters. Max length = 100. |
LastName | string | Optional | User’s last name. Only letters. Max length = 100. |
Address1 | string | Optional | User’s address. Max length = 100. |
Address2 | string | Optional | User’s address line 2. Max length = 100. |
City | string | Optional | User’s city. Max length = 50. |
State | string | Optional | User’s short name state. The ISO 3166-2 CA and US state or province code of a user. Length = 2. |
Zip | string | Optional | User’s zipcode. Length = 5. |
PersonalPhone | string | Optional | User’s phone number. The phone number must be syntactically correct. For example, 4152345678. |
WorkPhone | string | Optional | User’s phone number. The phone number must be syntactically correct. For example, 4152345678. |
Fax | string | Optional | User’s phone number. The phone number must be syntactically correct. For example, 4152345678. |
string | Optional | User’s valid email address |
Response
- 201 code (Created).
Get invoice customer
using System;
using Newtonsoft.Json;
using System.IO;
using System.Net;
using System.Text;
namespace ChoiceSample
{
public class InvoiceCustomer
{
public static void GetInvoiceCustomer()
{
try
{
var request = (HttpWebRequest)WebRequest.Create("https://sandbox.choice.dev/api/v1/Invoice/InvoiceCustomers/33524364-727a-422b-8bbe-5eab1a849e82");
request.Method = "GET";
request.Headers.Add("Authorization", "Bearer 1A089D6ziUybPZFQ3mpPyjt9OEx9yrCs7eQIC6V3A0lmXR2N6-seGNK16Gsnl3td6Ilfbr2Xf_EyukFXwnVEO3fYL-LuGw-L3c8WuaoxhPE8MMdlMPILJTIOV3lTGGdxbFXdKd9U03bbJ9TDUkqxHqq8_VyyjDrw7fs0YOob7bg0OovXTeWgIvZaIrSR1WFR06rYJ0DfWn-Inuf7re1-4SMOjY1ZoCelVwduWCBJpw1111cNbWtHJfObV8u1CVf0");
try
{
var response = (HttpWebResponse)request.GetResponse();
using (var reader = new StreamReader(response.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)response.StatusCode);
Console.WriteLine();
Console.WriteLine(response.StatusDescription);
Console.WriteLine(result);
}
}
catch (WebException wex)
{
if (wex.Response != null)
{
using (var errorResponse = (HttpWebResponse)wex.Response)
{
using (var reader = new StreamReader(errorResponse.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)errorResponse.StatusCode);
Console.WriteLine();
Console.WriteLine(errorResponse.StatusDescription);
Console.WriteLine(result);
}
}
}
}
}
catch (IOException e)
{
Console.WriteLine(e);
}
}
}
}
Json Example Response:
{
"guid": "bb75d6ba-20bf-4d6b-8a56-6997c4e6fdde",
"merchantGuid": "cd3d0150-819c-44b9-8efd-2fa248fcacce",
"firstName": "John",
"lastName": "Doe",
"address1": "108 8th Av.",
"address2": "8th Floor",
"zip": "10008",
"city": "New York",
"state": "NY",
"stateFullName": "New York",
"email": "john.doe@mailinator.com",
"companyName": "Incutex",
"workPhone": "9177563046",
"fax": "8004578796",
"status": "Active",
"displayName": "John Doe - Incutex - "
}
Json Example Error Response:
{
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"traceId": "00-d30ac376279a06d5f89e57e140123bd0-07a076df16418083-00",
"errors": {
"guid": [
"The value '{{testGuid}}' is not valid."
]
}
}
This endpoint gets a invoice customer.
HTTP Request
GET https://sandbox.choice.dev/api/v1/Invoice/InvoiceCustomers/<guid>
Headers using token
Key | Value |
---|---|
Authorization | Token. Eg: "Bearer eHSN5rTBzqDozgAAlN1UlTMVuIT1zSiAZWCo6E..." |
Headers using API Key
Key | Value |
---|---|
UserAuthorization | API Key. Eg: "e516b6db-3230-4b1c-ae3f-e5379b774a80" |
URL Parameters
Parameter | Description |
---|---|
guid | Invoice customer’s guid to get |
Response
- 200 code (ok).
Get invoice customer by Merchant
using System;
using Newtonsoft.Json;
using System.IO;
using System.Net;
using System.Text;
namespace ChoiceSample
{
public class InvoiceCustomer
{
public static void GetInvoiceCustomerByMerchant()
{
try
{
var request = (HttpWebRequest)WebRequest.Create("https://sandbox.choice.dev/api/v1/Invoice/24639b5f-f881-45dc-966c-4beece954e6c/InvoiceCustomers");
request.Method = "GET";
request.Headers.Add("Authorization", "Bearer 1A089D6ziUybPZFQ3mpPyjt9OEx9yrCs7eQIC6V3A0lmXR2N6-seGNK16Gsnl3td6Ilfbr2Xf_EyukFXwnVEO3fYL-LuGw-L3c8WuaoxhPE8MMdlMPILJTIOV3lTGGdxbFXdKd9U03bbJ9TDUkqxHqq8_VyyjDrw7fs0YOob7bg0OovXTeWgIvZaIrSR1WFR06rYJ0DfWn-Inuf7re1-4SMOjY1ZoCelVwduWCBJpw1111cNbWtHJfObV8u1CVf0");
try
{
var response = (HttpWebResponse)request.GetResponse();
using (var reader = new StreamReader(response.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)response.StatusCode);
Console.WriteLine();
Console.WriteLine(response.StatusDescription);
Console.WriteLine(result);
}
}
catch (WebException wex)
{
if (wex.Response != null)
{
using (var errorResponse = (HttpWebResponse)wex.Response)
{
using (var reader = new StreamReader(errorResponse.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)errorResponse.StatusCode);
Console.WriteLine();
Console.WriteLine(errorResponse.StatusDescription);
Console.WriteLine(result);
}
}
}
}
}
catch (IOException e)
{
Console.WriteLine(e);
}
}
}
}
Json Example Response:
[
{
"guid": "c6697789-6b5d-4243-bb2c-91da084b6e4a",
"merchantGuid": "24639b5f-f881-45dc-966c-4beece954e6c",
"customerCode": "NA1530",
"companyName": "Incutex",
"firstName": "Max",
"lastName": "Tomassi",
"address1": "Belgrano 383",
"zip": "10016",
"city": "New York",
"state": "NY",
"country": "United States",
"province": "",
"personalPhone": "",
"email": "maxduplessy@mailinator.com",
"invoiceNumber": "000001",
"shippingAddresses": [
{
"isDeleted": false,
"guid": "e45e0464-39c8-4d87-b1da-7bef8b251f29",
"address1": "Belgrano 383",
"zip": "10016",
"city": "New York",
"state": "NY",
"country": "United States",
"province": ""
}
]
},
{
"guid": "e79ec8b0-dbd3-4be0-bf4e-8c12c632be7c",
"merchantGuid": "24639b5f-f881-45dc-966c-4beece954e6c",
"customerCode": "TD1627",
"companyName": "Incutex",
"firstName": "John",
"lastName": "Doe",
"address1": "108 8th Av.",
"address2": "8th Floor",
"zip": "10008",
"city": "New York",
"state": "NY",
"personalPhone": "9727414574",
"workPhone": "9177563046",
"fax": "8004578796",
"email": "john.doe@mailinator.com",
"invoiceNumber": "000001"
},
{
"guid": "33524364-727a-422b-8bbe-5eab1a849e82",
"merchantGuid": "24639b5f-f881-45dc-966c-4beece954e6c",
"customerCode": "LJ7482",
"companyName": "Incutex",
"firstName": "John",
"lastName": "Doe",
"address1": "108 8th Av.",
"address2": "8th Floor",
"zip": "10008",
"city": "New York",
"state": "NY",
"personalPhone": "9727414574",
"workPhone": "9177563046",
"fax": "8004578796",
"email": "john.doe@mailinator.com",
"invoiceNumber": "000001"
}
]
Json Example Error Response:
{
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"traceId": "00-d30ac376279a06d5f89e57e140123bd0-07a076df16418083-00",
"errors": {
"guid": [
"The value '{{testGuid}}' is not valid."
]
}
}
This endpoint gets a invoice customer.
HTTP Request
GET https://sandbox.choice.dev/api/v1/Invoice/<merchantGuid>/InvoiceCustomers
Headers using token
Key | Value |
---|---|
Authorization | Token. Eg: "Bearer eHSN5rTBzqDozgAAlN1UlTMVuIT1zSiAZWCo6E..." |
Headers using API Key
Key | Value |
---|---|
UserAuthorization | API Key. Eg: "e516b6db-3230-4b1c-ae3f-e5379b774a80" |
URL Parameters
Parameter | Description |
---|---|
merchantGuid | Merchant’s guid to get |
Response
- 200 code (ok).
Invoice
Create invoice
using System;
using Newtonsoft.Json;
using System.IO;
using System.Net;
using System.Text;
namespace ChoiceSample
{
public class Invoice
{
public static void CreateInvoice()
{
try
{
var request = (HttpWebRequest)WebRequest.Create("https://sandbox.choice.dev/api/v1/Invoice");
request.ContentType = "text/json";
request.Method = "POST";
var invoice = new
{
MerchantGuid = "24639b5f-f881-45dc-966c-4beece954e6c",
InvoiceCustomerGuid = "c6697789-6b5d-4243-bb2c-91da084b6e4a",
InvoiceNumber = "000006",
OrderNumber = "000006",
PaymentTerm = "Due on Receipt",
DueDate = "11/26/2020",
Details = new Detail[]
{
new Detail{
ItemDescription = "Wine Malbec",
ItemName = "Wine Malbec",
Rate = 14.78,
Quantity = 8
},
new Detail{
ItemDescription = "Rum",
ItemName = "Rum",
Rate = 9.85,
Quantity = 4
},
new Detail{
ItemDescription = "Brandy",
ItemName = "Brandy",
Rate = 11.80,
Quantity = 2
},
new Detail{
ItemDescription = "Cigars",
ItemName = "Cigars",
Rate = 44.89,
Quantity = 3
}
},
DiscountType = "Fixed",
DiscountValue = 5.00,
TaxZip = "10016",
TaxAmount = 27.5932625,
TaxRate = 8.875,
Note = "For september services",
TermsAndConditions = "The ones you accepted when you clicked two pages ago",
SendStatus = "Scheduled To be Sent",
SendDate = "11/25/2020",
InvoiceRecipientEmail = "maxduplessy@mailinator.com",
OtherRecipients = "maxduplessy@mailinator.com, maxduplessy123@mailinator.com",
SendBySMS = true,
SendToPhoneNumber = "9174355176",
SendToOthersNumber ="6384910738, 9174607489"
};
string json = JsonConvert.SerializeObject(invoice);
request.Headers.Add("Authorization", "Bearer 1A089D6ziUybPZFQ3mpPyjt9OEx9yrCs7eQIC6V3A0lmXR2N6-seGNK16Gsnl3td6Ilfbr2Xf_EyukFXwnVEO3fYL-LuGw-L3c8WuaoxhPE8MMdlMPILJTIOV3lTGGdxbFXdKd9U03bbJ9TDUkqxHqq8_VyyjDrw7fs0YOob7bg0OovXTeWgIvZaIrSR1WFR06rYJ0DfWn-Inuf7re1-4SMOjY1ZoCelVwduWCBJpw1111cNbWtHJfObV8u1CVf0");
request.ContentType = "application/json";
request.Accept = "application/json";
using (var streamWriter = new StreamWriter(request.GetRequestStream()))
{
streamWriter.Write(json);
streamWriter.Flush();
streamWriter.Close();
}
try
{
var response = (HttpWebResponse)request.GetResponse();
using (var reader = new StreamReader(response.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)response.StatusCode);
Console.WriteLine();
Console.WriteLine(response.StatusDescription);
Console.WriteLine(result);
}
}
catch (WebException wex)
{
if (wex.Response != null)
{
using (var errorResponse = (HttpWebResponse)wex.Response)
{
using (var reader = new StreamReader(errorResponse.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)errorResponse.StatusCode);
Console.WriteLine();
Console.WriteLine(errorResponse.StatusDescription);
Console.WriteLine(result);
}
}
}
}
}
catch (IOException e)
{
Console.WriteLine(e);
}
}
}
}
Json Example Request:
{
"merchantGuid": "24639b5f-f881-45dc-966c-4beece954e6c",
"invoiceCustomerGuid": "c6697789-6b5d-4243-bb2c-91da084b6e4a",
"invoiceNumber": "000006",
"orderNumber": "000006",
"paymentTerm": "Due on Receipt",
"dueDate": "11/26/2020",
"details": [
{
"itemName": "Wine Malbec",
"itemDescription": "",
"quantity": 8,
"rate": "14.78"
},
{
"itemName": "Rum",
"itemDescription": "",
"quantity": 4,
"rate": "9.85"
},
{
"itemName": "Brandy",
"itemDescription": "",
"quantity": 2,
"rate": "11.80"
},
{
"itemName": "Cigars",
"itemDescription": "",
"quantity": 3,
"rate": "44.89"
}
],
"discountType": "Fixed",
"discountValue": "5",
"taxZip": "10016",
"taxRate": 8.875,
"taxAmount": 27.5932625,
"note": "For september services",
"termsAndConditions": "The ones you accepted when you clicked two pages ago",
"sendStatus": "Scheduled To be Sent",
"sendDate": "11/25/2020",
"invoiceRecipientEmail": "maxduplessy@mailinator.com",
"sendToPhoneNumber": "9887555656",
"sendBySMS": true
}
Json Example Response:
{
"invoiceGuid": "3d6f573a-74c8-43cf-b049-1e84131022b1",
"timeStamp": "2023-06-28T19:27:39.74+00:00",
"merchantGuid": "cd3d0150-819c-44b9-8efd-2fa248fcacce",
"invoiceCustomerGuid": "a39fbb42-5686-4958-9cac-2eb6c51bfbf3",
"sendDate": "2030-02-25T00:00:00.00-06:00",
"sendStatus": "Scheduled To be Sent",
"paymentStatus": "Scheduled To be Sent",
"invoiceRecipientEmail": "maxduplessy@mailinator.com",
"paymentTerm": "Custom",
"dueDate": "2030-11-26T00:00:00.00-06:00",
"invoiceNumber": "66d69497",
"orderNumber": "556t623z1",
"amountSubTotal": 315.910,
"currencyQuote": 1.000,
"currency": "USD",
"amountDueTotal": 338.480,
"remainingBalance": 0.000,
"amountDiscounted": 5.000,
"discountValue": 5.000,
"discountType": "Fixed",
"taxRate": 8.870,
"taxAmount": 27.570,
"taxZip": "10016",
"note": "For september services",
"termsAndConditions": "The ones you accepted when you clicked two pages ago",
"extensionTotalAmount": 338.480,
"otherRecipients": [],
"extensionHostedPaymentPageRequestToken": "00000000-0000-0000-0000-000000000000",
"extensionDisplayCreditCard": false,
"extensionDisplayAch": false,
"details": [
{
"guid": "9ce8c168-8669-477d-a448-3d2abc0e738e",
"invoiceGuid": "3d6f573a-74c8-43cf-b049-1e84131022b1",
"itemName": "Wine Malbec",
"rate": 14.780,
"quantity": 8,
"amount": 118.240,
"isDeleted": false,
"discountedAmount": 0.000,
"finallyAmount": 118.240
},
{
"guid": "4de4e1ba-fca3-4770-ba7f-995a8420cabf",
"invoiceGuid": "3d6f573a-74c8-43cf-b049-1e84131022b1",
"itemName": "Rum",
"rate": 9.850,
"quantity": 4,
"amount": 39.400,
"isDeleted": false,
"discountedAmount": 0.000,
"finallyAmount": 39.400
},
{
"guid": "d9a8a274-20a6-44ed-adb3-8f11964c57be",
"invoiceGuid": "3d6f573a-74c8-43cf-b049-1e84131022b1",
"itemName": "Brandy",
"rate": 11.800,
"quantity": 2,
"amount": 23.600,
"isDeleted": false,
"discountedAmount": 0.000,
"finallyAmount": 23.600
},
{
"guid": "688f9ee6-1d7f-408d-b758-a7241ca87517",
"invoiceGuid": "3d6f573a-74c8-43cf-b049-1e84131022b1",
"itemName": "Cigars",
"rate": 44.890,
"quantity": 3,
"amount": 134.670,
"isDeleted": false,
"discountedAmount": 0.000,
"finallyAmount": 134.670
}
],
"reminders": [
{
"guid": "84b394f0-c570-42e5-aa50-29a8960733fc",
"invoiceGuid": "3d6f573a-74c8-43cf-b049-1e84131022b1",
"reminderType": "5 days after due Date",
"isActive": true,
"isCompleted": false,
"reminderDate": "2030-12-01T00:00:00.00-06:00"
}
],
"merchant": {
"guid": "cd3d0150-819c-44b9-8efd-2fa248fcacce",
"mid": "888000002849",
"allowOpenButton": false,
"mainAdmin": "303e2684-75a2-4f96-8d55-7457ca41b213",
"adminUserGuid": "303e2684-75a2-4f96-8d55-7457ca41b213",
"dba": "merchtest",
"legalName": "MerchTesting",
"email": "merchadmtest1@mailinator.com",
"phone": "4548888888",
"address1": "Example Street 1",
"address2": "Example Street 2",
"zipCode": "10012",
"city": "Manhattan",
"state": "NY",
"allowTips": true,
"allowDualPricing": false,
"allowCurrencyConversion": true,
"surchargeLabel": "Surcharge Fee",
"defaultSurchargeLabel": "Surcharge Fee",
"achSecCode": "WEB",
"requiredCustomerData": false,
"requiredProductData": false,
"alternativeNames": false,
"alternativeBatchNotifications": false,
"debtRepayment": false,
"enableAchRiskValidation": true,
"minTxnAmount": 1000.000,
"sendEmail": true,
"status": "Merchant - Active",
"reAttemptRb": true,
"adminUserRoles": [
{
"guid": "d7e97432-01c2-43c6-b0c9-e164be9c18ca",
"name": "Merchant Admin",
"description": "A user who run all type of transactions and search for all those transactions."
}
],
"webhookExist": false
},
"invoiceCustomer": {
"guid": "a39fbb42-5686-4958-9cac-2eb6c51bfbf3",
"merchantGuid": "cd3d0150-819c-44b9-8efd-2fa248fcacce",
"firstName": "Customer",
"lastName": "Testing",
"address1": "Example Street 1",
"address2": "Example Street 2",
"zip": "10012",
"city": "Manhattan",
"state": "NY",
"stateFullName": "New York",
"country": "United States",
"province": "",
"phone": "4548888888",
"email": "merchadmtest1@mailinator.com",
"personalPhone": "4548888888",
"shippingAddresses": [
{
"guid": "5e65933a-d094-4f47-ace3-18e59ef29220",
"address1": "Example Street 1",
"address2": "Example Street 2",
"zip": "10012",
"state": "NY",
"city": "Manhattan",
"country": "United States",
"province": ""
}
],
"status": "Active",
"displayName": "Customer Testing - 4548888888"
},
"sendBySms": true,
"sendToPhoneNumber": "9887555656",
"sendToOtherNumbers": [],
"sendStatusCode": 5001,
"paymentStatusCode": 5001,
"paymentTermCode": 5000
}
Json Example Error Response:
{
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"traceId": "00-f38046b86a364e08f1692c553db29a39-78c406e273bc38ea-00",
"errors": {
"InvoiceNumber": [
"The InvoiceNumber field is required.",
"The field InvoiceNumber is invalid."
],
"PaymentTerm": [
"The field PaymentTerm is invalid."
],
"TaxAmount": [
"TaxAmount can have 3 decimal places at most."
],
"TaxRate": [
"TaxRate can have 3 decimal places at most."
],
"Note": [
"The field Note is invalid."
],
"TermsAndConditions": [
"The field TermsAndConditions is invalid."
],
"SendStatus": [
"The field SendStatus is invalid."
],
"InvoiceRecipientEmail": [
"The InvoiceRecipientEmail field is not a valid e-mail address."
],
"SendToPhoneNumber": [
"The field SendToPhoneNumber is invalid."
],
"Details[0].ItemName": [
"The ItemName field is required."
],
"Details[0].Rate": [
"Rate can have 3 decimal places at most."
]
}
}
This endpoint creates a invoice.
HTTP Request
POST https://sandbox.choice.dev/api/v1/Invoice
Headers using token
Key | Value |
---|---|
Content-Type | "application/json" |
Authorization | Token. Eg: "Bearer eHSN5rTBzqDozgAAlN1UlTMVuIT1zSiAZWCo6E..." |
Headers using API Key
Key | Value |
---|---|
Content-Type | "application/json" |
UserAuthorization | API Key. Eg: "e516b6db-3230-4b1c-ae3f-e5379b774a80" |
Query Parameters
Parameter | Type | M/C/O | Value |
---|---|---|---|
MerchantGuid | string | Mandatory | Merchant's Guid. |
InvoiceCustomerGuid | string | Mandatory | InvoiceCustomer's Guid. |
DeviceCreditCardGuid | string | Optional | Credit card device's Guid. |
DeviceAchGuid | string | Optional | Ach device's Guid. |
InvoiceNumber | string | Mandatory | Invoice Number. Only letters, numbers and /-#@.&$ |
OrderNumber | string | Optional | Order number. Length = 30. |
PaymentTerm | string | Optional | The term of payments. Allowed values: 1. Custom 2. Due on Receipt 3. Due end of month 4. Due end of next month 5. Net 15 6. Net 30 7. Net 45 8. Net 60DueDate |
DiscountType | string | Optional | Discount Type. Allowed values: 1. Fixed 2. PercentageDiscountValue |
TaxZip | string | Optional | Tax Zip. Mandatory if there is a TaxRate. |
TaxAmount | decimal | Optional | Tax Amount. Only when TaxRate not sent. Up to 3 decimals. |
TaxRate | decimal | Optional | Tax Rate. Only when TaxAmount not sent. Up to 3 decimals. |
Note | string | Optional | Note. Only letters, numbers and /-#@.&$ |
TermsAndConditions | string | Optional | Terms And Conditions. Only letters, numbers and /-#@.&$ |
SendStatus | string | Optional | Send Status. Allowed values: 1. Draft 2. Scheduled To be Sent. Note: Will send email and text. 3. Scheduled To be SentEMAIL. Note: Will send email only. 4. Scheduled To be SentSMS. Note: Will send SMS only.SendDate |
InvoiceRecipientEmail | string | Optional | Valid email address. Mandatory if SendStatus is scheduled to be sent or scheduled to be sent email. |
SendBySMS | boolean | Optional | True or False. Mandatory value of true if SendStatus if scheduled to be sent or scheduled to be sent SMS. |
SendToPhoneNumber | string | Optional | Phone number. The phone number must be syntactically correct. For example, 4152345678. Mandatory if SendStatus is scheduled to be sent or scheduled to be sent SMS. |
Details | object[] | Mandatory | Details. |
Details | array of detail | ||
ItemDescription | string | Mandatory | Item Description. Only letters, numbers and /-#@.&$ |
ItemName | string | Mandatory | Item Name. Only letters, numbers and /-#@.&$ |
Rate | decimal | Mandatory | Rate. Up to 3 decimals. |
Quantity | integer | Mandatory | Quantity. |
Response
- 201 code (created).
Update invoice
using System;
using Newtonsoft.Json;
using System.IO;
using System.Net;
using System.Text;
namespace ChoiceSample
{
public class Invoice
{
public static void UpdateInvoice()
{
try
{
var request = (HttpWebRequest)WebRequest.Create("https://sandbox.choice.dev/api/v1/Invoice/2541692d-958f-46b7-8ca7-a127016ea3b6");
request.ContentType = "text/json";
request.Method = "PUT";
var invoice = new
{
OrderNumber = "000006",
PaymentTerm = "Due on Receipt",
DueDate = "11/26/2020",
DiscountType = "Fixed",
DiscountValue = "5",
TaxZip = "10016",
TaxRate = 8.875,
TaxAmount = 27.5932625,
Note = "For september services",
TermsAndConditions = "The ones you accepted when you clicked two pages ago",
SendStatus = "Scheduled To be Sent",
SendDate = "11/25/2020",
InvoiceRecipientEmail = "maxduplessy@mailinator.com",
SendToPhoneNumber = "9887555656",
SendBySMS = true
};
string json = JsonConvert.SerializeObject(invoice);
request.Headers.Add("Authorization", "Bearer 1A089D6ziUybPZFQ3mpPyjt9OEx9yrCs7eQIC6V3A0lmXR2N6-seGNK16Gsnl3td6Ilfbr2Xf_EyukFXwnVEO3fYL-LuGw-L3c8WuaoxhPE8MMdlMPILJTIOV3lTGGdxbFXdKd9U03bbJ9TDUkqxHqq8_VyyjDrw7fs0YOob7bg0OovXTeWgIvZaIrSR1WFR06rYJ0DfWn-Inuf7re1-4SMOjY1ZoCelVwduWCBJpw1111cNbWtHJfObV8u1CVf0");
request.ContentType = "application/json";
request.Accept = "application/json";
using (var streamWriter = new StreamWriter(request.GetRequestStream()))
{
streamWriter.Write(json);
streamWriter.Flush();
streamWriter.Close();
}
try
{
var response = (HttpWebResponse)request.GetResponse();
using (var reader = new StreamReader(response.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)response.StatusCode);
Console.WriteLine();
Console.WriteLine(response.StatusDescription);
Console.WriteLine(result);
}
}
catch (WebException wex)
{
if (wex.Response != null)
{
using (var errorResponse = (HttpWebResponse)wex.Response)
{
using (var reader = new StreamReader(errorResponse.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)errorResponse.StatusCode);
Console.WriteLine();
Console.WriteLine(errorResponse.StatusDescription);
Console.WriteLine(result);
}
}
}
}
}
catch (IOException e)
{
Console.WriteLine(e);
}
}
}
}
Json Example Request:
{
"OrderNumber": "000006",
"PaymentTerm": "Due on Receipt",
"DueDate": "11/26/2020",
"DiscountType": "Fixed",
"DiscountValue": "5",
"TaxZip": "10016",
"TaxRate": 8.875,
"TaxAmount": 27.5932625,
"Note": "For september services",
"TermsAndConditions": "The ones you accepted when you clicked two pages ago",
"SendStatus": "Scheduled To be Sent",
"SendDate": "11/25/2020",
"InvoiceRecipientEmail": "maxduplessy@mailinator.com",
"SendToPhoneNumber": "9887555656",
"SendBySMS": true
}
Json Example Response:
{
"invoiceGuid": "3f9a9010-ebfc-4975-8bb2-e4ee301db742",
"timeStamp": "2023-06-28T19:27:43.24+00:00",
"merchantGuid": "cd3d0150-819c-44b9-8efd-2fa248fcacce",
"invoiceCustomerGuid": "a39fbb42-5686-4958-9cac-2eb6c51bfbf3",
"sendDate": "2030-11-25T00:00:00.00-06:00",
"sendStatus": "Sent",
"paymentStatus": "Unpaid",
"invoiceRecipientEmail": "maxduplessy@mailinator.com",
"paymentTerm": "Custom",
"dueDate": "2030-11-26T00:00:00.00-06:00",
"invoiceNumber": "259p5557w",
"orderNumber": "000006",
"amountSubTotal": 315.910,
"currencyQuote": 1.000,
"currency": "USD",
"amountDueTotal": 338.480,
"remainingBalance": 0.000,
"amountDiscounted": 5.000,
"discountValue": 5.000,
"discountType": "Fixed",
"taxRate": 8.870,
"taxAmount": 27.570,
"taxZip": "10016",
"note": "For september services",
"termsAndConditions": "The ones you accepted when you clicked two pages ago",
"extensionTotalAmount": 338.480,
"otherRecipients": [],
"extensionHostedPaymentPageRequestToken": "b88fac53-8d3f-46e1-abed-f46899a0f71f",
"extensionDisplayCreditCard": false,
"extensionDisplayAch": false,
"details": [
{
"guid": "7b3de906-e453-4f1a-b3fd-2061037f9a75",
"invoiceGuid": "3f9a9010-ebfc-4975-8bb2-e4ee301db742",
"itemName": "Wine Malbec",
"rate": 14.780,
"quantity": 8,
"amount": 118.240,
"isDeleted": false,
"discountedAmount": 0.000,
"finallyAmount": 118.240
},
{
"guid": "682a998a-64c1-4104-88a7-46ec19c82acd",
"invoiceGuid": "3f9a9010-ebfc-4975-8bb2-e4ee301db742",
"itemName": "Rum",
"rate": 9.850,
"quantity": 4,
"amount": 39.400,
"isDeleted": false,
"discountedAmount": 0.000,
"finallyAmount": 39.400
},
{
"guid": "10694fc0-84ce-4fbe-a41a-10d3fbcff8c7",
"invoiceGuid": "3f9a9010-ebfc-4975-8bb2-e4ee301db742",
"itemName": "Brandy",
"rate": 11.800,
"quantity": 2,
"amount": 23.600,
"isDeleted": false,
"discountedAmount": 0.000,
"finallyAmount": 23.600
},
{
"guid": "8458f3af-63f2-42f6-9e4b-d9fd951f9dc5",
"invoiceGuid": "3f9a9010-ebfc-4975-8bb2-e4ee301db742",
"itemName": "Cigars",
"rate": 44.890,
"quantity": 3,
"amount": 134.670,
"isDeleted": false,
"discountedAmount": 0.000,
"finallyAmount": 134.670
}
],
"reminders": [
{
"guid": "ba5ab939-61a1-470b-b167-255b2410a03b",
"invoiceGuid": "3f9a9010-ebfc-4975-8bb2-e4ee301db742",
"reminderType": "5 days after due Date",
"isActive": true,
"isCompleted": false,
"reminderDate": "2023-07-03T19:27:42.29-05:00"
}
],
"merchant": {
"guid": "cd3d0150-819c-44b9-8efd-2fa248fcacce",
"mid": "888000002849",
"allowOpenButton": false,
"mainAdmin": "303e2684-75a2-4f96-8d55-7457ca41b213",
"adminUserGuid": "303e2684-75a2-4f96-8d55-7457ca41b213",
"dba": "merchtest",
"legalName": "MerchTesting",
"email": "merchadmtest1@mailinator.com",
"phone": "4548888888",
"address1": "Example Street 1",
"address2": "Example Street 2",
"zipCode": "10012",
"city": "Manhattan",
"state": "NY",
"allowTips": true,
"dualPricingFeeAmount": false,
"allowCurrencyConversion": true,
"surchargeLabel": "Surcharge Fee",
"defaultSurchargeLabel": "Surcharge Fee",
"achSecCode": "WEB",
"requiredCustomerData": false,
"requiredProductData": false,
"alternativeNames": false,
"alternativeBatchNotifications": false,
"debtRepayment": false,
"enableAchRiskValidation": true,
"minTxnAmount": 1000.000,
"sendEmail": true,
"status": "Merchant - Active",
"reAttemptRb": true,
"adminUserRoles": [
{
"guid": "d7e97432-01c2-43c6-b0c9-e164be9c18ca",
"name": "Merchant Admin",
"description": "A user who run all type of transactions and search for all those transactions."
}
],
"webhookExist": false
},
"invoiceCustomer": {
"guid": "a39fbb42-5686-4958-9cac-2eb6c51bfbf3",
"merchantGuid": "cd3d0150-819c-44b9-8efd-2fa248fcacce",
"firstName": "Customer",
"lastName": "Testing",
"address1": "Example Street 1",
"address2": "Example Street 2",
"zip": "10012",
"city": "Manhattan",
"state": "NY",
"stateFullName": "New York",
"country": "United States",
"province": "",
"phone": "4548888888",
"email": "merchadmtest1@mailinator.com",
"personalPhone": "4548888888",
"shippingAddresses": [
{
"guid": "5e65933a-d094-4f47-ace3-18e59ef29220",
"address1": "Example Street 1",
"address2": "Example Street 2",
"zip": "10012",
"state": "NY",
"city": "Manhattan",
"country": "United States",
"province": ""
}
],
"status": "Active",
"displayName": "Customer Testing - 4548888888"
},
"sendBySms": true,
"sendToPhoneNumber": "9887555656",
"sendToOtherNumbers": [],
"sendStatusCode": 5002,
"paymentStatusCode": 5017,
"paymentTermCode": 5000
}
Json Example Error Response:
{
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"traceId": "00-f38046b86a364e08f1692c553db29a39-78c406e273bc38ea-00",
"errors": {
"InvoiceNumber": [
"The InvoiceNumber field is required.",
"The field InvoiceNumber is invalid."
],
"PaymentTerm": [
"The field PaymentTerm is invalid."
],
"TaxAmount": [
"TaxAmount can have 3 decimal places at most."
],
"TaxRate": [
"TaxRate can have 3 decimal places at most."
],
"Note": [
"The field Note is invalid."
],
"TermsAndConditions": [
"The field TermsAndConditions is invalid."
],
"SendStatus": [
"The field SendStatus is invalid."
],
"InvoiceRecipientEmail": [
"The InvoiceRecipientEmail field is not a valid e-mail address."
],
"SendToPhoneNumber": [
"The field SendToPhoneNumber is invalid."
],
"Details[0].ItemName": [
"The ItemName field is required."
],
"Details[0].Rate": [
"Rate can have 3 decimal places at most."
]
}
}
This endpoint updates a invoice.
HTTP Request
PUT https://sandbox.choice.dev/api/v1/Invoice/<guid>
Headers using token
Key | Value |
---|---|
Content-Type | "application/json" |
Authorization | Token. Eg: "Bearer eHSN5rTBzqDozgAAlN1UlTMVuIT1zSiAZWCo6E..." |
Headers using API Key
Key | Value |
---|---|
Content-Type | "application/json" |
UserAuthorization | API Key. Eg: "e516b6db-3230-4b1c-ae3f-e5379b774a80" |
URL Parameters
Parameter | Description |
---|---|
guid | Invoice’s guid to update |
Query Parameters
Parameter | Type | M/C/O | Value |
---|---|---|---|
OrderNumber | string | Optional | Order number. Only letters, numbers and /-#@.&$. Max Length = 30. |
PaymentTerm | string | Optional | The term of payments. Allowed values: 1. Custom 2. Due on Receipt 3. Due end of month 4. Due end of next month 5. Net 15 6. Net 30 7. Net 45 8. Net 60DueDate |
DiscountType | string | Optional | Discount Type. Allowed values: 1. Fixed 2. PercentageDiscountValue |
TaxZip | string | Optional | Tax Zip. |
TaxAmount | decimal | Optional | Tax Amount. Up to 3 decimals. |
TaxRate | decimal | Optional | Tax Rate. Up to 3 decimals. |
Note | string | Optional | Note. |
TermsAndConditions | string | Optional | Terms And Conditions. Only letters, numbers and /-#@.&$. |
SendStatus | string | Optional | Send Status. Allowed values: 1. Draft 2. Scheduled To be Sent. Note: Will send email and text. 3. Scheduled To be SentEMAIL. Note: Will send email only. 4. Scheduled To be SentSMS. Note: Will send SMS only.SendDate |
InvoiceRecipientEmail | string | Optional | Valid email address. Mandatory if SendStatus is scheduled to be sent or scheduled to be sent email. |
SendBySMS | boolean | Optional | True or False. Mandatory value of true if SendStatus if scheduled to be sent or scheduled to be sent SMS. |
SendToPhoneNumber | string | Optional | Phone number. The phone number must be syntactically correct. For example, 4152345678. Mandatory if SendStatus is scheduled to be sent or scheduled to be sent SMS. |
Response
- 201 code (ok).
Get invoice
using System;
using Newtonsoft.Json;
using System.IO;
using System.Net;
using System.Text;
namespace ChoiceSample
{
public class Invoice
{
public static void GetInvoice()
{
try
{
var request = (HttpWebRequest)WebRequest.Create("https://sandbox.choice.dev/api/v1/Invoice/2541692d-958f-46b7-8ca7-a127016ea3b6");
request.Method = "GET";
request.Headers.Add("Authorization", "Bearer 1A089D6ziUybPZFQ3mpPyjt9OEx9yrCs7eQIC6V3A0lmXR2N6-seGNK16Gsnl3td6Ilfbr2Xf_EyukFXwnVEO3fYL-LuGw-L3c8WuaoxhPE8MMdlMPILJTIOV3lTGGdxbFXdKd9U03bbJ9TDUkqxHqq8_VyyjDrw7fs0YOob7bg0OovXTeWgIvZaIrSR1WFR06rYJ0DfWn-Inuf7re1-4SMOjY1ZoCelVwduWCBJpw1111cNbWtHJfObV8u1CVf0");
try
{
var response = (HttpWebResponse)request.GetResponse();
using (var reader = new StreamReader(response.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)response.StatusCode);
Console.WriteLine();
Console.WriteLine(response.StatusDescription);
Console.WriteLine(result);
}
}
catch (WebException wex)
{
if (wex.Response != null)
{
using (var errorResponse = (HttpWebResponse)wex.Response)
{
using (var reader = new StreamReader(errorResponse.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)errorResponse.StatusCode);
Console.WriteLine();
Console.WriteLine(errorResponse.StatusDescription);
Console.WriteLine(result);
}
}
}
}
}
catch (IOException e)
{
Console.WriteLine(e);
}
}
}
}
Json Example Response:
{
"invoiceGuid": "8733b0ed-d5be-4f3b-85d7-16920201eba4",
"timeStamp": "2023-06-28T19:27:45.91-05:00",
"merchantGuid": "cd3d0150-819c-44b9-8efd-2fa248fcacce",
"invoiceCustomerGuid": "a39fbb42-5686-4958-9cac-2eb6c51bfbf3",
"sendDate": "2030-02-25T00:00:00.00-06:00",
"sendStatus": "Scheduled To be Sent",
"paymentStatus": "Scheduled To be Sent",
"invoiceRecipientEmail": "maxduplessy@mailinator.com",
"paymentTerm": "Custom",
"dueDate": "2030-11-26T00:00:00.00-06:00",
"invoiceNumber": "499w3493q",
"orderNumber": "1996w499q",
"amountSubTotal": 315.910,
"currencyQuote": 1.000,
"currency": "USD",
"amountDueTotal": 338.480,
"remainingBalance": 0.000,
"amountDiscounted": 5.000,
"discountValue": 5.000,
"discountType": "Fixed",
"taxRate": 8.870,
"taxAmount": 27.570,
"taxZip": "10016",
"note": "For september services",
"termsAndConditions": "The ones you accepted when you clicked two pages ago",
"extensionTotalAmount": 338.480,
"otherRecipients": [],
"extensionHostedPaymentPageRequestToken": "00000000-0000-0000-0000-000000000000",
"extensionDisplayCreditCard": false,
"extensionDisplayAch": false,
"details": [
{
"guid": "4c5ea719-eca2-4015-9ffa-d2082cf00042",
"invoiceGuid": "8733b0ed-d5be-4f3b-85d7-16920201eba4",
"itemName": "Wine Malbec",
"itemDescription": "Example description",
"rate": 14.780,
"quantity": 8,
"amount": 118.240,
"isDeleted": false,
"discountedAmount": 0.000,
"finallyAmount": 118.240
},
{
"guid": "7160fefd-d355-4c7f-83d2-39faaafb0108",
"invoiceGuid": "8733b0ed-d5be-4f3b-85d7-16920201eba4",
"itemName": "Rum",
"itemDescription": "Example description",
"rate": 9.850,
"quantity": 4,
"amount": 39.400,
"isDeleted": false,
"discountedAmount": 0.000,
"finallyAmount": 39.400
},
{
"guid": "f69ed1ec-58fb-48ee-94f9-0a49d8f2eab7",
"invoiceGuid": "8733b0ed-d5be-4f3b-85d7-16920201eba4",
"itemName": "Brandy",
"itemDescription": "Example description",
"rate": 11.800,
"quantity": 2,
"amount": 23.600,
"isDeleted": false,
"discountedAmount": 0.000,
"finallyAmount": 23.600
},
{
"guid": "12dc3d2b-eb80-499c-ac57-5eac6a764d5f",
"invoiceGuid": "8733b0ed-d5be-4f3b-85d7-16920201eba4",
"itemName": "Cigars",
"itemDescription": "Example description",
"rate": 44.890,
"quantity": 3,
"amount": 134.670,
"isDeleted": false,
"discountedAmount": 0.000,
"finallyAmount": 134.670
}
],
"reminders": [
{
"guid": "d62745ad-1ffe-4e3c-9207-d77585e9d5e2",
"invoiceGuid": "8733b0ed-d5be-4f3b-85d7-16920201eba4",
"reminderType": "5 days after due Date",
"isActive": true,
"isCompleted": false,
"reminderDate": "2030-12-01T00:00:00.00-06:00"
}
],
"merchant": {
"guid": "cd3d0150-819c-44b9-8efd-2fa248fcacce",
"mid": "888000002849",
"allowOpenButton": false,
"mainAdmin": "303e2684-75a2-4f96-8d55-7457ca41b213",
"adminUserGuid": "303e2684-75a2-4f96-8d55-7457ca41b213",
"dba": "merchtest",
"legalName": "MerchTesting",
"email": "merchadmtest1@mailinator.com",
"phone": "4548888888",
"address1": "Example Street 1",
"address2": "Example Street 2",
"zipCode": "10012",
"city": "Manhattan",
"state": "NY",
"allowTips": true,
"dualPricingFeeAmount": false,
"allowCurrencyConversion": true,
"surchargeLabel": "Surcharge Fee",
"defaultSurchargeLabel": "Surcharge Fee",
"achSecCode": "WEB",
"requiredCustomerData": false,
"requiredProductData": false,
"alternativeNames": false,
"alternativeBatchNotifications": false,
"debtRepayment": false,
"enableAchRiskValidation": true,
"minTxnAmount": 1000.000,
"sendEmail": true,
"status": "Merchant - Active",
"reAttemptRb": true,
"adminUserRoles": [
{
"guid": "d7e97432-01c2-43c6-b0c9-e164be9c18ca",
"name": "Merchant Admin",
"description": "A user who run all type of transactions and search for all those transactions."
}
],
"webhookExist": false
},
"invoiceCustomer": {
"guid": "a39fbb42-5686-4958-9cac-2eb6c51bfbf3",
"merchantGuid": "cd3d0150-819c-44b9-8efd-2fa248fcacce",
"firstName": "Customer",
"lastName": "Testing",
"address1": "Example Street 1",
"address2": "Example Street 2",
"zip": "10012",
"city": "Manhattan",
"state": "NY",
"stateFullName": "New York",
"country": "United States",
"province": "",
"phone": "4548888888",
"email": "merchadmtest1@mailinator.com",
"personalPhone": "4548888888",
"status": "Active",
"displayName": "Customer Testing - 4548888888"
},
"sendBySms": true,
"sendToPhoneNumber": "9887555656",
"sendToOtherNumbers": [],
"sendStatusCode": 5001,
"paymentStatusCode": 5001,
"paymentTermCode": 5000
}
Json Example Error Response:
{
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"traceId": "00-d30ac376279a06d5f89e57e140123bd0-07a076df16418083-00",
"errors": {
"guid": [
"The value '{{testGuid}}' is not valid."
]
}
}
This endpoint gets a invoice.
HTTP Request
GET https://sandbox.choice.dev/api/v1/Invoice/<guid>
Headers using token
Key | Value |
---|---|
Authorization | Token. Eg: "Bearer eHSN5rTBzqDozgAAlN1UlTMVuIT1zSiAZWCo6E..." |
Headers using API Key
Key | Value |
---|---|
UserAuthorization | API Key. Eg: "e516b6db-3230-4b1c-ae3f-e5379b774a80" |
URL Parameters
Parameter | Description |
---|---|
guid | Invoice’s guid to get |
Response
- 200 code (ok).
Invoice Detail
Add invoice detail
using System;
using Newtonsoft.Json;
using System.IO;
using System.Net;
using System.Text;
namespace ChoiceSample
{
public class InvoiceDetail
{
public static void CreateInvoiceDetail()
{
try
{
var request = (HttpWebRequest)WebRequest.Create("https://sandbox.choice.dev/api/v1/Invoice/Detail");
request.ContentType = "text/json";
request.Method = "POST";
var invoiceDetail = new
{
InvoiceGuid = "4be52be2-bedf-4125-b7d5-2ed9ef8d6027",
ItemDescription = "Sparkling Wine",
Rate = 1.95,
Quantity = 3
};
string json = JsonConvert.SerializeObject(invoiceDetail);
request.Headers.Add("Authorization", "Bearer 1A089D6ziUybPZFQ3mpPyjt9OEx9yrCs7eQIC6V3A0lmXR2N6-seGNK16Gsnl3td6Ilfbr2Xf_EyukFXwnVEO3fYL-LuGw-L3c8WuaoxhPE8MMdlMPILJTIOV3lTGGdxbFXdKd9U03bbJ9TDUkqxHqq8_VyyjDrw7fs0YOob7bg0OovXTeWgIvZaIrSR1WFR06rYJ0DfWn-Inuf7re1-4SMOjY1ZoCelVwduWCBJpw1111cNbWtHJfObV8u1CVf0");
request.ContentType = "application/json";
request.Accept = "application/json";
using (var streamWriter = new StreamWriter(request.GetRequestStream()))
{
streamWriter.Write(json);
streamWriter.Flush();
streamWriter.Close();
}
try
{
var response = (HttpWebResponse)request.GetResponse();
using (var reader = new StreamReader(response.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)response.StatusCode);
Console.WriteLine();
Console.WriteLine(response.StatusDescription);
Console.WriteLine(result);
}
}
catch (WebException wex)
{
if (wex.Response != null)
{
using (var errorResponse = (HttpWebResponse)wex.Response)
{
using (var reader = new StreamReader(errorResponse.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)errorResponse.StatusCode);
Console.WriteLine();
Console.WriteLine(errorResponse.StatusDescription);
Console.WriteLine(result);
}
}
}
}
}
catch (IOException e)
{
Console.WriteLine(e);
}
}
}
}
Json Example Request:
{
"invoiceGuid" : "2541692d-958f-46b7-8ca7-a127016ea3b6",
"ItemDescription":"Sparkling Wine",
"ItemName": "Sparkling Wine",
"Rate":1.95,
"Quantity": 3
}
Json Example Response:
{
"guid": "61935343-8fa1-4c83-9fa1-bb95f2341351",
"invoiceGuid": "695262cb-233f-457d-83d6-ff759c941841",
"itemName": "Sparkling Wine",
"itemDescription": "Sparkling Wine",
"rate": 1.950,
"quantity": 3,
"amount": 5.850,
"isDeleted": false,
"discountedAmount": 0.000,
"finallyAmount": 5.850
}
Json Example Error Response:
{
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"traceId": "00-6354424c900b182d51cddcd70c196c79-0426afe3e9a20afa-00",
"errors": {
"Rate": [
"Rate can have 3 decimal places at most."
],
"ItemName": [
"The ItemName field is required."
],
"ItemDescription": [
"The field ItemDescription is invalid."
]
}
}
This endpoint add a invoice detail.
HTTP Request
POST https://sandbox.choice.dev/api/v1/Invoice/Detail
Headers using token
Key | Value |
---|---|
Content-Type | "application/json" |
Authorization | Token. Eg: "Bearer eHSN5rTBzqDozgAAlN1UlTMVuIT1zSiAZWCo6E..." |
Headers using API Key
Key | Value |
---|---|
Content-Type | "application/json" |
UserAuthorization | API Key. Eg: "e516b6db-3230-4b1c-ae3f-e5379b774a80" |
Query Parameters
Parameter | Type | M/C/O | Value |
---|---|---|---|
InvoiceGuid | string | Mandatory | Invoice's Guid. |
ItemDescription | string | Mandatory | Item Description. Only letters, numbers and /-#@.&$ |
ItemName | string | Optional | Item Name. Only letters, numbers and /-#@.&$ |
Rate | decimal | Mandatory | Rate. Up to 3 decimals. |
Quantity | integer | Mandatory | Quantity. |
Response
- 201 code (created).
Create invoice details list
using System;
using Newtonsoft.Json;
using System.IO;
using System.Net;
using System.Text;
namespace ChoiceSample
{
public class InvoiceDetail
{
public static void CreateInvoiceDetailsList()
{
try
{
var request = (HttpWebRequest)WebRequest.Create("https://sandbox.choice.dev/api/v1/Invoice/Detail/all/2541692d-958f-46b7-8ca7-a127016ea3b6");
request.ContentType = "text/json";
request.Method = "PUT";
var invoiceDetailsList = new Detail[]
{
new Detail{
ItemDescription = "Red Wine",
ItemName = "Red Wine",
Rate = 14.78,
Quantity = 8
},
new Detail{
ItemDescription = "Purple Wine",
ItemName = "Purple Wine",
Rate = 9.85,
Quantity = 4
}
};
string json = JsonConvert.SerializeObject(invoiceDetailsList);
request.Headers.Add("Authorization", "Bearer 1A089D6ziUybPZFQ3mpPyjt9OEx9yrCs7eQIC6V3A0lmXR2N6-seGNK16Gsnl3td6Ilfbr2Xf_EyukFXwnVEO3fYL-LuGw-L3c8WuaoxhPE8MMdlMPILJTIOV3lTGGdxbFXdKd9U03bbJ9TDUkqxHqq8_VyyjDrw7fs0YOob7bg0OovXTeWgIvZaIrSR1WFR06rYJ0DfWn-Inuf7re1-4SMOjY1ZoCelVwduWCBJpw1111cNbWtHJfObV8u1CVf0");
request.ContentType = "application/json";
request.Accept = "application/json";
using (var streamWriter = new StreamWriter(request.GetRequestStream()))
{
streamWriter.Write(json);
streamWriter.Flush();
streamWriter.Close();
}
try
{
var response = (HttpWebResponse)request.GetResponse();
using (var reader = new StreamReader(response.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)response.StatusCode);
Console.WriteLine();
Console.WriteLine(response.StatusDescription);
Console.WriteLine(result);
}
}
catch (WebException wex)
{
if (wex.Response != null)
{
using (var errorResponse = (HttpWebResponse)wex.Response)
{
using (var reader = new StreamReader(errorResponse.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)errorResponse.StatusCode);
Console.WriteLine();
Console.WriteLine(errorResponse.StatusDescription);
Console.WriteLine(result);
}
}
}
}
}
catch (IOException e)
{
Console.WriteLine(e);
}
}
}
}
Json Example Request:
[
{
"ItemDescription": "Red Wine",
"ItemName": "Red Wine",
"Rate": 1.95,
"Quantity": 3
},
{
"ItemDescription": "Purple Wine",
"ItemName": "Purple Wine",
"Rate": 7.55,
"Quantity": 1
}
]
Json Example Response:
{
"invoiceGuid": "ef083298-a15d-4f6b-9d76-6264d38fb715",
"timeStamp": "2023-06-28T19:27:43.32-05:00",
"merchantGuid": "cd3d0150-819c-44b9-8efd-2fa248fcacce",
"invoiceCustomerGuid": "a39fbb42-5686-4958-9cac-2eb6c51bfbf3",
"sendDate": "2030-02-25T00:00:00.00-06:00",
"sendStatus": "Scheduled To be Sent",
"paymentStatus": "Scheduled To be Sent",
"invoiceRecipientEmail": "maxduplessy@mailinator.com",
"paymentTerm": "Custom",
"dueDate": "2030-11-26T00:00:00.00-06:00",
"invoiceNumber": "670y4690p",
"orderNumber": "2680y670p",
"amountSubTotal": 315.910,
"currencyQuote": 1.000,
"currency": "USD",
"amountDueTotal": 338.480,
"remainingBalance": 0.000,
"amountDiscounted": 5.000,
"discountValue": 5.000,
"discountType": "Fixed",
"taxRate": 8.870,
"taxAmount": 27.570,
"taxZip": "10016",
"note": "For september services",
"termsAndConditions": "The ones you accepted when you clicked two pages ago",
"extensionTotalAmount": 338.480,
"otherRecipients": [],
"extensionHostedPaymentPageRequestToken": "00000000-0000-0000-0000-000000000000",
"extensionDisplayCreditCard": false,
"extensionDisplayAch": false,
"details": [
{
"guid": "1ab66367-9ced-4cca-aa7a-90618cce29e6",
"invoiceGuid": "ef083298-a15d-4f6b-9d76-6264d38fb715",
"itemName": "Red Wine",
"itemDescription": "Red Wine",
"rate": 1.950,
"quantity": 3,
"amount": 5.850,
"isDeleted": false,
"discountedAmount": 0.000,
"finallyAmount": 5.850
},
{
"guid": "55b1c847-ce5b-4158-b1d7-a9d4e6feaf85",
"invoiceGuid": "ef083298-a15d-4f6b-9d76-6264d38fb715",
"itemName": "Purple Wine",
"itemDescription": "Purple Wine",
"rate": 7.550,
"quantity": 1,
"amount": 7.550,
"isDeleted": false,
"discountedAmount": 0.000,
"finallyAmount": 7.550
},
{
"guid": "6979c2e3-e264-4b5e-a9c1-1831303aafb5",
"invoiceGuid": "ef083298-a15d-4f6b-9d76-6264d38fb715",
"itemName": "Wine Malbec",
"itemDescription": "Example description",
"rate": 14.780,
"quantity": 8,
"amount": 118.240,
"isDeleted": true,
"discountedAmount": 0.000,
"finallyAmount": 118.240
},
{
"guid": "f049e80e-923c-4e8f-a857-0ce43c55d57a",
"invoiceGuid": "ef083298-a15d-4f6b-9d76-6264d38fb715",
"itemName": "Rum",
"itemDescription": "Example description",
"rate": 9.850,
"quantity": 4,
"amount": 39.400,
"isDeleted": true,
"discountedAmount": 0.000,
"finallyAmount": 39.400
},
{
"guid": "2f658707-c114-4467-a314-164aad928439",
"invoiceGuid": "ef083298-a15d-4f6b-9d76-6264d38fb715",
"itemName": "Brandy",
"itemDescription": "Example description",
"rate": 11.800,
"quantity": 2,
"amount": 23.600,
"isDeleted": true,
"discountedAmount": 0.000,
"finallyAmount": 23.600
},
{
"guid": "e8bccc19-d2f3-4f46-be84-a55827f303da",
"invoiceGuid": "ef083298-a15d-4f6b-9d76-6264d38fb715",
"itemName": "Cigars",
"itemDescription": "Example description",
"rate": 44.890,
"quantity": 3,
"amount": 134.670,
"isDeleted": true,
"discountedAmount": 0.000,
"finallyAmount": 134.670
}
],
"reminders": [
{
"guid": "d197c936-3659-4ee5-97e0-795b85201f3c",
"invoiceGuid": "ef083298-a15d-4f6b-9d76-6264d38fb715",
"reminderType": "5 days after due Date",
"isActive": true,
"isCompleted": false,
"reminderDate": "2030-12-01T00:00:00.00-06:00"
}
],
"merchant": {
"guid": "cd3d0150-819c-44b9-8efd-2fa248fcacce",
"mid": "888000002849",
"allowOpenButton": false,
"mainAdmin": "303e2684-75a2-4f96-8d55-7457ca41b213",
"adminUserGuid": "303e2684-75a2-4f96-8d55-7457ca41b213",
"dba": "merchtest",
"legalName": "MerchTesting",
"email": "merchadmtest1@mailinator.com",
"phone": "4548888888",
"address1": "Example Street 1",
"address2": "Example Street 2",
"zipCode": "10012",
"city": "Manhattan",
"state": "NY",
"allowTips": true,
"dualPricingFeeAmount": false,
"allowCurrencyConversion": true,
"surchargeLabel": "Surcharge Fee",
"defaultSurchargeLabel": "Surcharge Fee",
"achSecCode": "WEB",
"requiredCustomerData": false,
"requiredProductData": false,
"alternativeNames": false,
"alternativeBatchNotifications": false,
"debtRepayment": false,
"enableAchRiskValidation": true,
"minTxnAmount": 1000.000,
"sendEmail": true,
"status": "Active",
"reAttemptRb": true,
"adminUserRoles": [],
"webhookExist": false
},
"invoiceCustomer": {
"guid": "a39fbb42-5686-4958-9cac-2eb6c51bfbf3",
"merchantGuid": "cd3d0150-819c-44b9-8efd-2fa248fcacce",
"firstName": "Customer",
"lastName": "Testing",
"address1": "Example Street 1",
"address2": "Example Street 2",
"zip": "10012",
"city": "Manhattan",
"state": "NY",
"stateFullName": "New York",
"country": "United States",
"province": "",
"phone": "4548888888",
"email": "merchadmtest1@mailinator.com",
"personalPhone": "4548888888",
"status": "Active",
"displayName": "Customer Testing - 4548888888"
},
"sendBySms": true,
"sendToPhoneNumber": "9887555656",
"sendToOtherNumbers": [],
"sendStatusCode": 5001,
"paymentStatusCode": 5001,
"paymentTermCode": 5000
}
Json Example Error Response:
{
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"traceId": "00-8dfb9ca55be762e5af908a2a73dec8a2-1e2f06055dd29c75-00",
"errors": {
"Rate": [
"Rate can have 3 decimal places at most."
],
"ItemName": [
"The field ItemName is invalid.",
"The ItemName field is required."
],
"ItemDescription": [
"The field ItemDescription is invalid."
]
}
}
This endpoint create a invoice details list.
HTTP Request
PUT https://sandbox.choice.dev/api/v1/Invoice/Detail/all/<guid>
Headers using token
Key | Value |
---|---|
Content-Type | "application/json" |
Authorization | Token. Eg: "Bearer eHSN5rTBzqDozgAAlN1UlTMVuIT1zSiAZWCo6E..." |
Headers using API Key
Key | Value |
---|---|
Content-Type | "application/json" |
UserAuthorization | API Key. Eg: "e516b6db-3230-4b1c-ae3f-e5379b774a80" |
URL Parameters
Parameter | Description |
---|---|
guid | Invoice’s guid |
Query Parameters
Parameter | Type | M/C/O | Value |
---|---|---|---|
ItemDescription | string | Mandatory | Item Description. Only letters, numbers and /-#@.&$ |
Rate | decimal | Mandatory | Rate. Up to 3 decimals. |
Quantity | integer | Mandatory | Quantity. |
Response
- 201 code (created).
Invoice Reminder
Create invoice reminder
using System;
using Newtonsoft.Json;
using System.IO;
using System.Net;
using System.Text;
namespace ChoiceSample
{
public class InvoiceReminder
{
public static void CreateInvoiceReminder()
{
try
{
var request = (HttpWebRequest)WebRequest.Create("https://sandbox.choice.dev/api/v1/Invoice/Reminder");
request.ContentType = "text/json";
request.Method = "POST";
var invoiceReminder = new
{
InvoiceGuid = "d5828cfd-12a6-4a7e-9be6-7c4b11f07dbf",
ReminderType = "2 weeks after due date"
};
string json = JsonConvert.SerializeObject(invoiceReminder);
request.Headers.Add("Authorization", "Bearer 1A089D6ziUybPZFQ3mpPyjt9OEx9yrCs7eQIC6V3A0lmXR2N6-seGNK16Gsnl3td6Ilfbr2Xf_EyukFXwnVEO3fYL-LuGw-L3c8WuaoxhPE8MMdlMPILJTIOV3lTGGdxbFXdKd9U03bbJ9TDUkqxHqq8_VyyjDrw7fs0YOob7bg0OovXTeWgIvZaIrSR1WFR06rYJ0DfWn-Inuf7re1-4SMOjY1ZoCelVwduWCBJpw1111cNbWtHJfObV8u1CVf0");
request.ContentType = "application/json";
request.Accept = "application/json";
using (var streamWriter = new StreamWriter(request.GetRequestStream()))
{
streamWriter.Write(json);
streamWriter.Flush();
streamWriter.Close();
}
try
{
var response = (HttpWebResponse)request.GetResponse();
using (var reader = new StreamReader(response.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)response.StatusCode);
Console.WriteLine();
Console.WriteLine(response.StatusDescription);
Console.WriteLine(result);
}
}
catch (WebException wex)
{
if (wex.Response != null)
{
using (var errorResponse = (HttpWebResponse)wex.Response)
{
using (var reader = new StreamReader(errorResponse.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)errorResponse.StatusCode);
Console.WriteLine();
Console.WriteLine(errorResponse.StatusDescription);
Console.WriteLine(result);
}
}
}
}
}
catch (IOException e)
{
Console.WriteLine(e);
}
}
}
}
Json Example Request:
{
"InvoiceGuid" : "d5828cfd-12a6-4a7e-9be6-7c4b11f07dbf",
"ReminderType" : "2 weeks after due date"
}
Json Example Response:
{
"guid": "a8339fc4-bd83-4dec-9e54-c6278a2f84e3",
"invoiceGuid": "ff93e7bc-c359-4dd1-8f23-63c8f480294e",
"reminderType": "1 week after due date",
"isActive": false,
"isCompleted": false,
"reminderDate": "2030-12-03T00:00:00.00-06:00"
}
Json Example Error Response:
{
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"traceId": "00-e1d5356972f673aa4210109acc310229-c0f93983fec1a337-00",
"errors": {
"$.InvoiceGuid": [
"Unable to parse {{wrongGuid}} to GUID"
]
}
}
This endpoint creates a invoice reminder.
HTTP Request
POST https://sandbox.choice.dev/api/v1/Invoice/Reminder
Headers using token
Key | Value |
---|---|
Content-Type | "application/json" |
Authorization | Token. Eg: "Bearer eHSN5rTBzqDozgAAlN1UlTMVuIT1zSiAZWCo6E..." |
Headers using API Key
Key | Value |
---|---|
Content-Type | "application/json" |
UserAuthorization | API Key. Eg: "e516b6db-3230-4b1c-ae3f-e5379b774a80" |
Query Parameters
Parameter | Type | M/C/O | Value |
---|---|---|---|
InvoiceGuid | string | Mandatory | Invoice's Guid. |
ReminderType | string | Mandatory | Reminder Type. Allowed values: 1. X days before due date 2. 1 days before due date 3. 5 days before due date 4. 1 week before due date 5. 10 days before due date 6. 2 week before due date 7. X days after due date 8. 1 days after due date 9. 5 days after due date 10. 1 week after due date 11. 10 days after due date 12. 2 week after due date |
ReminderDaysValue | byte | Optional | Reminder Days Value. Only with "X days before due date" or "X days after due date" |
Response
- 201 code (created).
Update invoice reminder
using System;
using Newtonsoft.Json;
using System.IO;
using System.Net;
using System.Text;
namespace ChoiceSample
{
public class InvoiceReminder
{
public static void UpdateInvoiceReminder()
{
try
{
var request = (HttpWebRequest)WebRequest.Create("https://sandbox.choice.dev/api/v1/Invoice/Reminder/a4e4278b-f2de-41d9-8da5-d0aabbf5a385/true");
request.ContentType = "text/json";
request.Method = "PUT";
request.Headers.Add("Authorization", "Bearer 1A089D6ziUybPZFQ3mpPyjt9OEx9yrCs7eQIC6V3A0lmXR2N6-seGNK16Gsnl3td6Ilfbr2Xf_EyukFXwnVEO3fYL-LuGw-L3c8WuaoxhPE8MMdlMPILJTIOV3lTGGdxbFXdKd9U03bbJ9TDUkqxHqq8_VyyjDrw7fs0YOob7bg0OovXTeWgIvZaIrSR1WFR06rYJ0DfWn-Inuf7re1-4SMOjY1ZoCelVwduWCBJpw1111cNbWtHJfObV8u1CVf0");
request.ContentType = "application/json";
request.Accept = "application/json";
try
{
var response = (HttpWebResponse)request.GetResponse();
using (var reader = new StreamReader(response.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)response.StatusCode);
Console.WriteLine();
Console.WriteLine(response.StatusDescription);
Console.WriteLine(result);
}
}
catch (WebException wex)
{
if (wex.Response != null)
{
using (var errorResponse = (HttpWebResponse)wex.Response)
{
using (var reader = new StreamReader(errorResponse.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)errorResponse.StatusCode);
Console.WriteLine();
Console.WriteLine(errorResponse.StatusDescription);
Console.WriteLine(result);
}
}
}
}
}
catch (IOException e)
{
Console.WriteLine(e);
}
}
}
}
Json Example Response (PUT https://sandbox.choice.dev/api/v1/Invoice/Reminder/
/true):
{
"guid": "a4e4278b-f2de-41d9-8da5-d0aabbf5a385",
"invoiceGuid": "d5828cfd-12a6-4a7e-9be6-7c4b11f07dbf",
"reminderType": "2 weeks after due date",
"isActive": true,
"isCompleted": false,
"reminderDate": "2030-12-03T00:00:00.00-06:00"}
Json Example Response (PUT https://sandbox.choice.dev/api/v1/Invoice/Reminder/
/false):
{
"guid": "a4e4278b-f2de-41d9-8da5-d0aabbf5a385",
"invoiceGuid": "d5828cfd-12a6-4a7e-9be6-7c4b11f07dbf",
"reminderType": "2 weeks after due date",
"isActive": false,
"isCompleted": false,
"reminderDate": "2030-12-03T00:00:00.00-06:00"
}
Json Example Error Response:
{
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"traceId": "00-e1d5356972f673aa4210109acc310229-c0f93983fec1a337-00",
"errors": {
"$.InvoiceGuid": [
"Unable to parse {{wrongGuid}} to GUID"
]
}
}
This endpoint updates a invoice reminder.
HTTP Request
PUT https://sandbox.choice.dev/api/v1/Invoice/Reminder/<guid>/true
or
PUT https://sandbox.choice.dev/api/v1/Invoice/Reminder/<guid>/false
Headers using token
Key | Value |
---|---|
Content-Type | "application/json" |
Authorization | Token. Eg: "Bearer eHSN5rTBzqDozgAAlN1UlTMVuIT1zSiAZWCo6E..." |
Headers using API Key
Key | Value |
---|---|
Content-Type | "application/json" |
UserAuthorization | API Key. Eg: "e516b6db-3230-4b1c-ae3f-e5379b774a80" |
URL Parameters
Parameter | Description |
---|---|
guid | Reminder’s guid to update |
Response
- 200 code (ok).
Get invoice reminder
using System;
using Newtonsoft.Json;
using System.IO;
using System.Net;
using System.Text;
namespace ChoiceSample
{
public class InvoiceReminder
{
public static void GetInvoiceReminder()
{
try
{
var request = (HttpWebRequest)WebRequest.Create("https://sandbox.choice.dev/api/v1/Invoice/Reminder/d5828cfd-12a6-4a7e-9be6-7c4b11f07dbf/true");
request.Method = "GET";
request.Headers.Add("Authorization", "Bearer 1A089D6ziUybPZFQ3mpPyjt9OEx9yrCs7eQIC6V3A0lmXR2N6-seGNK16Gsnl3td6Ilfbr2Xf_EyukFXwnVEO3fYL-LuGw-L3c8WuaoxhPE8MMdlMPILJTIOV3lTGGdxbFXdKd9U03bbJ9TDUkqxHqq8_VyyjDrw7fs0YOob7bg0OovXTeWgIvZaIrSR1WFR06rYJ0DfWn-Inuf7re1-4SMOjY1ZoCelVwduWCBJpw1111cNbWtHJfObV8u1CVf0");
try
{
var response = (HttpWebResponse)request.GetResponse();
using (var reader = new StreamReader(response.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)response.StatusCode);
Console.WriteLine();
Console.WriteLine(response.StatusDescription);
Console.WriteLine(result);
}
}
catch (WebException wex)
{
if (wex.Response != null)
{
using (var errorResponse = (HttpWebResponse)wex.Response)
{
using (var reader = new StreamReader(errorResponse.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)errorResponse.StatusCode);
Console.WriteLine();
Console.WriteLine(errorResponse.StatusDescription);
Console.WriteLine(result);
}
}
}
}
}
catch (IOException e)
{
Console.WriteLine(e);
}
}
}
}
Json Example Response (GET https://sandbox.choice.dev/api/v1/Invoice/Reminder/
/true):
[
{
"guid": "00000000-0000-0000-0000-000000000000",
"invoiceGuid": "d5828cfd-12a6-4a7e-9be6-7c4b11f07dbf",
"reminderType": "1 day before due date",
"isActive": false,
"isCompleted": false,
"reminderDate": "2030-12-03T00:00:00.00-06:00"
},
{
"guid": "fbb2633f-0bf4-412b-a51e-edad3fb4b058",
"invoiceGuid": "d5828cfd-12a6-4a7e-9be6-7c4b11f07dbf",
"reminderType": "5 days before due date",
"isActive": true,
"isCompleted": false,
"reminderDate": "2030-12-03T00:00:00.00-06:00"
},
{
"guid": "00000000-0000-0000-0000-000000000000",
"invoiceGuid": "d5828cfd-12a6-4a7e-9be6-7c4b11f07dbf",
"reminderType": "1 week before due date",
"isActive": false,
"isCompleted": false,
"reminderDate": "2030-12-03T00:00:00.00-06:00"
},
{
"guid": "00000000-0000-0000-0000-000000000000",
"invoiceGuid": "d5828cfd-12a6-4a7e-9be6-7c4b11f07dbf",
"reminderType": "10 days before due date",
"isActive": false,
"isCompleted": false,
"reminderDate": "2030-12-03T00:00:00.00-06:00"
},
{
"guid": "00000000-0000-0000-0000-000000000000",
"invoiceGuid": "d5828cfd-12a6-4a7e-9be6-7c4b11f07dbf",
"reminderType": "2 weeks before due date",
"isActive": false,
"isCompleted": false,
"reminderDate": "2030-12-03T00:00:00.00-06:00"
},
{
"guid": "00000000-0000-0000-0000-000000000000",
"invoiceGuid": "d5828cfd-12a6-4a7e-9be6-7c4b11f07dbf",
"reminderType": "1 day after due date",
"isActive": false,
"isCompleted": false,
"reminderDate": "2030-12-03T00:00:00.00-06:00"
},
{
"guid": "cf7f8d0a-7540-43de-b637-09f7dec0a273",
"invoiceGuid": "d5828cfd-12a6-4a7e-9be6-7c4b11f07dbf",
"reminderType": "5 days after due date",
"isActive": true,
"isCompleted": false,
"reminderDate": "2019-07-30T00:00:00"
},
{
"guid": "00000000-0000-0000-0000-000000000000",
"invoiceGuid": "d5828cfd-12a6-4a7e-9be6-7c4b11f07dbf",
"reminderType": "1 week after due date",
"isActive": false,
"isCompleted": false,
"reminderDate": "2030-12-03T00:00:00.00-06:00"
},
{
"guid": "00000000-0000-0000-0000-000000000000",
"invoiceGuid": "d5828cfd-12a6-4a7e-9be6-7c4b11f07dbf",
"reminderType": "10 days after due date",
"isActive": false,
"isCompleted": false,
"reminderDate": "2030-12-03T00:00:00.00-06:00"
},
{
"guid": "00000000-0000-0000-0000-000000000000",
"invoiceGuid": "d5828cfd-12a6-4a7e-9be6-7c4b11f07dbf",
"reminderType": "2 weeks after due date",
"isActive": false,
"isCompleted": false,
"reminderDate": "2030-12-03T00:00:00.00-06:00"
}
]
Json Example Response (GET https://sandbox.choice.dev/api/v1/Invoice/Reminder/
/false):
[
{
"guid": "fbb2633f-0bf4-412b-a51e-edad3fb4b058",
"invoiceGuid": "d5828cfd-12a6-4a7e-9be6-7c4b11f07dbf",
"reminderType": "5 days before due date",
"isActive": true,
"isCompleted": false,
"reminderDate": "2030-12-03T00:00:00.00-06:00"
},
{
"guid": "cf7f8d0a-7540-43de-b637-09f7dec0a273",
"invoiceGuid": "d5828cfd-12a6-4a7e-9be6-7c4b11f07dbf",
"reminderType": "5 days after due date",
"isActive": true,
"isCompleted": false,
"reminderDate": "2030-12-03T00:00:00.00-06:00"
}
]
Json Example Error Response:
{
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"traceId": "00-e1d5356972f673aa4210109acc310229-c0f93983fec1a337-00",
"errors": {
"$.InvoiceGuid": [
"Unable to parse {{wrongGuid}} to GUID"
]
}
}
This endpoint gets a invoice reminder.
HTTP Request
GET https://sandbox.choice.dev/api/v1/Invoice/Reminder/<guid>/true
or
GET https://sandbox.choice.dev/api/v1/Invoice/Reminder/<guid>/false
Headers using token
Key | Value |
---|---|
Authorization | Token. Eg: "Bearer eHSN5rTBzqDozgAAlN1UlTMVuIT1zSiAZWCo6E..." |
Headers using API Key
Key | Value |
---|---|
UserAuthorization | API Key. Eg: "e516b6db-3230-4b1c-ae3f-e5379b774a80" |
URL Parameters
Parameter | Description |
---|---|
guid | Invoice’s guid to get |
Response
- 200 code (ok).
Search
Search sales
using System;
using Newtonsoft.Json;
using System.IO;
using System.Net;
using System.Text;
namespace ChoiceSample
{
public class Search
{
public static void SearchSales()
{
try
{
var request = (HttpWebRequest)WebRequest.Create("https://sandbox.choice.dev/api/v1/Search/Sales/false");
request.ContentType = "text/json";
request.Method = "POST";
var search = new
{
merchantGuid = "19344275-985e-4dff-81ee-cb84b8ad356c",
Status = "Transaction - Approved"
};
string json = JsonConvert.SerializeObject(search);
request.Headers.Add("Authorization", "Bearer 1A089D6ziUybPZFQ3mpPyjt9OEx9yrCs7eQIC6V3A0lmXR2N6-seGNK16Gsnl3td6Ilfbr2Xf_EyukFXwnVEO3fYL-LuGw-L3c8WuaoxhPE8MMdlMPILJTIOV3lTGGdxbFXdKd9U03bbJ9TDUkqxHqq8_VyyjDrw7fs0YOob7bg0OovXTeWgIvZaIrSR1WFR06rYJ0DfWn-Inuf7re1-4SMOjY1ZoCelVwduWCBJpw1111cNbWtHJfObV8u1CVf0");
request.ContentType = "application/json";
request.Accept = "application/json";
using (var streamWriter = new StreamWriter(request.GetRequestStream()))
{
streamWriter.Write(json);
streamWriter.Flush();
streamWriter.Close();
}
try
{
var response = (HttpWebResponse)request.GetResponse();
using (var reader = new StreamReader(response.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)response.StatusCode);
Console.WriteLine();
Console.WriteLine(response.StatusDescription);
Console.WriteLine(result);
}
}
catch (WebException wex)
{
if (wex.Response != null)
{
using (var errorResponse = (HttpWebResponse)wex.Response)
{
using (var reader = new StreamReader(errorResponse.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)errorResponse.StatusCode);
Console.WriteLine();
Console.WriteLine(errorResponse.StatusDescription);
Console.WriteLine(result);
}
}
}
}
}
catch (IOException e)
{
Console.WriteLine(e);
}
}
}
}
Json Example Request:
{
"merchantGuid": "19344275-985e-4dff-81ee-cb84b8ad356c",
"Status": "Transaction - Approved"
}
Json Example Response:
{
"pageCurrent": 1,
"pageCurrentResults": 1,
"pageTotal": 1,
"pageSize": 10,
"totalResults": 1,
"searchResultDto": [
{
"status": "Transaction - Approved",
"amount": 20.540,
"card": {
"cardHolderName": "John Doe",
"cardType": "Mastercard",
"last4": "0213",
"cardToken": "1zcGT7J4pkGh0213"
},
"orderNumber": "11518",
"orderDate": "2020-11-24T00:00:00",
"timeStamp": "2023-06-28T15:18:13.77-05:00",
"customerId": "xt147",
"processorResponseMessage": "Success",
"effectiveAmount": 20.540,
"batchStatus": "Batch - Closed",
"guid": "e1ad65e6-7abd-4467-8176-1cdd3c569d53",
"deviceGuid": "397eb067-2ebf-4934-bbb4-ace4e4a6194e",
"customData": "order details",
"generatedByCapture": false,
"processorRefNumber": "33490707",
"type": "Credit",
"dualPricingFeeAmount": 0.400,
"cardDataSource": "INTERNET",
"allowCardEmv": false,
"addressVerificationCode": "N",
"addressVerificationResult": "No Match",
"cvvVerificationCode": "M",
"cvvVerificationResult": "Passed",
"semiIntegrated": false,
"userName": "merchadmtest",
"hasRelatedReturn": "No"
}
]
}
Json error example response:
{
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"traceId": "00-2be920374480ac59ebadf4a9a6057706-0680052537eeceae-00",
"errors": {
"guid": [
"The value 'invalid guid' is not valid."
]
}
}
This endpoint search a sales.
HTTP Request
POST https://sandbox.choice.dev/api/v1/Search/Sales/{exportable}
POST https://sandbox.choice.dev/api/v1/Search/Sales/{exportable}/{pageNumber}
POST https://sandbox.choice.dev/api/v1/Search/Sales/{exportable}/{pageNumber}/{pageSize}
Headers using token
Key | Value |
---|---|
Content-Type | "application/json" |
Authorization | Token. Eg: "Bearer eHSN5rTBzqDozgAAlN1UlTMVuIT1zSiAZWCo6E..." |
Headers using API Key
Key | Value |
---|---|
Content-Type | "application/json" |
UserAuthorization | API Key. Eg: "e516b6db-3230-4b1c-ae3f-e5379b774a80" |
URL Parameters:
Parameter | Type | M/C/O | Value |
---|---|---|---|
Exportable | string | Mandatory | True or False. It means if you want results exportable to CSV. |
PageNumber | integer | Optional | Int. Number of page of the results. Default is 1 (Page size default is 500). |
PageSize | integer | Optional | Int. Size of each page of the results. Default is 500. |
Json Body:
Parameter | Type | M/C/O | Value |
---|---|---|---|
MerchantGuid | string | Mandatory | Merchant's Guid. |
AmountFrom | decimal | Optional | Amount of the transaction. Min. amt.: $0.50 |
AmountTo | decimal | Optional | Amount of the transaction. Min. amt.: $0.50 |
CardHolderName | string | Optional | Cardholder's name. Must be between 0 and 30 digits long. |
first6 | string | Optional | Card first six number. |
last4 | string | Optional | Card last four number. |
Card.Token | string | Optional | Card tokenized number value |
CardType | string | Optional | Card type. |
InvoiceNumber | string | Optional | Sale's InvoiceNumber. |
OrderNumber | string | Optional | Sale's order number. Length = 17. |
OrderDateFrom | date | Optional | Sale's order Date. |
OrderDateTo | date | Optional | Sale's order Date. |
TimeStampFrom | date | Optional | Sale's TimeStamp. |
TimeStampTo | date | Optional | Sale's TimeStamp. |
Status | string | Optional | Sale’s status. Allowed values: 1. Transaction - Approved 2. Transaction - Declined 3. Transaction - Created - Local 4. Transaction - Created - Error: Processor not reached 5. Transaction - Processor Error 6. Transaction - Approved - Warning |
CustomerId | string | Optional | Customer Id. |
CustomData | string | Optional | Customer Data. |
GeneratedByCapture | boolean | Optional | Generated By Capture. Allowed values: 1. true 2. false |
ProcessorRefNumber | string | Optional | Processor Reference Number. |
UserName | string | Optional | UserName. |
Response
- 200 code (ok).
Search EBT Cash Benefit Purchases
using System;
using Newtonsoft.Json;
using System.IO;
using System.Net;
using System.Text;
namespace ChoiceSample
{
public class Search
{
public static void SearchEbtCashBenefitPurchases()
{
try
{
var request = (HttpWebRequest)WebRequest.Create("https://sandbox.choice.dev/api/v1/Search/EbtCashBenefitPurchases/false");
request.ContentType = "text/json";
request.Method = "POST";
var search = new
{
merchantGuid = "19344275-985e-4dff-81ee-cb84b8ad356c",
Status = "Transaction - Approved"
};
string json = JsonConvert.SerializeObject(search);
request.Headers.Add("Authorization", "Bearer 1A089D6ziUybPZFQ3mpPyjt9OEx9yrCs7eQIC6V3A0lmXR2N6-seGNK16Gsnl3td6Ilfbr2Xf_EyukFXwnVEO3fYL-LuGw-L3c8WuaoxhPE8MMdlMPILJTIOV3lTGGdxbFXdKd9U03bbJ9TDUkqxHqq8_VyyjDrw7fs0YOob7bg0OovXTeWgIvZaIrSR1WFR06rYJ0DfWn-Inuf7re1-4SMOjY1ZoCelVwduWCBJpw1111cNbWtHJfObV8u1CVf0");
request.ContentType = "application/json";
request.Accept = "application/json";
using (var streamWriter = new StreamWriter(request.GetRequestStream()))
{
streamWriter.Write(json);
streamWriter.Flush();
streamWriter.Close();
}
try
{
var response = (HttpWebResponse)request.GetResponse();
using (var reader = new StreamReader(response.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)response.StatusCode);
Console.WriteLine();
Console.WriteLine(response.StatusDescription);
Console.WriteLine(result);
}
}
catch (WebException wex)
{
if (wex.Response != null)
{
using (var errorResponse = (HttpWebResponse)wex.Response)
{
using (var reader = new StreamReader(errorResponse.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)errorResponse.StatusCode);
Console.WriteLine();
Console.WriteLine(errorResponse.StatusDescription);
Console.WriteLine(result);
}
}
}
}
}
catch (IOException e)
{
Console.WriteLine(e);
}
}
}
}
Json Example Request:
{
"merchantGuid": "19344275-985e-4dff-81ee-cb84b8ad356c",
}
Json Example Response:
{
"pageCurrent": 1,
"pageCurrentResults": 1,
"pageTotal": 1,
"pageSize": 10,
"totalResults": 1,
"cardSummary": null,
"searchResultDTO": [
{
"status": "Transaction - Approved",
"amount": 20.00,
"card": {
"cardHolderName": null,
"cardType": "Visa",
"first6": "123456",
"last4": "2910",
"cardToken": "xxxx-xxxx-xxxx-xxxx-2910"
},
"timeStamp": "2020-11-26T06:34:34.46-06:00",
"processorResponseMessage": "Success",
"effectiveAmount": 0.00,
"batchStatus": "Batch - Open",
"relatedVoid": {
"guid": "0f85c12d-9f51-49b8-8b8a-38238c89b9a6"
},
"guid": "372d66e5-1a5d-48ec-bebc-bb9347abe200",
"deviceGuid": "b29725af-b067-4a35-9819-bbb31bdf8808",
"generatedByCapture": false,
"processorRefNumber": "24823396",
"type": "Credit",
"surchargeType": null,
"tipAmount": null,
"cardDataSource": "INTERNET",
"allowCardEmv": false,
"addressVerificationCode": "0",
"addressVerificationResult": "Full Match",
"cvvVerificationResult": " ",
"semiIntegrated": false,
"userName": "maxduplessy"
}
]
}
Json error example response:
{
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"traceId": "00-2be920374480ac59ebadf4a9a6057706-0680052537eeceae-00",
"errors": {
"guid": [
"The value 'invalid guid' is not valid."
]
}
}
This endpoint search a EBT Cash Benefit Purchases.
HTTP Request
POST https://sandbox.choice.dev/api/v1/Search/EbtCashBenefitPurchases/{exportable}
POST https://sandbox.choice.dev/api/v1/Search/EbtCashBenefitPurchases/{exportable}/{pageNumber}
POST https://sandbox.choice.dev/api/v1/Search/EbtCashBenefitPurchases/{exportable}/{pageNumber}/{pageSize}
Headers using token
Key | Value |
---|---|
Content-Type | "application/json" |
Authorization | Token. Eg: "Bearer eHSN5rTBzqDozgAAlN1UlTMVuIT1zSiAZWCo6E..." |
Headers using API Key
Key | Value |
---|---|
Content-Type | "application/json" |
UserAuthorization | API Key. Eg: "e516b6db-3230-4b1c-ae3f-e5379b774a80" |
URL Parameters:
Parameter | Type | M/C/O | Value |
---|---|---|---|
Exportable | string | Mandatory | True or False. It means if you want results exportable to CSV. |
PageNumber | integer | Optional | Int. Number of page of the results. Default is 1 (Page size default is 500). |
PageSize | integer | Optional | Int. Size of each page of the results. Default is 500. |
Json Body:
Parameter | Type | M/C/O | Value |
---|---|---|---|
MerchantGuid | string | Mandatory | Merchant's Guid. |
AmountFrom | decimal | Optional | Amount of the transaction. Min. amt.: $0.50 |
AmountTo | decimal | Optional | Amount of the transaction. Min. amt.: $0.50 |
CardHolderName | string | Optional | Cardholder's name. Must be between 0 and 30 digits long. |
first6 | string | Optional | Card first six number. |
last4 | string | Optional | Card last four number. |
cardToken | string | Optional | Card tokenized number value |
CardType | string | Optional | Card type. |
InvoiceNumber | string | Optional | Sale's InvoiceNumber. |
OrderNumber | string | Optional | Sale's order number. Length = 17. |
OrderDateFrom | date | Optional | Sale's order Date. |
OrderDateTo | date | Optional | Sale's order Date. |
TimeStampFrom | date | Optional | Sale's TimeStamp. |
TimeStampTo | date | Optional | Sale's TimeStamp. |
Status | string | Optional | Sale’s status. Allowed values: 1. Transaction - Approved 2. Transaction - Declined 3. Transaction - Created - Local 4. Transaction - Created - Error: Processor not reached 5. Transaction - Processor Error 6. Transaction - Approved - Warning |
CustomerId | string | Optional | Customer Id. |
CustomData | string | Optional | Customer Data. |
GeneratedByCapture | boolean | Optional | Generated By Capture. Allowed values: 1. true 2. false |
ProcessorRefNumber | string | Optional | Processor Reference Number. |
UserName | string | Optional | UserName. |
Response
- 200 code (ok).
Search EBT Food Stamp Purchases
using System;
using Newtonsoft.Json;
using System.IO;
using System.Net;
using System.Text;
namespace ChoiceSample
{
public class Search
{
public static void SearchEbtFoodStampPurchases()
{
try
{
var request = (HttpWebRequest)WebRequest.Create("https://sandbox.choice.dev/api/v1/Search/ebtFoodStampPurchases/false");
request.ContentType = "text/json";
request.Method = "POST";
var search = new
{
merchantGuid = "19344275-985e-4dff-81ee-cb84b8ad356c",
Status = "Transaction - Approved"
};
string json = JsonConvert.SerializeObject(search);
request.Headers.Add("Authorization", "Bearer 1A089D6ziUybPZFQ3mpPyjt9OEx9yrCs7eQIC6V3A0lmXR2N6-seGNK16Gsnl3td6Ilfbr2Xf_EyukFXwnVEO3fYL-LuGw-L3c8WuaoxhPE8MMdlMPILJTIOV3lTGGdxbFXdKd9U03bbJ9TDUkqxHqq8_VyyjDrw7fs0YOob7bg0OovXTeWgIvZaIrSR1WFR06rYJ0DfWn-Inuf7re1-4SMOjY1ZoCelVwduWCBJpw1111cNbWtHJfObV8u1CVf0");
request.ContentType = "application/json";
request.Accept = "application/json";
using (var streamWriter = new StreamWriter(request.GetRequestStream()))
{
streamWriter.Write(json);
streamWriter.Flush();
streamWriter.Close();
}
try
{
var response = (HttpWebResponse)request.GetResponse();
using (var reader = new StreamReader(response.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)response.StatusCode);
Console.WriteLine();
Console.WriteLine(response.StatusDescription);
Console.WriteLine(result);
}
}
catch (WebException wex)
{
if (wex.Response != null)
{
using (var errorResponse = (HttpWebResponse)wex.Response)
{
using (var reader = new StreamReader(errorResponse.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)errorResponse.StatusCode);
Console.WriteLine();
Console.WriteLine(errorResponse.StatusDescription);
Console.WriteLine(result);
}
}
}
}
}
catch (IOException e)
{
Console.WriteLine(e);
}
}
}
}
Json Example Request:
{
"merchantGuid": "19344275-985e-4dff-81ee-cb84b8ad356c",
}
Json Example Response:
{
"pageCurrent": 1,
"pageCurrentResults": 1,
"pageTotal": 1,
"pageSize": 10,
"totalResults": 1,
"cardSummary": null,
"searchResultDTO": [
{
"status": "Transaction - Approved",
"amount": 20.00,
"card": {
"cardHolderName": null,
"cardType": "Visa",
"first6": "123456",
"last4": "2910",
"cardToken": "xxxx-xxxx-xxxx-xxxx-2910"
},
"timeStamp": "2020-11-26T06:34:34.46-06:00",
"processorResponseMessage": "Success",
"effectiveAmount": 0.00,
"batchStatus": "Batch - Open",
"relatedVoid": {
"guid": "0f85c12d-9f51-49b8-8b8a-38238c89b9a6"
},
"guid": "372d66e5-1a5d-48ec-bebc-bb9347abe200",
"deviceGuid": "b29725af-b067-4a35-9819-bbb31bdf8808",
"generatedByCapture": false,
"processorRefNumber": "24823396",
"type": "Credit",
"surchargeType": null,
"tipAmount": null,
"cardDataSource": "INTERNET",
"allowCardEmv": false,
"addressVerificationCode": "0",
"addressVerificationResult": "Full Match",
"cvvVerificationResult": " ",
"semiIntegrated": false,
"userName": "maxduplessy"
}
]
}
Json error example response:
{
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"traceId": "00-2be920374480ac59ebadf4a9a6057706-0680052537eeceae-00",
"errors": {
"guid": [
"The value 'invalid guid' is not valid."
]
}
}
This endpoint search a EBT Food Stamp Purchases.
HTTP Request
POST https://sandbox.choice.dev/api/v1/Search/ebtFoodStampPurchases/{exportable}
POST https://sandbox.choice.dev/api/v1/Search/ebtFoodStampPurchases/{exportable}/{pageNumber}
POST https://sandbox.choice.dev/api/v1/Search/ebtFoodStampPurchases/{exportable}/{pageNumber}/{pageSize}
Headers using token
Key | Value |
---|---|
Content-Type | "application/json" |
Authorization | Token. Eg: "Bearer eHSN5rTBzqDozgAAlN1UlTMVuIT1zSiAZWCo6E..." |
Headers using API Key
Key | Value |
---|---|
Content-Type | "application/json" |
UserAuthorization | API Key. Eg: "e516b6db-3230-4b1c-ae3f-e5379b774a80" |
URL Parameters:
Parameter | Type | M/C/O | Value |
---|---|---|---|
Exportable | string | Mandatory | True or False. It means if you want results exportable to CSV. |
PageNumber | integer | Optional | Int. Number of page of the results. Default is 1 (Page size default is 500). |
PageSize | integer | Optional | Int. Size of each page of the results. Default is 500. |
Json Body:
Parameter | Type | M/C/O | Value |
---|---|---|---|
MerchantGuid | string | Mandatory | Merchant's Guid. |
AmountFrom | decimal | Optional | Amount of the transaction. Min. amt.: $0.50 |
AmountTo | decimal | Optional | Amount of the transaction. Min. amt.: $0.50 |
CardHolderName | string | Optional | Cardholder's name. Must be between 0 and 30 digits long |
first6 | string | Optional | Card first six number. |
last4 | string | Optional | Card last four number. |
cardToken | string | Optional | Card tokenized number value |
CardType | string | Optional | Card type. |
InvoiceNumber | string | Optional | Sale's InvoiceNumber. |
OrderNumber | string | Optional | Sale's order number. Length = 17. |
OrderDateFrom | date | Optional | Sale's order Date. |
OrderDateTo | date | Optional | Sale's order Date. |
TimeStampFrom | date | Optional | Sale's TimeStamp. |
TimeStampTo | date | Optional | Sale's TimeStamp. |
Status | string | Optional | Sale’s status. Allowed values: 1. Transaction - Approved 2. Transaction - Declined 3. Transaction - Created - Local 4. Transaction - Created - Error: Processor not reached 5. Transaction - Processor Error 6. Transaction - Approved - Warning |
CustomerId | string | Optional | Customer Id. |
CustomData | string | Optional | Customer Data. |
GeneratedByCapture | boolean | Optional | Generated By Capture. Allowed values: 1. true 2. false |
ProcessorRefNumber | string | Optional | Processor Reference Number. |
UserName | string | Optional | UserName. |
Response
- 200 code (ok).
Search EBT Electronic Vouchers
using System;
using Newtonsoft.Json;
using System.IO;
using System.Net;
using System.Text;
namespace ChoiceSample
{
public class Search
{
public static void SearchEbtElectronicVouchers()
{
try
{
var request = (HttpWebRequest)WebRequest.Create("https://sandbox.choice.dev/api/v1/Search/ebtElectronicVouchers/false");
request.ContentType = "text/json";
request.Method = "POST";
var search = new
{
merchantGuid = "19344275-985e-4dff-81ee-cb84b8ad356c",
Status = "Transaction - Approved"
};
string json = JsonConvert.SerializeObject(search);
request.Headers.Add("Authorization", "Bearer 1A089D6ziUybPZFQ3mpPyjt9OEx9yrCs7eQIC6V3A0lmXR2N6-seGNK16Gsnl3td6Ilfbr2Xf_EyukFXwnVEO3fYL-LuGw-L3c8WuaoxhPE8MMdlMPILJTIOV3lTGGdxbFXdKd9U03bbJ9TDUkqxHqq8_VyyjDrw7fs0YOob7bg0OovXTeWgIvZaIrSR1WFR06rYJ0DfWn-Inuf7re1-4SMOjY1ZoCelVwduWCBJpw1111cNbWtHJfObV8u1CVf0");
request.ContentType = "application/json";
request.Accept = "application/json";
using (var streamWriter = new StreamWriter(request.GetRequestStream()))
{
streamWriter.Write(json);
streamWriter.Flush();
streamWriter.Close();
}
try
{
var response = (HttpWebResponse)request.GetResponse();
using (var reader = new StreamReader(response.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)response.StatusCode);
Console.WriteLine();
Console.WriteLine(response.StatusDescription);
Console.WriteLine(result);
}
}
catch (WebException wex)
{
if (wex.Response != null)
{
using (var errorResponse = (HttpWebResponse)wex.Response)
{
using (var reader = new StreamReader(errorResponse.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)errorResponse.StatusCode);
Console.WriteLine();
Console.WriteLine(errorResponse.StatusDescription);
Console.WriteLine(result);
}
}
}
}
}
catch (IOException e)
{
Console.WriteLine(e);
}
}
}
}
Json Example Request:
{
"merchantGuid": "19344275-985e-4dff-81ee-cb84b8ad356c",
}
Json Example Response:
{
"pageCurrent": 1,
"pageCurrentResults": 1,
"pageTotal": 1,
"pageSize": 10,
"totalResults": 1,
"cardSummary": null,
"searchResultDTO": [
{
"status": "Transaction - Approved",
"amount": 20.00,
"card": {
"cardHolderName": null,
"cardType": "Visa",
"first6": "123456",
"last4": "2910",
"cardToken": "xxxx-xxxx-xxxx-xxxx-2910"
},
"timeStamp": "2020-11-26T06:34:34.46-06:00",
"processorResponseMessage": "Success",
"effectiveAmount": 0.00,
"batchStatus": "Batch - Open",
"relatedVoid": {
"guid": "0f85c12d-9f51-49b8-8b8a-38238c89b9a6"
},
"guid": "372d66e5-1a5d-48ec-bebc-bb9347abe200",
"deviceGuid": "b29725af-b067-4a35-9819-bbb31bdf8808",
"generatedByCapture": false,
"processorRefNumber": "24823396",
"type": "Credit",
"surchargeType": null,
"tipAmount": null,
"cardDataSource": "INTERNET",
"allowCardEmv": false,
"addressVerificationCode": "0",
"addressVerificationResult": "Full Match",
"cvvVerificationResult": " ",
"semiIntegrated": false,
"userName": "maxduplessy"
}
]
}
Json error example response:
{
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"traceId": "00-2be920374480ac59ebadf4a9a6057706-0680052537eeceae-00",
"errors": {
"guid": [
"The value 'invalid guid' is not valid."
]
}
}
This endpoint search a Ebt Electronic Vouchers.
HTTP Request
POST https://sandbox.choice.dev/api/v1/Search/ebtElectronicVouchers/{exportable}
POST https://sandbox.choice.dev/api/v1/Search/ebtElectronicVouchers/{exportable}/{pageNumber}
POST https://sandbox.choice.dev/api/v1/Search/ebtElectronicVouchers/{exportable}/{pageNumber}/{pageSize}
Headers using token
Key | Value |
---|---|
Content-Type | "application/json" |
Authorization | Token. Eg: "Bearer eHSN5rTBzqDozgAAlN1UlTMVuIT1zSiAZWCo6E..." |
Headers using API Key
Key | Value |
---|---|
Content-Type | "application/json" |
UserAuthorization | API Key. Eg: "e516b6db-3230-4b1c-ae3f-e5379b774a80" |
URL Parameters:
Parameter | Type | M/C/O | Value |
---|---|---|---|
Exportable | string | Mandatory | True or False. It means if you want results exportable to CSV. |
PageNumber | integer | Optional | Int. Number of page of the results. Default is 1 (Page size default is 500). |
PageSize | integer | Optional | Int. Size of each page of the results. Default is 500. |
Json Body:
Parameter | Type | M/C/O | Value |
---|---|---|---|
MerchantGuid | string | Mandatory | Merchant's Guid. |
AmountFrom | decimal | Optional | Amount of the transaction. Min. amt.: $0.50 |
AmountTo | decimal | Optional | Amount of the transaction. Min. amt.: $0.50 |
CardHolderName | string | Optional | Cardholder's name. Must be between 0 and 30 digits long. |
first6 | string | Optional | Card first six number. |
last4 | string | Optional | Card last four number. |
cardToken | string | Optional | Card tokenized number value |
CardType | string | Optional | Card type. |
InvoiceNumber | string | Optional | Sale's InvoiceNumber. |
OrderNumber | string | Optional | Sale's order number. Length = 17. |
OrderDateFrom | date | Optional | Sale's order Date. |
OrderDateTo | date | Optional | Sale's order Date. |
TimeStampFrom | date | Optional | Sale's TimeStamp. |
TimeStampTo | date | Optional | Sale's TimeStamp. |
Status | string | Optional | Sale’s status. Allowed values: 1. Transaction - Approved 2. Transaction - Declined 3. Transaction - Created - Local 4. Transaction - Created - Error: Processor not reached 5. Transaction - Processor Error 6. Transaction - Approved - Warning |
CustomerId | string | Optional | Customer Id. |
CustomData | string | Optional | Customer Data. |
GeneratedByCapture | boolean | Optional | Generated By Capture. Allowed values: 1. true 2. false |
ProcessorRefNumber | string | Optional | Processor Reference Number. |
UserName | string | Optional | UserName. |
Response
- 200 code (ok).
Search voids
using System;
using Newtonsoft.Json;
using System.IO;
using System.Net;
using System.Text;
namespace ChoiceSample
{
public class Search
{
public static void SearchVoids()
{
try
{
var request = (HttpWebRequest)WebRequest.Create("https://sandbox.choice.dev/api/v1/Search/Voids/false");
request.ContentType = "text/json";
request.Method = "POST";
var search = new
{
merchantGuid = "19344275-985e-4dff-81ee-cb84b8ad356c",
Status = "Transaction - Approved"
};
string json = JsonConvert.SerializeObject(search);
request.Headers.Add("Authorization", "Bearer 1A089D6ziUybPZFQ3mpPyjt9OEx9yrCs7eQIC6V3A0lmXR2N6-seGNK16Gsnl3td6Ilfbr2Xf_EyukFXwnVEO3fYL-LuGw-L3c8WuaoxhPE8MMdlMPILJTIOV3lTGGdxbFXdKd9U03bbJ9TDUkqxHqq8_VyyjDrw7fs0YOob7bg0OovXTeWgIvZaIrSR1WFR06rYJ0DfWn-Inuf7re1-4SMOjY1ZoCelVwduWCBJpw1111cNbWtHJfObV8u1CVf0");
request.ContentType = "application/json";
request.Accept = "application/json";
using (var streamWriter = new StreamWriter(request.GetRequestStream()))
{
streamWriter.Write(json);
streamWriter.Flush();
streamWriter.Close();
}
try
{
var response = (HttpWebResponse)request.GetResponse();
using (var reader = new StreamReader(response.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)response.StatusCode);
Console.WriteLine();
Console.WriteLine(response.StatusDescription);
Console.WriteLine(result);
}
}
catch (WebException wex)
{
if (wex.Response != null)
{
using (var errorResponse = (HttpWebResponse)wex.Response)
{
using (var reader = new StreamReader(errorResponse.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)errorResponse.StatusCode);
Console.WriteLine();
Console.WriteLine(errorResponse.StatusDescription);
Console.WriteLine(result);
}
}
}
}
}
catch (IOException e)
{
Console.WriteLine(e);
}
}
}
}
Json Example Request:
{
"merchantGuid": "19344275-985e-4dff-81ee-cb84b8ad356c",
"Status": "Transaction - Approved"
}
Json Example Response:
{
"pageCurrent": 1,
"pageCurrentResults": 1,
"pageTotal": 1,
"pageSize": 500,
"totalResults": 1,
"cardSummary": null,
"searchResultDTO": [
{
"status": "Transaction - Approved",
"sale": {
"amount": 10.00,
"card": {
"cardHolderName": null,
"cardType": "Visa",
"last4": "6734"
}
},
"voidReason": "POST_AUTH_USER_DECLINE",
"timeStamp": "2020-11-26T06:40:25.7-06:00",
"processorStatusCode": "A0000",
"batchStatus": "Batch - Open",
"guid": "4130888a-cb0a-41a9-9d06-d90e10535b2a",
"allowCardEmv": false,
"userName": "maxduplessy"
}
]
}
Json error example response:
{
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"traceId": "00-2be920374480ac59ebadf4a9a6057706-0680052537eeceae-00",
"errors": {
"guid": [
"The value 'invalid guid' is not valid."
]
}
}
This endpoint search a voids.
HTTP Request
POST https://sandbox.choice.dev/api/v1/Search/Voids/{exportable}
POST https://sandbox.choice.dev/api/v1/Search/Voids/{exportable}/{pageNumber}
POST https://sandbox.choice.dev/api/v1/Search/Voids/{exportable}/{pageNumber}/{pageSize}
Headers using token
Key | Value |
---|---|
Content-Type | "application/json" |
Authorization | Token. Eg: "Bearer eHSN5rTBzqDozgAAlN1UlTMVuIT1zSiAZWCo6E..." |
Headers using API Key
Key | Value |
---|---|
Content-Type | "application/json" |
UserAuthorization | API Key. Eg: "e516b6db-3230-4b1c-ae3f-e5379b774a80" |
URL Parameters:
Parameter | Type | M/C/O | Value |
---|---|---|---|
Exportable | string | Mandatory | True or False. It means if you want results exportable to CSV. |
PageNumber | integer | Optional | Int. Number of page of the results. Default is 1 (Page size default is 500). |
PageSize | integer | Optional | Int. Size of each page of the results. Default is 500. |
Json Body:
Parameter | Type | M/C/O | Value |
---|---|---|---|
MerchantGuid | string | Mandatory | Merchant's Guid. |
VoidReason | string | Optional | Indicates the reason the transaction was voided. Allowed values: 1. POST_AUTH_USER_DECLINE 2. DEVICE_TIMEOUT 3. DEVICE_UNAVAILABLE 4. PARTIAL_REVERSAL 5. TORN_TRANSACTION 6. POST_AUTH_CHIP_DECLINE |
Status | string | Optional | Void’s status. Allowed values: 1. Transaction - Approved 2. Transaction - Declined 3. Transaction - Created - Local 4. Transaction - Created - Error: Processor not reached 5. Transaction - Processor Error 6. Transaction - Approved - Warning |
TimeStampFrom | date | Optional | Void's TimeStamp. |
TimeStampTo | date | Optional | Void's TimeStamp. |
UserName | string | Optional | UserName. |
Response
- 200 code (ok).
Search returns
using System;
using Newtonsoft.Json;
using System.IO;
using System.Net;
using System.Text;
namespace ChoiceSample
{
public class Search
{
public static void SearchReturns()
{
try
{
var request = (HttpWebRequest)WebRequest.Create("https://sandbox.choice.dev/api/v1/Search/Returns/false");
request.ContentType = "text/json";
request.Method = "POST";
var search = new
{
merchantGuid = "19344275-985e-4dff-81ee-cb84b8ad356c",
Status = "Transaction - Approved"
};
string json = JsonConvert.SerializeObject(search);
request.Headers.Add("Authorization", "Bearer 1A089D6ziUybPZFQ3mpPyjt9OEx9yrCs7eQIC6V3A0lmXR2N6-seGNK16Gsnl3td6Ilfbr2Xf_EyukFXwnVEO3fYL-LuGw-L3c8WuaoxhPE8MMdlMPILJTIOV3lTGGdxbFXdKd9U03bbJ9TDUkqxHqq8_VyyjDrw7fs0YOob7bg0OovXTeWgIvZaIrSR1WFR06rYJ0DfWn-Inuf7re1-4SMOjY1ZoCelVwduWCBJpw1111cNbWtHJfObV8u1CVf0");
request.ContentType = "application/json";
request.Accept = "application/json";
using (var streamWriter = new StreamWriter(request.GetRequestStream()))
{
streamWriter.Write(json);
streamWriter.Flush();
streamWriter.Close();
}
try
{
var response = (HttpWebResponse)request.GetResponse();
using (var reader = new StreamReader(response.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)response.StatusCode);
Console.WriteLine();
Console.WriteLine(response.StatusDescription);
Console.WriteLine(result);
}
}
catch (WebException wex)
{
if (wex.Response != null)
{
using (var errorResponse = (HttpWebResponse)wex.Response)
{
using (var reader = new StreamReader(errorResponse.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)errorResponse.StatusCode);
Console.WriteLine();
Console.WriteLine(errorResponse.StatusDescription);
Console.WriteLine(result);
}
}
}
}
}
catch (IOException e)
{
Console.WriteLine(e);
}
}
}
}
Json Example Request:
{
"merchantGuid": "19344275-985e-4dff-81ee-cb84b8ad356c",
"Status": "Transaction - Approved"
}
Json Example Response:
{
"pageCurrent": 1,
"pageCurrentResults": 1,
"pageTotal": 1,
"pageSize": 500,
"totalResults": 1,
"cardSummary": null,
"searchResultDTO": [
{
"status": "Transaction - Approved",
"amount": 19.74,
"card": {
"cardHolderName": "John Doe",
"cardType": "Mastercard",
"last4": "0213"
},
"timeStamp": "2020-11-25T07:17:24.15-06:00",
"processorStatusCode": "A0014",
"batchStatus": "Batch - Closed",
"userName": "maxduplessy",
"guid": "9fb17f4e-b508-48d3-bd77-bb6813b42620",
"deviceGuid": "b29725af-b067-4a35-9819-bbb31bdf8808",
"saleGuid": "b4084e11-884d-468c-84d9-614c5b986fde",
"type": "CreditReturn",
"cardDataSource": "",
"allowCardEmv": false
}
]
}
Json error example response:
{
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"traceId": "00-2be920374480ac59ebadf4a9a6057706-0680052537eeceae-00",
"errors": {
"guid": [
"The value 'invalid guid' is not valid."
]
}
}
This endpoint search a returns.
HTTP Request
POST https://sandbox.choice.dev/api/v1/Search/Returns/{exportable}
POST https://sandbox.choice.dev/api/v1/Search/Returns/{exportable}/{pageNumber}
POST https://sandbox.choice.dev/api/v1/Search/Returns/{exportable}/{pageNumber}/{pageSize}
Headers using token
Key | Value |
---|---|
Content-Type | "application/json" |
Authorization | Token. Eg: "Bearer eHSN5rTBzqDozgAAlN1UlTMVuIT1zSiAZWCo6E..." |
Headers using API Key
Key | Value |
---|---|
Content-Type | "application/json" |
UserAuthorization | API Key. Eg: "e516b6db-3230-4b1c-ae3f-e5379b774a80" |
URL Parameters:
Parameter | Type | M/C/O | Value |
---|---|---|---|
Exportable | string | Mandatory | True or False. It means if you want results exportable to CSV. |
PageNumber | integer | Optional | Int. Number of page of the results. Default is 1 (Page size default is 500). |
PageSize | integer | Optional | Int. Size of each page of the results. Default is 500. |
Json Body:
Parameter | Type | M/C/O | Value |
---|---|---|---|
MerchantGuid | string | Mandatory | Merchant's Guid. |
AmountFrom | decimal | Optional | Amount of the transaction. Min. amt.: $0.50 |
AmountTo | decimal | Optional | Amount of the transaction. Min. amt.: $0.50 |
Status | string | Optional | Return’s status. Allowed values: 1. Transaction - Approved 2. Transaction - Declined 3. Transaction - Created - Local 4. Transaction - Created - Error: Processor not reached 5. Transaction - Processor Error 6. Transaction - Approved - Warning |
last4 | string | Optional | Card last four number. |
TimeStampFrom | date | Optional | Return's TimeStamp. |
TimeStampTo | date | Optional | Return's TimeStamp. |
UserName | string | Optional | UserName. |
Response
- 200 code (ok).
Search returns EBT Transactions
using System;
using Newtonsoft.Json;
using System.IO;
using System.Net;
using System.Text;
namespace ChoiceSample
{
public class Search
{
public static void SearchReturnsEbtCashBenefitPurchases()
{
try
{
var request = (HttpWebRequest)WebRequest.Create("https://sandbox.choice.dev/api/v1/Search/ebtReturn/false");
request.ContentType = "text/json";
request.Method = "POST";
var search = new
{
merchantGuid = "19344275-985e-4dff-81ee-cb84b8ad356c",
Status = "Transaction - Approved"
};
string json = JsonConvert.SerializeObject(search);
request.Headers.Add("Authorization", "Bearer 1A089D6ziUybPZFQ3mpPyjt9OEx9yrCs7eQIC6V3A0lmXR2N6-seGNK16Gsnl3td6Ilfbr2Xf_EyukFXwnVEO3fYL-LuGw-L3c8WuaoxhPE8MMdlMPILJTIOV3lTGGdxbFXdKd9U03bbJ9TDUkqxHqq8_VyyjDrw7fs0YOob7bg0OovXTeWgIvZaIrSR1WFR06rYJ0DfWn-Inuf7re1-4SMOjY1ZoCelVwduWCBJpw1111cNbWtHJfObV8u1CVf0");
request.ContentType = "application/json";
request.Accept = "application/json";
using (var streamWriter = new StreamWriter(request.GetRequestStream()))
{
streamWriter.Write(json);
streamWriter.Flush();
streamWriter.Close();
}
try
{
var response = (HttpWebResponse)request.GetResponse();
using (var reader = new StreamReader(response.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)response.StatusCode);
Console.WriteLine();
Console.WriteLine(response.StatusDescription);
Console.WriteLine(result);
}
}
catch (WebException wex)
{
if (wex.Response != null)
{
using (var errorResponse = (HttpWebResponse)wex.Response)
{
using (var reader = new StreamReader(errorResponse.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)errorResponse.StatusCode);
Console.WriteLine();
Console.WriteLine(errorResponse.StatusDescription);
Console.WriteLine(result);
}
}
}
}
}
catch (IOException e)
{
Console.WriteLine(e);
}
}
}
}
Json Example Request:
{
"merchantGuid": "19344275-985e-4dff-81ee-cb84b8ad356c",
}
Json Example Response:
{ "pageCurrent": 1,
"pageCurrentResults": 124,
"pageTotal": 1,
"pageSize": 500,
"totalResults": 124,
"cardSummary": null,
"searchResultDto": [
{
"status": "Transaction - Approved",
"amount": 50.00,
"card": {
"cardHolderName": "ExampleText",
"cardType": "Other",
"last4": "0267"
},
"orderNumber": null,
"orderDate": null,
"timeStamp": "2023-02-03T11:00:37.08-06:00",
"customerId": null,
"processorResponseMessage": "Success",
"effectiveAmount": 30.50,
"batchStatus": "Batch - Open",
"relatedVoid": null,
"relatedReturns": null,
"guid": "125cc0f2-30db-4adc-9c1b-c3e098df90ef",
"deviceGuid": "c7917935-7956-46a0-b6a6-d4725244dd58",
"captureGuid": null,
"customData": null,
"generatedByCapture": false,
"processorRefNumber": null,
"partiallyApprovedAmount": null,
"type": null,
"surchargeAmount": null,
"surchargeType": null,
"dualPricingFeeAmount": null,
"tipAmount": null,
"saleTax": null,
"shippingCharges": null,
"cardDataSource": null,
"allowCardEmv": false,
"userName": "TestMerchant",
"hasRelatedReturn": "Yes"
}
]
}
Json error example response:
{
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"traceId": "00-2be920374480ac59ebadf4a9a6057706-0680052537eeceae-00",
"errors": {
"guid": [
"The value 'invalid guid' is not valid."
]
}
}
This endpoint search a returns EBT Cash Benefit Purchases.
HTTP Request
POST https://sandbox.choice.dev/api/v1/Search/ebtReturn/{exportable}
POST https://sandbox.choice.dev/api/v1/Search/ebtReturn/{exportable}/{pageNumber}
POST https://sandbox.choice.dev/api/v1/Search/ebtReturn/{exportable}/{pageNumber}/{pageSize}
Headers using token
Key | Value |
---|---|
Content-Type | "application/json" |
Authorization | Token. Eg: "Bearer eHSN5rTBzqDozgAAlN1UlTMVuIT1zSiAZWCo6E..." |
Headers using API Key
Key | Value |
---|---|
Content-Type | "application/json" |
UserAuthorization | API Key. Eg: "e516b6db-3230-4b1c-ae3f-e5379b774a80" |
URL Parameters:
Parameter | Type | M/C/O | Value |
---|---|---|---|
Exportable | string | Mandatory | True or False. It means if you want results exportable to CSV. |
PageNumber | integer | Optional | Int. Number of page of the results. Default is 1 (Page size default is 500). |
PageSize | integer | Optional | Int. Size of each page of the results. Default is 500. |
Json Body:
Parameter | Type | M/C/O | Value |
---|---|---|---|
MerchantGuid | string | Mandatory | Merchant's Guid. |
AmountFrom | decimal | Optional | Amount of the transaction. Min. amt.: $0.50 |
AmountTo | decimal | Optional | Amount of the transaction. Min. amt.: $0.50 |
Status | string | Optional | Return’s status. Allowed values: 1. Transaction - Approved 2. Transaction - Declined 3. Transaction - Created - Local 4. Transaction - Created - Error: Processor not reached 5. Transaction - Processor Error 6. Transaction - Approved - Warning |
last4 | string | Optional | Card last four number. |
TimeStampFrom | date | Optional | Return's TimeStamp. |
TimeStampTo | date | Optional | Return's TimeStamp. |
UserName | string | Optional | UserName. |
Response
- 200 code (ok).
Search authOnlys
using System;
using Newtonsoft.Json;
using System.IO;
using System.Net;
using System.Text;
namespace ChoiceSample
{
public class Search
{
public static void SearchAuthOnlys()
{
try
{
var request = (HttpWebRequest)WebRequest.Create("https://sandbox.choice.dev/api/v1/Search/AuthOnlys/false");
request.ContentType = "text/json";
request.Method = "POST";
var search = new
{
merchantGuid = "19344275-985e-4dff-81ee-cb84b8ad356c",
Status = "Transaction - Approved"
};
string json = JsonConvert.SerializeObject(search);
request.Headers.Add("Authorization", "Bearer 1A089D6ziUybPZFQ3mpPyjt9OEx9yrCs7eQIC6V3A0lmXR2N6-seGNK16Gsnl3td6Ilfbr2Xf_EyukFXwnVEO3fYL-LuGw-L3c8WuaoxhPE8MMdlMPILJTIOV3lTGGdxbFXdKd9U03bbJ9TDUkqxHqq8_VyyjDrw7fs0YOob7bg0OovXTeWgIvZaIrSR1WFR06rYJ0DfWn-Inuf7re1-4SMOjY1ZoCelVwduWCBJpw1111cNbWtHJfObV8u1CVf0");
request.ContentType = "application/json";
request.Accept = "application/json";
using (var streamWriter = new StreamWriter(request.GetRequestStream()))
{
streamWriter.Write(json);
streamWriter.Flush();
streamWriter.Close();
}
try
{
var response = (HttpWebResponse)request.GetResponse();
using (var reader = new StreamReader(response.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)response.StatusCode);
Console.WriteLine();
Console.WriteLine(response.StatusDescription);
Console.WriteLine(result);
}
}
catch (WebException wex)
{
if (wex.Response != null)
{
using (var errorResponse = (HttpWebResponse)wex.Response)
{
using (var reader = new StreamReader(errorResponse.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)errorResponse.StatusCode);
Console.WriteLine();
Console.WriteLine(errorResponse.StatusDescription);
Console.WriteLine(result);
}
}
}
}
}
catch (IOException e)
{
Console.WriteLine(e);
}
}
}
}
Json Example Request:
{
"merchantGuid": "19344275-985e-4dff-81ee-cb84b8ad356c",
"Status": "Transaction - Approved"
}
Json Example Response:
{
"pageCurrent": 1,
"pageCurrentResults": 1,
"pageTotal": 1,
"pageSize": 10,
"totalResults": 1,
"cardSummary": null,
"searchResultDTO": [
{
"status": "Transaction - Approved",
"amount": 10.00,
"effectiveAmount": 10.00,
"card": {
"cardHolderName": "John Doe",
"cardType": "Mastercard",
"first6": "123456",
"last4": "9426",
"cardToken": "xxxx-xxxx-xxxx-xxxx-9426"
},
"orderNumber": "11518",
"orderDate": "2020-11-24T00:00:00",
"timeStamp": "2020-11-24T14:18:54.16-06:00",
"customerId": "xt147",
"processorResponseMessage": "Success",
"batchStatus": "Batch - Closed",
"relatedCapture": {
"guid": "284dd923-a266-4d0f-80bd-e8441154c742",
"newAmount": 10.00
},
"relatedVoid": null,
"guid": "493cffed-232a-4896-b9ca-36b543d7da13",
"deviceGuid": "b29725af-b067-4a35-9819-bbb31bdf8808",
"partiallyApprovedAmount": null,
"cardDataSource": "INTERNET",
"allowCardEmv": false,
"addressVerificationCode": "N",
"addressVerificationResult": "No Match",
"cvvVerificationCode": "M",
"cvvVerificationResult": "Passed",
"semiIntegrated": null,
"userName": "maxduplessy"
}
]
}
Json error example response:
{
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"traceId": "00-2be920374480ac59ebadf4a9a6057706-0680052537eeceae-00",
"errors": {
"guid": [
"The value 'invalid guid' is not valid."
]
}
}
This endpoint search an authOnlys.
HTTP Request
POST https://sandbox.choice.dev/api/v1/Search/AuthOnlys/{exportable}
POST https://sandbox.choice.dev/api/v1/Search/AuthOnlys/{exportable}/{pageNumber}
POST https://sandbox.choice.dev/api/v1/Search/AuthOnlys/{exportable}/{pageNumber}/{pageSize}
Headers using token
Key | Value |
---|---|
Content-Type | "application/json" |
Authorization | Token. Eg: "Bearer eHSN5rTBzqDozgAAlN1UlTMVuIT1zSiAZWCo6E..." |
Headers using API Key
Key | Value |
---|---|
Content-Type | "application/json" |
UserAuthorization | API Key. Eg: "e516b6db-3230-4b1c-ae3f-e5379b774a80" |
URL Parameters:
Parameter | Type | M/C/O | Value |
---|---|---|---|
Exportable | string | Mandatory | True or False. It means if you want results exportable to CSV. |
PageNumber | integer | Optional | Int. Number of page of the results. Default is 1 (Page size default is 500). |
PageSize | integer | Optional | Int. Size of each page of the results. Default is 500. |
Json Body:
Parameter | Type | M/C/O | Value |
---|---|---|---|
MerchantGuid | string | Mandatory | Merchant's Guid. |
AmountFrom | decimal | Optional | Amount of the transaction. Min. amt.: $0.50 |
AmountTo | decimal | Optional | Amount of the transaction. Min. amt.: $0.50 |
first6 | string | Optional | Card first six number. |
last4 | string | Optional | Card last four number. |
CardToken | string | Optional | Card tokenized number value. |
CardHolderName | string | Optional | Cardholder's name. Must be between 0 and 30 digits long. |
CardType | string | Optional | Card Type. |
InvoiceNumber | string | Optional | AuthOnly's InvoiceNumber. |
OrderNumber | string | Optional | AuthOnly's order number. Length = 17. |
OrderDateFrom | date | Optional | AuthOnly's order Date. |
OrderDateTo | date | Optional | AuthOnly's order Date. |
TimeStampFrom | date | Optional | AuthOnly's TimeStamp. |
TimeStampTo | date | Optional | AuthOnly's TimeStamp. |
Status | string | Optional | AuthOnly’s status. Allowed values: 1. Transaction - Approved 2. Transaction - Declined 3. Transaction - Created - Local 4. Transaction - Created - Error: Processor not reached 5. Transaction - Processor Error 6. Transaction - Approved - Warning |
MerchantCustomerId | string | Optional | Merchant Customer Id. |
UserName | string | Optional | UserName. |
Response
- 200 code (ok).
Search captures
using System;
using Newtonsoft.Json;
using System.IO;
using System.Net;
using System.Text;
namespace ChoiceSample
{
public class Search
{
public static void SearchCaptures()
{
try
{
var request = (HttpWebRequest)WebRequest.Create("https://sandbox.choice.dev/api/v1/Search/Captures/false");
request.ContentType = "text/json";
request.Method = "POST";
var search = new
{
merchantGuid = "19344275-985e-4dff-81ee-cb84b8ad356c",
Status = "Transaction - Approved"
};
string json = JsonConvert.SerializeObject(search);
request.Headers.Add("Authorization", "Bearer 1A089D6ziUybPZFQ3mpPyjt9OEx9yrCs7eQIC6V3A0lmXR2N6-seGNK16Gsnl3td6Ilfbr2Xf_EyukFXwnVEO3fYL-LuGw-L3c8WuaoxhPE8MMdlMPILJTIOV3lTGGdxbFXdKd9U03bbJ9TDUkqxHqq8_VyyjDrw7fs0YOob7bg0OovXTeWgIvZaIrSR1WFR06rYJ0DfWn-Inuf7re1-4SMOjY1ZoCelVwduWCBJpw1111cNbWtHJfObV8u1CVf0");
request.ContentType = "application/json";
request.Accept = "application/json";
using (var streamWriter = new StreamWriter(request.GetRequestStream()))
{
streamWriter.Write(json);
streamWriter.Flush();
streamWriter.Close();
}
try
{
var response = (HttpWebResponse)request.GetResponse();
using (var reader = new StreamReader(response.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)response.StatusCode);
Console.WriteLine();
Console.WriteLine(response.StatusDescription);
Console.WriteLine(result);
}
}
catch (WebException wex)
{
if (wex.Response != null)
{
using (var errorResponse = (HttpWebResponse)wex.Response)
{
using (var reader = new StreamReader(errorResponse.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)errorResponse.StatusCode);
Console.WriteLine();
Console.WriteLine(errorResponse.StatusDescription);
Console.WriteLine(result);
}
}
}
}
}
catch (IOException e)
{
Console.WriteLine(e);
}
}
}
}
Json Example Request:
{
"merchantGuid": "19344275-985e-4dff-81ee-cb84b8ad356c",
"Status": "Transaction - Approved"
}
Json Example Response:
{
"pageCurrent": 1,
"pageCurrentResults": 1,
"pageTotal": 1,
"pageSize": 500,
"totalResults": 1,
"cardSummary": null,
"searchResultDTO": [
{
"status": "Transaction - Approved",
"authOnly": {
"status": null,
"amount": 10.00,
"effectiveAmount": null,
"card": {
"cardHolderName": "John Doe",
"cardType": "Mastercard",
"last4": "9426"
},
"orderNumber": "11518",
"orderDate": "2020-11-24T00:00:00",
"timeStamp": "0001-01-01T00:00:00",
"customerId": null,
"processorResponseMessage": null,
"batchStatus": null,
"relatedCapture": null,
"relatedVoid": null,
"guid": "493cffed-232a-4896-b9ca-36b543d7da13",
"deviceGuid": "b29725af-b067-4a35-9819-bbb31bdf8808",
"partiallyApprovedAmount": null,
"cardDataSource": null,
"allowCardEmv": false,
"addressVerificationCode": null,
"addressVerificationResult": null,
"cvvVerificationCode": null,
"cvvVerificationResult": null,
"semiIntegrated": null,
"userName": null
},
"newAmount": 10.00,
"timeStamp": "2020-11-24T14:21:25.59-06:00",
"processorResponseMessage": "Success",
"batchStatus": "Batch - Closed",
"guid": "284dd923-a266-4d0f-80bd-e8441154c742",
"allowCardEmv": false,
"userName": "maxduplessy"
}
]
}
Json error example response:
{
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"traceId": "00-2be920374480ac59ebadf4a9a6057706-0680052537eeceae-00",
"errors": {
"guid": [
"The value 'invalid guid' is not valid."
]
}
}
This endpoint search a captures.
HTTP Request
POST https://sandbox.choice.dev/api/v1/Search/Captures/{exportable}
POST https://sandbox.choice.dev/api/v1/Search/Captures/{exportable}/{pageNumber}
POST https://sandbox.choice.dev/api/v1/Search/Captures/{exportable}/{pageNumber}/{pageSize}
Headers using token
Key | Value |
---|---|
Content-Type | "application/json" |
Authorization | Token. Eg: "Bearer eHSN5rTBzqDozgAAlN1UlTMVuIT1zSiAZWCo6E..." |
Headers using API Key
Key | Value |
---|---|
Content-Type | "application/json" |
UserAuthorization | API Key. Eg: "e516b6db-3230-4b1c-ae3f-e5379b774a80" |
URL Parameters:
Parameter | Type | M/C/O | Value |
---|---|---|---|
Exportable | string | Mandatory | True or False. It means if you want results exportable to CSV. |
PageNumber | integer | Optional | Int. Number of page of the results. Default is 1 (Page size default is 500). |
PageSize | integer | Optional | Int. Size of each page of the results. Default is 500. |
Json Body:
Parameter | Type | M/C/O | Value |
---|---|---|---|
MerchantGuid | string | Mandatory | Merchant's Guid. |
NewAmountFrom | decimal | Optional | NewAmount From of the transaction. Min. amt.: $0.50 |
NewAmountTo | decimal | Optional | NewAmount To of the transaction. Min. amt.: $0.50 |
TimeStampFrom | date | Optional | Capture's TimeStamp From. |
TimeStampTo | date | Optional | Capture's TimeStamp To. |
Status | string | Optional | Capture’s status. Allowed values: 1. Transaction - Approved 2. Transaction - Declined 3. Transaction - Created - Local 4. Transaction - Created - Error: Processor not reached 5. Transaction - Processor Error 6. Transaction - Approved - Warning |
UserName | string | Optional | UserName. |
Response
- 200 code (ok).
Search verify
using System;
using Newtonsoft.Json;
using System.IO;
using System.Net;
using System.Text;
namespace ChoiceSample
{
public class Search
{
public static void SearchVerify()
{
try
{
var request = (HttpWebRequest)WebRequest.Create("https://sandbox.choice.dev/api/v1/Search/Verify/false");
request.ContentType = "text/json";
request.Method = "POST";
var search = new
{
merchantGuid = "19344275-985e-4dff-81ee-cb84b8ad356c",
Status = "Transaction - Approved"
};
string json = JsonConvert.SerializeObject(search);
request.Headers.Add("Authorization", "Bearer 1A089D6ziUybPZFQ3mpPyjt9OEx9yrCs7eQIC6V3A0lmXR2N6-seGNK16Gsnl3td6Ilfbr2Xf_EyukFXwnVEO3fYL-LuGw-L3c8WuaoxhPE8MMdlMPILJTIOV3lTGGdxbFXdKd9U03bbJ9TDUkqxHqq8_VyyjDrw7fs0YOob7bg0OovXTeWgIvZaIrSR1WFR06rYJ0DfWn-Inuf7re1-4SMOjY1ZoCelVwduWCBJpw1111cNbWtHJfObV8u1CVf0");
request.ContentType = "application/json";
request.Accept = "application/json";
using (var streamWriter = new StreamWriter(request.GetRequestStream()))
{
streamWriter.Write(json);
streamWriter.Flush();
streamWriter.Close();
}
try
{
var response = (HttpWebResponse)request.GetResponse();
using (var reader = new StreamReader(response.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)response.StatusCode);
Console.WriteLine();
Console.WriteLine(response.StatusDescription);
Console.WriteLine(result);
}
}
catch (WebException wex)
{
if (wex.Response != null)
{
using (var errorResponse = (HttpWebResponse)wex.Response)
{
using (var reader = new StreamReader(errorResponse.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)errorResponse.StatusCode);
Console.WriteLine();
Console.WriteLine(errorResponse.StatusDescription);
Console.WriteLine(result);
}
}
}
}
}
catch (IOException e)
{
Console.WriteLine(e);
}
}
}
}
Json Example Request:
{
"merchantGuid": "19344275-985e-4dff-81ee-cb84b8ad356c",
"Status": "Transaction - Approved"
}
Json Example Response:
{
"pageCurrent": 1,
"pageCurrentResults": 1,
"pageTotal": 1,
"pageSize": 500,
"totalResults": 1,
"cardSummary": null,
"searchResultDTO": [
{
"status": "Transaction - Approved",
"card": {
"cardHolderName": "Justin Troudeau",
"cardType": "Visa",
"first6": "123456",
"last4": "7402",
"cardToken": "xxxx-xxxx-xxxx-xxxx-7402"
},
"timeStamp": "2020-11-25T07:24:25.29-06:00",
"processorStatusCode": "A0000",
"userName": "maxduplessy"
}
]
}
Json error example response:
{
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"traceId": "00-2be920374480ac59ebadf4a9a6057706-0680052537eeceae-00",
"errors": {
"guid": [
"The value 'invalid guid' is not valid."
]
}
}
This endpoint search a verify.
HTTP Request
POST https://sandbox.choice.dev/api/v1/Search/Verify/{exportable}
POST https://sandbox.choice.dev/api/v1/Search/Verify/{exportable}/{pageNumber}
POST https://sandbox.choice.dev/api/v1/Search/Verify/{exportable}/{pageNumber}/{pageSize}
Headers using token
Key | Value |
---|---|
Content-Type | "application/json" |
Authorization | Token. Eg: "Bearer eHSN5rTBzqDozgAAlN1UlTMVuIT1zSiAZWCo6E..." |
Headers using API Key
Key | Value |
---|---|
Content-Type | "application/json" |
UserAuthorization | API Key. Eg: "e516b6db-3230-4b1c-ae3f-e5379b774a80" |
URL Parameters:
Parameter | Type | M/C/O | Value |
---|---|---|---|
Exportable | string | Mandatory | True or False. It means if you want results exportable to CSV. |
PageNumber | integer | Optional | Int. Number of page of the results. Default is 1 (Page size default is 500). |
PageSize | integer | Optional | Int. Size of each page of the results. Default is 500. |
Json Body:
Parameter | Type | M/C/O | Value |
---|---|---|---|
MerchantGuid | string | Mandatory | Merchant's Guid. |
first6 | string | Optional | Card first six number. |
last4 | string | Optional | Card last four number. |
Card.Token | string | Optional | Card tokenized number value |
CardHolderName | string | Optional | Cardholder's name. Must be between 0 and 30 digits long. |
CardType | string | Optional | Card Type. |
TimeStampFrom | date | Optional | Verify's TimeStamp From. |
TimeStampTo | date | Optional | Verify's TimeStamp To. |
Status | string | Optional | Verify’s status. Allowed values: 1. Transaction - Approved 2. Transaction - Declined 3. Transaction - Created - Local 4. Transaction - Created - Error: Processor not reached 5. Transaction - Processor Error 6. Transaction - Approved - Warning |
UserName | string | Optional | UserName. |
Response
- 200 code (ok).
Search Recurring Billings
using System;
using Newtonsoft.Json;
using System.IO;
using System.Net;
using System.Text;
namespace ChoiceSample
{
public class Search
{
public static void SearchRecurringBillings()
{
try
{
var request = (HttpWebRequest)WebRequest.Create("https://sandbox.choice.dev/api/v1/Search/RecurringBillings/false");
request.ContentType = "text/json";
request.Method = "POST";
var search = new
{
merchantGuid = "19344275-985e-4dff-81ee-cb84b8ad356c",
Status = "Transaction - Approved"
};
string json = JsonConvert.SerializeObject(search);
request.Headers.Add("Authorization", "Bearer 1A089D6ziUybPZFQ3mpPyjt9OEx9yrCs7eQIC6V3A0lmXR2N6-seGNK16Gsnl3td6Ilfbr2Xf_EyukFXwnVEO3fYL-LuGw-L3c8WuaoxhPE8MMdlMPILJTIOV3lTGGdxbFXdKd9U03bbJ9TDUkqxHqq8_VyyjDrw7fs0YOob7bg0OovXTeWgIvZaIrSR1WFR06rYJ0DfWn-Inuf7re1-4SMOjY1ZoCelVwduWCBJpw1111cNbWtHJfObV8u1CVf0");
request.ContentType = "application/json";
request.Accept = "application/json";
using (var streamWriter = new StreamWriter(request.GetRequestStream()))
{
streamWriter.Write(json);
streamWriter.Flush();
streamWriter.Close();
}
try
{
var response = (HttpWebResponse)request.GetResponse();
using (var reader = new StreamReader(response.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)response.StatusCode);
Console.WriteLine();
Console.WriteLine(response.StatusDescription);
Console.WriteLine(result);
}
}
catch (WebException wex)
{
if (wex.Response != null)
{
using (var errorResponse = (HttpWebResponse)wex.Response)
{
using (var reader = new StreamReader(errorResponse.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)errorResponse.StatusCode);
Console.WriteLine();
Console.WriteLine(errorResponse.StatusDescription);
Console.WriteLine(result);
}
}
}
}
}
catch (IOException e)
{
Console.WriteLine(e);
}
}
}
}
Json Example Request:
{
"merchantGuid": "19344275-985e-4dff-81ee-cb84b8ad356c",
"Status": "Transaction - Approved"
}
Json Example Response:
{
"pageCurrent": 1,
"pageCurrentResults": 1,
"pageTotal": 1,
"pageSize": 10,
"totalResults": 1,
"cardSummary": null,
"searchResultDTO": [
{
"status": "RecurringBilling - Active",
"interval": "monthly",
"intervalValue": "april, may, june",
"amount": 10.50,
"name": "John Doe",
"recurringBillingNumber": "64942678",
"startDate": "2021-05-13T00:00:00",
"endDate": "2023-04-01T00:00:00",
"paymentCount": null,
"processorResponseMessage": null,
"first6": "123456",
"last4": "6019",
"accountNumberLastFour": null,
"timeStamp": "2020-11-25T14:31:38.6",
"invoiceGuid": "00000000-0000-0000-0000-000000000000",
"invoiceNumber": null,
"guid": "11fd2d0a-298f-4387-81ed-ffd6780f7a21",
"scheduleNotes": "Cable",
"pause": null,
"accountNumber": "",
"pauseStartDate": null,
"pauseEndDate": null,
"userName": "maxduplessy"
}
]
}
Json error example response:
{
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"traceId": "00-2be920374480ac59ebadf4a9a6057706-0680052537eeceae-00",
"errors": {
"guid": [
"The value 'invalid guid' is not valid."
]
}
}
This endpoint search a recurring billings.
HTTP Request
POST https://sandbox.choice.dev/api/v1/Search/RecurringBillings/{exportable}
POST https://sandbox.choice.dev/api/v1/Search/RecurringBillings/{exportable}/{pageNumber}
POST https://sandbox.choice.dev/api/v1/Search/RecurringBillings/{exportable}/{pageNumber}/{pageSize}
Headers using token
Key | Value |
---|---|
Content-Type | "application/json" |
Authorization | Token. Eg: "Bearer eHSN5rTBzqDozgAAlN1UlTMVuIT1zSiAZWCo6E..." |
Headers using API Key
Key | Value |
---|---|
Content-Type | "application/json" |
UserAuthorization | API Key. Eg: "e516b6db-3230-4b1c-ae3f-e5379b774a80" |
URL Parameters:
Parameter | Type | M/C/O | Value |
---|---|---|---|
Exportable | string | Mandatory | True or False. It means if you want results exportable to CSV. |
PageNumber | integer | Optional | Int. Number of page of the results. Default is 1 (Page size default is 500). |
PageSize | integer | Optional | Int. Size of each page of the results. Default is 500. |
Json Body:
Parameter | Type | M/C/O | Value |
---|---|---|---|
MerchantGuid | string | Mandatory | Merchant's Guid. |
CardOnly | string | Optional | Card Only. |
BankAccountOnly | string | Optional | Bank Account Only. |
Status | string | Optional | Recurring billing status. Allowed values: 1. RecurringBilling - Active 2. RecurringBilling - Created - Local 3. RecurringBilling - Created - Error: Processor not reached 4. RecurringBilling - Created - Processor Fail 5. RecurringBilling - Deactivated 6. RecurringBilling - Paused 7. RecurringBilling - Finished 8. RecurringBilling - Deleted 9. RecurringBilling - Active Started |
Name | string | Optional | Name. |
AmountFrom | decimal | Optional | amount from of the transaction. Min. amt.: $0.50 |
AmountTo | decimal | Optional | amount to of the transaction. Min. amt.: $0.50 |
CreatedDateFrom | date | Optional | Created Date From RecurringBillings. |
CreatedDateTo | date | Optional | Created Date To RecurringBillings. |
BillingDateFrom | date | Optional | Created Billing Date From RecurringBillings. |
BillingDateTo | date | Optional | Created Billing Date To RecurringBillings. |
LastFour | string | Optional | LastFour. |
RecurringBillingNumber | string | Optional | RecurringBillingNumber. |
ScheduleNotes | string | Optional | ScheduleNotes. |
ScheduleExceptions | string | Optional | ScheduleExceptions. |
UserName | string | Optional | UserName. |
AccountNumber | string | Optional | AccountNumber. |
Response
- 200 code (ok).
Search bank clearing
using System;
using Newtonsoft.Json;
using System.IO;
using System.Net;
using System.Text;
namespace ChoiceSample
{
public class Search
{
public static void SearchBankClearing()
{
try
{
var request = (HttpWebRequest)WebRequest.Create("https://sandbox.choice.dev/api/v1/Search/BankClearings/false");
request.ContentType = "text/json";
request.Method = "POST";
var search = new
{
merchantGuid = "19344275-985e-4dff-81ee-cb84b8ad356c",
Status = "Transaction - Approved"
};
string json = JsonConvert.SerializeObject(search);
request.Headers.Add("Authorization", "Bearer 1A089D6ziUybPZFQ3mpPyjt9OEx9yrCs7eQIC6V3A0lmXR2N6-seGNK16Gsnl3td6Ilfbr2Xf_EyukFXwnVEO3fYL-LuGw-L3c8WuaoxhPE8MMdlMPILJTIOV3lTGGdxbFXdKd9U03bbJ9TDUkqxHqq8_VyyjDrw7fs0YOob7bg0OovXTeWgIvZaIrSR1WFR06rYJ0DfWn-Inuf7re1-4SMOjY1ZoCelVwduWCBJpw1111cNbWtHJfObV8u1CVf0");
request.ContentType = "application/json";
request.Accept = "application/json";
using (var streamWriter = new StreamWriter(request.GetRequestStream()))
{
streamWriter.Write(json);
streamWriter.Flush();
streamWriter.Close();
}
try
{
var response = (HttpWebResponse)request.GetResponse();
using (var reader = new StreamReader(response.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)response.StatusCode);
Console.WriteLine();
Console.WriteLine(response.StatusDescription);
Console.WriteLine(result);
}
}
catch (WebException wex)
{
if (wex.Response != null)
{
using (var errorResponse = (HttpWebResponse)wex.Response)
{
using (var reader = new StreamReader(errorResponse.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)errorResponse.StatusCode);
Console.WriteLine();
Console.WriteLine(errorResponse.StatusDescription);
Console.WriteLine(result);
}
}
}
}
}
catch (IOException e)
{
Console.WriteLine(e);
}
}
}
}
Json Example Request:
{
"merchantGuid": "19344275-985e-4dff-81ee-cb84b8ad356c",
"Status": "Transaction - Approved"
}
Json Example Response:
{
"pageCurrent": 1,
"pageCurrentResults": 1,
"pageTotal": 1,
"pageSize": 500,
"totalResults": 1,
"cardSummary": null,
"searchResultDTO": [
{
"status": "Transaction - Approved - Warning",
"amount": 3.50,
"effectiveAmount": 0.00,
"bankAccount": {
"nameOnAccount": "Joe Black",
"routingNumber": "211274450",
"lastFour": "2020"
},
"orderNumber": "11518",
"timeStamp": "2020-11-24T08:53:17.61-06:00",
"updateTimeStamp": null,
"fromRecurringBilling": false,
"customerId": "xt147",
"processorResponseMessage": "HELD",
"relatedVoid": null,
"relatedReturn": "f76fda9b-3632-441b-aa8c-f98ff4389ade",
"guid": "8c7d4ce1-1cd2-4c92-ac24-86bf7ae1c0ed",
"deviceGuid": "a9c0505b-a087-44b1-b9cd-0e7f75715d4d",
"responseTransactionStatus": "Debit Sent",
"responseSettlementStatus": "Credit Sent",
"responseCode": "HELD",
"userName": "maxduplessy"
}
]
}
Json error example response:
{
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"traceId": "00-2be920374480ac59ebadf4a9a6057706-0680052537eeceae-00",
"errors": {
"guid": [
"The value 'invalid guid' is not valid."
]
}
}
This endpoint search a bank clearings.
HTTP Request
POST https://sandbox.choice.dev/api/v1/Search/BankClearings/{exportable}
POST https://sandbox.choice.dev/api/v1/Search/BankClearings/{exportable}/{pageNumber}
POST https://sandbox.choice.dev/api/v1/Search/BankClearings/{exportable}/{pageNumber}/{pageSize}
Headers using token
Key | Value |
---|---|
Content-Type | "application/json" |
Authorization | Token. Eg: "Bearer eHSN5rTBzqDozgAAlN1UlTMVuIT1zSiAZWCo6E..." |
Headers using API Key
Key | Value |
---|---|
Content-Type | "application/json" |
UserAuthorization | API Key. Eg: "e516b6db-3230-4b1c-ae3f-e5379b774a80" |
URL Parameters:
Parameter | Type | M/C/O | Value |
---|---|---|---|
Exportable | string | Mandatory | True or False. It means if you want results exportable to CSV. |
PageNumber | integer | Optional | Int. Number of page of the results. Default is 1 (Page size default is 500). |
PageSize | integer | Optional | Int. Size of each page of the results. Default is 500. |
Json Body:
Parameter | Type | M/C/O | Value |
---|---|---|---|
MerchantGuid | string | Mandatory | Merchant's Guid. |
Status | string | Optional | Bank clearing’s status. Allowed values: 1. Transaction - Approved 2. Transaction - Declined 3. Transaction - Created - Local 4. Transaction - Created - Error: Processor not reached 5. Transaction - Processor Error 6. Transaction - Approved - Warning |
TotalAmountFrom | decimal | Optional | Total amount from of the transaction. Min. amt.: $0.50 |
TotalAmountTo | decimal | Optional | Total amount to of the transaction. Min. amt.: $0.50 |
NameOnAccount | string | Optional | Account's name. |
RoutingNumber | string | Optional | Routing's number. Must be 9 characters (example: 490000018). |
AccountNumberLastFour | string | Optional | Account's number last four. |
FromRecurringBilling | boolean | Optional | From RecurringBilling. |
OrderNumber | string | Optional | Merchant's order number. The value sent on this element will be returned as InvoiceNumber. Length = 17. Max length = 20. Not allow special characters. |
TimeStampFrom | date | Optional | Bank clearing's TimeStamp. |
UpdateTimeStampFrom | date | Optional | Bank clearing's UpdateTimeStamp. |
TimeStampTo | date | Optional | Bank clearing's TimeStamp. |
UpdateTimeStampTo | date | Optional | Bank clearing's UpdateTimeStamp. |
MerchantCustomerId | string | Optional | Merchant Customer Id. |
UserName | string | Optional | UserName. |
SettlementStatus | string | Optional | Settlement’s status. Allowed values: 1.Pending 2. Debit Sent 3. Credit Sent 4. Chargeback 5. Not Available 6. No Credit 7. Voided 8. Returned 9. Cancelled |
Response
- 200 code (ok).
Search bank clearing voids
using System;
using Newtonsoft.Json;
using System.IO;
using System.Net;
using System.Text;
namespace ChoiceSample
{
public class Search
{
public static void SearchBankClearingVoids()
{
try
{
var request = (HttpWebRequest)WebRequest.Create("https://sandbox.choice.dev/api/v1/Search/BankClearingVoids/false");
request.ContentType = "text/json";
request.Method = "POST";
var search = new
{
merchantGuid = "19344275-985e-4dff-81ee-cb84b8ad356c",
Status = "Transaction - Approved"
};
string json = JsonConvert.SerializeObject(search);
request.Headers.Add("Authorization", "Bearer 1A089D6ziUybPZFQ3mpPyjt9OEx9yrCs7eQIC6V3A0lmXR2N6-seGNK16Gsnl3td6Ilfbr2Xf_EyukFXwnVEO3fYL-LuGw-L3c8WuaoxhPE8MMdlMPILJTIOV3lTGGdxbFXdKd9U03bbJ9TDUkqxHqq8_VyyjDrw7fs0YOob7bg0OovXTeWgIvZaIrSR1WFR06rYJ0DfWn-Inuf7re1-4SMOjY1ZoCelVwduWCBJpw1111cNbWtHJfObV8u1CVf0");
request.ContentType = "application/json";
request.Accept = "application/json";
using (var streamWriter = new StreamWriter(request.GetRequestStream()))
{
streamWriter.Write(json);
streamWriter.Flush();
streamWriter.Close();
}
try
{
var response = (HttpWebResponse)request.GetResponse();
using (var reader = new StreamReader(response.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)response.StatusCode);
Console.WriteLine();
Console.WriteLine(response.StatusDescription);
Console.WriteLine(result);
}
}
catch (WebException wex)
{
if (wex.Response != null)
{
using (var errorResponse = (HttpWebResponse)wex.Response)
{
using (var reader = new StreamReader(errorResponse.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)errorResponse.StatusCode);
Console.WriteLine();
Console.WriteLine(errorResponse.StatusDescription);
Console.WriteLine(result);
}
}
}
}
}
catch (IOException e)
{
Console.WriteLine(e);
}
}
}
}
Json Example Request:
{
"merchantGuid": "19344275-985e-4dff-81ee-cb84b8ad356c",
"UserName": "maxduplessy"
}
Json Example Response:
{
"pageCurrent": 1,
"pageCurrentResults": 1,
"pageTotal": 1,
"pageSize": 500,
"totalResults": 1,
"cardSummary": null,
"searchResultDTO": [
{
"status": "Transaction - Approved",
"relatedClearing": {
"status": null,
"amount": 3.50,
"effectiveAmount": 0.0,
"bankAccount": {
"nameOnAccount": "max tomassi",
"routingNumber": "211274450",
"lastFour": "5678"
},
"orderNumber": "11518",
"timeStamp": "0001-01-01T00:00:00",
"updateTimeStamp": null,
"fromRecurringBilling": null,
"customerId": null,
"processorResponseMessage": null,
"relatedVoid": null,
"relatedReturn": null,
"guid": "00000000-0000-0000-0000-000000000000",
"deviceGuid": "00000000-0000-0000-0000-000000000000",
"responseTransactionStatus": null,
"responseSettlementStatus": null,
"responseCode": null,
"userName": null
},
"timeStamp": "2020-11-26T08:20:33.7-06:00",
"processorResponseMessage": "VOIDED",
"guid": "8fc24460-718f-4db2-a5cb-31ce722cec3a",
"userName": "maxduplessy"
}
]
}
Json error example response:
{
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"traceId": "00-2be920374480ac59ebadf4a9a6057706-0680052537eeceae-00",
"errors": {
"guid": [
"The value 'invalid guid' is not valid."
]
}
}
This endpoint search a bank clearing voids.
HTTP Request
POST https://sandbox.choice.dev/api/v1/Search/BankClearingVoids/{exportable}
POST https://sandbox.choice.dev/api/v1/Search/BankClearingVoids/{exportable}/{pageNumber}
POST https://sandbox.choice.dev/api/v1/Search/BankClearingVoids/{exportable}/{pageNumber}/{pageSize}
Headers using token
Key | Value |
---|---|
Content-Type | "application/json" |
Authorization | Token. Eg: "Bearer eHSN5rTBzqDozgAAlN1UlTMVuIT1zSiAZWCo6E..." |
Headers using API Key
Key | Value |
---|---|
Content-Type | "application/json" |
UserAuthorization | API Key. Eg: "e516b6db-3230-4b1c-ae3f-e5379b774a80" |
URL Parameters:
Parameter | Type | M/C/O | Value |
---|---|---|---|
Exportable | string | Mandatory | True or False. It means if you want results exportable to CSV. |
PageNumber | integer | Optional | Int. Number of page of the results. Default is 1 (Page size default is 500). |
PageSize | integer | Optional | Int. Size of each page of the results. Default is 500. |
Json Body:
Parameter | Type | M/C/O | Value |
---|---|---|---|
MerchantGuid | string | Mandatory | Merchant's Guid. |
OrderNumber | string | Optional | Merchant's order number. The value sent on this element will be returned as InvoiceNumber. Length = 17. Max length = 20. Not allow special characters. |
TimeStampFrom | date | Optional | Bank clearing void's TimeStamp. |
TimeStampTo | date | Optional | Bank clearing void's TimeStamp. |
Status | string | Optional | Bank clearing void’s status. Allowed values: 1. Transaction - Approved 2. Transaction - Declined 3. Transaction - Created - Local 4. Transaction - Created - Error: Processor not reached 5. Transaction - Processor Error 6. Transaction - Approved - Warning |
UserName | string | Optional | UserName. |
Response
- 200 code (ok).
Search bank clearing returns
using System;
using Newtonsoft.Json;
using System.IO;
using System.Net;
using System.Text;
namespace ChoiceSample
{
public class Search
{
public static void SearchBankClearingReturns()
{
try
{
var request = (HttpWebRequest)WebRequest.Create("https://sandbox.choice.dev/api/v1/Search/BankClearingReturns/false");
request.ContentType = "text/json";
request.Method = "POST";
var search = new
{
merchantGuid = "19344275-985e-4dff-81ee-cb84b8ad356c",
Status = "Transaction - Approved"
};
string json = JsonConvert.SerializeObject(search);
request.Headers.Add("Authorization", "Bearer 1A089D6ziUybPZFQ3mpPyjt9OEx9yrCs7eQIC6V3A0lmXR2N6-seGNK16Gsnl3td6Ilfbr2Xf_EyukFXwnVEO3fYL-LuGw-L3c8WuaoxhPE8MMdlMPILJTIOV3lTGGdxbFXdKd9U03bbJ9TDUkqxHqq8_VyyjDrw7fs0YOob7bg0OovXTeWgIvZaIrSR1WFR06rYJ0DfWn-Inuf7re1-4SMOjY1ZoCelVwduWCBJpw1111cNbWtHJfObV8u1CVf0");
request.ContentType = "application/json";
request.Accept = "application/json";
using (var streamWriter = new StreamWriter(request.GetRequestStream()))
{
streamWriter.Write(json);
streamWriter.Flush();
streamWriter.Close();
}
try
{
var response = (HttpWebResponse)request.GetResponse();
using (var reader = new StreamReader(response.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)response.StatusCode);
Console.WriteLine();
Console.WriteLine(response.StatusDescription);
Console.WriteLine(result);
}
}
catch (WebException wex)
{
if (wex.Response != null)
{
using (var errorResponse = (HttpWebResponse)wex.Response)
{
using (var reader = new StreamReader(errorResponse.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)errorResponse.StatusCode);
Console.WriteLine();
Console.WriteLine(errorResponse.StatusDescription);
Console.WriteLine(result);
}
}
}
}
}
catch (IOException e)
{
Console.WriteLine(e);
}
}
}
}
Json Example Request:
{
"merchantGuid": "19344275-985e-4dff-81ee-cb84b8ad356c",
"Status": "Transaction - Approved"
}
Json Example Response:
{
"pageCurrent": 1,
"pageCurrentResults": 1,
"pageTotal": 1,
"pageSize": 500,
"totalResults": 1,
"cardSummary": null,
"searchResultDTO": [
{
"status": "Transaction - Approved - Warning",
"relatedClearing": {
"status": null,
"amount": 3.50,
"effectiveAmount": 0.0,
"bankAccount": {
"nameOnAccount": "Joe Black",
"routingNumber": "211274450",
"lastFour": "2020"
},
"orderNumber": "11518",
"timeStamp": "0001-01-01T00:00:00",
"updateTimeStamp": null,
"fromRecurringBilling": null,
"customerId": null,
"processorResponseMessage": null,
"relatedVoid": null,
"relatedReturn": null,
"guid": "00000000-0000-0000-0000-000000000000",
"deviceGuid": "00000000-0000-0000-0000-000000000000",
"responseTransactionStatus": null,
"responseSettlementStatus": null,
"responseCode": null,
"userName": null
},
"timeStamp": "2020-11-24T09:05:12.05-06:00",
"processorResponseMessage": "HELD",
"guid": "f76fda9b-3632-441b-aa8c-f98ff4389ade",
"userName": null
}
]
}
Json error example response:
{
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"traceId": "00-2be920374480ac59ebadf4a9a6057706-0680052537eeceae-00",
"errors": {
"guid": [
"The value 'invalid guid' is not valid."
]
}
}
This endpoint search a bank clearing returns.
HTTP Request
POST https://sandbox.choice.dev/api/v1/Search/BankClearingReturns/{exportable}
POST https://sandbox.choice.dev/api/v1/Search/BankClearingReturns/{exportable}/{pageNumber}
POST https://sandbox.choice.dev/api/v1/Search/BankClearingReturns/{exportable}/{pageNumber}/{pageSize}
Headers using token
Key | Value |
---|---|
Content-Type | "application/json" |
Authorization | Token. Eg: "Bearer eHSN5rTBzqDozgAAlN1UlTMVuIT1zSiAZWCo6E..." |
Headers using API Key
Key | Value |
---|---|
Content-Type | "application/json" |
UserAuthorization | API Key. Eg: "e516b6db-3230-4b1c-ae3f-e5379b774a80" |
URL Parameters:
Parameter | Type | M/C/O | Value |
---|---|---|---|
Exportable | string | Mandatory | True or False. It means if you want results exportable to CSV. |
PageNumber | integer | Optional | Int. Number of page of the results. Default is 1 (Page size default is 500). |
PageSize | integer | Optional | Int. Size of each page of the results. Default is 500. |
Json Body:
Parameter | Type | M/C/O | Value |
---|---|---|---|
MerchantGuid | string | Mandatory | Merchant's Guid. |
OrderNumber | string | Optional | Merchant's order number. The value sent on this element will be returned as InvoiceNumber. Length = 17. Max length = 20. Not allow special characters. |
TimeStampFrom | date | Optional | Bank clearing void's TimeStamp. |
TimeStampTo | date | Optional | Bank clearing void's TimeStamp. |
Status | string | Optional | Bank clearing void’s status. Allowed values: 1. Transaction - Approved 2. Transaction - Declined 3. Transaction - Created - Local 4. Transaction - Created - Error: Processor not reached 5. Transaction - Processor Error 6. Transaction - Approved - Warning |
UserName | string | Optional | UserName. |
Response
- 200 code (ok).
Search bank Clearing Settlement
using System;
using Newtonsoft.Json;
using System.IO;
using System.Net;
using System.Text;
namespace ChoiceSample
{
public class Search
{
public static void ShowSettlements()
{
try
{
var request = (HttpWebRequest)WebRequest.Create("https://sandbox.choice.dev/api/v1/Search/BankClearings/ShowSettlements");
request.ContentType = "text/json";
request.Method = "POST";
var search = new
{
DeviceGuid = "a9c0505b-a087-44b1-b9cd-0e7f75715d4d",
SettleDateBegin = "01/01/2010",
SettleDateEnd = "12/01/2020"
};
string json = JsonConvert.SerializeObject(search);
request.Headers.Add("Authorization", "Bearer 1A089D6ziUybPZFQ3mpPyjt9OEx9yrCs7eQIC6V3A0lmXR2N6-seGNK16Gsnl3td6Ilfbr2Xf_EyukFXwnVEO3fYL-LuGw-L3c8WuaoxhPE8MMdlMPILJTIOV3lTGGdxbFXdKd9U03bbJ9TDUkqxHqq8_VyyjDrw7fs0YOob7bg0OovXTeWgIvZaIrSR1WFR06rYJ0DfWn-Inuf7re1-4SMOjY1ZoCelVwduWCBJpw1111cNbWtHJfObV8u1CVf0");
request.ContentType = "application/json";
request.Accept = "application/json";
using (var streamWriter = new StreamWriter(request.GetRequestStream()))
{
streamWriter.Write(json);
streamWriter.Flush();
streamWriter.Close();
}
try
{
var response = (HttpWebResponse)request.GetResponse();
using (var reader = new StreamReader(response.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)response.StatusCode);
Console.WriteLine();
Console.WriteLine(response.StatusDescription);
Console.WriteLine(result);
}
}
catch (WebException wex)
{
if (wex.Response != null)
{
using (var errorResponse = (HttpWebResponse)wex.Response)
{
using (var reader = new StreamReader(errorResponse.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)errorResponse.StatusCode);
Console.WriteLine();
Console.WriteLine(errorResponse.StatusDescription);
Console.WriteLine(result);
}
}
}
}
}
catch (IOException e)
{
Console.WriteLine(e);
}
}
}
}
Json Example Request:
{
"DeviceGuid" : "a9c0505b-a087-44b1-b9cd-0e7f75715d4d",
"SettleDateBegin": "01/01/2010",
"SettleDateEnd": "12/01/2020"
}
Json Example Response:
{
"summary": {
"error": "",
"message": "",
"requestCount": 1,
"successCount": 1,
"failCount": 0,
"timeStamp": "11/27/2020 8:58:20 AM",
"executeTime": 0.0
},
"items": [
{
"settlementId": "1931",
"settlementDate": "2020-11-17T08:22:00",
"fileId": "1162",
"subMerchantNum": "",
"settlementAmount": 398.0000,
"settlementType": "Origination File Settlement",
"approvedDebits": 398.0000,
"approvedCredits": 0.0,
"debitCreditFees": 0.0,
"nocFees": 0.0,
"returnFees": 0.0,
"reserve": 0.0,
"discount": 0.0,
"chargebacks": 0.0,
"chargebackFees": 0.0,
"extendedHoursFees": 0.0,
"adminFees": 0.0,
"deliveryMethod": 0.0,
"offset": 0.0
}
],
"messageXml": "<?xml version='1.0'?>\n<BOPRequest>\n<ResponseSummary>\n<Error></Error>\n<Message></Message>\n<RequestCount>1</RequestCount>\n<SuccessCount>1</SuccessCount>\n<FailCount>0</FailCount>\n<TimeStamp>11/27/2020 8:58:20 AM</TimeStamp>\n<ExecuteTime>0</ExecuteTime>\n</ResponseSummary>\n<Request ID=\"1\">\n<RequestType>ShowSettlements</RequestType>\n<Status>Success</Status>\n<StatusMessage/>\n<TimeStamp>11/27/2020 8:58:20 AM</TimeStamp>\n<Results Count=\"1\">\n<Result ID=\"1\">\n<SettlementID>1931</SettlementID>\n<SettlementDate>11/17/2020 8:22:00 AM</SettlementDate>\n<FileID>1162</FileID>\n<SubMerchantNum></SubMerchantNum>\n<SettlementAmount>398.0000</SettlementAmount>\n<SettlementType>1</SettlementType>\n<ApprovedDebits>398.0000</ApprovedDebits>\n<ApprovedCredits>0</ApprovedCredits>\n<DebitCreditFees>0</DebitCreditFees>\n<NOCFees>0</NOCFees>\n<ReturnFees>0</ReturnFees>\n<Reserve>0</Reserve>\n<Discount>0</Discount>\n<Chargebacks>0</Chargebacks>\n<ChargebackFees>0</ChargebackFees>\n<ExtendedHoursFees>0</ExtendedHoursFees>\n<AdminFees>0</AdminFees>\n<DeliveryMethod>ACH</DeliveryMethod>\n<Offset>0</Offset>\n</Result>\n</Results>\n</Request>\n</BOPRequest>\n"
}
Json error example response:
{
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"traceId": "00-2be920374480ac59ebadf4a9a6057706-0680052537eeceae-00",
"errors": {
"guid": [
"The value 'invalid guid' is not valid."
]
}
}
This endpoint searchs Bank Clearing Settlement.
HTTP Request
POST https://sandbox.choice.dev/api/v1/Search/BankClearings/ShowSettlements
Headers using token
Key | Value |
---|---|
Content-Type | "application/json" |
Authorization | Token. Eg: "Bearer eHSN5rTBzqDozgAAlN1UlTMVuIT1zSiAZWCo6E..." |
Headers using API Key
Key | Value |
---|---|
Content-Type | "application/json" |
UserAuthorization | API Key. Eg: "e516b6db-3230-4b1c-ae3f-e5379b774a80" |
Json Body:
Parameter | Type | M/C/O | Value |
---|---|---|---|
DeviceGuid | string | Mandatory | Device's Guid. |
SettleDateBegin | string | Mandatory | Settle Date Begin. |
SettleDateEnd | string | Mandatory | Settle Date End. |
Response
- 200 code (ok).
Search bank Clearing Settlement Details
using System;
using Newtonsoft.Json;
using System.IO;
using System.Net;
using System.Text;
namespace ChoiceSample
{
public class Search
{
public static void ShowSettlementDetails()
{
try
{
var request = (HttpWebRequest)WebRequest.Create("https://sandbox.choice.dev/api/v1/Search/BankClearings/ShowSettlementDetails");
request.ContentType = "text/json";
request.Method = "POST";
var search = new
{
DeviceGuid = "a9c0505b-a087-44b1-b9cd-0e7f75715d4d",
SettlementId = "1931"
};
string json = JsonConvert.SerializeObject(search);
request.Headers.Add("Authorization", "Bearer 1A089D6ziUybPZFQ3mpPyjt9OEx9yrCs7eQIC6V3A0lmXR2N6-seGNK16Gsnl3td6Ilfbr2Xf_EyukFXwnVEO3fYL-LuGw-L3c8WuaoxhPE8MMdlMPILJTIOV3lTGGdxbFXdKd9U03bbJ9TDUkqxHqq8_VyyjDrw7fs0YOob7bg0OovXTeWgIvZaIrSR1WFR06rYJ0DfWn-Inuf7re1-4SMOjY1ZoCelVwduWCBJpw1111cNbWtHJfObV8u1CVf0");
request.ContentType = "application/json";
request.Accept = "application/json";
using (var streamWriter = new StreamWriter(request.GetRequestStream()))
{
streamWriter.Write(json);
streamWriter.Flush();
streamWriter.Close();
}
try
{
var response = (HttpWebResponse)request.GetResponse();
using (var reader = new StreamReader(response.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)response.StatusCode);
Console.WriteLine();
Console.WriteLine(response.StatusDescription);
Console.WriteLine(result);
}
}
catch (WebException wex)
{
if (wex.Response != null)
{
using (var errorResponse = (HttpWebResponse)wex.Response)
{
using (var reader = new StreamReader(errorResponse.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)errorResponse.StatusCode);
Console.WriteLine();
Console.WriteLine(errorResponse.StatusDescription);
Console.WriteLine(result);
}
}
}
}
}
catch (IOException e)
{
Console.WriteLine(e);
}
}
}
}
Json Example Request:
{
"DeviceGuid" : "a9c0505b-a087-44b1-b9cd-0e7f75715d4d",
"SettlementId" : 1931
}
Json Example Response:
{
"summary": {
"error": "",
"message": "",
"requestCount": 1,
"successCount": 1,
"failCount": 0,
"timeStamp": "11/27/2020 9:00:23 AM",
"executeTime": 0.0
},
"item": {
"status": "Success",
"statusMessage": "",
"transactionId": "22275",
"transactionType": "CREDIT",
"fileId": "1162",
"subMerchantNum": "",
"amount": 299.0000,
"customerId": "543f9dd4-1234-4e69-a5e9-212b9486020e",
"accountName": "Irish City"
},
"messageXml": "<?xml version='1.0'?>\n<BOPRequest>\n<ResponseSummary>\n<Error></Error>\n<Message></Message>\n<RequestCount>1</RequestCount>\n<SuccessCount>1</SuccessCount>\n<FailCount>0</FailCount>\n<TimeStamp>11/27/2020 9:00:23 AM</TimeStamp>\n<ExecuteTime>0</ExecuteTime>\n</ResponseSummary>\n<Request ID=\"1\">\n<RequestType>ShowSettlementDetails</RequestType>\n<Status>Success</Status>\n<StatusMessage/>\n<TimeStamp>11/27/2020 9:00:23 AM</TimeStamp>\n<Results Count=\"2\">\n<Result ID=\"1\">\n<TransactionID>22274</TransactionID>\n<TransactionType>CREDIT</TransactionType>\n<FileID>1162</FileID>\n<SubMerchantNum></SubMerchantNum>\n<Amount>99.0000</Amount>\n<CustomerID>8337ea32-1234-4ddb-9b80-6f67c7d7048a</CustomerID>\n<AccountName>Galaxy Fun Park</AccountName>\n</Result>\n<Result ID=\"2\">\n<TransactionID>22275</TransactionID>\n<TransactionType>CREDIT</TransactionType>\n<FileID>1162</FileID>\n<SubMerchantNum></SubMerchantNum>\n<Amount>299.0000</Amount>\n<CustomerID>543f9dd4-1234-4e69-a5e9-212b9486020e</CustomerID>\n<AccountName>Irish City</AccountName>\n</Result>\n</Results>\n</Request>\n</BOPRequest>\n"
}
Json error example response:
{
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"traceId": "00-2be920374480ac59ebadf4a9a6057706-0680052537eeceae-00",
"errors": {
"guid": [
"The value 'invalid guid' is not valid."
]
}
}
This endpoint Searchs bank Clearing Settlement Details.
HTTP Request
POST https://sandbox.choice.dev/api/v1/Search/BankClearings/ShowSettlementDetails
Headers using token
Key | Value |
---|---|
Content-Type | "application/json" |
Authorization | Token. Eg: "Bearer eHSN5rTBzqDozgAAlN1UlTMVuIT1zSiAZWCo6E..." |
Headers using API Key
Key | Value |
---|---|
Content-Type | "application/json" |
UserAuthorization | API Key. Eg: "e516b6db-3230-4b1c-ae3f-e5379b774a80" |
Json Body:
Parameter | Type | M/C/O | Value |
---|---|---|---|
DeviceGuid | string | Mandatory | Device's Guid. |
SettlementId | string | Mandatory | Settlement Id. |
Response
- 200 code (ok).
Search bank Clearing Notifications
using System;
using Newtonsoft.Json;
using System.IO;
using System.Net;
using System.Text;
namespace ChoiceSample
{
public class Search
{
public static void ShowReturnNotificationList()
{
try
{
var request = (HttpWebRequest)WebRequest.Create("https://sandbox.choice.dev/api/v1/Search/BankClearings/ShowReturnNotificationList");
request.ContentType = "text/json";
request.Method = "POST";
var search = new
{
DeviceGuid = "a9c0505b-a087-44b1-b9cd-0e7f75715d4d",
NotificationDateBegin = "2020-11-11",
NotificationDateEnd = "2021-11-11"
};
string json = JsonConvert.SerializeObject(search);
request.Headers.Add("Authorization", "Bearer 1A089D6ziUybPZFQ3mpPyjt9OEx9yrCs7eQIC6V3A0lmXR2N6-seGNK16Gsnl3td6Ilfbr2Xf_EyukFXwnVEO3fYL-LuGw-L3c8WuaoxhPE8MMdlMPILJTIOV3lTGGdxbFXdKd9U03bbJ9TDUkqxHqq8_VyyjDrw7fs0YOob7bg0OovXTeWgIvZaIrSR1WFR06rYJ0DfWn-Inuf7re1-4SMOjY1ZoCelVwduWCBJpw1111cNbWtHJfObV8u1CVf0");
request.ContentType = "application/json";
request.Accept = "application/json";
using (var streamWriter = new StreamWriter(request.GetRequestStream()))
{
streamWriter.Write(json);
streamWriter.Flush();
streamWriter.Close();
}
try
{
var response = (HttpWebResponse)request.GetResponse();
using (var reader = new StreamReader(response.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)response.StatusCode);
Console.WriteLine();
Console.WriteLine(response.StatusDescription);
Console.WriteLine(result);
}
}
catch (WebException wex)
{
if (wex.Response != null)
{
using (var errorResponse = (HttpWebResponse)wex.Response)
{
using (var reader = new StreamReader(errorResponse.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)errorResponse.StatusCode);
Console.WriteLine();
Console.WriteLine(errorResponse.StatusDescription);
Console.WriteLine(result);
}
}
}
}
}
catch (IOException e)
{
Console.WriteLine(e);
}
}
}
}
Json Example Request:
{
"DeviceGuid": "0e51ea3e-56ff-49e6-9d72-39f2058774a1",
"NotificationDateBegin": "2020-11-11",
"NotificationDateEnd": "2021-11-11"
}
Json Example Response:
{
"summary": {
"error": "",
"message": "",
"requestCount": 1,
"successCount": 1,
"failCount": 0,
"timeStamp": "11/16/2021 4:44:55 PM",
"executeTime": 0.0
},
"items": [
{
"messageXml": "<Result ID=\"1\"><NotificationID>66</NotificationID><NotificationTime>11/23/2020 5:06:39 PM</NotificationTime><Announced>True</Announced><Retrieved>False</Retrieved><Description>RETURN NOTIFICATION FOR RETURN FILE ID: 9999</Description></Result>",
"messageJson": "{\"Result\":{\"@ID\":\"1\",\"NotificationID\":\"66\",\"NotificationTime\":\"11/23/2020 5:06:39 PM\",\"Announced\":\"True\",\"Retrieved\":\"False\",\"Description\":\"RETURN NOTIFICATION FOR RETURN FILE ID: 9999\"}}",
"notificationId": "66",
"notificationTime": "2020-11-23T17:06:39",
"announced": true,
"retrieved": false,
"description": "RETURN NOTIFICATION FOR RETURN FILE ID: 9999"
},
{
"messageXml": "<Result ID=\"2\"><NotificationID>67</NotificationID><NotificationTime>11/23/2020 5:08:08 PM</NotificationTime><Announced>True</Announced><Retrieved>False</Retrieved><Description>RETURN NOTIFICATION FOR RETURN FILE ID: 9999</Description></Result>",
"messageJson": "{\"Result\":{\"@ID\":\"2\",\"NotificationID\":\"67\",\"NotificationTime\":\"11/23/2020 5:08:08 PM\",\"Announced\":\"True\",\"Retrieved\":\"False\",\"Description\":\"RETURN NOTIFICATION FOR RETURN FILE ID: 9999\"}}",
"notificationId": "67",
"notificationTime": "2020-11-23T17:08:08",
"announced": true,
"retrieved": false,
"description": "RETURN NOTIFICATION FOR RETURN FILE ID: 9999"
},
{
"messageXml": "<Result ID=\"3\"><NotificationID>71</NotificationID><NotificationTime>12/2/2020 2:12:02 PM</NotificationTime><Announced>True</Announced><Retrieved>False</Retrieved><Description>RETURN NOTIFICATION FOR RETURN FILE ID: 9999</Description></Result>",
"messageJson": "{\"Result\":{\"@ID\":\"3\",\"NotificationID\":\"71\",\"NotificationTime\":\"12/2/2020 2:12:02 PM\",\"Announced\":\"True\",\"Retrieved\":\"False\",\"Description\":\"RETURN NOTIFICATION FOR RETURN FILE ID: 9999\"}}",
"notificationId": "71",
"notificationTime": "2020-12-02T14:12:02",
"announced": true,
"retrieved": false,
"description": "RETURN NOTIFICATION FOR RETURN FILE ID: 9999"
}
],
"messageXml": "<?xml version='1.0'?>\n<BOPRequest>\n<ResponseSummary>\n<Error></Error>\n<Message></Message>\n<RequestCount>1</RequestCount>\n<SuccessCount>1</SuccessCount>\n<FailCount>0</FailCount>\n<TimeStamp>11/16/2021 4:44:55 PM</TimeStamp>\n<ExecuteTime>0</ExecuteTime>\n</ResponseSummary>\n<Request ID=\"1\">\n<RequestType>ShowReturnNotificationList</RequestType>\n<Status>Success</Status>\n<StatusMessage/>\n<TimeStamp>11/16/2021 4:44:55 PM</TimeStamp>\n<Results Count=\"3\">\n<Result ID=\"1\">\n<NotificationID>66</NotificationID>\n<NotificationTime>11/23/2020 5:06:39 PM</NotificationTime>\n<Announced>True</Announced>\n<Retrieved>False</Retrieved>\n<Description>RETURN NOTIFICATION FOR RETURN FILE ID: 9999</Description>\n</Result>\n<Result ID=\"2\">\n<NotificationID>67</NotificationID>\n<NotificationTime>11/23/2020 5:08:08 PM</NotificationTime>\n<Announced>True</Announced>\n<Retrieved>False</Retrieved>\n<Description>RETURN NOTIFICATION FOR RETURN FILE ID: 9999</Description>\n</Result>\n<Result ID=\"3\">\n<NotificationID>71</NotificationID>\n<NotificationTime>12/2/2020 2:12:02 PM</NotificationTime>\n<Announced>True</Announced>\n<Retrieved>False</Retrieved>\n<Description>RETURN NOTIFICATION FOR RETURN FILE ID: 9999</Description>\n</Result>\n</Results>\n</Request>\n</BOPRequest>\n",
"messageJson": "{\"BOPRequest\":{\"ResponseSummary\":{\"Error\":\"\",\"Message\":\"\",\"RequestCount\":\"1\",\"SuccessCount\":\"1\",\"FailCount\":\"0\",\"TimeStamp\":\"11/16/2021 4:44:55 PM\",\"ExecuteTime\":\"0\"},\"Request\":{\"@ID\":\"1\",\"RequestType\":\"ShowReturnNotificationList\",\"Status\":\"Success\",\"StatusMessage\":null,\"TimeStamp\":\"11/16/2021 4:44:55 PM\",\"Results\":{\"@Count\":\"3\",\"Result\":[{\"@ID\":\"1\",\"NotificationID\":\"66\",\"NotificationTime\":\"11/23/2020 5:06:39 PM\",\"Announced\":\"True\",\"Retrieved\":\"False\",\"Description\":\"RETURN NOTIFICATION FOR RETURN FILE ID: 9999\"},{\"@ID\":\"2\",\"NotificationID\":\"67\",\"NotificationTime\":\"11/23/2020 5:08:08 PM\",\"Announced\":\"True\",\"Retrieved\":\"False\",\"Description\":\"RETURN NOTIFICATION FOR RETURN FILE ID: 9999\"},{\"@ID\":\"3\",\"NotificationID\":\"71\",\"NotificationTime\":\"12/2/2020 2:12:02 PM\",\"Announced\":\"True\",\"Retrieved\":\"False\",\"Description\":\"RETURN NOTIFICATION FOR RETURN FILE ID: 9999\"}]}}}}"
}
Json error example response:
{
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"traceId": "00-2be920374480ac59ebadf4a9a6057706-0680052537eeceae-00",
"errors": {
"guid": [
"The value 'invalid guid' is not valid."
]
}
}
This endpoint Searchs bank Clearing Notifications.
HTTP Request
POST https://sandbox.choice.dev/api/v1/Search/BankClearings/ShowReturnNotificationList
Headers using token
Key | Value |
---|---|
Content-Type | "application/json" |
Authorization | Token. Eg: "Bearer eHSN5rTBzqDozgAAlN1UlTMVuIT1zSiAZWCo6E..." |
Headers using API Key
Key | Value |
---|---|
Content-Type | "application/json" |
UserAuthorization | API Key. Eg: "e516b6db-3230-4b1c-ae3f-e5379b774a80" |
Json Body:
Parameter | Type | M/C/O | Value |
---|---|---|---|
DeviceGuid | string | Mandatory | Device's Guid. |
NotificationDateBegin | string | Mandatory | Notification Date Begin. |
NotificationDateEnd | string | Mandatory | Notification Date End. |
Response
- 200 code (ok).
Search bank Clearing Notifications Details
using System;
using Newtonsoft.Json;
using System.IO;
using System.Net;
using System.Text;
namespace ChoiceSample
{
public class Search
{
public static void ShowReturnNotificationDetails()
{
try
{
var request = (HttpWebRequest)WebRequest.Create("https://sandbox.choice.dev/api/v1/Search/BankClearings/ShowReturnNotificationDetails");
request.ContentType = "text/json";
request.Method = "POST";
var search = new
{
DeviceGuid = "a9c0505b-a087-44b1-b9cd-0e7f75715d4d",
NotificationId = "66"
};
string json = JsonConvert.SerializeObject(search);
request.Headers.Add("Authorization", "Bearer 1A089D6ziUybPZFQ3mpPyjt9OEx9yrCs7eQIC6V3A0lmXR2N6-seGNK16Gsnl3td6Ilfbr2Xf_EyukFXwnVEO3fYL-LuGw-L3c8WuaoxhPE8MMdlMPILJTIOV3lTGGdxbFXdKd9U03bbJ9TDUkqxHqq8_VyyjDrw7fs0YOob7bg0OovXTeWgIvZaIrSR1WFR06rYJ0DfWn-Inuf7re1-4SMOjY1ZoCelVwduWCBJpw1111cNbWtHJfObV8u1CVf0");
request.ContentType = "application/json";
request.Accept = "application/json";
using (var streamWriter = new StreamWriter(request.GetRequestStream()))
{
streamWriter.Write(json);
streamWriter.Flush();
streamWriter.Close();
}
try
{
var response = (HttpWebResponse)request.GetResponse();
using (var reader = new StreamReader(response.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)response.StatusCode);
Console.WriteLine();
Console.WriteLine(response.StatusDescription);
Console.WriteLine(result);
}
}
catch (WebException wex)
{
if (wex.Response != null)
{
using (var errorResponse = (HttpWebResponse)wex.Response)
{
using (var reader = new StreamReader(errorResponse.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)errorResponse.StatusCode);
Console.WriteLine();
Console.WriteLine(errorResponse.StatusDescription);
Console.WriteLine(result);
}
}
}
}
}
catch (IOException e)
{
Console.WriteLine(e);
}
}
}
}
Json Example Request:
{
"DeviceGuid": "0e51ea3e-56ff-49e6-9d72-39f2058774a1",
"NotificationId": "66"
}
Json Example Response:
{
"summary": {
"error": "",
"message": "",
"requestCount": 1,
"successCount": 1,
"failCount": 0,
"timeStamp": "11/16/2021 5:10:39 PM",
"executeTime": 0.0
},
"items": [
{
"messageXml": "<Result ID=\"1\"><TransactionID>22346</TransactionID><ReturnDate>11/23/2020 5:07:00 PM</ReturnDate><ReturnCode>R01</ReturnCode><ReturnDesc>INSUFFICIENT FUNDS</ReturnDesc><CustomerID>5c9aa8e8-38d3-44c8-a97e-637ccdb7fc3a</CustomerID></Result>",
"messageJson": "{\"Result\":{\"@ID\":\"1\",\"TransactionID\":\"22346\",\"ReturnDate\":\"11/23/2020 5:07:00 PM\",\"ReturnCode\":\"R01\",\"ReturnDesc\":\"INSUFFICIENT FUNDS\",\"CustomerID\":\"5c9aa8e8-38d3-44c8-a97e-637ccdb7fc3a\"}}",
"transactionId": "22346",
"returnDate": "2020-11-23T17:07:00",
"returnCode": "R01",
"returnDesc": "INSUFFICIENT FUNDS",
"customerId": "5c9aa8e8-38d3-44c8-a97e-637ccdb7fc3a"
}
],
"messageXml": "<?xml version='1.0'?>\n<BOPRequest>\n<ResponseSummary>\n<Error></Error>\n<Message></Message>\n<RequestCount>1</RequestCount>\n<SuccessCount>1</SuccessCount>\n<FailCount>0</FailCount>\n<TimeStamp>11/16/2021 5:10:39 PM</TimeStamp>\n<ExecuteTime>0</ExecuteTime>\n</ResponseSummary>\n<Request ID=\"1\">\n<RequestType>ShowReturnNotificationDetails</RequestType>\n<Status>Success</Status>\n<StatusMessage/>\n<TimeStamp>11/16/2021 5:10:39 PM</TimeStamp>\n<Results Count=\"1\">\n<Result ID=\"1\">\n<TransactionID>22346</TransactionID>\n<ReturnDate>11/23/2020 5:07:00 PM</ReturnDate>\n<ReturnCode>R01</ReturnCode>\n<ReturnDesc>INSUFFICIENT FUNDS</ReturnDesc>\n<CustomerID>5c9aa8e8-38d3-44c8-a97e-637ccdb7fc3a</CustomerID>\n</Result>\n</Results>\n</Request>\n</BOPRequest>\n",
"messageJson": "{\"BOPRequest\":{\"ResponseSummary\":{\"Error\":\"\",\"Message\":\"\",\"RequestCount\":\"1\",\"SuccessCount\":\"1\",\"FailCount\":\"0\",\"TimeStamp\":\"11/16/2021 5:10:39 PM\",\"ExecuteTime\":\"0\"},\"Request\":{\"@ID\":\"1\",\"RequestType\":\"ShowReturnNotificationDetails\",\"Status\":\"Success\",\"StatusMessage\":null,\"TimeStamp\":\"11/16/2021 5:10:39 PM\",\"Results\":{\"@Count\":\"1\",\"Result\":{\"@ID\":\"1\",\"TransactionID\":\"22346\",\"ReturnDate\":\"11/23/2020 5:07:00 PM\",\"ReturnCode\":\"R01\",\"ReturnDesc\":\"INSUFFICIENT FUNDS\",\"CustomerID\":\"5c9aa8e8-38d3-44c8-a97e-637ccdb7fc3a\"}}}}}"
}
Json error example response:
{
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"traceId": "00-2be920374480ac59ebadf4a9a6057706-0680052537eeceae-00",
"errors": {
"guid": [
"The value 'invalid guid' is not valid."
]
}
}
This endpoint Searchs bank Clearing Notifications Details.
HTTP Request
POST https://sandbox.choice.dev/api/v1/Search/BankClearings/ShowReturnNotificationDetails
Headers using token
Key | Value |
---|---|
Content-Type | "application/json" |
Authorization | Token. Eg: "Bearer eHSN5rTBzqDozgAAlN1UlTMVuIT1zSiAZWCo6E..." |
Headers using API Key
Key | Value |
---|---|
Content-Type | "application/json" |
UserAuthorization | API Key. Eg: "e516b6db-3230-4b1c-ae3f-e5379b774a80" |
Json Body:
Parameter | Type | M/C/O | Value |
---|---|---|---|
DeviceGuid | string | Mandatory | Device's Guid. |
NotificationId | string | Mandatory | Notification Id. |
Response
- 200 code (ok).
Search bank Clearing Chargebacks
using System;
using Newtonsoft.Json;
using System.IO;
using System.Net;
using System.Text;
namespace ChoiceSample
{
public class Search
{
public static void Chargebacks()
{
try
{
var request = (HttpWebRequest)WebRequest.Create("https://sandbox.choice.dev/api/v1/Search/BankClearings/ShowChargebacks");
request.ContentType = "text/json";
request.Method = "POST";
var search = new
{
DeviceGuid = "a9c0505b-a087-44b1-b9cd-0e7f75715d4d",
ChargeBackDateBegin = "2020-11-11",
ChargeBackDateEnd = "2021-11-11",
};
string json = JsonConvert.SerializeObject(search);
request.Headers.Add("Authorization", "Bearer 1A089D6ziUybPZFQ3mpPyjt9OEx9yrCs7eQIC6V3A0lmXR2N6-seGNK16Gsnl3td6Ilfbr2Xf_EyukFXwnVEO3fYL-LuGw-L3c8WuaoxhPE8MMdlMPILJTIOV3lTGGdxbFXdKd9U03bbJ9TDUkqxHqq8_VyyjDrw7fs0YOob7bg0OovXTeWgIvZaIrSR1WFR06rYJ0DfWn-Inuf7re1-4SMOjY1ZoCelVwduWCBJpw1111cNbWtHJfObV8u1CVf0");
request.ContentType = "application/json";
request.Accept = "application/json";
using (var streamWriter = new StreamWriter(request.GetRequestStream()))
{
streamWriter.Write(json);
streamWriter.Flush();
streamWriter.Close();
}
try
{
var response = (HttpWebResponse)request.GetResponse();
using (var reader = new StreamReader(response.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)response.StatusCode);
Console.WriteLine();
Console.WriteLine(response.StatusDescription);
Console.WriteLine(result);
}
}
catch (WebException wex)
{
if (wex.Response != null)
{
using (var errorResponse = (HttpWebResponse)wex.Response)
{
using (var reader = new StreamReader(errorResponse.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)errorResponse.StatusCode);
Console.WriteLine();
Console.WriteLine(errorResponse.StatusDescription);
Console.WriteLine(result);
}
}
}
}
}
catch (IOException e)
{
Console.WriteLine(e);
}
}
}
}
Json Example Request:
{
"DeviceGuid": "0e51ea3e-56ff-49e6-9d72-39f2058774a1",
"ChargeBackDateBegin": "2020-11-11",
"ChargeBackDateEnd": "2021-11-11"
}
Json Example Response:
{
"summary": {
"error": "",
"message": "",
"requestCount": 1,
"successCount": 1,
"failCount": 0,
"timeStamp": "11/16/2021 5:23:17 PM",
"executeTime": 0.0
},
"items": [],
"messageXml": "<?xml version='1.0'?>\n<BOPRequest>\n<ResponseSummary>\n<Error></Error>\n<Message></Message>\n<RequestCount>1</RequestCount>\n<SuccessCount>1</SuccessCount>\n<FailCount>0</FailCount>\n<TimeStamp>11/16/2021 5:23:17 PM</TimeStamp>\n<ExecuteTime>0</ExecuteTime>\n</ResponseSummary>\n<Request ID=\"1\">\n<RequestType>ShowChargebacks</RequestType>\n<Status>Success</Status>\n<StatusMessage/>\n<TimeStamp>11/16/2021 5:23:17 PM</TimeStamp>\n<Results Count=\"0\">\n</Results>\n</Request>\n</BOPRequest>\n",
"messageJson": "{\"BOPRequest\":{\"ResponseSummary\":{\"Error\":\"\",\"Message\":\"\",\"RequestCount\":\"1\",\"SuccessCount\":\"1\",\"FailCount\":\"0\",\"TimeStamp\":\"11/16/2021 5:23:17 PM\",\"ExecuteTime\":\"0\"},\"Request\":{\"@ID\":\"1\",\"RequestType\":\"ShowChargebacks\",\"Status\":\"Success\",\"StatusMessage\":null,\"TimeStamp\":\"11/16/2021 5:23:17 PM\",\"Results\":{\"@Count\":\"0\"}}}}"
}
Json error example response:
{
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"traceId": "00-2be920374480ac59ebadf4a9a6057706-0680052537eeceae-00",
"errors": {
"guid": [
"The value 'invalid guid' is not valid."
]
}
}
This endpoint searchs bank Clearing Chargebacks.
HTTP Request
POST https://sandbox.choice.dev/api/v1/Search/BankClearings/ShowChargebacks
Headers using token
Key | Value |
---|---|
Content-Type | "application/json" |
Authorization | Token. Eg: "Bearer eHSN5rTBzqDozgAAlN1UlTMVuIT1zSiAZWCo6E..." |
Headers using API Key
Key | Value |
---|---|
Content-Type | "application/json" |
UserAuthorization | API Key. Eg: "e516b6db-3230-4b1c-ae3f-e5379b774a80" |
Json Body:
Parameter | Type | M/C/O | Value |
---|---|---|---|
DeviceGuid | string | Mandatory | Device's Guid. |
ChargeBackDateBegin | string | Mandatory | ChargeBack Date Begin. |
ChargeBackDateEnd | string | Mandatory | ChargeBack Date Begin. |
Response
- 200 code (ok).
Search bank Clearing NOCs
using System;
using Newtonsoft.Json;
using System.IO;
using System.Net;
using System.Text;
namespace ChoiceSample
{
public class Search
{
public static void Chargebacks()
{
try
{
var request = (HttpWebRequest)WebRequest.Create("https://sandbox.choice.dev/api/v1/Search/BankClearings/ShowNOCList");
request.ContentType = "text/json";
request.Method = "POST";
var search = new
{
DeviceGuid = "a9c0505b-a087-44b1-b9cd-0e7f75715d4d",
NocDateBegin = "2020-11-11",
NocDateEnd = "2021-11-11",
};
string json = JsonConvert.SerializeObject(search);
request.Headers.Add("Authorization", "Bearer 1A089D6ziUybPZFQ3mpPyjt9OEx9yrCs7eQIC6V3A0lmXR2N6-seGNK16Gsnl3td6Ilfbr2Xf_EyukFXwnVEO3fYL-LuGw-L3c8WuaoxhPE8MMdlMPILJTIOV3lTGGdxbFXdKd9U03bbJ9TDUkqxHqq8_VyyjDrw7fs0YOob7bg0OovXTeWgIvZaIrSR1WFR06rYJ0DfWn-Inuf7re1-4SMOjY1ZoCelVwduWCBJpw1111cNbWtHJfObV8u1CVf0");
request.ContentType = "application/json";
request.Accept = "application/json";
using (var streamWriter = new StreamWriter(request.GetRequestStream()))
{
streamWriter.Write(json);
streamWriter.Flush();
streamWriter.Close();
}
try
{
var response = (HttpWebResponse)request.GetResponse();
using (var reader = new StreamReader(response.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)response.StatusCode);
Console.WriteLine();
Console.WriteLine(response.StatusDescription);
Console.WriteLine(result);
}
}
catch (WebException wex)
{
if (wex.Response != null)
{
using (var errorResponse = (HttpWebResponse)wex.Response)
{
using (var reader = new StreamReader(errorResponse.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)errorResponse.StatusCode);
Console.WriteLine();
Console.WriteLine(errorResponse.StatusDescription);
Console.WriteLine(result);
}
}
}
}
}
catch (IOException e)
{
Console.WriteLine(e);
}
}
}
}
Json Example Request:
{
"DeviceGuid": "0e51ea3e-56ff-49e6-9d72-39f2058774a1",
"NocDateBegin": "2020-11-11",
"NocDateEnd": "2021-11-11"
}
Json Example Response:
{
"summary": {
"error": "",
"message": "",
"requestCount": 1,
"successCount": 1,
"failCount": 0,
"timeStamp": "11/16/2021 5:23:17 PM",
"executeTime": 0.0
},
"items": [],
"messageXml": "<?xml version='1.0'?>\n<BOPRequest>\n<ResponseSummary>\n<Error></Error>\n<Message></Message>\n<RequestCount>1</RequestCount>\n<SuccessCount>1</SuccessCount>\n<FailCount>0</FailCount>\n<TimeStamp>11/16/2021 5:23:17 PM</TimeStamp>\n<ExecuteTime>0</ExecuteTime>\n</ResponseSummary>\n<Request ID=\"1\">\n<RequestType>ShowChargebacks</RequestType>\n<Status>Success</Status>\n<StatusMessage/>\n<TimeStamp>11/16/2021 5:23:17 PM</TimeStamp>\n<Results Count=\"0\">\n</Results>\n</Request>\n</BOPRequest>\n",
"messageJson": "{\"BOPRequest\":{\"ResponseSummary\":{\"Error\":\"\",\"Message\":\"\",\"RequestCount\":\"1\",\"SuccessCount\":\"1\",\"FailCount\":\"0\",\"TimeStamp\":\"11/16/2021 5:23:17 PM\",\"ExecuteTime\":\"0\"},\"Request\":{\"@ID\":\"1\",\"RequestType\":\"ShowChargebacks\",\"Status\":\"Success\",\"StatusMessage\":null,\"TimeStamp\":\"11/16/2021 5:23:17 PM\",\"Results\":{\"@Count\":\"0\"}}}}"
}
Json error example response:
{
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"traceId": "00-2be920374480ac59ebadf4a9a6057706-0680052537eeceae-00",
"errors": {
"guid": [
"The value 'invalid guid' is not valid."
]
}
}
This endpoint searchs bank Clearing NOCs.
HTTP Request
POST https://sandbox.choice.dev/api/v1/Search/BankClearings/ShowNOCList
Headers using token
Key | Value |
---|---|
Content-Type | "application/json" |
Authorization | Token. Eg: "Bearer eHSN5rTBzqDozgAAlN1UlTMVuIT1zSiAZWCo6E..." |
Headers using API Key
Key | Value |
---|---|
Content-Type | "application/json" |
UserAuthorization | API Key. Eg: "e516b6db-3230-4b1c-ae3f-e5379b774a80" |
Json Body:
Parameter | Type | M/C/O | Value |
---|---|---|---|
DeviceGuid | string | Mandatory | Device's Guid. |
NocDateBegin | string | Mandatory | Noc Date Begin. |
NocDateEnd | string | Mandatory | Noc Date Begin. |
Response
- 200 code (ok).
Hosted Payment Page
Hosted Payment Page
using System;
using Newtonsoft.Json;
using System.IO;
using System.Net;
using System.Text;
namespace ChoiceSample
{
public class Account
{
public static void HostedPaymentPage()
{
try
{
var request = (HttpWebRequest)WebRequest.Create("https://sandbox.choice.dev/api/v1/HostedPaymentPageRequests");
request.ContentType = "text/json";
request.Method = "POST";
var payment = new
{
DeviceCreditCardGuid = "4b5013f7-b275-4929-8e83-0167c6edf639",
DeviceAchGuid = "386ac1e6-250d-4866-b283-248c1e9340ef",
Merchantname = "StarCoffe",
Description = "coffe latte",
Amount = 7.50,
OtherURL = "http://StarCoffe/other",
SuccessURL = "http://StarCoffe/success",
CancelURL = "http://StarCoffe/cancel"
OtherInfo = "Energy tax",
OrderNumber = "12345abc"
Customer = new
{
FirstName = "Max",
LastName = "Tomassi",
Phone = "8741234745",
City = "New York",
State = "NY",
Email = "maxduplessy@mailinator.com",
Address1 = "110 10th Av.",
Address2 = "",
Zip = "10016"
}
};
string json = JsonConvert.SerializeObject(payment);
request.Headers.Add("Authorization", "Bearer eHSN5rTBzqDozgAAlN1UlTMVuIT1zSiAZWCo6EBqB7RFjVMuhmuPNWcYM7ozyMb3uaDe0gyDL_nMPESbuM5I4skBOYcUM4A06NO88CVV3yBYee7mWB1qT-YFu5A3KZJSfRIbTX9GZdrZpi-JuWsx-7GE9GIYrNJ29BpaQscTwxYDr67WiFlCCrsCqWnCPJUjCFRIrTDltz8vM15mlgjiO0y04ZACGOWNNErIVegX062oydV7SqumGJEbS9Av4gdy");
request.ContentType = "application/json";
request.Accept = "application/json";
using (var streamWriter = new StreamWriter(request.GetRequestStream()))
{
streamWriter.Write(json);
streamWriter.Flush();
streamWriter.Close();
}
try
{
var response = (HttpWebResponse)request.GetResponse();
using (var reader = new StreamReader(response.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)response.StatusCode);
Console.WriteLine();
Console.WriteLine(response.StatusDescription);
Console.WriteLine(result);
}
}
catch (WebException wex)
{
if (wex.Response != null)
{
using (var errorResponse = (HttpWebResponse)wex.Response)
{
using (var reader = new StreamReader(errorResponse.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)errorResponse.StatusCode);
Console.WriteLine();
Console.WriteLine(errorResponse.StatusDescription);
Console.WriteLine(result);
}
}
}
}
}
catch (IOException e)
{
Console.WriteLine(e);
}
}
}
}
Json Example Request:
{
"DeviceCreditCardGuid": "4b5013f7-b275-4929-8e83-0167c6edf639",
"DeviceAchGuid": "386ac1e6-250d-4866-b283-248c1e9340ef",
"Merchantname": "StarCoffe",
"Description": "coffe latte",
"Amount": 7.50,
"OtherURL": "http://StarCoffe/other",
"SuccessURL": "http://StarCoffe/success",
"CancelURL": "http://StarCoffe/cancel",
"OtherInfo": "Energy tax",
"OrderNumber":"12345abc",
"Customer": {
"FirstName": "Max",
"LastName": "Tomassi",
"Phone": "8741234745",
"City": "New York",
"State": "NY",
"Email": "maxduplessy@mailinator.com",
"Address1": "110 10th Av.",
"Address2": "",
"Zip": "10016"
}
}
Json Example Response:
{
"merchantName": "StarCoffe",
"description": "coffe latte",
"amount": 7.500,
"otherUrl": "www.StarCoffe/other",
"successUrl": "www.StarCoffe/success",
"cancelUrl": "www.StarCoffe/cancel",
"tempToken": "765fabb8-25e5-4746-a07f-147516f10325",
"html": "<button type='button' class='btn btn-success'><a style = 'color: white !important' href='https://webportalsandbox.choice.dev/HostedPaymentPage/765fabb8-25e5-4746-a07f-147516f10325' target='_blank'> </a></button>",
"expiration": "2123-06-28T19:42:42.0232089Z",
"otherInfo": "Energy tax",
"merchantGuid": "cd3d0150-819c-44b9-8efd-2fa248fcacce",
"avs": "No Match",
"used": false,
"customer": {
"guid": "681acbce-fa13-4a69-92f6-8e448999cfb3",
"merchantGuid": "cd3d0150-819c-44b9-8efd-2fa248fcacce",
"firstName": "Max",
"lastName": "Tomassi",
"address1": "110 10th Av.",
"zip": "10016",
"city": "New York",
"state": "NY",
"stateFullName": "New York",
"phone": "8741234745",
"email": "maxduplessy@mailinator.com",
"personalPhone": "8741234745",
"status": "Active",
"displayName": "Max Tomassi - 8741234745"
},
"customerGuid": "681acbce-fa13-4a69-92f6-8e448999cfb3"
}
If the transaction gets approved the user will be redirected back to your site, sending a POST to the SuccessURL with the following parameters.
{
"PaymentType": "Credit Card",
"SaleGuid": "fa101801-1b87-495d-87b9-aeae745e9c85",
"TokenizedCard": "84yXtM3EcGze0103",
"OtherInfo": "",
"Status": "Success",
"AccountNumberLastFour": "1234",
"OrderNumber":"12345abc",
"Receipt": "CHOICE MERCHANT SOLUTIONS<br/>8320 S HARDY DRIVE<br/>TEMPE AZ 85284<br/>07/07/2017 07:23:55<br/><br/>CREDIT - SALE<br/><br/>CARD # : **** **** **** 0103<br/>CARD TYPE : VISA<br/>Entry Mode : MANUAL<br/><br/>REF # : 13259222<br/>Invoice number : 13259222<br/>AUTH CODE : TAS869<br/>Subtotal: $13.50<br/>--------------------------------------<br/>Total: $13.50<br/>--------------------------------------<br/>Andres Ordonez<br/><br/>CUSTOMER ACKNOWLEDGES RECEIPT OF<br/>GOODS AND/OR SERVICES IN THE AMOUNT<br/>OF THE TOTAL SHOWN HEREON AND AGREES<br/>TO PERFORM THE OBLIGATIONS SET FORTH<br/>BY THE CUSTOMER`S AGREEMENT WITH THE<br/>ISSUER<br/>APPROVED<br/>Customer Copy<br/>"
}
If the transaction goes wrong the user will be redirected back to your site, sending a POST to OtherURL with the following parameters
{
"Error": "The Sale could not be processed correctly. Error code D2020. Error message: CVV2 verification failed"
}
Json Example Error Response:
{
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"traceId": "00-47e4224f9d3a97e29cba16f74bfceedf-b149a64216fdff76-00",
"errors": {
"Amount": [
"The amount must be equal or greater than 0.01"
],
"OtherUrl": [
"Field maximum length must be less than 512"
],
"CancelUrl": [
"Field maximum length must be less than 512"
],
"OtherInfo": [
"Field maximum length must be less than 1000",
"The field OtherInfo is invalid."
],
"SuccessUrl": [
"Field maximum length must be less than 512"
],
"ButtonLabel": [
"Field maximum length must be less than 100",
"The field ButtonLabel is invalid."
],
"Description": [
"Field maximum length must be less than 300"
],
"MerchantName": [
"Field maximum length must be less than 100"
]
}
}
The hosted payment page feature allows online and small merchants to redirect via a checkout button at their website visitors who wish to purchase items, pay invoices or make any type or transaction credit or ACH (if enabled).
To do this, simply POST to the following address using the following parameters and get your temporal token back. Then GET to our Hosted Payment Page using that temporal token and we care about the rest. This streamlines the checkout process and helps protect shoppers’ sensitive payment account data.
Enjoy a seamless checkout experience that automatically routes them to a secure page, branded with your company name. The customer enters their payment data directly into our server, releasing you of the responsibility of receiving, storing and transmitting sensitive cardholder data.
HTTP POST
POST https://sandbox.choice.dev/api/v1/HostedPaymentPageRequests
Headers using token
Key | Value |
---|---|
Content-Type | "application/json" |
Authorization | Token. Eg: "Bearer eHSN5rTBzqDozgAAlN1UlTMVuIT1zSiAZWCo6E..." |
Headers using API Key
Key | Value |
---|---|
Content-Type | "application/json" |
UserAuthorization | API Key. Eg: "e516b6db-3230-4b1c-ae3f-e5379b774a80" |
Query Parameters
Parameter | Type | M/C/O | Value |
---|---|---|---|
DeviceCreditCardGuid | string | Mandatory | Device's guid Credit Card. |
DeviceAchGuid | string | Mandatory | Device's guid Ach. |
Merchantname | string | Mandatory | Merchant's name. |
Description | string | Mandatory | Items description. |
Amount | string | Mandatory | Items total amount. |
OtherURL | string | Mandatory | Web page you want to redirect the user in case something failed. |
SuccessURL | string | Mandatory | Web page you want to redirect the user when transaction was successful. |
CancelURL | string | Mandatory | Web page you want to redirect the user in case he decided to cancel the transaction. |
OtherInfo | string | optional | Any alphanumeric code you might want to send to see it on the confirmation's response to keep track of your sales. |
IsButton | boolean | optional | Determines if the hosted payment page request will be used as a button (allows multiple payments for the same request or not). |
ButtonLabel | string | optional | This will be the text shown on your button (For example: "Pay here", "Donate"). |
Html | string | optional | Provide the html code you will use to share the button on your website. |
orderNumber | string | optional | It is used to identify payments made. |
Customer | object | optional | Customer. |
RecurringBilling | object | optional | See Recurring Billing for details. |
Invoice | object | optional | See Invoice for details. |
Response
- 201 code (ok).
Headers for http post backs
Key | Value |
---|---|
Content-Type | application/x-www-form-urlencoded |
HTTP POST BACK SUCCESS
If the transaction gets approved the user will be redirected back to your site, sending a POST to the SuccessURL with the parameters on the Json sample.
HTTP POST BACK ERROR
If the transaction goes wrong the user will be redirected back to your site, sending a POST to OtherURL with the parameters on the Json sample.
MAKE YOUR PAYMENT
Go to https://webportalsandbox.choice.dev/HostedPaymentPage/{{tempToken}}
Payment Button
Payment Button
using System;
using Newtonsoft.Json;
using System.IO;
using System.Net;
using System.Text;
namespace ChoiceSample
{
public class Account
{
public static void PaymentButton()
{
try
{
var request = (HttpWebRequest)WebRequest.Create("https://sandbox.choice.dev/api/v1/HostedPaymentPageRequests");
request.ContentType = "text/json";
request.Method = "POST";
var paymentButton = new
{
DeviceCreditCardGuid = "2a566893-4ad3-4063-9f64-13ff055b695a",
Merchantname = "StarCoffe",
Description = "coffe latte",
Amount = 7.50,
isButton = true,
buttonLabel = "button coffe latte",
OtherURL = "http://StarCoffe/other",
SuccessURL = "http://StarCoffe/success",
CancelURL = "http://StarCoffe/cancel",
OtherInfo = "coffe latte express"
};
string json = JsonConvert.SerializeObject(paymentButton);
request.Headers.Add("Authorization", "Bearer eHSN5rTBzqDozgAAlN1UlTMVuIT1zSiAZWCo6EBqB7RFjVMuhmuPNWcYM7ozyMb3uaDe0gyDL_nMPESbuM5I4skBOYcUM4A06NO88CVV3yBYee7mWB1qT-YFu5A3KZJSfRIbTX9GZdrZpi-JuWsx-7GE9GIYrNJ29BpaQscTwxYDr67WiFlCCrsCqWnCPJUjCFRIrTDltz8vM15mlgjiO0y04ZACGOWNNErIVegX062oydV7SqumGJEbS9Av4gdy");
request.ContentType = "application/json";
request.Accept = "application/json";
using (var streamWriter = new StreamWriter(request.GetRequestStream()))
{
streamWriter.Write(json);
streamWriter.Flush();
streamWriter.Close();
}
try
{
var response = (HttpWebResponse)request.GetResponse();
using (var reader = new StreamReader(response.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)response.StatusCode);
Console.WriteLine();
Console.WriteLine(response.StatusDescription);
Console.WriteLine(result);
}
}
catch (WebException wex)
{
if (wex.Response != null)
{
using (var errorResponse = (HttpWebResponse)wex.Response)
{
using (var reader = new StreamReader(errorResponse.GetResponseStream()))
{
string result = reader.ReadToEnd();
Console.Write((int)errorResponse.StatusCode);
Console.WriteLine();
Console.WriteLine(errorResponse.StatusDescription);
Console.WriteLine(result);
}
}
}
}
}
catch (IOException e)
{
Console.WriteLine(e);
}
}
}
}
Json Example Request:
{
"DeviceCreditCardGuid": "2a566893-4ad3-4063-9f64-13ff055b695a",
"Merchantname": "StarCoffe",
"Description": "coffe latte",
"Amount": 7.50,
"isButton": true,
"buttonLabel": "button coffe latte",
"OtherURL": "http://StarCoffe/other",
"SuccessURL": "http://StarCoffe/success",
"CancelURL": "http://StarCoffe/cancel",
"OtherInfo": "coffe latte express"
}
Json Example Response:
{
"merchantName": "StarCoffe",
"description": "coffe latte",
"amount": 7.500,
"otherUrl": "www.StarCoffe/other",
"successUrl": "www.StarCoffe/success",
"cancelUrl": "www.StarCoffe/cancel",
"tempToken": "20fe3b07-5a40-4770-8b1f-3dbc132969cc",
"isButton": true,
"buttonLabel": "button coffe latte",
"html": "<button type='button' class='btn btn-success'><a style = 'color: white !important' href='https://webportalsandbox.choice.dev/HostedPaymentPage/20fe3b07-5a40-4770-8b1f-3dbc132969cc' target='_blank'> button coffe latte </a></button>",
"status": "Button - Active",
"expiration": "2123-06-28T19:42:41.0884024Z",
"otherInfo": "coffe latte express",
"merchantGuid": "cd3d0150-819c-44b9-8efd-2fa248fcacce",
"avs": "No Match",
"used": false
}
If the transaction gets approved the user will be redirected back to your site, sending a POST to the SuccessURL with the following parameters.
{
"PaymentType": "Credit Card",
"SaleGuid": "fa101801-1b87-495d-87b9-aeae745e9c85",
"TokenizedCard": "84yXtM3EcGze0103",
"OtherInfo": "",
"Status": "Success",
"AccountNumberLastFour": "1234",
"Receipt": "CHOICE MERCHANT SOLUTIONS<br/>8320 S HARDY DRIVE<br/>TEMPE AZ 85284<br/>07/07/2017 07:23:55<br/><br/>CREDIT - SALE<br/><br/>CARD # : **** **** **** 0103<br/>CARD TYPE : VISA<br/>Entry Mode : MANUAL<br/><br/>REF # : 13259222<br/>Invoice number : 13259222<br/>AUTH CODE : TAS869<br/>Subtotal: $13.50<br/>--------------------------------------<br/>Total: $13.50<br/>--------------------------------------<br/>Andres Ordonez<br/><br/>CUSTOMER ACKNOWLEDGES RECEIPT OF<br/>GOODS AND/OR SERVICES IN THE AMOUNT<br/>OF THE TOTAL SHOWN HEREON AND AGREES<br/>TO PERFORM THE OBLIGATIONS SET FORTH<br/>BY THE CUSTOMER`S AGREEMENT WITH THE<br/>ISSUER<br/>APPROVED<br/>Customer Copy<br/>"
}
If the transaction goes wrong the user will be redirected back to your site, sending a POST to OtherURL with the following parameters
{
"Error": "The Sale could not be processed correctly. Error code D2020. Error message: CVV2 verification failed"
}
Json Example Error Response:
{
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"traceId": "00-47e4224f9d3a97e29cba16f74bfceedf-b149a64216fdff76-00",
"errors": {
"Amount": [
"The amount must be equal or greater than 0.01"
],
"OtherUrl": [
"Field maximum length must be less than 512"
],
"CancelUrl": [
"Field maximum length must be less than 512"
],
"OtherInfo": [
"Field maximum length must be less than 1000",
"The field OtherInfo is invalid."
],
"SuccessUrl": [
"Field maximum length must be less than 512"
],
"ButtonLabel": [
"Field maximum length must be less than 100",
"The field ButtonLabel is invalid."
],
"Description": [
"Field maximum length must be less than 300"
],
"MerchantName": [
"Field maximum length must be less than 100"
]
}
}
Payment buttons allow you to seamlessly accept payments on your site. This feature will create a snippet of HTML code for a button you can add to your site allowing your customer to make a payment.
HTTP POST
POST https://sandbox.choice.dev/api/v1/HostedPaymentPageRequests
Headers using token
Key | Value |
---|---|
Content-Type | "application/json" |
Authorization | Token. Eg: "Bearer eHSN5rTBzqDozgAAlN1UlTMVuIT1zSiAZWCo6E..." |
Headers using API Key
Key | Value |
---|---|
Content-Type | "application/json" |
UserAuthorization | API Key. Eg: "e516b6db-3230-4b1c-ae3f-e5379b774a80" |
Query Parameters
Parameter | Type | M/C/O | Value |
---|---|---|---|
DeviceCreditCardGuid | string | Mandatory | Device's guid Credit Card. |
Merchantname | string | Mandatory | Merchant's name. Max length = 100. |
Description | string | Optional first button, then mandatory | Items description. Max length = 100. |
Amount | string | Optional first button, then mandatory | Items total amount. Must be greater than 0.01 |
IsButton | boolean | Mandatory | Determines if the hosted payment page request will be used as a button (allows multiple payments for the same request or not). |
ButtonLabel | string | Mandatory | This will be the text shown on your button (For example: "Pay here", "Donate"). Max length = 100. |
OtherURL | string | Mandatory | Web page you want to redirect the user in case something failed. Max length = 512. |
SuccessURL | string | Mandatory | Web page you want to redirect the user when transaction was successful. Max length = 512. |
CancelURL | string | Mandatory | Web page you want to redirect the user in case he decided to cancel the transaction. Max length = 512. |
OtherInfo | string | optional | Any alphanumeric code you might want to send to see it on the confirmation's response to keep track of your sales. Max length = 1000. |
Response
- 201 code (ok).
HTTP POST BACK SUCCESS
If the transaction gets approved the user will be redirected back to your site, sending a POST to the SuccessURL with the parameters on the Json sample.
HTTP POST BACK ERROR
If the transaction goes wrong the user will be redirected back to your site, sending a POST to OtherURL with the parameters on the Json sample.
MAKE YOUR PAYMENT
Go to https://webportalsandbox.choice.dev/HostedPaymentPage/{{tempToken}}
Payment Token JS
Payment Token JS
Integration example for script tag:
<script
src="https://webportalsandbox.choice.dev/assets/token/PaymentToken.js"
id="choicePayment"
data-tokenization-key="B8A5B84F-5630-4CA1-BAAB-799193CF3F5E"
data-device-guid="8B2572A8-D269-4A55-A909-1D51ED397A94"
data-notify-alert="false"
data-style-class="form-control"
data-environment="sandbox"
>
</script>
Integration example for your script:
//Setting your own submit method as callback for our Payment Token JS
paymentTokenJS.callback = onSubmit
function onSubmit (response) {}
<!-- Divs with ids in wich the necessary inputs will be rendered-->
<div id="ccNumber"></div>
<div id="ccExpDate"></div>
<div id="cvv"></div>
<!-- The necessary id to add to your submit button for tokenization event and callback execution -->
<button id="paymentButton" type="button">Submit Payment</button>
Response examples:
//Error response
{
error: 'Invalid Card Number',
token: null
}
//Succesfull response
{
error: null,
token: 'hQZzemwsEdK94242'
}
Example form page for integration:
<html>
<head>
<title>Payment Token JS Demo</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.3.1/dist/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
</head>
<body>
<script
src="https://webportalsandbox.choice.dev/assets/token/PaymentToken.js"
id="choicePayment"
data-tokenization-key="B8A5B84F-5630-4CA1-BAAB-799193CF3F5E"
data-device-guid="8B2572A8-D269-4A55-A909-1D51ED397A94"
data-notify-alert="false"
data-style-class="form-control"
data-environment="sandbox"
>
</script>
<script>
paymentTokenJS.callback = onSubmit
function onSubmit (response) {
if (response.token !== null) {
document.getElementById('title').innerHTML = 'Thank you!'
var firstName = document.getElementById('fname').value
document.getElementById('paymentForm').hidden = true
document.getElementById('backToPaymentButton').hidden = false
document.getElementById('response').innerHTML = `
${firstName}, thank you for your purchase
<br>
<br>
Your Token has been generated: ${response.token}
`
}
else {
document.getElementById('errorMessage').innerHTML = `<span style="color: red">${response.error}</span>`
}
}
window.addEventListener("load", function (event) {
document.getElementById('backToPaymentButton').hidden = true
document.getElementById('backToPaymentButton').addEventListener("click", async function() {
document.getElementById('title').innerHTML = 'Payment JS Form'
document.getElementById('paymentForm').hidden = false
document.getElementById('backToPaymentButton').hidden = true
document.getElementById('response').innerHTML = ''
})
});
</script>
<div class="container text-center">
<h1 id="title" class="bs-primary">Payment JS Form</h1>
<form id="paymentForm">
<table class="container">
<tr>
<td><label for="fname" class="form-label">First Name</label></td>
<td><input type="text" class="form-control" id="fname" value="Test"></td>
</tr>
<tr>
<td><label for="lname" class="form-label">Last Name</label></td>
<td><input type="text" class="form-control" name="lname" value="User" /></td>
</tr>
<tr>
<td><label for="aname" class="form-label">Address</label></td>
<td><input type="text" class="form-control" name="address" value="123 Fake Street" /></td>
</tr>
<tr>
<td><label for="cname" class="form-label">City</label></td>
<td><input type="text" class="form-control" name="city" value="New York" /></td>
</tr>
<tr>
<td><label for="sname" class="form-label">State</label></td>
<td><input type="text" class="form-control" name="state" value="NY" /></td>
</tr>
<tr>
<td><label for="zname" class="form-label">Zip</label></td>
<td><input type="text" class="form-control" name="zip" value="10016" /></td>
</tr>
<tr>
<td><label for="zname" class="form-label">Country</label></td>
<td><input type="text" class="form-control" name="country" value="US" /></td>
</tr>
<tr>
<td><label for="pname" class="form-label">Phone</label></td>
<td><input type="text" class="form-control" name="phone" value="5555555555" /></td>
</tr>
<tr>
<td colspan="2">
<span>Credit Card Information</span>
</td>
</tr>
<tr>
<td><label for="ccname" class="form-label">CC Number</label></td>
<td><div id="ccNumber"></div></td>
</tr>
<tr>
<td><label for="expname" class="form-label">CC Exp Date</label></td>
<td><div id="ccExpDate"></div></td>
</tr>
<tr>
<td><label for="cvvname" class="form-label">CVV</label></td>
<td><div id="cvv"></div></td>
</tr>
</table>
<br>
<div id="errorMessage"></div>
<br>
<button id="paymentButton" class="btn btn-primary" type="button">Submit Payment</button>
</form>
<div id="response"></div>
<div id="backToPaymentButton">
<br>
<button type="button" class="btn btn-secondary">Back to payment</button>
</div>
</div>
</body>
</html>
Payment Token JS is a JavaScript framework that allows merchants to collect credit card information from their customers without exposing their website and getting into PCI scope. ISV and Merchants have full control over the look and feel of their checkout page while payment data is not captured by their site.
This is a tokenization only process, so you will only obtain a token from our Payment Token JS and then integrate our payment gateway API endpoints to process transactions by submitting the obtained token rather than submitting the full card information.
Script URL Sandbox Integration
https://webportalsandbox.choice.dev/assets/token/PaymentToken.js
Script URL Production Integration
https://webportal.choice.dev/assets/token/PaymentToken.js
Script tag properties
Property | M/C/O | Value | Description |
---|---|---|---|
src | Mandatory | Payment token js url | URL location of the JavaScript code to import into your solution |
id | Mandatory | choicePayment | A mandatory field that represents the script tag name to be used on your checkout page |
data-tokenization-key | Mandatory | Api Key | User Authentication token associated with you user credentials |
data-device-guid | Mandatory | Device Guid | Device GUID to use for the tokenization process |
data-environment | Mandatory | sandbox/production | This value should be used in conjunction with the tokenization key and the device guid |
data-notify-alert | Optional | true/false | When enabled we will display a pop up with any error obtained from the tokenization process. If set to false, you should have an event handler on your checkout page to present the consumer |
data-style-class | Optional | string | Name of the class you wish to apply to the input text boxes to match your checkout pages look and feel |
Card
Card data by BIN number
Response examples:
{
"bin": "010051",
"brand": "PAGOBANCOMAT",
"type": "DEBIT",
"country": "ITALY"
}
{
"bin": "371529",
"brand": "AMERICAN EXPRESS",
"bank": "AMERICAN EXPRESS US CONSUMER",
"type": "CREDIT",
"subType": "PERSONAL",
"country": "UNITED STATES",
"web": "HTTPS://WWW.AMERICANEXPRESS.COM/",
"phone": "1 (800) 528-4800"
}
{
"bin": "424200",
"brand": "VISA",
"bank": "LANDESBANK BADEN-WUERTTEMBERG",
"type": "DEBIT",
"subType": "PREPAID",
"country": "GERMANY",
"web": "HTTPS://WWW.LBBW.DE/",
"phone": "+49 711 127-0"
}
This endpoint gets card's information by Bin Number such as brand, card type and origin.
HTTP GET
GET https://sandbox.choice.dev/api/v1/Card/BinNumber/{{binNumber}}
Headers using token
Key | Value |
---|---|
Content-Type | "application/json" |
Authorization | Token. Eg: "Bearer eHSN5rTBzqDozgAAlN1UlTMVuIT1zSiAZWCo6E..." |
Headers using API Key
Key | Value |
---|---|
Content-Type | "application/json" |
UserAuthorization | API Key. Eg: "e516b6db-3230-4b1c-ae3f-e5379b774a80" |
Declined Response Codes
Codes
Code | Response Message | Description |
---|---|---|
D0001 | Duplicate Request (Approved previously) | The transaction was already performed and approved. Verify if the request was submitted twice for the same transaction ID or external reference number. |
D0003 | Duplicate Request (Declined previously) | The transaction was already performed and declined. Verify if the request was submitted twice for the same transaction ID or external reference number. |
D0004 | Reversal Not Allowed | The transaction is not authorized for reversal. This error may occur because the transaction was not settled, was declined, or already reversed. |
D0005 | Return Not Allowed | The transaction is not authorized for return. This error may occur because the transaction was not settled, was declined, or already reversed. |
D0006 | Supervisor Override Required | |
D0007 | Modify Transaction Not Allowed | The transaction is not authorized for modification. This error may occur because the transaction was already settled, or was declined. |
D0008 | Possible Duplicate Request | This is a duplicate request. The credentials for this transaction (i.e. amount, card number or same service) are the same as another transaction submitted less than one minute apart. |
D0009 | Duplicate Request (Reversed previously) | The request with the same credentials (amount, card number, or same service) hit the server twice within a minute. |
E0010 | Inactive Device (Terminal) | The device is not registered, or is inactive in the system. |
E0011 | Device (Terminal) Configuration missing | The configuration parameter is missing. |
E0012 | Insufficient privileges | |
E0013 | Incremental Auth Not Allowed | |
E0015 | Unable to process your request. Settlement InProgress. | The transaction settlement is in progress. |
E0016 | Functionality currently not available. | The functionality is not supported. |
E0020 | Inactive Merchant (Account) | The merchant is not registered, or is inactive in the system. |
E0021 | Merchant (Account) configuration missing | The configuration parameter is missing. |
E0022 | Processor configuration missing | The processor parameter is missing. |
D0023 | Merchant already active | |
E0030 | Unique ID Error The terminal unique ID is invalid, or is not registered in the system. | |
D0050 | Inactive terminal (Backend) | The device is inactive, or is not registered at the host. |
D0060 | Inactive account (Backend) | The account is inactive, or is not registered at the host. |
D0070 | Unique ID Error (Backend) | The terminal unique ID is invalid, or is not registered at the host. |
D0080 | Duplicate Request (Backend) | This is a duplicate transaction. This transaction was already approved and processed. |
D0090 | Reversal Not Allowed (Backend) | The transaction is not authorized for reversal. This error may occur because the transaction was settled, declined, or already reversed. |
D0091 | Return Not Allowed (Backend) | The transaction is not authorized for return. This error may occur because the transaction was settled, declined, or already reversed. |
D0092 | Request Format Error (Backend) | |
D0093 | Encryption failure from host | |
D0094 | Return not allowed, Card number requested does not match with original transaction card number | |
D0095 | Invalid taskID | |
D0096 | Currency code mismatch with original transaction | |
D0097 | Multiple amount format in single request not supported | |
D0098 | Multiple tax with same tax type is not allowed. | A request includes multiple tax with same tax type. |
E0110 | System Error (BillParam) | |
E0111 | System Error (UBillACC) | |
E0200 | System Error (Tran) | |
E0201 | System Error (BillpayTran) | |
E0202 | System Error (CardTran) | |
E0203 | System Error (CheckTran) | |
E0204 | System Error (MTTran) | |
E0205 | System Error (MOTran) | |
E0206 | System Error (AccTran) | |
E0207 | System Error (Shipping_Info Tran) | |
E0208 | System Error (Products Tran) | |
E0209 | System Error (Override Tran) | |
E0210 | System Error (PayMode Tran) | |
E0300 | System Error (UTran) | |
E0301 | System Error (BillpayUTran) | |
E0302 | System Error (CardUTran) | |
E0303 | System Error (CheckUTran) | |
E0304 | System Error (MTUTran) | |
E0305 | System Error (MoUTran) | |
E0306 | System Error (ACCUTran) | |
E0310 | System Error (BillPay WAY UTran) | |
E0311 | System Error (BillPay WAY Seq) | |
E0350 | System Error (UTranStatus) | |
E0360 | System Error (PERIUTran) | |
E0370 | System Error (SearchTran) | |
E0380 | System Error (chkc history) | |
E0400 | System Error (Login) | |
E0450 | System Error (NoFee) | |
E0451 | System Error (GetFEE) | |
E0460 | System Error (EXRate) | |
E0470 | System Error (PhCountry) | |
E0480 | System Error (PrePay Number) | |
E0481 | System Error (PrePay update) | |
E0482 | System Error (PrePay List) | |
E0490 | System Error (Bin Lookup) | |
E0491 | System Error (Merchant Bin Lookup) | |
E0500 | System Error (BrdCorp) | |
E0501 | System Error (BrdMer) | |
E0502 | System Error (Upate DeviceProc) | |
E0503 | System Error (Upate MerchProductProc) | |
E0504 | System Error (Upate LogoProc) | |
E0510 | System Error (Upate MerchantProc) | |
E0511 | System Error (Upate OperatorProc) | |
E0550 | System Error (Search Corporation) | |
E0551 | System Error (Search Merchant) | |
E0560 | System Error (Modify Schedule) | |
E0561 | System Error (Modify Payment) | |
E0600 | System Error (CCust) | |
E0601 | System Error (CCustID) | |
E0610 | System Error (UCust) | |
E0611 | System Error (UCustID) | |
E0620 | System Error (SCust) | |
E0621 | System Error (CustDt) | |
E0630 | System Error (ECustACC) | |
E0631 | System Error (ECust) | |
E0632 | System Error (Deactivate Cust Account) | |
E0650 | System Error (CRec) | |
E0651 | System Error (CRecID) | |
E0660 | System Error (URec) | |
E0661 | System Error (URecID) | |
E0670 | System Error (SRec) | |
E0671 | System Error (RecDt) | |
E0672 | System Error (CAdminTran) | |
E0673 | System Error (BoardFee) | |
E0713 | Transaction Key Expired | Transaction Key provided in request is expired. Register new key with our system. |
E0720 | System Error(Async Insert) | |
E0721 | System Error (Async Update) | |
E0722 | System Error (Async Call Fail) | |
E0723 | System Error (Async Select Fail) | |
E0724 | System Error (Key Gen Fail) | System Error. Please contact help desk. |
E0800 | System Error (KeyNox Error) | |
E0910 | Time out | |
E0911 | System Error | |
E0912 | Error on Host | |
D1001 | Account Number Invalid | Account number provided in request is not a valid account number. |
D1002 | Valid Account, Cash payments only. | |
D1003 | Amount invalid. | |
D1004 | Biller ID Invalid. | Biller ID provided in request is not valid. |
D1005 | Cash only biller. | |
D1006 | Bill Pay Processor Code is missing or is incorrect. Processing host is not configured please contact help desk. | |
D1007 | One or more Fields missing or incorrect. | |
D1020 | Pre Pay Number not available. | |
D1201 | Unable to determine merchant ID. | Merchant is not register with Mobilozophy. |
D1202 | Unable to process your request. | |
D1203 | Invalid redemption code. | Redemption code provided in request is invalid. |
D1204 | Unable to determine coupon ID. | Unable to determine coupon ID. |
D1205 | Coupon not valid at this location. | Coupon not valid at this location. |
D1206 | Minimum Purchase Amount criteria not met. | Minimum Purchase Amount criteria not met. |
D1207 | Either end user ID or registration ID is required. | Either end user ID or registration ID is required. |
D1208 | Unable to modify coupon. | Modification of coupon data is not allowed. |
D1209 | Unable to modify coupon. | Modification of coupon data is not allowed. |
D1210 | Unable to modify coupon. | Modification of coupon data is not allowed. |
D1211 | Unable to modify coupon. | Modification of coupon data is not allowed. |
D1212 | This code has already been redeemed. | This code has already been redeemed. |
D1213 | This code has been deleted. | This code has been deleted. |
D1214 | Invalid store ID. | Invalid store ID. |
D1215 | Invalid amount. | Amount provided in request is invalid. |
D1217 | Coupon service is temporarily unavailable. | Coupon service is temporarily unavailable. |
D1999 | General Bill Pay Decline. | General declined please contact help desk. |
D2001 | Refer to Issuer. | The merchant must call the issuer to obtain verbal authorization. |
D2002 | Suspected Card (pick-up, hot-card) | This credit card has been flagged for fraud. the merchant should call the number on the back of the card to obtain further instructions. Suspected card error occurs in the following scenarios: 1-The card is restricted by the issuer 2-Loss of card is reported 3-Theft of card is reported |
D2003 | Honor with identification? | The card is not identified. |
D2004 | Invalid Amount | The amount exceeds the limits established by the issuer for this type of transaction. |
D2005 | Invalid Card | The issuer indicates that this card is invalid. |
D2006 | No such issuer | The card issuer number is invalid. |
D2007 | Invalid fee | The transaction fee is unacceptable. |
D2008 | Incorrect Pin | The PIN entered by the cardholder is incorrect. |
D2009 | Pin attempts exceeded | The number of attempts to enter the PIN has exceeded. |
D2010 | Key synchronization failed from the host | The failure of a key synchronization from the host. |
D2011 | Expired Card | The card has expired. |
D2012 | Insufficient Funds | The credit limit for this account has exceeded, or the amount is not enough to perform the transaction. |
D2013 | Invalid From Account | The transaction account is invalid. |
D2014 | Invalid To Account | The transaction account is invalid. |
D2015 | Withdrawal Limit exceeded | The withdrawal limit on an account is exceeded. |
D2016 | Withdrawal frequency exceeded | The withdrawal frequency on an account is exceeded. |
D2017 | Time limit for Pre-Auth reached | The time for Pre-Auth has reached its limit. |
D2018 | AVS FAILED | The address verification has failed and the merchant is configured for auto decline on AVS failure. |
D2019 | Billing ZIP Mismatch | The zip provided does not match the billing address on file and merchant is configured for auto decline on ZIP code mismatch. |
D2020 | CVV2 verification failed | The V code provided is invalid or does not match what is on file and merchant set up for auto decline on CVV2 failure. |
D2021 | Issuer or Switch inoperative | The bank is unavailable to authorize this transaction. |
D2022 | Duplicate transaction ( Same amount / Account) | The transaction with same amount and account is performed twice. |
D2023 | Balance unavailable for inquiry | The balance cannot be validated. |
D2024 | Check Digit Err | The credit card number entered did not pass validation. Correct and re-enter the credit card number. |
D2025 | Excluded Bin ID for Merchant | Card is not allowed to do transaction at this merchant. |
D2026 | Do not honor | The transaction was declined by the issuer. |
D2027 | AVS and CVV2 failed | The address verification and V code verification failed and merchant set up for auto decline on AVS anc CVV2 failure. |
D2028 | Invalid Date | The credit card expiration date is invalid. Verify and re-enter the expiration date. |
D2029 | Invalid Service | The service provided by the card is invalid. |
D2030 | Host Validation Error | The host is an invalid host. |
D2031 | Activity Limit exceeded | The daily card activity limit has been exceeded. |
D2032 | Cannot complete because of Violation | The transaction cannot be completed because the credit card account has been flagged with a violation. |
D2033 | Debit Pin Required | |
D2034 | Debit Pin Required | The BIN is blocked by the issuer. |
D2035 | Check Service authentication failure | |
D2039 | Could Not Retrieve a Valid Card Number for Token | |
E2042 | No Card found for the BIN No Card found for the BIN | |
D2200 | UNKNOWN_ERROR | |
D2201 | CONTENT_TYPE_NOT_SET | |
D2202 | UNKNOWN_CONTENT_TYPE | |
D2203 | CONTENT_LENGTH_NOT_SET | |
D2204 | INCOMING_REQUEST_READ_ERROR | |
D2205 | OUTGOING_RESPONSE_SEND_ERROR | |
D2206 | INPUT_VALIDATION_ERROR | |
D2208 | OCT_FAILED | |
D2209 | AFT_FAILED | |
D2210 | AFTR_FAILED | |
D2211 | REMOTE_VPP_ERROR | |
D2212 | INVALID_ISSUER_COUNTRY_CODE | |
D2213 | FAST_FUNDS_NOT_ENABLED | |
D2214 | INTERNAL_ERROR | |
D2215 | ACNL_FAILED | |
D2216 | ReceiverLimitExceeded | |
D2800 | Invalid FCS ID | |
D2801 | Invalid Voucher Serial Number | |
D2802 | Invalid Voucher Approval Code | |
D2803 | Electronics Benefit Transactions cannot contain Fee or Tax | |
D2998 | PreFraudScout Decline | Transaction is declined in Pre Fraud rules. |
D2999 | General Card Auth Decline | This is a general decline error. |
D3001 | Invalid Bank Routing Number | Invalid routing number in the request message. |
D3002 | Invalid Bank Account Number | The bank account number in the request message is invalid. |
D3003 | Invalid MICR Data | The MICR data in the request message is invalid. |
D3004 | Invalid Account Type | The account type in the request message is invalid. |
D3005 | Invalid Check Type | The check type in the request message is invalid. |
D3006 | Invalid Amount | The amount for a transaction is invalid. |
D3007 | Missing Signature | |
D3008 | Missing Endorsement | |
D3009 | Invalid Check Date | The date format in the request message is invalid. |
D3010 | Car Lar Mismatch | Mismatch between the check amount written in numbers (courtesy amount) and letters (legal amount) provided on check image. |
D3011 | CallNox Timeout | |
D3012 | Duplicate Check | |
D3013 | Blocked Account | The account provided in transaction is blocked. |
D3014 | Blocked Check | The check provided in transaction is blocked. |
D3015 | Cannot Process Image | |
D3016 | Invalid Check Number | The check number in the request message is invalid. |
D3017 | Bank Account Closed | The bank account does not exist. |
D3018 | Decline NSF | |
D3019 | Check Image Decline | |
D3020 | Invalid SEC | |
D3101 | Maker Check Return Stop Pay Limit Exceeded | |
D3102 | Maker Check Return No Auth Limit Exceeded | |
D3103 | Maker Check Return No Settlement Limit Exceeded | |
D3104 | Maker Check Return NSF/Other Limit Exceeded | |
D3105 | Maker Check Return Limit Exceeded | |
D3106 | Customer Check Return Stop Pay Limit Exceeded | |
D3107 | Customer Check Return No Auth Limit Exceeded | |
D3108 | Customer Check Return No Settlement Limit Exceede | |
D3109 | Customer Check Return NSF/Other Limit Exceeded | |
D3110 | Customer Check Return Limit Exceeded | |
D3111 | Check Image Processing Error | |
D3112 | Customer Check Cashing Limit Exceeded | |
D3200 | Record(s) Processed Successfully | |
D3201 | Duplicate Custom Fields Not Allowed. | Duplicate Custom Field Not Allowed. |
D3202 | Item code already exists. | Item code already exists. |
D3203 | Custom Field Type cannot be modified during update. | Custom Field Type cannot be modified during update. |
D3204 | Could not find Product for Update. | Product is not registered in the system. |
D3205 | Could not find Product for Removal. | Product is not registered in the system. |
D3206 | Unidentified Tax Category | Tax Category is not set in our system. |
D3207 | Some Record(s) Processed Successfully | |
D3208 | No Records Processed | No records are processed further. |
D3211 | Parsing Failed | Issue with request parameter. |
D3212 | Product Enroll Fail at Merchant Level | Merchant level data is not added or updated in the system. |
D3213 | Item code not provided | The item code in the request message is invalid. |
D3214 | Product Enroll Fail at Merchant Custom Level | Merchant level custom data is not added and updated in the system. |
D3215 | Product Enroll Fail at Global Level | The UPC level data is not added and updated in our system. |
D3216 | Product Removal Failed | Product Removal Failed. |
D3217 | No Tax Category Found | No Tax Category Found. |
D3218 | Category already exists | |
D3219 | Invalid Category Code | |
D3220 | Modifier already exists | |
D3221 | Invalid Modifier Code | |
D3222 | Variation already exists | |
D3223 | Invalid Variation | |
D3224 | Invalid Product Code | |
D3225 | Duplicate Variation Option Fields Not Allowed | |
D3226 | Discount already exists | |
D3227 | Start Date should be current date or future date | |
D3228 | End Date should be current date or future date | |
D3229 | Invalid Discount Code | |
D3230 | No Product found for given search criteria. | No product is found for given search criteria. |
D3231 | End Date should be greater than Start Date | |
D3232 | Discount amount should be less than Max Discount amount | |
D3233 | Discount percentage should be less than 100 | |
D3234 | Max Discount amount should be less than Discount Qualifying amount | |
D3235 | Discount Code already removed | |
D3236 | Already Associated | |
D3237 | Invalid role | |
D3238 | Invalid Operation | |
D3239 | Role Already Exist | |
D3240 | Operation Type Already Exist | |
D3241 | Role does not Exist | |
D3242 | Role can not be Deleted | |
D3243 | Default Role can not be Modified | |
D3250 | Invalid modifierOptionDetails | Invalid modifierOptionDetails |
D3253 | Order service date can not be a previous date | |
E3254 | Order creation failed | |
E3255 | OrderID not found | |
E3256 | Order updation failed | |
E3257 | Order can not be modified | |
D3259 | Invalid modifier categoryCode | Invalid modifier categoryCode |
D3260 | Invalid product categoryCode | Invalid product categoryCode |
D3264 | currentPaymentSequenceNumber should be less than and equal totalPaymentCount | The currentPaymentSequenceNumber value entered does not meet the required criteria. |
D3999 | Check Auth Decline | |
D4000 | Invalid content, one of {encodedCardData, keyedCardData, returnTransactionData} group is required | |
E4001 | Invalid Source Country Code | |
E4002 | Invalid Source Currency Code | |
E4003 | Invalid Destination Location | |
E4004 | Invalid Destination Currency Code | |
E4005 | Invalid Source Agent | |
E4006 | Invalid Destination Agent | |
E4007 | Invalid Conversion Rate | |
E4008 | Invalid Fee | |
E4009 | Missing/Invalid Amount | |
E4010 | Missing/Invalid Payout Amount | |
E4011 | Invalid MTCN | |
E4012 | Duplicate transaction ( Same amount/ Account ). | |
E4050 | Missing /Invalid Sender Name | |
E4051 | Invalid Sender ID Type | |
E4052 | Invalid Sender ID | |
E4053 | Invalid Sender Address | |
E4054 | Invalid Sender phone number | |
E4055 | Missing /Invalid Receiver Name | |
E4056 | Invalid Receiver ID Type | |
E4057 | Invalid Receiver ID | |
E4058 | Invalid Receiver Address | |
E4059 | Invalid Receiver phone number | |
E4060 | Missing / Invalid Input | |
E4999 | General Money Transfer Decline | |
E5000 | Invalid Money order Number. | |
E5001 | Invalid Amount. | |
E5002 | Missing Payee Name. | |
D5201 | Invalid Page size in the request | |
D5202 | Invalid Report column name for requested report | |
D5203 | Invalid date range, redefine your search | |
D5204 | Invalid search column for requested report | |
D5205 | Invalid optional column for requested report | |
D5206 | Invalid Report column name for requested report | |
D5207 | Invalid/Expired Report data identifier | |
D5208 | Invalid search column value for requested report | |
D5209 | No data found, please redefine your search | |
D5210 | One or more duplicate columns used for search, sort or for optional columns | |
D5211 | Invalid search condition, transactionID is required | |
D5212 | Invalid search condition, productCode is required | |
D5213 | Service is temporarily unavailable.Please try later | |
E5213 | Service is temporarily unavailable.Please try later | |
D5214 | Invalid search condition, dateRange is required | |
E5500 | Invalid Payroll Info | |
E5599 | General Payroll Decline. | |
E5999 | General Money order Decline | |
E6000 | Missing /Invalid Name | |
E6001 | Invalid ID Type | |
E6002 | Invalid ID Number | |
E6004 | Invalid Address | The address provided in the transaction is invalid. |
E6005 | Invalid phone number | The phone number provided in the transaction is Invalid. |
E6006 | Invalid SSN | The SSN provided in the transaction is Invalid. |
E6007 | Invalid DOB | The DOB provided in the transaction is Invalid. |
E6008 | Missing/Invalid Gender | |
E6009 | Missing/Invalid customer Image | |
E6010 | Missing/Invalid ID Image | |
E6011 | Missing/Invalid Finger Print Image | |
E6012 | Biometric Auth failure | |
E6013 | BFD failed | |
E6014 | OTP failed | |
E6050 | Duplicate Enrollment | The Customer is enrolled. Verify if the request is send twice for the same customer. |
E6051 | OFAC Match | |
E6052 | Blocked Customer | |
E6053 | Blocked Biometrics | |
E6054 | Declined Score below threshold. | |
E6055 | Customer Not Enrolled. | The customer code provided in request is not registered. |
E6056 | Financial Account Not Enrolled. | |
E6057 | Customer requested stop of specific recurring payment | Customers request to stop recurring payments. |
E6058 | Customer requested stop of all recurring payments from specific merchant | Customers request to stop recurring payments from specific merchant. |
E6059 | Missing Customer ID/External Customer Number | Customer ID or external customer number is not provided in request. |
E6060 | Inactive Customer | Inactive Customer |
E6061 | Invalid UID | UID number provided in request is invalid. |
E6062 | Incorrect or No Card Indicator Value | |
E6063 | Customer Group Name already exists | |
E6064 | Invalid Customer Group code | |
E6065 | Customer Code already associated | |
E6066 | Invalid Customer Code | |
E6067 | Search criteria not found. | The search request does not include any search criteria fields.The search criteria includes the firstName, lastName, paymentInstrumentID, or customerID fields. |
E6068 | External Customer number is already available. | |
E6069 | Invalid Search Criteria | |
E6071 | Customer modification not allowed, payment is in process. | The application is unable to delete a customer record while a recurring transaction for the customer is processing. |
E6072 | Transaction is in process. Please try again after some time. | Simultaneous actions cannot be performed on the same customer record. The application is unable to perform edits on a customer record while the record is in use. |
E6100 | Inactive Customer | Inactive Customer. |
E6901 | Duplicate Schedule Billing Reference Number | Duplicate schedule billing reference number. |
E6902 | Payment Count Cannot be Greater than Processed Count | Payment count cannot be greater than processed count. |
E6903 | Next start date cannot be earlier than Current Date | Next start date cannot be earlier than current date. |
E6904 | Schedule cannot be added without a Payment Methods (i.e. Card, Account...) | |
E6905 | Schedule not found | |
E6906 | Invalid Schedule string | |
E6999 | General Customer Auth Decline | General declined. |
D7000 | Record not found | The transaction requested is not available. |
E7001 | Invalid User ID | The user Id provided in request message is invalid. |
E7002 | Record Not Found. | The Transaction is not present in the system. |
E7003 | User Locked. Call CSR | |
E7004 | Invalid Security Question/Answer | Invalid security question and answer. |
E7005 | User Already Logged in | User Already Logged in try after some time. |
E7006 | Your Password has Expired, Please change the password. | Change your password. |
E7007 | User Inactive. Call CSR | |
E7008 | Operator Not Found | The user ID is not registered in the system. |
E7009 | Expired Client Password | The client password is expired. |
E7010 | Invalid Host ID | The Host Id provided in the request message is invalid. |
E7011 | Client Authentication Failed | This message may occur for more than one reason. 1. The manifest included in the request is not configured properly. 2. The Domain Key included in the request manifest is expired. 3. The Host Password included in the request is expired. |
E7012 | Invalid user or password | The User id and password is invalid. |
D7013 | Multiple users with same email. Enter Login ID | |
E7013 | Multiple users with same email. Enter Login ID | There are multiple users with the same email ID. Enter your login ID. |
E7014 | Invalid Manifest | Manifest provided in the request message is invalid. |
E7015 | Invalid Transaction Key | The transaction key provided in the request message is invalid. |
E7016 | Invalid UserID or EmailID | |
D7017 | User Modification Request Failed | |
E7018 | The provided authentication credentials are not correct | |
E7019 | Duplicate Questions/answers not allowed | |
E7020 | The question cannot be same as any of the answers | |
E7021 | Unable to process, retry with terminalNumber | |
E7022 | Unable to process, retry with profileName or profileID | |
E7023 | Unable to find profile | |
E7024 | Security question expired, please fetch a new question | |
E7027 | Unable to process, retry with userID | Multiple entries found for the merchantID and emailID search criteria used. |
E7100 | General Login Decline | General Login Decline. |
E7101 | User_ID already exists | User_ID already exists. |
E7102 | Operation not allowed | Operation not allowed. |
E7103 | Operator not Register/Present | Operator is not Register or Present in the system. |
E7104 | Last active admin operator in the system | The last Active Admin operator in the system. At least one Admin operator should be active for a merchant. |
E7105 | Admin operator cannot change his own status or type | The Admin operator cannot change his own profile details. |
E7106 | Not allowed to add Administrator | The operator is not allowed to add Admin operator. |
E7107 | Input Password does not adhere to complexity norms | The Input Password does not adhere to complexity norms. |
E7108 | New password must not match previous password. Please enter a unique new password | The new password must not match previous password. Please enter a unique new password. |
E7109 | Suspended/Inactive User | The User Id provided in request is Suspended or Inactive. Please reactivate to perform transaction. |
E7110 | Invalid password length | The password length must be between 8 and 20 characters. |
E7111 | Parameter validation Error | |
E7112 | User already exists | |
E7113 | User Credential not active | |
E7114 | Security question not set for user | |
E7200 | General User Admin Decline | General User Admin Decline. |
E7201 | Client not registered to our system. | The client domain name or unique ID is not registered. |
E7202 | Invalid Client Key | The client key is invalid. Re-enter the correct key and resubmit the transaction. |
E7203 | Client Validity Expired, Please re-register | The client validity is expired. Re-register the domain or the unique ID. |
E7204 | Invalid merchant details | |
E7251 | Invalid one time password | The one time password is invalid. Re-enter the correct password and resubmit the transaction. |
E7252 | Duplicate one time password | The one time password is a duplicate. Re-enter the correct password and resubmit the transaction. |
E7253 | One time password validity expired | The one time password has expired. Generate a new password and resubmit the transaction. |
E7254 | Host Operator not allowed | The host operator is not allowed. |
E7255 | Operator is not Host | The operator ID for this transaction is invalid. |
E7256 | Token services cannot be enabled until the merchant account is set up with a token zone | Tokenization service is not enabled for the merchant. |
E7257 | Tokenization service not enabled | Tokenization service not enabled for the merchant. |
E7259 | De-tokenization service not enabled | De-tokenization service is not enabled for the merchant. |
E7260 | De-tokenization UnSuccessful | The token is invalid. Resubmit with a valid token number. |
E7261 | Tokenization UnSuccessful | Service is not available. Resubmit the transaction. |
D7500 | record not found (backend) | The record was not found. |
D7501 | Chargeback Protection is not allowed | The transaction is not eligible for Chargeback Protection. |
E8000 | Customer not found | Customer is not register in our system. |
E8001 | Customer not enrolled | Customer is not register in our system. |
E8002 | Customer Declined | Customer enrollment declined. |
E8003 | Customer Locked | Customer is locked in system. |
E8004 | Invalid user or password | Invalid user or password. |
E8005 | Credit Limit Reached | Max Credit Limit Reached. |
E8006 | Local Opt Out | Local Opt Out. |
E8007 | Invalid Message | Invalid Message |
E8008 | Globally Opted Out phone number | Globally Opted Out phone number |
F8009 | Invalid Email | Invalid Email |
E8900 | System Error | System Error. |
E8999 | General Notify Decline. | General Notify Decline. |
D9000 | Amount Limit Exceeded | Amount Limit Exceeded for transaction. |
D9001 | Transaction count Limit Exceeded | Transaction count Limit Exceeded. |
D9002 | Device activity Limit Exceeded | Device activity Limit Exceeded. |
D9003 | Amount per days Limit Exceeded | Amount per days Limit Exceeded. |
D9004 | Excluded Customer | Customer is excluded to perform transaction at this merchant. |
E9005 | Invalid Cashback amount | Cash back amount provided in request is invalid. Cash back should always be less then transaction amount. |
E9006 | Cashback Amount is not allowed for this type of transaction | Cashback Amount is not allowed for this type of transaction. |
D9007 | Maximum Line Items Exceeded Maximum Line Items Limit Exceeded | |
D9008 | BC limit not set for merchant. BC limit not set for merchant. | |
D9009 | BC buffer percent was not set for merchant. BC buffer percent was not set for merchant | |
D9010 | Invalid Transaction_Info/Service_Code. | The error occurs in the scenarios as follows: 1-Service code is missing in the request. 2-Service code is invalid. 3-Service code is inadequate for this type of transaction. |
D9011 | Net Balance is less than zero | |
D9012 | Invalid Merchant_Info/Agent_Chain_Number must be 6 bytes | |
D9013 | Invalid Transaction type Invalid Transaction type | |
D9014 | Merchant Per Transaction Deposit Limit Exceeded Transaction Deposit Limit Exceeded | |
D9015 | Head Quarter merchant not found. Head Quarter merchant not found. | |
D9018 | No Valid Data Found,Please Generate Token First. | |
D9019 | Invalid Token | |
D9020 | Invalid Transaction_Info/SubServiceCode | The error occurs in the scenarios as follows: 1- Sub service code is missing in request. 2- Sub service code is invalid. 3- Sub service code is inadequate for this type of transaction. |
D9021 | Invalid Transaction_Info/Type. | The error occurs in the scenarios as follows: 1-Type is missing in request. 2-Type is invalid. 3-Type is inadequate for this type of transaction. |
D9022 | Invalid Transaction_Info/Transaction_ID | Transaction ID is expected in request for this transaction. Re-enter the Transaction ID, and resend the transaction. |
D9030 | Invalid Device_Info/Device_Type | Device is inadequate to do this type of transaction. |
D9040 | Invalid Processor_Info/Acquirer_Institute must be 6 bytes | Acquirer_Institute must be 6 bytes. |
D9050 | Invalid Processor_Info/Proc_Merchant_Id must be 12 bytes | Proc_Merchant_Id must be 12 bytes. |
D9070 | Invalid Processor_Info/Processor_Term must be 4 bytes | Processor_Term must be 4 bytes. |
D9080 | Invalid Processor_Info/Store_Number must be 4 bytes | Store_Number must be 4 bytes. |
D9090 | Invalid Merchant_Info/MerchantType | The merchant name is invalid or is not present. |
D9091 | Invalid Merchant_Info/Name | |
D9092 | Invalid Merchant_Info/City | |
D9093 | Invalid Merchant_Info/State | |
D9094 | Invalid Merchant_Info/TimeZone must be 3 bytes | |
D9096 | Invalid Transaction_Info/Time_Stamp must be [MMDDYY HHMMSS] | |
D9100 | Fee Configuration Level must be mentioned | |
D9101 | Fee not configured | |
D9110 | Invalid Merchant_Info/SICCODE must be 4 bytes. | |
D9111 | Invalid Processor_Info/Sequence_Number must be 4 bytes | |
D9120 | Invalid Card_Info/PIN | |
D9130 | Invalid Transaction_Info/Country_Code must be at least 2 bytes. | |
D9140 | Invalid Card_Info/Type | |
D9210 | Invalid Card_Info/PIN | |
D9211 | Invalid Card_Info/Token | |
D9212 | Invalid Card_Info/KSN must be at least 16 chars | |
D9240 | Invalid Merchant_Info/Agent_Bank_Number must be 6 bytes. | |
D9250 | Invalid Merchant_Info/Agent_Chain_Number must be 6 bytes | |
D9260 | Invalid Processor_Info/Batch_Number must be 3 bytes | |
D9270 | Invalid Merchant_Info/Reimburse_Attr must be 1 byte | |
D9280 | Invalid Merchant_Info/ABA_Number must be 9 bytes | |
D9282 | Invalid Merchant_Info/Settle_Agent_Number must be 4 bytes | |
D9283 | Check Out date can not be less than or equal to Check In date | |
D9284 | Transaction amount should not be greater than authorized amount | |
D9286 | Invalid CheckoutID | The checkOutID provided is incorrect. Provide the correct checkOutID. |
D9287 | Duplicate card sequence number | |
E9288 | Invalid Wallet Identifier Format | |
E9289 | Encoded Data is not allowed with checkoutID | |
D9290 | Invalid Transaction_Info/Orig_Purchase_Date must be MMDDHHMM | |
E9291 | Keyed Card Data is not allowed with checkoutID | |
E9292 | Mandatory Tags are missing | |
E9293 | Card Type not supported for requeted service | |
E9294 | terminalData {terminalCapability, terminalOperatingEnvironment, cardholderAuthenticationMethod, terminalAuthenticationCapability, terminalOutputCapability,maxPinLength} group is required | |
E9295 | cardholderAuthenticationMethod must be PIN | |
D9500 | Encryption services not enabled for the device | Encryption services are not enabled for the device. |
D9501 | Encryption service requested not enabled for the device | The device has encryption service but the encryption service requested is not enabled. |
D9502 | Encryption method could not be determined | The device is configured with more than one encryption service. The request does not indicate which service to use. |
D9503 | Decryption unsuccessful | The decryption failed. |
D9504 | Invalid Format Id | |
D9505 | Product Details is required to perform this action | |
D9510 | Invalid Encryption Type | An invalid encryption type was included in the request. |
D9511 | A unique KSN not generated or not sent in request | The application was unable to generate or submit the key serial number. |
D9610 | Data Parsing fail | Data parsing failed. |
D9611 | Encrypted Data not generated or not sent in request | Encrypted data was not received from the host or the application was unable to include this data in the response. |
F9900 | XSD Format Error | XSD Format Error |
F9901 | Format Error field details | Format Error field details |
F9902 | Group encodedCardData is not allowed with cardDataSource value MANUAL | |
F9903 | Group encodedCardData is not allowed with cardDataSource value PHONE | |
F9904 | Group encodedCardData is not allowed with cardDataSource value EMAIL | |
F9905 | Group encodedCardData is not allowed with cardDataSource value INTERNET | |
F9906 | Group keyedCardData is not allowed with cardDataSource value SWIPE | |
F9907 | Invalid cardDataSource for requested service. | |
F9908 | Sum of elements of group additionalCharges should not be greater than transactionAmount. | |
F9909 | cashTendered must not be less than transactionAmount | |
F9910 | lastChipRead is Mandatory with Fallback Swipe (Icc Terminal Error) transaction | |
F9911 | lastchipRead is not Allowed with Fallback Swipe (Empty Candidate List) transaction | |
F9912 | Invalid content, one of {track1Data, track2Data, track3Data} is required | |
F9913 | Invalid content, {encodedCardData, keyedCardData or swipedCardData} is not Allowed with Chip Card | |
F9914 | emvFallbackCondition is Mandatory with Fallback Swipe transaction | |
F9915 | voidReason is Mandatory for Chip Card transaction | |
F9916 | Fallback Swipe allowed with track2Data only | |
F9917 | Invalid emvTags, {9F1F or 9F20 or 57 or 5A} | Tags 9F1F, 9F20, 57 and 5A are not allowed if encryptionType is VOLTAGE |
F9918 | Invalid content, {track1Data, track3Data, emulatedTrackData} is not Allowed with Chip Card and encryptionType | track1Data, track3Data, and emulatedTrackData are not allowed if encryptionType is VOLTAGE |
Other Errors
Error Description | Reason | Location |
---|---|---|
"Unable to decode the Model" | The Json you sent doesn’t match a valid input | Any endpoint. |
“The (entity) could not be saved because of an unmanaged exception” | An unknown reason didn’t allow the system to save the entity. Please contact support. | Any endpoint |
“Update (entity) did not finish correctly because of an unmanaged exception” | An unknown reason didn’t allow the system to update the entity. Please contact support. | Any endpoint |
“The (entity) could not be retrieved because of an unmanaged exception” | An unknown reason didn’t allow the system to retrieve the entity. Please contact support. | Any endpoint |
“No Devices were found for the given User/Merchant relationship” | You sent a device GUID that does not belong to a merchant administrated by the logged user. Please try with a different GUID. | Any transaction endpoint |
“No Merchant was found for the current User” | You sent a device GUID that does not belong to a merchant administrated by the logged user. Please try with a different GUID. | Any transaction endpoint |
“Invalid Routing Number: invalid digit” | You sent and invalid Routing Number. Please try with a different one. | Create Bank Clearing |
“Invalid Routing Number: digit check failed” | You sent and invalid Routing Number. Please try with a different one. | Create Bank Clearing |
“An error occurred while executing Transaction General Check” | There is some inconsistence between your devices, Merchant Processor accounts and Merchants. Please contact support. | Any transaction endpoint. |
“Invalid Device GUID” | You sent a device GUID that does not exist at all. Please try with a different GUID. | Any transaction endpoint. |
“BankAccount reference not found.” | You sent an invalid BankAccount GUID. Please try with a different GUID. | Create Bank Clearing. |
“At least one of SSN4 or DateOfBirth are required.” | You attempted to create a bank clearing without providing SSN4 or Date of Birth of the bank account owner. Please provide any of those two. | Create Bank Clearing. |
The DriverLicenseState and DriverLicenseNumber fields are required. | You didn’t provide Driver License State nor Driver License Number. | Create Bank Clearing. |
“The transaction was not originated in any device of the current user.” | You are trying to void or refund a sale or bank clearing that was run on a device that is not administrated by the logged user. | Void Bank Clearing, Refund Bank Clearing, Void Sale, Refund Sale |
“There was a database error” | There was some inconsistence on the database, please contact support. | Any endpoint. |
“The related clearing is not settled. It can be voided only” | You attempted to refund a not settled bank clearing. | Refund Bank Clearing. |
“The related clearing is already voided” | You attempted to void or refund an already voided Bank Clearing. | Void Bank Clearing, Refund Bank Clearing. |
“The related clearing is already returned” | You attempted to void or refund an already refunded Bank Clearing. | Void Bank Clearing, Refund Bank Clearing. |
“The related clearing was not processed, therefore it cannot be voided” | You attempted to void or refund a Bank Clearing that didn’t run successfully. | Void Bank Clearing, Refund Bank Clearing. |
“Invalid (entity) GUID” | You attempted to void or refund a Bank Clearing or a Sale or to capture an Auth Only using an invalid Guid. | Capture Auth Only, Void Sale, Refund Sale, Void Bank Clearing, Refund Bank Clearing. |
“No (entity) could be found for the given Id” | You attempted to updated or retrieve an entity using an invalid Guid. | Any endpoint. |
“Credit Cards not allowed for this processor” | You attempted to run a Sale or Auth Only on a Merchant Processor Account that is Debit Only. | Create Auth Only, Create Sale. |
“Debit Cards not allowed for this processor” | You attempted to run a Sale or Auth Only on a Merchant Processor Account that is Credit Only. | Create Auth Only, Create Sale. |
“The (transaction) could not be processed correctly. Error code (error code). Error message: (error message)” | The transaction didn’t run for reason provided by the processor. If you have any question regarding this error, please contact support. | Any transaction endpoint. |
“No open batch” | For some reason, there was no open batch when you attempted to run a sale or auth only. Please contact support. | Create Auth Only, Create Sale. |
“Invalid CardDataSource” | You provided an invalid card data source. | Create Auth Only, Create Sale. |
“The (transaction) amount must be greater than zero” | You provided a negative or zero amount for the transaction. | Any transaction endpoint. |
“The (transaction) could not be fetched because of an unmanaged exception” | Something when wrong when trying to retrieve the entity. Please contact support. | Any endpoint. |
“There is an approved Capture for this AuthOnly already” | You attempted to capture an already captured Auth Only. | Create Capture. |
“The referenced AuthOnly and this Capture devices are not from the same MerchantAccount” | You attempted to capture an AuthOnly using a device guid belonging to a different merchant processor account. | Create Capture. |
“The Capture AuthOnlyGuid value does not have matching results.” | You attempted to capture an AuthOnly using an invalid Auth Only Guid. | Create Capture. |
“There is no Batch for the given guid.” | For some reason, there was no open batch when you attempted to run the transaction. Please contact support. | Any transaction endpoint. |
“Only one of Bank Account or Card can be used.” | You sent both, a Credit Card and a Bank Account, when trying to create a Recurring Billing | Create Recurring Billing. |
“The device hierarchy and settings could not be loaded” | Something is wrong with the merchant processor account of the device you provided. Please contact support. | Create Recurring Billing. |
“The current Merchant Processor Account does not allow Tokenization. Tokenization is required to create Recurring Billings.” | You provided a device guid belonging to a merchant processor account that does not have Tokenization activated. | Create Recurring Billing. |
“The setup of this device does not allow this operation. Processor Transaction Type is not Card nor ACH” | You provided a Credit Card for an ACH Merchant Processor Account or a Bank Account for a Credit Card Merchant Processor Account. | Create Recurring Billing. |
“Required data for a Recurring Billing with Card are: FirstName, LastName, Email and Phone” | You’re missing at least one of First Name, Last Name, Email or Phone when trying to create a Recurring Billing using a credit card. | Create Recurring Billing. |
“An Email is required for a Recurring Billing with ACH” | You’re missing e-mail address when trying to create a Recurring Billing using a Bank Account | Create Recurring Billing. |
“There are no payments to be generated for the given parameters (StartDate, EndDate, PaymentCount, Interval, IntervalValue)” | You sent a combination of parameters that didn’t result in any possible payment. | Create Recurring Billing. |
“Invalid Card or Bank Account” | You provided an invalid credit card or an invalid bank account when trying to create a recurring billing. | Create Recurring Billing. |
“Customer data not present” | You provided a Credit Card or Bank Account without the customer’s information. | Create Recurring Billing. |
“Invalid Interval. The 'every' value must be the only value.” | You sent both, an “every” interval and a list of custom dates | Create Recurring Billing. |
“Invalid Interval/IntervalValue” | You provided an invalid combination of the interval and its values. | Create Recurring Billing. |
“An error occurred while parsing the CustomDates” | At least one of the custom dates you provided is not properly formatted | Create Recurring Billing. |
“There is a date in the CustomDates smaller than the StartDate” | At least one of the custom dates you provided is previous to the StartDate you provided. | Create Recurring Billing. |
“The EndDate must be greater than the greatest CustomDate” | At least one of the custom dates you provided is posterior to the EndDate you provided. | Create Recurring Billing. |
“EndDate must be submitted for CustomDates” | You provided a list of CustomDates but not an EndDate | Create Recurring Billing. |
“Invalid InertervalValue: this interval does not allow values” | You selected an interval that does not require interval values. | Create Recurring Billing. |
“Invalid Interval, you must explicit an IntervalValue” | You selected an interval that requires IntervalValue and you did not send it. | Create Recurring Billing. |
“Invalid Interval” | You sent a wrong Interval name. | Create Recurring Billing. |
“End Date must be after start date” | You sent an End Date that is posterior to the Start Date you sent | Create Recurring Billing. |
“The Start Date cannot be earlier than today” | You sent a Start Date previous to the current date. | Create Recurring Billing. |
“Just one of End Date or Payment Count values are required, not both” | You sent both “EndDate” and “PaymentCount”. Please send one or the other one, but not the both together. | Create Recurring Billing. |
“Either one of End Date or Payment Count values are needed” | You didn’t send “EndDate” neither “PaymentCount”. Please send at least one of them. | Create Recurring Billing. |
“The Payment Count value must be greater than 0” | You sent PaymentCount with a value equal or less than 0 | Create Recurring Billing. |
“The current status of the Recurring Billing is final and does not allow any updates.” | The Recurring Billing finished on scheduled, was deactivated or wasn’t created correctly so its status cannot be change. | Update Recurring Billing. |
“Invalid Status” | You sent a wrong status name. | Any Update endpoint. |
“Invalid Amount, it cannot be 0. If you wish to cancel the Recurring Billing, set the status to Deactivated” | You sent Amount with a 0 value. | Update Recurring Billing. |
“A database related error occurred B.RBB.04” | Something went wrong when trying to retrieve the scheduled payments. Please contact support. | Get Recurring Billing. |
“Either the SaleGuid or SaleReferenceNumber are required” | You didn’t send SaleGuid neither SaleReferenceNumber. Please send one of them. | Create Return. |
“You can't return a sale run more than 180 days ago” | You attempted to return a sale that was run 180 days ago. | Create Return. |
“The Return Amount must be greater than zero” | You sent Amount with a value equal or less than 0 | Create Return. |
“Original Amount exceeded” | You attempted to return an amount greater than the original sale amount | Create Return. |
“Sale has been voided” | You attempted to return a voided sale. | Create Return. |
“Sale has not been settled” | You attempted to return a sale of which batch has not been closed. | Create Return. |
“The referenced Sale and this Return devices are not from the same MerchantAccount” | You sent a device guid belonging to a merchant processor account different from the one where the sale was run. | Create Return. |
“The current invoice status does not allow a payment” | Invoice was already paid, cancelled or has not been sent yet so it cannot be paid. | Create Sale. |
“The sale amount does not match the invoice amount” | You sent and Invoice Guid, but the sale amount does not match the amount of that invoice. | Create Sale. |
“The calculated amount after Discount and/or DualPricingFeeAmount and GrossAmount does not match the Amount value” | You sent GrossAmount and Discount and/or DualPricingFeeAmount, but the amount you sent does not match the result of Amount=GrossAmount-Discount+DualPricingFeeAmount | Create Sale. |
“If Discount and/or DualPricingFeeAmount are submitted, the GrossAmount value is required” | You sent Discount and or DualPricingFeeAmount but you didn’t send GrossAmount. | Create Sale. |
“Unable to find the device where the original sale was run.” | You’re trying to charge a fee (or to reattempt a sale) over sale we cannot find the device where it ran. Please contact support. | Charge Fee, Reattempt sale. |
“There are no active Fee Charger devices for your Merchant Processor Account” | You’re trying to charge a fee but you haven’t setup a Fee Charger device yet. | Charge Fee. |
“Unable to charge fee for sale” | System was not able to charge the fee for the selected sale for some unknown reason. Please contact support. | Charge Fee. |
“Unable to run sale again” | System was not able to run the selected sale again for some unknown reason. Please contact support. | Reattempt sale. |
“Original Sale not found” | You sent an invalid Sale Guid | Reattempt sale. |
“Card for original Sale not found” | We were not able to find the card used on the original sale. Please contact support. | Reattempt sale. |
“Tax Rate submitted without declaring Tax Type” | You sent TaxRate but not TaxType. | Create Sale, Create AuthOnly, Create Capture. |
“Tax Rate submitted without declaring Tax Amount” | You sent TaxRate but not TaxAmount. | Create Sale, Create AuthOnly, Create Capture. |
“An error occurred while saving the EnhancedData” | Something went wrong when trying to save tax information. Please contact support. | Create Sale, Create AuthOnly, Create Capture. |
“An error occurred while retrieving the EnhancedData” | Something went wrong when trying to get tax information. Please contact support. | Get Sale, Get AuthOnly, Get Capture. |
“The underlying Sale was not processed correctly. A Tip Adjustment cannot be made” | You attempted to add a tip to a sale that didn’t run successfully. | Create Tip Adjustment. |
“The TipAdjustment could not be processed correctly B.TA.C01” | Something went wrong when trying to add the tip to the sale. Please contact Support. | Create Tip Adjustment. |
“The Sale belongs to a closed batch. Tip Adjustments can only be made on open batches B.TA.C02” | You attempted to create a tip for a sale that is already settled. | Create Tip Adjustment. |
“Sale not found B.TA.C03” | You sent an invalid Sale Guid | Create Tip Adjustment. |
“Invalid Device GUID B.TA.C04” | You sent an invalid Device Guid. | Create Tip Adjustment. |
“Card Verification does not allow Swiped requests. B.VB.C06” | You sent track1 and/or track2. Please send a keyed card. | Create Verify. |
“Card Verification does not allow EMV requests. B.VB.C07” | You sent EMV data. Please send a keyed card. | Create Verify. |
“There is no card match for the given Token. B.VB.C01” | You sent a tokenized card but we were not able to find the original card number. | Create Verify. |
“The Verify could not be processed correctly. B.VB.C05” | The Verify didn’t run successfully for an unknown reason. Please contact support. | Create Verify. |
“One of SaleGuid, AuthOnlyGuid, ReturnGuid, SaleReferenceNumber, AuthOnlyReferenceNumber or ReturnReferenceNumber fields is required” | You didn’t say any Guid or Reference Number of the transaction you want to void. | Create Void. |
“Only one of SaleGuid, AuthOnlyGuid, ReturnGuid, SaleReferenceNumber, AuthOnlyReferenceNumber or ReturnReferenceNumber fields can be accepted” | You sent more than one Guid belonging to different kind of transactions. | Create Void. |
“The AuthOnly cannot be voided because it has been captured already” | You attempted to void an AuthOnly that has been already captured. Please try voiding the Sale generated instead. | Create Void. |
“No device found for the underlying transaction” | No active device was found for the transaction you’re trying to void. | Create Void. |
“Sale cannot be voided because it was not processed” | You attempted to void a sale that didn’t run successfully. | Create Void. |
“AuthOnly cannot be voided because it was not processed” | You attempted to void an auth only that didn’t run successfully. | Create Void. |
“Return cannot be voided because it was not processed” | You attempted to void a return that didn’t run successfully. | Create Void. |
“Transaction already settled” | You attempted to void a transaction of which batch has already been closed | Create Void. |
“No open batch available” | For some reason, there is no open batch to process your transaction. Please contact support. | Any Create Transaction endpoint. |
“Expiration date is required if the Card number is being sent. B.CB.GS01” | You sent a Card Number but no expiration date. | Create Sale, Create AuthOnly, Create Recurring Billing, Create Verify. |
“Expiration date is required if the Card is being swiped. B.CB.GS02” | You sent track1 and/or track2 but no expiration date. | Create Sale, Create AuthOnly. |
“The current Merchant Processor Account does not allow Swiped transactions. B.CB.GS03” | You provided a Device Guid that belongs to a Merchant Processor Account that does not allow swiped transactions. Please try with a different device Guid. | Create Sale, Create Auth Only. |
“The current Merchant Processor Account does not allow EMV transactions. B.CB.GS04” | You provided a Device Guid that belongs to a Merchant Processor Account that does not allow EMV transactions. Please try with a different device Guid. | Create Sale, Create Auth Only. |
“For EMV, required fields are EMVTags and ExpirationDate B.CB.GS05” | You’re missing either EmvTags or ExpirationDate fields (or both) when trying to run an EMV transaction. | Create Sale, Create Auth Only. |
“Tags missing B.CB.GS06” | You’re missing at least one required tag for an EMV transaction. | Create Sale, Create Auth Only. |
“Unexpected error: Card without token.” | We were not able to tokenize the card. Please contact support. | Create Sale, Create AuthOnly, Create Recurring Billing, Create Verify. |
“The Card tokenization could not be processed.” | Processor were not able to tokenize the card. Please contact support. | Create Sale, Create AuthOnly, Create Recurring Billing, Create Verify. |
“Card number, track1data or track2data missing” | You didn’t say any of cardNumber, track1data or track2data. Please provide at least one of them. | Create Sale, Create AuthOnly, Create Recurring Billing, Create Verify. |
“Invalid DriverLicenseState name” | You provided a wrong short name for Driver License State | Create Bank Clearing, Create Bank Account. |
“As a Credit Card device, the ProcessorId, ProcessorOperatingUserId and ProcessorPassword data are required.” | You’re missing at least one of ProcessorId, ProcessorOperating UserId or ProcessorPassword | Create Device. |
“As an ACH device, the ProcessorLocationId data is required.” | You’re missing ProcessorLocationId | Create Device. |
“As an ACH device, the TerminalNumber data is required.” | You’re missing TerminalNumber. | Create Device. |
“Only one Fee Charger active device is allowed per Merchant Processor Account” | You’re trying to create a device with FeeCharger=true for a Merchant Processor Account that already has an active Fee Charger Device | Create Device. |
“Only one Mobile active device is allowed per Merchant Processor Account” | You’re trying to create a device with IsMobile=true for a Merchant Processor Account that already has an active Mobile Device. | Create Device. |
“In order to create a Virtual Terminal, the Merchant Processor Account where you're attempting to create this device must have setup an Auto Close Batch time.” | You’re trying to create a device with IsVirtualTerminal=true for a Merchant Processor Account that hasn’t set an Auto Close Batch time yet. | Create Device. |
“The processor failed to return the Device Parameters. B.DB.04” | Processor was not able to return the device data. Please contact support. | Create Device. |
“An error occurred while requesting the processor parameters for this device. B.DB.02” | System was not able retrieve device data from the processor. Please contact support. | Create Device. |
“An error occurred while requesting the processor parameters for this device. B.DB.03” | Something went wrong when system sent device parameters to processor. Please contact support. | Create Device. |
“Device updated. Device status changed to Paused because of an error.” | Device was updated, but something went wrong so it was paused. Please contact support. | Create Device. |
“There are no active Fee Charger devices for your Merchant Processor Account” | No active device with FeeCharger=true was found. | Charge Fee. |
“checkIpIsAllowed failed to check if endpoint is allowed to be run from IP” | You tried to run an endpoint that is not allowed to be run from your IP address. | Protected endpoints. |
“The user does not have permission to do this” | You attempted to run an endpoint that is not allowed for your user profile. | Any endpoint. |
“A server error has occurred. The operation could not be finished.” | A general error occurred. Please contact support. | Any endpoint. |
“Hosted Payment Page Request expired” | You attempted to see the preview or to confirm the transaction of a Hosted Payment Page request of which token has already expired. | HostedPaymentPageRequests – Get Preview, HostedPaymentPageRequests – Confirm Transaction |
“Hosted Payment Page Request TempToken already used” | You attempted to see the preview or to confirm the transaction of a Hosted Payment Page request of which token has already been used. | HostedPaymentPageRequests – Get Preview, HostedPaymentPageRequests – Confirm Transaction |
“SendDate cannot be earlier than today” | You sent a SendDate previous to current date. | Create Invoice. |
“PaymentDate cannot be earlier than today” | You sent a PaymentDate previous to CurrentDate | Create Invoice. |
“Send Status not allowed” | You sent a SendSatus different from “Draft” or “Scheduled To be Sent” | Create Invoice. |
“Invalid SendStatus” | You sent a wrong SendStatus | Create Invoice. |
“Invalid PaymentTerm” | You sent a wrong PaymentTerm | Create Invoice. |
“Forbidden SendStatus” | You’re trying to update the SendStatus of an invoice that has been already sent and cannot be updated. | Update Invoice. |
“Invalid PaymentStatus” | You sent a wrong PaymentStatus | Update Invoice. |
“A database related error occurred B.Iv.01” | We were not able to retrieve the invoice because of a database error. Plase contact support. | Get Invoice |
“The current invoice status does not allow modifications” | Invoice has been already sent and cannot be updated. | Update Invoice, Update Invoice Detail |
“The current detail is deleted, no changes are allowed” | Invoice Detail has been deleted and cannot be updated. | Update Invoice Detail. |
“A database related error occurred B.IvD.01” | Invoice Detail or Invoice Reminder could not be retrieved because of a database error. Please contact support. | Get Invoice Detail, Get Invoice Reminder. |
“For a custom reminder, date is required” | You sent a customized reminder but you didn’t include the reminder’s date. | Create Invoice Reminder. |
“The current invoice payment status does not allow a new reminder” | Invoice is already paid and a new reminder cannot be created. | Create Invoice Reminder. |
“Reminder date cannot be earlier than send date” | You attempted to generate a reminder of which date is previous to the send date of the invoice. | Create Invoice Reminder. |
“Reminder date cannot be earlier than today” | You attempted to generate a reminder of which date is previous to current date. | Create Invoice Reminder. |
“For this invoice there is an active reminder for this date already” | You attempted to generate a reminder of which date is the same one another active reminder for the same invoice has. | Create Invoice Reminder. |
“The reminder is completed, it cannot be updated” | You’re trying to update a reminder that has already been executed. | Update Invoice Reminder. |
“Days not specified” | Something went wrong when trying to calculate the date of the reminder. Please try with a different value. | Create Invoice Reminder, Update Invoice Reminder. |
“Invalid Parent Iso Number” | You provided a wrong Iso Number for ParentIso | Create Iso |
“Iso Fees and Discount rate can be null or zero, but cannot be negative” | You sent a negative amount for at least one of the fees. | Create Iso |
“User does not have the Merchant Admin role assigned.” | You assigned as merchant’s admin a user that does not have the Merchant Admin Role | Create Merchant |
“Merchant Processor Account Fees and Discount rate can be null or zero, but cannot be negative” | You sent a negative amount for at least one of the fees. | Create Merchant Processor Account |
“AutoClose is available for Credit Card only” | You attempted to set “AutoClose=true” for an ACH Merchant Processor Account. | Create Merchant Processor Account, Update Merchant Processor Account |
“Subisos cannot setup fees lower than those established by its Parent Iso” | You attempted to create or update a merchant processor account and setup fees lower than the ones your parent iso charges. | Create Merchant Processor Account, Update Merchant Processor Account |
“Invalid context. Allowed values are: Invoice, i, RecurringBilling, rb” | You sent an invalid context | Get Merchant Product, Get Merchant Product List |
“A database related error occurred B.MPB.01” | Something went wrong at the database level when trying to retrieve something related with merchant product. | Get Merchant Product, Get Merchant Product List, Get Merchant Product List Detail. |
“The authenticated user does not have permission to perform this operation.” | Your user role does not have permission to run the endpoint you’re pointing to. Please try with a different endpoint or contact support to get a new role. | Any endpoint. |
“Invalid State name” | You sent a wrong US State short name. | Any endpoint. |
“Invalid Invoice Customer” | You sent a wrong InvoiceCustomer Guid | Create Invoice, Update Invoice. |
“Iso number not found” | You sent a wrong Iso Number | Register Account |
“Unable to remove Merchant Admin Profile. User is still admin of the following merchants:” | You’re trying to remove the Merchant Admin profile to a user who is still admin of some merchants. Remove the user from the admin list on each of the merchants listed | Update User Role |
“Unable to decode the Model” | You sent a wrong Json for the endpoint you pointed to | Any endpoint. |
“Invalid ModelState” | You sent a wrong Json for the endpoint you pointed to | Any endpoint. |
“NoResultFound204” | You sent a search or called a Get All endpoint that generated no results | Any get all endpoint, Any search endpoint. |
“Unable to reach entity” | You sent an invalid Guid | Any get endpoint. |
“Wrong emailType” | You sent an invalid e-mail address | Resend Email. |
“Invalid TempToken” | You sent a wrong temporal token | HostedPaymentPageRequests – Confirm Transaction |
“Operation is only available for Sandbox url” | You attempted to create a user using an endpoint only available for Sandbox | Create User |
“Iso is not active.” | You sent an Iso Number belonging to an inactive iso | Register Account. |
“Username does not exist” | You sent a username that does not exist at all | Reset Password Request. |
“Key expired” | You attempted to reset a password using a key that is expired. | Reset Password. |
“Key does not exist” | You attempted to reseat a password using a key that does not exist at all. | Reset Password. |
“Invalid State” | You sent a wrong US State short name. | Any endpoint. |
“Invalid Status” | You sent a wrong status name. | Any endpoint. |