Create Token
curl --request POST \
--url https://api.ecrypt.com/v1/tokens \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"credit_card": {
"expires": "0135",
"name_on_card": "John Doe",
"account_number": "4111111111111111",
"verification_value": "000",
"postal_code": "90210"
},
"check": {
"name": "<string>",
"account_number": "<string>",
"routing_number": "<string>",
"check_number": "<string>",
"verification": {
"dob": "<string>",
"ssn": "<string>",
"drivers_license": {
"number": "<string>",
"state": "<string>"
}
}
}
}
'import requests
url = "https://api.ecrypt.com/v1/tokens"
payload = {
"credit_card": {
"expires": "0135",
"name_on_card": "John Doe",
"account_number": "4111111111111111",
"verification_value": "000",
"postal_code": "90210"
},
"check": {
"name": "<string>",
"account_number": "<string>",
"routing_number": "<string>",
"check_number": "<string>",
"verification": {
"dob": "<string>",
"ssn": "<string>",
"drivers_license": {
"number": "<string>",
"state": "<string>"
}
}
}
}
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({
credit_card: {
expires: '0135',
name_on_card: 'John Doe',
account_number: '4111111111111111',
verification_value: '000',
postal_code: '90210'
},
check: {
name: '<string>',
account_number: '<string>',
routing_number: '<string>',
check_number: '<string>',
verification: {
dob: '<string>',
ssn: '<string>',
drivers_license: {number: '<string>', state: '<string>'}
}
}
})
};
fetch('https://api.ecrypt.com/v1/tokens', 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/tokens",
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([
'credit_card' => [
'expires' => '0135',
'name_on_card' => 'John Doe',
'account_number' => '4111111111111111',
'verification_value' => '000',
'postal_code' => '90210'
],
'check' => [
'name' => '<string>',
'account_number' => '<string>',
'routing_number' => '<string>',
'check_number' => '<string>',
'verification' => [
'dob' => '<string>',
'ssn' => '<string>',
'drivers_license' => [
'number' => '<string>',
'state' => '<string>'
]
]
]
]),
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/tokens"
payload := strings.NewReader("{\n \"credit_card\": {\n \"expires\": \"0135\",\n \"name_on_card\": \"John Doe\",\n \"account_number\": \"4111111111111111\",\n \"verification_value\": \"000\",\n \"postal_code\": \"90210\"\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}")
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/tokens")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"credit_card\": {\n \"expires\": \"0135\",\n \"name_on_card\": \"John Doe\",\n \"account_number\": \"4111111111111111\",\n \"verification_value\": \"000\",\n \"postal_code\": \"90210\"\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}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ecrypt.com/v1/tokens")
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 \"credit_card\": {\n \"expires\": \"0135\",\n \"name_on_card\": \"John Doe\",\n \"account_number\": \"4111111111111111\",\n \"verification_value\": \"000\",\n \"postal_code\": \"90210\"\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}"
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>"
}Tokens
Create Token
Payment Tokens support credit card’s and ACH bank account information. Tokens, can be for one time use, or stored and saved to a customers profile.
POST
/
v1
/
tokens
Create Token
curl --request POST \
--url https://api.ecrypt.com/v1/tokens \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"credit_card": {
"expires": "0135",
"name_on_card": "John Doe",
"account_number": "4111111111111111",
"verification_value": "000",
"postal_code": "90210"
},
"check": {
"name": "<string>",
"account_number": "<string>",
"routing_number": "<string>",
"check_number": "<string>",
"verification": {
"dob": "<string>",
"ssn": "<string>",
"drivers_license": {
"number": "<string>",
"state": "<string>"
}
}
}
}
'import requests
url = "https://api.ecrypt.com/v1/tokens"
payload = {
"credit_card": {
"expires": "0135",
"name_on_card": "John Doe",
"account_number": "4111111111111111",
"verification_value": "000",
"postal_code": "90210"
},
"check": {
"name": "<string>",
"account_number": "<string>",
"routing_number": "<string>",
"check_number": "<string>",
"verification": {
"dob": "<string>",
"ssn": "<string>",
"drivers_license": {
"number": "<string>",
"state": "<string>"
}
}
}
}
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({
credit_card: {
expires: '0135',
name_on_card: 'John Doe',
account_number: '4111111111111111',
verification_value: '000',
postal_code: '90210'
},
check: {
name: '<string>',
account_number: '<string>',
routing_number: '<string>',
check_number: '<string>',
verification: {
dob: '<string>',
ssn: '<string>',
drivers_license: {number: '<string>', state: '<string>'}
}
}
})
};
fetch('https://api.ecrypt.com/v1/tokens', 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/tokens",
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([
'credit_card' => [
'expires' => '0135',
'name_on_card' => 'John Doe',
'account_number' => '4111111111111111',
'verification_value' => '000',
'postal_code' => '90210'
],
'check' => [
'name' => '<string>',
'account_number' => '<string>',
'routing_number' => '<string>',
'check_number' => '<string>',
'verification' => [
'dob' => '<string>',
'ssn' => '<string>',
'drivers_license' => [
'number' => '<string>',
'state' => '<string>'
]
]
]
]),
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/tokens"
payload := strings.NewReader("{\n \"credit_card\": {\n \"expires\": \"0135\",\n \"name_on_card\": \"John Doe\",\n \"account_number\": \"4111111111111111\",\n \"verification_value\": \"000\",\n \"postal_code\": \"90210\"\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}")
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/tokens")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"credit_card\": {\n \"expires\": \"0135\",\n \"name_on_card\": \"John Doe\",\n \"account_number\": \"4111111111111111\",\n \"verification_value\": \"000\",\n \"postal_code\": \"90210\"\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}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ecrypt.com/v1/tokens")
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 \"credit_card\": {\n \"expires\": \"0135\",\n \"name_on_card\": \"John Doe\",\n \"account_number\": \"4111111111111111\",\n \"verification_value\": \"000\",\n \"postal_code\": \"90210\"\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}"
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>"
}