Create Customer Wallet Payment Method
curl --request POST \
--url https://api.ecrypt.com/v1/customers/{Customer}/wallet \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"token": "00000000-0000-0000-0000-000000000000",
"transaction_id": "0",
"default": true,
"billing_address": {
"name": "<string>",
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>",
"country": "<string>"
}
}
'import requests
url = "https://api.ecrypt.com/v1/customers/{Customer}/wallet"
payload = {
"token": "00000000-0000-0000-0000-000000000000",
"transaction_id": "0",
"default": True,
"billing_address": {
"name": "<string>",
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>",
"country": "<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({
token: '00000000-0000-0000-0000-000000000000',
transaction_id: '0',
default: true,
billing_address: {
name: '<string>',
line1: '<string>',
line2: '<string>',
city: '<string>',
state: '<string>',
postal_code: '<string>',
country: '<string>'
}
})
};
fetch('https://api.ecrypt.com/v1/customers/{Customer}/wallet', 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/customers/{Customer}/wallet",
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([
'token' => '00000000-0000-0000-0000-000000000000',
'transaction_id' => '0',
'default' => true,
'billing_address' => [
'name' => '<string>',
'line1' => '<string>',
'line2' => '<string>',
'city' => '<string>',
'state' => '<string>',
'postal_code' => '<string>',
'country' => '<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/customers/{Customer}/wallet"
payload := strings.NewReader("{\n \"token\": \"00000000-0000-0000-0000-000000000000\",\n \"transaction_id\": \"0\",\n \"default\": true,\n \"billing_address\": {\n \"name\": \"<string>\",\n \"line1\": \"<string>\",\n \"line2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"country\": \"<string>\"\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/customers/{Customer}/wallet")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"token\": \"00000000-0000-0000-0000-000000000000\",\n \"transaction_id\": \"0\",\n \"default\": true,\n \"billing_address\": {\n \"name\": \"<string>\",\n \"line1\": \"<string>\",\n \"line2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"country\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ecrypt.com/v1/customers/{Customer}/wallet")
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 \"token\": \"00000000-0000-0000-0000-000000000000\",\n \"transaction_id\": \"0\",\n \"default\": true,\n \"billing_address\": {\n \"name\": \"<string>\",\n \"line1\": \"<string>\",\n \"line2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"country\": \"<string>\"\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>"
}Customers Wallet
Create Customer Wallet Payment Method
POST
/
v1
/
customers
/
{Customer}
/
wallet
Create Customer Wallet Payment Method
curl --request POST \
--url https://api.ecrypt.com/v1/customers/{Customer}/wallet \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"token": "00000000-0000-0000-0000-000000000000",
"transaction_id": "0",
"default": true,
"billing_address": {
"name": "<string>",
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>",
"country": "<string>"
}
}
'import requests
url = "https://api.ecrypt.com/v1/customers/{Customer}/wallet"
payload = {
"token": "00000000-0000-0000-0000-000000000000",
"transaction_id": "0",
"default": True,
"billing_address": {
"name": "<string>",
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>",
"country": "<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({
token: '00000000-0000-0000-0000-000000000000',
transaction_id: '0',
default: true,
billing_address: {
name: '<string>',
line1: '<string>',
line2: '<string>',
city: '<string>',
state: '<string>',
postal_code: '<string>',
country: '<string>'
}
})
};
fetch('https://api.ecrypt.com/v1/customers/{Customer}/wallet', 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/customers/{Customer}/wallet",
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([
'token' => '00000000-0000-0000-0000-000000000000',
'transaction_id' => '0',
'default' => true,
'billing_address' => [
'name' => '<string>',
'line1' => '<string>',
'line2' => '<string>',
'city' => '<string>',
'state' => '<string>',
'postal_code' => '<string>',
'country' => '<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/customers/{Customer}/wallet"
payload := strings.NewReader("{\n \"token\": \"00000000-0000-0000-0000-000000000000\",\n \"transaction_id\": \"0\",\n \"default\": true,\n \"billing_address\": {\n \"name\": \"<string>\",\n \"line1\": \"<string>\",\n \"line2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"country\": \"<string>\"\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/customers/{Customer}/wallet")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"token\": \"00000000-0000-0000-0000-000000000000\",\n \"transaction_id\": \"0\",\n \"default\": true,\n \"billing_address\": {\n \"name\": \"<string>\",\n \"line1\": \"<string>\",\n \"line2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"country\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ecrypt.com/v1/customers/{Customer}/wallet")
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 \"token\": \"00000000-0000-0000-0000-000000000000\",\n \"transaction_id\": \"0\",\n \"default\": true,\n \"billing_address\": {\n \"name\": \"<string>\",\n \"line1\": \"<string>\",\n \"line2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"country\": \"<string>\"\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
Path Parameters
Required string length:
8 - 64Pattern:
^[0-9A-Za-z-]*$Body
application/jsontext/jsonapplication/*+json
Token generated from the tokens endpoint
Required string length:
8 - 64Pattern:
^[0-9A-Za-z-]*$Approved Transaction ID
Required string length:
8 - 64Pattern:
^[0-9]*$Make this the default payment method
Show child attributes
Show child attributes
Response
object | null
OK
The response is of type object | null.