NAV Navbar
csharp Json

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

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

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

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

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

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

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.
Email 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

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

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

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

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

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

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

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

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

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.
Email 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

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

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

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

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

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.
Email 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

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.
Email 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

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.
Email 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

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

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

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

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.
Email 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

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

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

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

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

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

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

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

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"