### GET Products Response Examples Source: https://help.usaepay.info/api/rest Examples of the JSON or object structure returned by the GET /products endpoint across different programming languages. ```javascript var response = { "type": "list", "limit": "0", "offset": "20", "data": [ { "type": "product", "key": "80v96p6rx2k6sktw", "product_refnum": "2", "name": "Botts Every Flavor Beans", "price": "2.00", "enabled": "True", "taxable": "True", "categoryid": "1238710", "commodity_code": "3122", "description": "Every flavor you can imagine and then some.", "list_price": "3.00", "manufacturer": "Jelly Belly", "merch_productid": "EXA1234", "physicalgood": "True", "ship_weight": "1.2 oz", "sku": "123456789", "upc": "999999999", "weight": "1.2 oz", "wholesale_price": "3.22", "created": "", "modified": "", }, ], "total": "42",} ``` ```php "list", "limit"=>"0", "offset"=>"20", "data"=>[ (object)[ "type"=>"product", "key"=>"80v96p6rx2k6sktw", "product_refnum"=>"2", "name"=>"Botts Every Flavor Beans", "price"=>"2.00", "enabled"=>"True", "taxable"=>"True", "categoryid"=>"1238710", "commodity_code"=>"3122", "description"=>"Every flavor you can imagine and then some.", "list_price"=>"3.00", "manufacturer"=>"Jelly Belly", "merch_productid"=>"EXA1234", "physicalgood"=>"True", "ship_weight"=>"1.2 oz", "sku"=>"123456789", "upc"=>"999999999", "weight"=>"1.2 oz", "wholesale_price"=>"3.22", "created"=>"", "modified"=>"", ], ], "total"=>"42", ] ``` ```json { "type": "list", "limit": "0", "offset": "20", "data": [ { "type": "product", "key": "80v96p6rx2k6sktw", "product_refnum": "2", "name": "Botts Every Flavor Beans", "price": "2.00", "enabled": "True", "taxable": "True", "categoryid": "1238710", "commodity_code": "3122", "description": "Every flavor you can imagine and then some.", "list_price": "3.00", "manufacturer": "Jelly Belly", "merch_productid": "EXA1234", "physicalgood": "True", "ship_weight": "1.2 oz", "sku": "123456789", "upc": "999999999", "weight": "1.2 oz", "wholesale_price": "3.22", "created": "", "modified": "" } ], "total": "42" } ``` ```csharp IDictionary response = new Dictionary(); response\["type"\]="list"; response\["limit"\]="0"; response\["offset"\]="20"; IList> data = new List>(); IDictionary dataItem = new Dictionary(); dataItem\["type"\]="product"; dataItem\["key"\]="80v96p6rx2k6sktw"; dataItem\["product_refnum"\]="2"; dataItem\["name"\]="Botts Every Flavor Beans"; dataItem\["price"\]="2.00"; dataItem\["enabled"\]="True"; dataItem\["taxable"\]="True"; dataItem\["categoryid"\]="1238710"; dataItem\["commodity_code"\]="3122"; dataItem\["description"\]="Every flavor you can imagine and then some."; dataItem\["list_price"\]="3.00"; dataItem\["manufacturer"\]="Jelly Belly"; dataItem\["merch_productid"\]="EXA1234"; dataItem\["physicalgood"\]="True"; dataItem\["ship_weight"\]="1.2 oz"; dataItem\["sku"\]="123456789"; dataItem\["upc"\]="999999999"; dataItem\["weight"\]="1.2 oz"; dataItem\["wholesale_price"\]="3.22"; dataItem\["created"\]=""; dataItem\["modified"\]=""; data.Add(dataItem); response\["data"\]="data"; response\["total"\]="42"; ``` -------------------------------- ### GET /customers/:custkey:/payment_methods Examples Source: https://help.usaepay.info/api/rest Examples of retrieving payment methods for a specific customer in various programming languages. ```javascript var response = { "type": "list", "limit": "0", "offset": "20", "data": [ { "key": "x8KccrxeydHJ4MmT", "type": "customerpaymentmethod", "method_name": "Example method", "cardholder": "Testor Jones", "expiration": "0426", "ccnum4last": "xxxxxxxxxxxxxx7779", "card_type": "Visa", }, ], "total": "1",} ``` ```php "list", "limit"=>"0", "offset"=>"20", "data"=>[ (object)[ "key"=>"x8KccrxeydHJ4MmT", "type"=>"customerpaymentmethod", "method_name"=>"Example method", "cardholder"=>"Testor Jones", "expiration"=>"0426", "ccnum4last"=>"xxxxxxxxxxxxxx7779", "card_type"=>"Visa", ], ], "total"=>"1", ] ``` ```json { "type": "list", "limit": "0", "offset": "20", "data": [ { "key": "x8KccrxeydHJ4MmT", "type": "customerpaymentmethod", "method_name": "Example method", "cardholder": "Testor Jones", "expiration": "0426", "ccnum4last": "xxxxxxxxxxxxxx7779", "card_type": "Visa" } ], "total": "1" } ``` ```csharp IDictionary response = new Dictionary(); response["type"]="list"; response["limit"]="0"; response["offset"]="20"; IList> data = new List>(); IDictionary dataItem = new Dictionary(); dataItem["key"]="x8KccrxeydHJ4MmT"; dataItem["type"]="customerpaymentmethod"; dataItem["method_name"]="Example method"; dataItem["cardholder"]="Testor Jones"; dataItem["expiration"]="0426" dataItem["ccnum4last"]="xxxxxxxxxxxxxx7779"; dataItem["card_type"]="Visa"; data.Add(dataItem); response["data"]="data"; response["total"]="1"; ``` -------------------------------- ### Create Product SDK Examples Source: https://help.usaepay.info/api/rest Examples for creating a product using various language-specific SDKs. ```javascript var request = { "name": "Botts Every Flavor Beans", "price": "2.00", "enabled": "True", "taxable": "True", "categoryid": "1238710", "commodity_code": "3122", "description": "Every flavor you can imagine and then some.", "list_price": "3.00", "manufacturer": "Jelly Belly", "merch_productid": "EXA1234", "physicalgood": "True", "ship_weight": "1.2 oz", "sku": "123456789", "upc": "999999999", "weight": "1.2 oz", "wholesale_price": "3.22",} var response = usaepay.Products\Post(request); ``` ```php "Botts Every Flavor Beans", "price"=>"2.00", "enabled"=>"True", "taxable"=>"True", "categoryid"=>"1238710", "commodity_code"=>"3122", "description"=>"Every flavor you can imagine and then some.", "list_price"=>"3.00", "manufacturer"=>"Jelly Belly", "merch_productid"=>"EXA1234", "physicalgood"=>"True", "ship_weight"=>"1.2 oz", "sku"=>"123456789", "upc"=>"999999999", "weight"=>"1.2 oz", "wholesale_price"=>"3.22", ]; $response = USAePay\Products\Post($request); ``` ```java Map request = new HashMap(); request.put("name","Botts Every Flavor Beans"); request.put("price","2.00"); request.put("enabled","True"); request.put("taxable","True"); request.put("categoryid","1238710"); request.put("commodity_code","3122"); request.put("description","Every flavor you can imagine and then some."); request.put("list_price","3.00"); request.put("manufacturer","Jelly Belly"); request.put("merch_productid","EXA1234"); request.put("physicalgood","True"); request.put("ship_weight","1.2 oz"); request.put("sku","123456789"); request.put("upc","999999999"); request.put("weight","1.2 oz"); request.put("wholesale_price","3.22"); String response = ""; response = USAePay.Products.post(request); ``` ```csharp IDictionary request = new Dictionary(); request["name"]="Botts Every Flavor Beans"; request["price"]="2.00"; request["enabled"]="True"; request["taxable"]="True"; request["categoryid"]="1238710"; request["commodity_code"]="3122"; request["description"]="Every flavor you can imagine and then some."; request["list_price"]="3.00"; request["manufacturer"]="Jelly Belly"; request["merch_productid"]="EXA1234"; request["physicalgood"]="True"; request["ship_weight"]="1.2 oz"; request["sku"]="123456789"; request["upc"]="999999999"; request["weight"]="1.2 oz"; request["wholesale_price"]="3.22"; var response = USAePay.API.Products.Post(request); ``` -------------------------------- ### cURL Request Example Source: https://help.usaepay.info/api/rest Example of how to retrieve a product using a cURL command. ```bash curl -X GET https://sandbox.usaepay.com/api/v2/products/4s4b4qrn3k4pmsg8 -H "Authorization: Basic XzduMjhub0YwOTVoNTh5bUM2UjhIODcyRlp2MnI5Z1o6czIvZTRiZTVhZjU3YTZkOWUwZDQ0ZDM2ZGQ0N2I1ZGU4NzYvYjNiZTJhOGMxZDk2NGZmZGQzNjYyMjg2NDE4MmQwMzA4MTg3OGYyZDc2MDdiODIyMTQzOTYyN2U4Y2Y5ZmQyNA==" -H "Content-Type: application/json" ``` -------------------------------- ### QuickSale Example Request Source: https://help.usaepay.info/api/rest An example of how to perform a QuickSale using a trankey to reference a previous transaction. ```bash curl -X POST https://sandbox.usaepay.com/api/v2/transactions -H "Content-Type: application/json" -H "Authorization: Basic X1Y4N1F0YjUxM0NkM3ZhYk03UkMwVGJ0SldlU284cDc6czIvYWJjZGVmZ2hpamtsbW5vcC9iNzRjMmZhOTFmYjBhMDk3NTVlMzc3ZWU4ZTIwYWE4NmQyYjkyYzNkMmYyNzcyODBkYjU5NWY2MzZiYjE5MGU2" -d `{ "command": "quicksale", "trankey": "gnfkd12yhsr7mbs", "amount": "5.00" }` ``` -------------------------------- ### cURL Request Example Source: https://help.usaepay.info/api/rest Example of how to perform the GET request using cURL with authentication headers. ```bash curl -X GET https://secure.usaepay.com/api/v2/customers/ksddgpqgpbs5zkmb/payment_methods/ln02pc6vxy98c79cs -H "Content-Type: application/json" -H "Authorization: Basic X3JMRnlVczMya0pjN2VkNzlJaFBNMGgwdzM4MUxSaEQ6czIvMGM1MjZiYjYzZGI0MmVhZTRhOTY2NGM4NjFjMzljNTgvNGYxNDI3MTI0Y2Y1ZjliMzEwNjkyYzI2ZmU5YmVlZWNmMjQwMTI0YTFjYmRjNzI2MWM0NTg1ZTA2N2RkMDIyNA==" ``` -------------------------------- ### Retrieve Batch by Key SDK Examples Source: https://help.usaepay.info/api/rest Code examples for retrieving a batch using various SDKs. ```javascript var request = { "batch_key": "Example_batch_key",} var response = usaepay.Batches\Get(request); ``` ```php "Example_batch_key", ]; $response = USAePay\Batches\Get($request); ``` ```java Map request = new HashMap(); request.put("batch_key","Example_batch_key"); String response = ""; response = USAePay.Batches.get(request); ``` ```csharp IDictionary request = new Dictionary(); request["batch_key"]="Example_batch_key"; var response = USAePay.API.Batches.Get(request); ``` -------------------------------- ### Initiate Payment Request Source: https://help.usaepay.info/api/rest Example requests to start a payment transaction, including amount details, billing information, and line items. ```javascript var request = { "devicekey": "sa_YdebDV6I2q0MfWV8kPDvQkHEvUjpA", "command": "sale", "amount": "2.11", "amount_detail": { "subtotal": "40.00", "tax": "10.00", "enable_partialauth": "false", }, "timeout": "150", "block_offline": "true", "ignore_duplicate": "true", "save_card": "true", "manual_key": "true", "prompt_tip": "true", "invoice": "123456", "ponum": "987654321", "orderid": "12345678", "description": "sample description", "billing_address": { "company": "Hogwarts School of Witchcraft and Wizardry", "street": "123 Astronomy Tower", "postalcode": "10005", }, "shipping_address": { "company": "Hogwarts School of Witchcraft and Wizardry", "street": "123 Astronomy Tower", "postalcode": "10005", }, "lineitems": [ { "name": "Antique Pensieve", "description": "See into your past...", "size": "Large", "color": "Bronze", "cost": "450.00", "list_price": "500.00", "qty": "1", "sku": "68453423", "commoditycode": "535", "discountamount": "0", "discountrate": "0", "taxable": "", "taxamount": "45.00", "taxclass": "NA", "taxrate": "10", "um": "EA", "category": "Antiques", "manufacturer": "The Ancients", }, ],} var response = usaepay.Paymentengine.Payrequests\Post(request); ``` ```php "sa_YdebDV6I2q0MfWV8kPDvQkHEvUjpA", "command"=>"sale", "amount"=>"2.11", "amount_detail"=>(object)[ "subtotal"=>"40.00", "tax"=>"10.00", "enable_partialauth"=>"false", ], "timeout"=>"150", "block_offline"=>"true", "ignore_duplicate"=>"true", "save_card"=>"true", "manual_key"=>"true", "prompt_tip"=>"true", "invoice"=>"123456", "ponum"=>"987654321", "orderid"=>"12345678", "description"=>"sample description", "billing_address"=>(object)[ "company"=>"Hogwarts School of Witchcraft and Wizardry", "street"=>"123 Astronomy Tower", "postalcode"=>"10005", ], "shipping_address"=>(object)[ "company"=>"Hogwarts School of Witchcraft and Wizardry", "street"=>"123 Astronomy Tower", "postalcode"=>"10005", ], "lineitems"=>[ (object)[ "name"=>"Antique Pensieve", "description"=>"See into your past...", "size"=>"Large", "color"=>"Bronze", "cost"=>"450.00", "list_price"=>"500.00", "qty"=>"1", "sku"=>"68453423", "commoditycode"=>"535", "discountamount"=>"0", "discountrate"=>"0", "taxable"=>"", "taxamount"=>"45.00", "taxclass"=>"NA", "taxrate"=>"10", "um"=>"EA", "category"=>"Antiques", "manufacturer"=>"The Ancients", ], ], ]; $response = USAePay\Paymentengine\Payrequests\Post($request); ``` -------------------------------- ### Create Credit Card Method SDK Examples Source: https://help.usaepay.info/api/rest Examples for creating a credit card payment method using various SDKs. ```javascript var request = { "custkey": "Example_custkey", "CustomerPaymentMethodRequests": [ { "cardholder": "Fillius Flitwick", "expiration": "0426", "number": "4000100011112224", "pay_type": "cc", }, ],} var response = usaepay.Customers.Payment_methods\Post(request); ``` ```php "Example_custkey", "CustomerPaymentMethodRequests"=>[ (object)[ "cardholder"=>"Fillius Flitwick", "expiration"=>"0426", "number"=>"4000100011112224", "pay_type"=>"cc", ], ], ]; $response = USAePay\Customers\Payment_methods\Post($request); ``` ```java Map request = new HashMap(); request.put("custkey","Example_custkey");List CustomerPaymentMethodRequests = new ArrayList(); Map CustomerPaymentMethodRequests_item = new HashMap(); CustomerPaymentMethodRequests_item.put("cardholder","Fillius Flitwick"); CustomerPaymentMethodRequests_item.put("expiration","0426"); CustomerPaymentMethodRequests_item.put("number","4000100011112224"); CustomerPaymentMethodRequests_item.put("pay_type","cc"); CustomerPaymentMethodRequests.add(CustomerPaymentMethodRequests_item); request.put("CustomerPaymentMethodRequests",(CustomerPaymentMethodRequests); String response = ""; response = USAePay.Customers.Payment_methods.post(request); ``` ```csharp IDictionary request = new Dictionary(); request\["custkey"\]="Example_custkey"; IList> CustomerPaymentMethodRequests = new List>(); IDictionary CustomerPaymentMethodRequestsItem = new Dictionary(); CustomerPaymentMethodRequestsItem\["cardholder"\]="Fillius Flitwick"; CustomerPaymentMethodRequestsItem\["expiration"\]="0426" CustomerPaymentMethodRequestsItem\["number"\]="4000100011112224"; CustomerPaymentMethodRequestsItem\["pay_type"\]="cc"; CustomerPaymentMethodRequests.Add(CustomerPaymentMethodRequestsItem); request\["CustomerPaymentMethodRequests"\]="CustomerPaymentMethodRequests"; var response = USAePay.API.Customers.Payment_methods.Post(request); ``` -------------------------------- ### POST Products Response Examples Source: https://help.usaepay.info/api/rest Example response objects for the POST /products endpoint in JavaScript and PHP. ```javascript var response = { "type": "product", "key": "80v96p6rx2k6sktw", "product_refnum": "2", "name": "Botts Every Flavor Beans", "price": "2.00", "enabled": "True", "taxable": "True", "categoryid": "1238710", "commodity_code": "3122", "description": "Every flavor you can imagine and then some.", "list_price": "3.00", "manufacturer": "Jelly Belly", "merch_productid": "EXA1234", "physicalgood": "True", "ship_weight": "1.2 oz", "sku": "123456789", "upc": "999999999", "weight": "1.2 oz", "wholesale_price": "3.22", "created": "", "modified": "",} ``` ```php "product", "key"=>"80v96p6rx2k6sktw", "product_refnum"=>"2", "name"=>"Botts Every Flavor Beans", "price"=>"2.00", "enabled"=>"True", "taxable"=>"True", "categoryid"=>"1238710", "commodity_code"=>"3122", "description"=>"Every flavor you can imagine and then some.", "list_price"=>"3.00", "manufacturer"=>"Jelly Belly", "merch_productid"=>"EXA1234", "physicalgood"=>"True", "ship_weight"=>"1.2 oz", "sku"=>"123456789", "upc"=>"999999999", "weight"=>"1.2 oz", "wholesale_price"=>"3.22", "created"=>"", "modified"=>"", ] ``` -------------------------------- ### Device Settings Response Examples Source: https://help.usaepay.info/api/rest Examples of the device settings object structure across different programming languages and formats. ```javascript var response = { "type": "device", "key": "sa_WKwzyQawBG0RMy0XpDGFXb6pXA32r", "apikeyid": "ntC8nP31Moh0wtvYT", "terminal_type": "standalone", "status": "ntC8nP31Moh0wtvYT", "name": "ntC8nP31Moh0wtvYT", "settings": { "timeout": "30", "enable_standalone": "false", "share_device": "false", "notify_update": "true", "notify_update_next": "true", "sleep_battery_device": "5", "sleep_battery_display": "3", "sleep_powered_device": "10", "sleep_powered_display": "8", }, "terminal_info": { "make": "Castle", "model": "Vega3000", "revision": "18043001-0055.00", "serial": "011118170300198", "key_pin": "FFFF5B04", "key_pan": "FF908A", }, "terminal_config": { "enable_emv": "true", "enable_debit_msr": "true", "enable_tip_adjust": "true", "enable_contactless": "true", }, "pairing_code": "690520", "expiration": "2019-10-29 11:59:28",} ``` ```php "device", "key"=>"sa_WKwzyQawBG0RMy0XpDGFXb6pXA32r", "apikeyid"=>"ntC8nP31Moh0wtvYT", "terminal_type"=>"standalone", "status"=>"ntC8nP31Moh0wtvYT", "name"=>"ntC8nP31Moh0wtvYT", "settings"=>(object)[ "timeout"=>"30", "enable_standalone"=>"false", "share_device"=>"false", "notify_update"=>"true", "notify_update_next"=>"true", "sleep_battery_device"=>"5", "sleep_battery_display"=>"3", "sleep_powered_device"=>"10", "sleep_powered_display"=>"8", ], "terminal_info"=>(object)[ "make"=>"Castle", "model"=>"Vega3000", "revision"=>"18043001-0055.00", "serial"=>"011118170300198", "key_pin"=>"FFFF5B04", "key_pan"=>"FF908A", ], "terminal_config"=>(object)[ "enable_emv"=>"true", "enable_debit_msr"=>"true", "enable_tip_adjust"=>"true", "enable_contactless"=>"true", ], "pairing_code"=>"690520", "expiration"=>"2019-10-29 11:59:28", ] ``` ```json { "type": "device", "key": "sa_WKwzyQawBG0RMy0XpDGFXb6pXA32r", "apikeyid": "ntC8nP31Moh0wtvYT", "terminal_type": "standalone", "status": "ntC8nP31Moh0wtvYT", "name": "ntC8nP31Moh0wtvYT", "settings": { "timeout": "30", "enable_standalone": "false", "share_device": "false", "notify_update": "true", "notify_update_next": "true", "sleep_battery_device": "5", "sleep_battery_display": "3", "sleep_powered_device": "10", "sleep_powered_display": "8" }, "terminal_info": { "make": "Castle", "model": "Vega3000", "revision": "18043001-0055.00", "serial": "011118170300198", "key_pin": "FFFF5B04", "key_pan": "FF908A" }, "terminal_config": { "enable_emv": "true", "enable_debit_msr": "true", "enable_tip_adjust": "true", "enable_contactless": "true" }, "pairing_code": "690520", "expiration": "2019-10-29 11:59:28" } ``` ```json { "type": "device", "key": "sa_WKwzyQawBG0RMy0XpDGFXb6pXA23r", "apikeyid": "ntC8nP31Moh0wtvYT", "terminal_type": "standalone", "status": "connected", "name": "Register 1", "settings": { "timeout": 30, "share_device": true, "enable_standalone": false, "sleep_battery_device": 5, "sleep_battery_display": 1, "sleep_powered_device": 0, "sleep_powered_display": 0 }, "terminal_info": { "make": "Castles", "model": "VEGA3000", "revision": "18043001-0055.00", "serial": "011118170300198", "key_pin": "FFFF5B04", "key_pan": "FF908A" }, "capabilities": { "emv": true, "swipe": true, "contactless": true, "signature_capture": true, "printer": true, "pin": true, "sleep_battery": true, "sleep_power": true }, "terminal_config": { "enable_emv": true, "enable_debit_msr": true, "enable_tip_adjust": true, "enable_contactless": true } } ``` -------------------------------- ### Register Device Request Examples Source: https://help.usaepay.info/api/rest Examples of how to register a payment terminal using different programming languages and cURL. ```javascript var request = { "terminal_type": "standalone", "name": "ntC8nP31Moh0wtvYT", "settings": { "timeout": "30", "enable_standalone": "false", "share_device": "false", "notify_update": "true", "notify_update_next": "true", "sleep_battery_device": "5", "sleep_battery_display": "3", "sleep_powered_device": "10", "sleep_powered_display": "8", }, "terminal_config": { "enable_emv": "true", "enable_debit_msr": "true", "enable_tip_adjust": "true", "enable_contactless": "true", },} var response = usaepay.Paymentengine.Devices\Post(request); ``` ```php "standalone", "name"=>"ntC8nP31Moh0wtvYT", "settings"=>(object)[ "timeout"=>"30", "enable_standalone"=>"false", "share_device"=>"false", "notify_update"=>"true", "notify_update_next"=>"true", "sleep_battery_device"=>"5", "sleep_battery_display"=>"3", "sleep_powered_device"=>"10", "sleep_powered_display"=>"8", ], "terminal_config"=>(object)[ "enable_emv"=>"true", "enable_debit_msr"=>"true", "enable_tip_adjust"=>"true", "enable_contactless"=>"true", ], ]; $response = USAePay\Paymentengine\Devices\Post($request); ``` ```java Map request = new HashMap(); request.put("terminal_type","standalone"); request.put("name","ntC8nP31Moh0wtvYT"); Map settings = new HashMap(); settings.put("timeout","30"); settings.put("enable_standalone","false"); settings.put("share_device","false"); settings.put("notify_update","true"); settings.put("notify_update_next","true"); settings.put("sleep_battery_device","5"); settings.put("sleep_battery_display","3"); settings.put("sleep_powered_device","10"); settings.put("sleep_powered_display","8"); request.put("settings",(settings); Map terminal_config = new HashMap(); terminal_config.put("enable_emv","true"); terminal_config.put("enable_debit_msr","true"); terminal_config.put("enable_tip_adjust","true"); terminal_config.put("enable_contactless","true"); request.put("terminal_config",(terminal_config); String response = ""; response = USAePay.Paymentengine.Devices.post(request); ``` ```bash curl --basic --user APIKEY:PINHASH \ -H "Content-Type: application/json" -X POST \ -d '{"name":"Register 1","terminal_type":"standalone","settings":{"timeout":30,"share_device":false,"enable_standalone":false,"sleep_battery_device":5,"sleep_battery_display":1,"sleep_powered_device":0,"sleep_powered_display":0},"terminal_config":{"enable_emv":true,"enable_debit_msr":true,"enable_tip_adjust":true,"enable_contactless":true}}' https://usaepay.com/api/v2/paymentengine/devices ``` -------------------------------- ### Update Device Request Examples Source: https://help.usaepay.info/api/rest Examples demonstrating how to update device parameters using different programming languages and cURL. ```javascript var request = { "devicekey": "Example_devicekey", "terminal_type": "standalone", "name": "ntC8nP31Moh0wtvYT", "settings": { "timeout": "30", "enable_standalone": "false", "share_device": "false", "notify_update": "true", "notify_update_next": "true", "sleep_battery_device": "5", "sleep_battery_display": "3", "sleep_powered_device": "10", "sleep_powered_display": "8", }, "terminal_config": { "enable_emv": "true", "enable_debit_msr": "true", "enable_tip_adjust": "true", "enable_contactless": "true", },} var response = usaepay.Paymentengine.Devices\Put(request); ``` ```php "Example_devicekey", "terminal_type"=>"standalone", "name"=>"ntC8nP31Moh0wtvYT", "settings"=>(object)[ "timeout"=>"30", "enable_standalone"=>"false", "share_device"=>"false", "notify_update"=>"true", "notify_update_next"=>"true", "sleep_battery_device"=>"5", "sleep_battery_display"=>"3", "sleep_powered_device"=>"10", "sleep_powered_display"=>"8", ], "terminal_config"=>(object)[ "enable_emv"=>"true", "enable_debit_msr"=>"true", "enable_tip_adjust"=>"true", "enable_contactless"=>"true", ], ]; $response = USAePay\Paymentengine\Devices\Put($request); ``` ```java Map request = new HashMap(); request.put("devicekey","Example_devicekey"); request.put("terminal_type","standalone"); request.put("name","ntC8nP31Moh0wtvYT"); Map settings = new HashMap(); settings.put("timeout","30"); settings.put("enable_standalone","false"); settings.put("share_device","false"); settings.put("notify_update","true"); settings.put("notify_update_next","true"); settings.put("sleep_battery_device","5"); settings.put("sleep_battery_display","3"); settings.put("sleep_powered_device","10"); settings.put("sleep_powered_display","8"); request.put("settings",(settings); Map terminal_config = new HashMap(); terminal_config.put("enable_emv","true"); terminal_config.put("enable_debit_msr","true"); terminal_config.put("enable_tip_adjust","true"); terminal_config.put("enable_contactless","true"); request.put("terminal_config",(terminal_config); String response = ""; response = USAePay.Paymentengine.Devices.put(request); ``` ```bash curl --basic --user APIKEY:PINHASH \ -X PUT \ -H "Content-Type: application/json" \ -d '{"name":"Testing","settings":{"share_device":true}}' \ https://usaepay.com/api/v2/paymentengine/devices/sa_1BTTI5Yys0G3gVQa6beYxM4K0hhjC ``` -------------------------------- ### Batch Response SDK Examples Source: https://help.usaepay.info/api/rest Examples of batch response objects across different languages. ```javascript var response = { "type": "batch", "key": "ft1m9m5p9wgd9mb", "opened": "2019-01-28 17:02:22", "status": "closed", "closed": "2019-01-28 17:02:36", "scheduled": "2019-01-28 17:02:36", "total_amount": "3042.48", "total_count": "29", "sales_amount": "4755.48", "sales_count": "18", "voids_amount": "17.99", "voids_count": "1", "refunds_amount": "1713", "refunds_count": "10",} ``` ```php "batch", "key"=>"ft1m9m5p9wgd9mb", "opened"=>"2019-01-28 17:02:22", "status"=>"closed", "closed"=>"2019-01-28 17:02:36", "scheduled"=>"2019-01-28 17:02:36", "total_amount"=>"3042.48", "total_count"=>"29", "sales_amount"=>"4755.48", "sales_count"=>"18", "voids_amount"=>"17.99", "voids_count"=>"1", "refunds_amount"=>"1713", "refunds_count"=>"10", ] ``` ```json { "type": "batch", "key": "ft1m9m5p9wgd9mb", "opened": "2019-01-28 17:02:22", "status": "closed", "closed": "2019-01-28 17:02:36", "scheduled": "2019-01-28 17:02:36", "total_amount": "3042.48", "total_count": "29", "sales_amount": "4755.48", "sales_count": "18", "voids_amount": "17.99", "voids_count": "1", "refunds_amount": "1713", "refunds_count": "10" } ``` ```csharp IDictionary response = new Dictionary(); response["type"]="batch"; response["key"]="ft1m9m5p9wgd9mb"; response["opened"]="2019-01-28 17:02:22"; response["status"]="closed"; response["closed"]="2019-01-28 17:02:36"; response["scheduled"]="2019-01-28 17:02:36"; response["total_amount"]="3042.48"; response["total_count"]="29"; response["sales_amount"]="4755.48"; response["sales_count"]="18"; response["voids_amount"]="17.99"; response["voids_count"]="1"; response["refunds_amount"]="1713"; response["refunds_count"]="10"; ``` -------------------------------- ### Update Payment Method SDK Examples Source: https://help.usaepay.info/api/rest Examples for updating payment methods using various language-specific SDKs. ```javascript var request = { "custkey": "Example_custkey", "paymethod_key": "Example_paymethod_key", "cardholder": "Fillius Flitwick", "expiration": "0426", "number": "40001000111^date:MMYY,+4Y4", "pay_type": "cc",} var response = usaepay.Customers.Payment_methods\Put(request); ``` ```php "Example_custkey", "paymethod_key"=>"Example_paymethod_key", "cardholder"=>"Fillius Flitwick", "expiration"=>"0426", "number"=>"40001000111^date:MMYY,+4Y4", "pay_type"=>"cc", ]; $response = USAePay\Customers\Payment_methods\Put($request); ``` ```java Map request = new HashMap(); request.put("custkey","Example_custkey"); request.put("paymethod_key","Example_paymethod_key"); request.put("cardholder","Fillius Flitwick"); request.put("expiration","0426"); request.put("number","40001000111^date:MMYY,+4Y4"); request.put("pay_type","cc"); String response = ""; response = USAePay.Customers.Payment_methods.put(request); ``` ```csharp IDictionary request = new Dictionary(); request["custkey"]="Example_custkey"; request["paymethod_key"]="Example_paymethod_key"; request["cardholder"]="Fillius Flitwick"; request["expiration"]="0426" request["number"]="40001000111^date:MMYY,+4Y4"; request["pay_type"]="cc"; var response = USAePay.API.Customers.Payment_methods.Put(request); ``` -------------------------------- ### Delete Device Request Examples Source: https://help.usaepay.info/api/rest Examples for initiating a device deletion request across multiple programming languages. ```javascript var request = { "devicekey": "Example_devicekey",} var response = usaepay.Paymentengine.Devices\Delete(request); ``` ```php "Example_devicekey", ]; $response = USAePay\Paymentengine\Devices\Delete($request); ``` ```java Map request = new HashMap(); request.put("devicekey","Example_devicekey"); String response = ""; response = USAePay.Paymentengine.Devices.delete(request); ``` ```bash curl --user APIKEY:PINHASH \ -X DELETE \ https://usaepay.com/api/v2/paymentengine/devices/sa_p7wyCLbGgGtPyDE12U9zHJy3pg6WO ``` ```csharp IDictionary request = new Dictionary(); request["devicekey"]="Example_devicekey"; var response = USAePay.API.Paymentengine.Devices.Delete(request); ``` -------------------------------- ### Quick Refund Request Example Source: https://help.usaepay.info/api/rest A cURL request example for performing a quick refund using a transaction key. ```bash curl -X POST https://sandbox.usaepay.com/api/v2/transactions -H "Content-Type: application/json" -H "Authorization: Basic X1Y4N1F0YjUxM0NkM3ZhYk03UkMwVGJ0SldlU284cDc6czIvYWJjZGVmZ2hpamtsbW5vcC9iNzRjMmZhOTFmYjBhMDk3NTVlMzc3ZWU4ZTIwYWE4NmQyYjkyYzNkMmYyNzcyODBkYjU5NWY2MzZiYjE5MGU2" -d '{ "command": "quickrefund", "trankey": "dnfwxwhz5kvnbgb", "amount": "5.00" }' ``` -------------------------------- ### Cash Sale Request Example Source: https://help.usaepay.info/api/rest A cURL request example for logging a cash sale using the cash:sale command. ```bash curl -X POST https://sandbox.usaepay.com/api/v2/transactions -H "Content-Type: application/json" -H "Authorization: Basic X1Y4N1F0YjUxM0NkM3ZhYk03UkMwVGJ0SldlU284cDc6czIvYWJjZGVmZ2hpamtsbW5vcC9iNzRjMmZhOTFmYjBhMDk3NTVlMzc3ZWU4ZTIwYWE4NmQyYjkyYzNkMmYyNzcyODBkYjU5NWY2MzZiYjE5MGU2" -d '{ "command": "cash:sale", "amount": "5.00", "amount_detail": { "tax": "1.00", "tip": "0.50" } }' ``` -------------------------------- ### GET Customers JSON Response Source: https://help.usaepay.info/api/rest Example of the JSON structure returned by the GET /customers endpoint. ```json { "type": "list", "limit": "0", "offset": "20", "data": [ { "type": "customer", "key": "nsds9yd1h5kb9y5h", "custid": "123456", "company": "Weasleys Wizard Wheezes", "first_name": "George", "last_name": "Weasley", "address": "93 Diagon Alley", "address2": "Apartment 2", "city": "London", "state": "Greater London", "postalcode": "WC2H 0AW", "country": "Great Britain", "phone": "747-3733", "fax": "584-4537", "email": "noreply@mugglenet.com", "url": "https://www.pottermore.com/", "notes": "Born on April fools day.", "description": "Mischief Managed." } ], "total": "1" } ```