Credit
curl --request POST \
--url https://api.ecrypt.com/v1/transactions/credit \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"payment": {
"token": "<string>",
"stored": {
"customer": "<string>",
"wallet": "<string>"
},
"terminal": {
"id": "<string>",
"prompt_tip": true,
"tip_amounts": [
123
],
"prompt_cvv": true,
"prompt_postal_code": true,
"prompt_amount_confirmation": true,
"prompt_signature": true,
"key_card": true
},
"check": {
"name": "<string>",
"account_number": "<string>",
"routing_number": "<string>",
"check_number": "<string>",
"verification": {
"dob": "<string>",
"ssn": "<string>",
"drivers_license": {
"number": "<string>",
"state": "<string>"
}
}
},
"cash": true
},
"amount": {
"value": 500000000
},
"order": {
"bill_to": {
"name": "<string>",
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>",
"country": "<string>"
},
"ship_to": {
"name": "<string>",
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>",
"country": "<string>"
},
"discount": 123,
"surcharge": 123,
"shipping": 123,
"email": "<string>",
"tip": 123,
"tax": 123,
"total": 123,
"date": "2023-11-07T05:31:56Z",
"lines": [
{
"product_code": "<string>",
"description": "<string>",
"commodity_code": "<string>",
"unit_of_measure": "<string>",
"unit_cost": 123,
"quantity": 123,
"total": 123,
"tax": 123,
"tax_rate": 123,
"discount": 123,
"discount_rate": 123,
"tax_type": "<string>",
"alternate_tax_id": "<string>"
}
],
"metadata": {}
}
}
'import requests
url = "https://api.ecrypt.com/v1/transactions/credit"
payload = {
"payment": {
"token": "<string>",
"stored": {
"customer": "<string>",
"wallet": "<string>"
},
"terminal": {
"id": "<string>",
"prompt_tip": True,
"tip_amounts": [123],
"prompt_cvv": True,
"prompt_postal_code": True,
"prompt_amount_confirmation": True,
"prompt_signature": True,
"key_card": True
},
"check": {
"name": "<string>",
"account_number": "<string>",
"routing_number": "<string>",
"check_number": "<string>",
"verification": {
"dob": "<string>",
"ssn": "<string>",
"drivers_license": {
"number": "<string>",
"state": "<string>"
}
}
},
"cash": True
},
"amount": { "value": 500000000 },
"order": {
"bill_to": {
"name": "<string>",
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>",
"country": "<string>"
},
"ship_to": {
"name": "<string>",
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>",
"country": "<string>"
},
"discount": 123,
"surcharge": 123,
"shipping": 123,
"email": "<string>",
"tip": 123,
"tax": 123,
"total": 123,
"date": "2023-11-07T05:31:56Z",
"lines": [
{
"product_code": "<string>",
"description": "<string>",
"commodity_code": "<string>",
"unit_of_measure": "<string>",
"unit_cost": 123,
"quantity": 123,
"total": 123,
"tax": 123,
"tax_rate": 123,
"discount": 123,
"discount_rate": 123,
"tax_type": "<string>",
"alternate_tax_id": "<string>"
}
],
"metadata": {}
}
}
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
payment: {
token: '<string>',
stored: {customer: '<string>', wallet: '<string>'},
terminal: {
id: '<string>',
prompt_tip: true,
tip_amounts: [123],
prompt_cvv: true,
prompt_postal_code: true,
prompt_amount_confirmation: true,
prompt_signature: true,
key_card: true
},
check: {
name: '<string>',
account_number: '<string>',
routing_number: '<string>',
check_number: '<string>',
verification: {
dob: '<string>',
ssn: '<string>',
drivers_license: {number: '<string>', state: '<string>'}
}
},
cash: true
},
amount: {value: 500000000},
order: {
bill_to: {
name: '<string>',
line1: '<string>',
line2: '<string>',
city: '<string>',
state: '<string>',
postal_code: '<string>',
country: '<string>'
},
ship_to: {
name: '<string>',
line1: '<string>',
line2: '<string>',
city: '<string>',
state: '<string>',
postal_code: '<string>',
country: '<string>'
},
discount: 123,
surcharge: 123,
shipping: 123,
email: '<string>',
tip: 123,
tax: 123,
total: 123,
date: '2023-11-07T05:31:56Z',
lines: [
{
product_code: '<string>',
description: '<string>',
commodity_code: '<string>',
unit_of_measure: '<string>',
unit_cost: 123,
quantity: 123,
total: 123,
tax: 123,
tax_rate: 123,
discount: 123,
discount_rate: 123,
tax_type: '<string>',
alternate_tax_id: '<string>'
}
],
metadata: {}
}
})
};
fetch('https://api.ecrypt.com/v1/transactions/credit', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ecrypt.com/v1/transactions/credit",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'payment' => [
'token' => '<string>',
'stored' => [
'customer' => '<string>',
'wallet' => '<string>'
],
'terminal' => [
'id' => '<string>',
'prompt_tip' => true,
'tip_amounts' => [
123
],
'prompt_cvv' => true,
'prompt_postal_code' => true,
'prompt_amount_confirmation' => true,
'prompt_signature' => true,
'key_card' => true
],
'check' => [
'name' => '<string>',
'account_number' => '<string>',
'routing_number' => '<string>',
'check_number' => '<string>',
'verification' => [
'dob' => '<string>',
'ssn' => '<string>',
'drivers_license' => [
'number' => '<string>',
'state' => '<string>'
]
]
],
'cash' => true
],
'amount' => [
'value' => 500000000
],
'order' => [
'bill_to' => [
'name' => '<string>',
'line1' => '<string>',
'line2' => '<string>',
'city' => '<string>',
'state' => '<string>',
'postal_code' => '<string>',
'country' => '<string>'
],
'ship_to' => [
'name' => '<string>',
'line1' => '<string>',
'line2' => '<string>',
'city' => '<string>',
'state' => '<string>',
'postal_code' => '<string>',
'country' => '<string>'
],
'discount' => 123,
'surcharge' => 123,
'shipping' => 123,
'email' => '<string>',
'tip' => 123,
'tax' => 123,
'total' => 123,
'date' => '2023-11-07T05:31:56Z',
'lines' => [
[
'product_code' => '<string>',
'description' => '<string>',
'commodity_code' => '<string>',
'unit_of_measure' => '<string>',
'unit_cost' => 123,
'quantity' => 123,
'total' => 123,
'tax' => 123,
'tax_rate' => 123,
'discount' => 123,
'discount_rate' => 123,
'tax_type' => '<string>',
'alternate_tax_id' => '<string>'
]
],
'metadata' => [
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Api-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.ecrypt.com/v1/transactions/credit"
payload := strings.NewReader("{\n \"payment\": {\n \"token\": \"<string>\",\n \"stored\": {\n \"customer\": \"<string>\",\n \"wallet\": \"<string>\"\n },\n \"terminal\": {\n \"id\": \"<string>\",\n \"prompt_tip\": true,\n \"tip_amounts\": [\n 123\n ],\n \"prompt_cvv\": true,\n \"prompt_postal_code\": true,\n \"prompt_amount_confirmation\": true,\n \"prompt_signature\": true,\n \"key_card\": true\n },\n \"check\": {\n \"name\": \"<string>\",\n \"account_number\": \"<string>\",\n \"routing_number\": \"<string>\",\n \"check_number\": \"<string>\",\n \"verification\": {\n \"dob\": \"<string>\",\n \"ssn\": \"<string>\",\n \"drivers_license\": {\n \"number\": \"<string>\",\n \"state\": \"<string>\"\n }\n }\n },\n \"cash\": true\n },\n \"amount\": {\n \"value\": 500000000\n },\n \"order\": {\n \"bill_to\": {\n \"name\": \"<string>\",\n \"line1\": \"<string>\",\n \"line2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"country\": \"<string>\"\n },\n \"ship_to\": {\n \"name\": \"<string>\",\n \"line1\": \"<string>\",\n \"line2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"country\": \"<string>\"\n },\n \"discount\": 123,\n \"surcharge\": 123,\n \"shipping\": 123,\n \"email\": \"<string>\",\n \"tip\": 123,\n \"tax\": 123,\n \"total\": 123,\n \"date\": \"2023-11-07T05:31:56Z\",\n \"lines\": [\n {\n \"product_code\": \"<string>\",\n \"description\": \"<string>\",\n \"commodity_code\": \"<string>\",\n \"unit_of_measure\": \"<string>\",\n \"unit_cost\": 123,\n \"quantity\": 123,\n \"total\": 123,\n \"tax\": 123,\n \"tax_rate\": 123,\n \"discount\": 123,\n \"discount_rate\": 123,\n \"tax_type\": \"<string>\",\n \"alternate_tax_id\": \"<string>\"\n }\n ],\n \"metadata\": {}\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Api-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.ecrypt.com/v1/transactions/credit")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"payment\": {\n \"token\": \"<string>\",\n \"stored\": {\n \"customer\": \"<string>\",\n \"wallet\": \"<string>\"\n },\n \"terminal\": {\n \"id\": \"<string>\",\n \"prompt_tip\": true,\n \"tip_amounts\": [\n 123\n ],\n \"prompt_cvv\": true,\n \"prompt_postal_code\": true,\n \"prompt_amount_confirmation\": true,\n \"prompt_signature\": true,\n \"key_card\": true\n },\n \"check\": {\n \"name\": \"<string>\",\n \"account_number\": \"<string>\",\n \"routing_number\": \"<string>\",\n \"check_number\": \"<string>\",\n \"verification\": {\n \"dob\": \"<string>\",\n \"ssn\": \"<string>\",\n \"drivers_license\": {\n \"number\": \"<string>\",\n \"state\": \"<string>\"\n }\n }\n },\n \"cash\": true\n },\n \"amount\": {\n \"value\": 500000000\n },\n \"order\": {\n \"bill_to\": {\n \"name\": \"<string>\",\n \"line1\": \"<string>\",\n \"line2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"country\": \"<string>\"\n },\n \"ship_to\": {\n \"name\": \"<string>\",\n \"line1\": \"<string>\",\n \"line2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"country\": \"<string>\"\n },\n \"discount\": 123,\n \"surcharge\": 123,\n \"shipping\": 123,\n \"email\": \"<string>\",\n \"tip\": 123,\n \"tax\": 123,\n \"total\": 123,\n \"date\": \"2023-11-07T05:31:56Z\",\n \"lines\": [\n {\n \"product_code\": \"<string>\",\n \"description\": \"<string>\",\n \"commodity_code\": \"<string>\",\n \"unit_of_measure\": \"<string>\",\n \"unit_cost\": 123,\n \"quantity\": 123,\n \"total\": 123,\n \"tax\": 123,\n \"tax_rate\": 123,\n \"discount\": 123,\n \"discount_rate\": 123,\n \"tax_type\": \"<string>\",\n \"alternate_tax_id\": \"<string>\"\n }\n ],\n \"metadata\": {}\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ecrypt.com/v1/transactions/credit")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"payment\": {\n \"token\": \"<string>\",\n \"stored\": {\n \"customer\": \"<string>\",\n \"wallet\": \"<string>\"\n },\n \"terminal\": {\n \"id\": \"<string>\",\n \"prompt_tip\": true,\n \"tip_amounts\": [\n 123\n ],\n \"prompt_cvv\": true,\n \"prompt_postal_code\": true,\n \"prompt_amount_confirmation\": true,\n \"prompt_signature\": true,\n \"key_card\": true\n },\n \"check\": {\n \"name\": \"<string>\",\n \"account_number\": \"<string>\",\n \"routing_number\": \"<string>\",\n \"check_number\": \"<string>\",\n \"verification\": {\n \"dob\": \"<string>\",\n \"ssn\": \"<string>\",\n \"drivers_license\": {\n \"number\": \"<string>\",\n \"state\": \"<string>\"\n }\n }\n },\n \"cash\": true\n },\n \"amount\": {\n \"value\": 500000000\n },\n \"order\": {\n \"bill_to\": {\n \"name\": \"<string>\",\n \"line1\": \"<string>\",\n \"line2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"country\": \"<string>\"\n },\n \"ship_to\": {\n \"name\": \"<string>\",\n \"line1\": \"<string>\",\n \"line2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"country\": \"<string>\"\n },\n \"discount\": 123,\n \"surcharge\": 123,\n \"shipping\": 123,\n \"email\": \"<string>\",\n \"tip\": 123,\n \"tax\": 123,\n \"total\": 123,\n \"date\": \"2023-11-07T05:31:56Z\",\n \"lines\": [\n {\n \"product_code\": \"<string>\",\n \"description\": \"<string>\",\n \"commodity_code\": \"<string>\",\n \"unit_of_measure\": \"<string>\",\n \"unit_cost\": 123,\n \"quantity\": 123,\n \"total\": 123,\n \"tax\": 123,\n \"tax_rate\": 123,\n \"discount\": 123,\n \"discount_rate\": 123,\n \"tax_type\": \"<string>\",\n \"alternate_tax_id\": \"<string>\"\n }\n ],\n \"metadata\": {}\n }\n}"
response = http.request(request)
puts response.read_body{}{}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}Transactions
Credit
Credit or blind credit will return the specified amount to the payment method. This service must be enabled on your merchant account. Supported Payment Methods
Credit CardTerminal/Cloud EMVCheck/ACHCustomerWallet
POST
/
v1
/
transactions
/
credit
Credit
curl --request POST \
--url https://api.ecrypt.com/v1/transactions/credit \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"payment": {
"token": "<string>",
"stored": {
"customer": "<string>",
"wallet": "<string>"
},
"terminal": {
"id": "<string>",
"prompt_tip": true,
"tip_amounts": [
123
],
"prompt_cvv": true,
"prompt_postal_code": true,
"prompt_amount_confirmation": true,
"prompt_signature": true,
"key_card": true
},
"check": {
"name": "<string>",
"account_number": "<string>",
"routing_number": "<string>",
"check_number": "<string>",
"verification": {
"dob": "<string>",
"ssn": "<string>",
"drivers_license": {
"number": "<string>",
"state": "<string>"
}
}
},
"cash": true
},
"amount": {
"value": 500000000
},
"order": {
"bill_to": {
"name": "<string>",
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>",
"country": "<string>"
},
"ship_to": {
"name": "<string>",
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>",
"country": "<string>"
},
"discount": 123,
"surcharge": 123,
"shipping": 123,
"email": "<string>",
"tip": 123,
"tax": 123,
"total": 123,
"date": "2023-11-07T05:31:56Z",
"lines": [
{
"product_code": "<string>",
"description": "<string>",
"commodity_code": "<string>",
"unit_of_measure": "<string>",
"unit_cost": 123,
"quantity": 123,
"total": 123,
"tax": 123,
"tax_rate": 123,
"discount": 123,
"discount_rate": 123,
"tax_type": "<string>",
"alternate_tax_id": "<string>"
}
],
"metadata": {}
}
}
'import requests
url = "https://api.ecrypt.com/v1/transactions/credit"
payload = {
"payment": {
"token": "<string>",
"stored": {
"customer": "<string>",
"wallet": "<string>"
},
"terminal": {
"id": "<string>",
"prompt_tip": True,
"tip_amounts": [123],
"prompt_cvv": True,
"prompt_postal_code": True,
"prompt_amount_confirmation": True,
"prompt_signature": True,
"key_card": True
},
"check": {
"name": "<string>",
"account_number": "<string>",
"routing_number": "<string>",
"check_number": "<string>",
"verification": {
"dob": "<string>",
"ssn": "<string>",
"drivers_license": {
"number": "<string>",
"state": "<string>"
}
}
},
"cash": True
},
"amount": { "value": 500000000 },
"order": {
"bill_to": {
"name": "<string>",
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>",
"country": "<string>"
},
"ship_to": {
"name": "<string>",
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>",
"country": "<string>"
},
"discount": 123,
"surcharge": 123,
"shipping": 123,
"email": "<string>",
"tip": 123,
"tax": 123,
"total": 123,
"date": "2023-11-07T05:31:56Z",
"lines": [
{
"product_code": "<string>",
"description": "<string>",
"commodity_code": "<string>",
"unit_of_measure": "<string>",
"unit_cost": 123,
"quantity": 123,
"total": 123,
"tax": 123,
"tax_rate": 123,
"discount": 123,
"discount_rate": 123,
"tax_type": "<string>",
"alternate_tax_id": "<string>"
}
],
"metadata": {}
}
}
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
payment: {
token: '<string>',
stored: {customer: '<string>', wallet: '<string>'},
terminal: {
id: '<string>',
prompt_tip: true,
tip_amounts: [123],
prompt_cvv: true,
prompt_postal_code: true,
prompt_amount_confirmation: true,
prompt_signature: true,
key_card: true
},
check: {
name: '<string>',
account_number: '<string>',
routing_number: '<string>',
check_number: '<string>',
verification: {
dob: '<string>',
ssn: '<string>',
drivers_license: {number: '<string>', state: '<string>'}
}
},
cash: true
},
amount: {value: 500000000},
order: {
bill_to: {
name: '<string>',
line1: '<string>',
line2: '<string>',
city: '<string>',
state: '<string>',
postal_code: '<string>',
country: '<string>'
},
ship_to: {
name: '<string>',
line1: '<string>',
line2: '<string>',
city: '<string>',
state: '<string>',
postal_code: '<string>',
country: '<string>'
},
discount: 123,
surcharge: 123,
shipping: 123,
email: '<string>',
tip: 123,
tax: 123,
total: 123,
date: '2023-11-07T05:31:56Z',
lines: [
{
product_code: '<string>',
description: '<string>',
commodity_code: '<string>',
unit_of_measure: '<string>',
unit_cost: 123,
quantity: 123,
total: 123,
tax: 123,
tax_rate: 123,
discount: 123,
discount_rate: 123,
tax_type: '<string>',
alternate_tax_id: '<string>'
}
],
metadata: {}
}
})
};
fetch('https://api.ecrypt.com/v1/transactions/credit', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ecrypt.com/v1/transactions/credit",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'payment' => [
'token' => '<string>',
'stored' => [
'customer' => '<string>',
'wallet' => '<string>'
],
'terminal' => [
'id' => '<string>',
'prompt_tip' => true,
'tip_amounts' => [
123
],
'prompt_cvv' => true,
'prompt_postal_code' => true,
'prompt_amount_confirmation' => true,
'prompt_signature' => true,
'key_card' => true
],
'check' => [
'name' => '<string>',
'account_number' => '<string>',
'routing_number' => '<string>',
'check_number' => '<string>',
'verification' => [
'dob' => '<string>',
'ssn' => '<string>',
'drivers_license' => [
'number' => '<string>',
'state' => '<string>'
]
]
],
'cash' => true
],
'amount' => [
'value' => 500000000
],
'order' => [
'bill_to' => [
'name' => '<string>',
'line1' => '<string>',
'line2' => '<string>',
'city' => '<string>',
'state' => '<string>',
'postal_code' => '<string>',
'country' => '<string>'
],
'ship_to' => [
'name' => '<string>',
'line1' => '<string>',
'line2' => '<string>',
'city' => '<string>',
'state' => '<string>',
'postal_code' => '<string>',
'country' => '<string>'
],
'discount' => 123,
'surcharge' => 123,
'shipping' => 123,
'email' => '<string>',
'tip' => 123,
'tax' => 123,
'total' => 123,
'date' => '2023-11-07T05:31:56Z',
'lines' => [
[
'product_code' => '<string>',
'description' => '<string>',
'commodity_code' => '<string>',
'unit_of_measure' => '<string>',
'unit_cost' => 123,
'quantity' => 123,
'total' => 123,
'tax' => 123,
'tax_rate' => 123,
'discount' => 123,
'discount_rate' => 123,
'tax_type' => '<string>',
'alternate_tax_id' => '<string>'
]
],
'metadata' => [
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Api-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.ecrypt.com/v1/transactions/credit"
payload := strings.NewReader("{\n \"payment\": {\n \"token\": \"<string>\",\n \"stored\": {\n \"customer\": \"<string>\",\n \"wallet\": \"<string>\"\n },\n \"terminal\": {\n \"id\": \"<string>\",\n \"prompt_tip\": true,\n \"tip_amounts\": [\n 123\n ],\n \"prompt_cvv\": true,\n \"prompt_postal_code\": true,\n \"prompt_amount_confirmation\": true,\n \"prompt_signature\": true,\n \"key_card\": true\n },\n \"check\": {\n \"name\": \"<string>\",\n \"account_number\": \"<string>\",\n \"routing_number\": \"<string>\",\n \"check_number\": \"<string>\",\n \"verification\": {\n \"dob\": \"<string>\",\n \"ssn\": \"<string>\",\n \"drivers_license\": {\n \"number\": \"<string>\",\n \"state\": \"<string>\"\n }\n }\n },\n \"cash\": true\n },\n \"amount\": {\n \"value\": 500000000\n },\n \"order\": {\n \"bill_to\": {\n \"name\": \"<string>\",\n \"line1\": \"<string>\",\n \"line2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"country\": \"<string>\"\n },\n \"ship_to\": {\n \"name\": \"<string>\",\n \"line1\": \"<string>\",\n \"line2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"country\": \"<string>\"\n },\n \"discount\": 123,\n \"surcharge\": 123,\n \"shipping\": 123,\n \"email\": \"<string>\",\n \"tip\": 123,\n \"tax\": 123,\n \"total\": 123,\n \"date\": \"2023-11-07T05:31:56Z\",\n \"lines\": [\n {\n \"product_code\": \"<string>\",\n \"description\": \"<string>\",\n \"commodity_code\": \"<string>\",\n \"unit_of_measure\": \"<string>\",\n \"unit_cost\": 123,\n \"quantity\": 123,\n \"total\": 123,\n \"tax\": 123,\n \"tax_rate\": 123,\n \"discount\": 123,\n \"discount_rate\": 123,\n \"tax_type\": \"<string>\",\n \"alternate_tax_id\": \"<string>\"\n }\n ],\n \"metadata\": {}\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Api-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.ecrypt.com/v1/transactions/credit")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"payment\": {\n \"token\": \"<string>\",\n \"stored\": {\n \"customer\": \"<string>\",\n \"wallet\": \"<string>\"\n },\n \"terminal\": {\n \"id\": \"<string>\",\n \"prompt_tip\": true,\n \"tip_amounts\": [\n 123\n ],\n \"prompt_cvv\": true,\n \"prompt_postal_code\": true,\n \"prompt_amount_confirmation\": true,\n \"prompt_signature\": true,\n \"key_card\": true\n },\n \"check\": {\n \"name\": \"<string>\",\n \"account_number\": \"<string>\",\n \"routing_number\": \"<string>\",\n \"check_number\": \"<string>\",\n \"verification\": {\n \"dob\": \"<string>\",\n \"ssn\": \"<string>\",\n \"drivers_license\": {\n \"number\": \"<string>\",\n \"state\": \"<string>\"\n }\n }\n },\n \"cash\": true\n },\n \"amount\": {\n \"value\": 500000000\n },\n \"order\": {\n \"bill_to\": {\n \"name\": \"<string>\",\n \"line1\": \"<string>\",\n \"line2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"country\": \"<string>\"\n },\n \"ship_to\": {\n \"name\": \"<string>\",\n \"line1\": \"<string>\",\n \"line2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"country\": \"<string>\"\n },\n \"discount\": 123,\n \"surcharge\": 123,\n \"shipping\": 123,\n \"email\": \"<string>\",\n \"tip\": 123,\n \"tax\": 123,\n \"total\": 123,\n \"date\": \"2023-11-07T05:31:56Z\",\n \"lines\": [\n {\n \"product_code\": \"<string>\",\n \"description\": \"<string>\",\n \"commodity_code\": \"<string>\",\n \"unit_of_measure\": \"<string>\",\n \"unit_cost\": 123,\n \"quantity\": 123,\n \"total\": 123,\n \"tax\": 123,\n \"tax_rate\": 123,\n \"discount\": 123,\n \"discount_rate\": 123,\n \"tax_type\": \"<string>\",\n \"alternate_tax_id\": \"<string>\"\n }\n ],\n \"metadata\": {}\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ecrypt.com/v1/transactions/credit")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"payment\": {\n \"token\": \"<string>\",\n \"stored\": {\n \"customer\": \"<string>\",\n \"wallet\": \"<string>\"\n },\n \"terminal\": {\n \"id\": \"<string>\",\n \"prompt_tip\": true,\n \"tip_amounts\": [\n 123\n ],\n \"prompt_cvv\": true,\n \"prompt_postal_code\": true,\n \"prompt_amount_confirmation\": true,\n \"prompt_signature\": true,\n \"key_card\": true\n },\n \"check\": {\n \"name\": \"<string>\",\n \"account_number\": \"<string>\",\n \"routing_number\": \"<string>\",\n \"check_number\": \"<string>\",\n \"verification\": {\n \"dob\": \"<string>\",\n \"ssn\": \"<string>\",\n \"drivers_license\": {\n \"number\": \"<string>\",\n \"state\": \"<string>\"\n }\n }\n },\n \"cash\": true\n },\n \"amount\": {\n \"value\": 500000000\n },\n \"order\": {\n \"bill_to\": {\n \"name\": \"<string>\",\n \"line1\": \"<string>\",\n \"line2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"country\": \"<string>\"\n },\n \"ship_to\": {\n \"name\": \"<string>\",\n \"line1\": \"<string>\",\n \"line2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"country\": \"<string>\"\n },\n \"discount\": 123,\n \"surcharge\": 123,\n \"shipping\": 123,\n \"email\": \"<string>\",\n \"tip\": 123,\n \"tax\": 123,\n \"total\": 123,\n \"date\": \"2023-11-07T05:31:56Z\",\n \"lines\": [\n {\n \"product_code\": \"<string>\",\n \"description\": \"<string>\",\n \"commodity_code\": \"<string>\",\n \"unit_of_measure\": \"<string>\",\n \"unit_cost\": 123,\n \"quantity\": 123,\n \"total\": 123,\n \"tax\": 123,\n \"tax_rate\": 123,\n \"discount\": 123,\n \"discount_rate\": 123,\n \"tax_type\": \"<string>\",\n \"alternate_tax_id\": \"<string>\"\n }\n ],\n \"metadata\": {}\n }\n}"
response = http.request(request)
puts response.read_body{}{}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}Authorizations
Use this
Body
application/jsontext/jsonapplication/*+json
Response
object | null
OK
The response is of type object | null.