Request charge authorization from a customer
curl --request POST \
--url https://rest.staging.nickel.com/customer/{customerId}/requestChargeAuthorization \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"sendEmail": true,
"emails": [
"<string>"
],
"memo": "<string>",
"transactionLimitCents": 123,
"expirationDate": "2023-12-25",
"paymentMethodTypes": []
}
'import requests
url = "https://rest.staging.nickel.com/customer/{customerId}/requestChargeAuthorization"
payload = {
"sendEmail": True,
"emails": ["<string>"],
"memo": "<string>",
"transactionLimitCents": 123,
"expirationDate": "2023-12-25",
"paymentMethodTypes": []
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
sendEmail: true,
emails: ['<string>'],
memo: '<string>',
transactionLimitCents: 123,
expirationDate: '2023-12-25',
paymentMethodTypes: []
})
};
fetch('https://rest.staging.nickel.com/customer/{customerId}/requestChargeAuthorization', 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://rest.staging.nickel.com/customer/{customerId}/requestChargeAuthorization",
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([
'sendEmail' => true,
'emails' => [
'<string>'
],
'memo' => '<string>',
'transactionLimitCents' => 123,
'expirationDate' => '2023-12-25',
'paymentMethodTypes' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://rest.staging.nickel.com/customer/{customerId}/requestChargeAuthorization"
payload := strings.NewReader("{\n \"sendEmail\": true,\n \"emails\": [\n \"<string>\"\n ],\n \"memo\": \"<string>\",\n \"transactionLimitCents\": 123,\n \"expirationDate\": \"2023-12-25\",\n \"paymentMethodTypes\": []\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://rest.staging.nickel.com/customer/{customerId}/requestChargeAuthorization")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"sendEmail\": true,\n \"emails\": [\n \"<string>\"\n ],\n \"memo\": \"<string>\",\n \"transactionLimitCents\": 123,\n \"expirationDate\": \"2023-12-25\",\n \"paymentMethodTypes\": []\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://rest.staging.nickel.com/customer/{customerId}/requestChargeAuthorization")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"sendEmail\": true,\n \"emails\": [\n \"<string>\"\n ],\n \"memo\": \"<string>\",\n \"transactionLimitCents\": 123,\n \"expirationDate\": \"2023-12-25\",\n \"paymentMethodTypes\": []\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"customerId": "<string>",
"paymentMethod": {
"id": "<string>",
"type": "ACH",
"achDetails": {
"bankName": "JP Morgan Chase",
"routingNumber": "<string>",
"accountNumberLastFour": "<string>"
},
"cardDetails": {
"brand": "visa",
"last4": "<string>",
"holderName": "<string>",
"expMonth": "2",
"expYear": "2030"
},
"billingDetails": {
"name": "<string>",
"companyName": "<string>",
"street": "<string>",
"city": "<string>",
"state": "<string>",
"zip": "<string>",
"email": "<string>"
}
},
"transactionLimitInCents": 123,
"expiresAt": 123,
"active": true,
"url": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Charge Authorization
Request charge authorization from a customer
POST
/
customer
/
{customerId}
/
requestChargeAuthorization
Request charge authorization from a customer
curl --request POST \
--url https://rest.staging.nickel.com/customer/{customerId}/requestChargeAuthorization \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"sendEmail": true,
"emails": [
"<string>"
],
"memo": "<string>",
"transactionLimitCents": 123,
"expirationDate": "2023-12-25",
"paymentMethodTypes": []
}
'import requests
url = "https://rest.staging.nickel.com/customer/{customerId}/requestChargeAuthorization"
payload = {
"sendEmail": True,
"emails": ["<string>"],
"memo": "<string>",
"transactionLimitCents": 123,
"expirationDate": "2023-12-25",
"paymentMethodTypes": []
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
sendEmail: true,
emails: ['<string>'],
memo: '<string>',
transactionLimitCents: 123,
expirationDate: '2023-12-25',
paymentMethodTypes: []
})
};
fetch('https://rest.staging.nickel.com/customer/{customerId}/requestChargeAuthorization', 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://rest.staging.nickel.com/customer/{customerId}/requestChargeAuthorization",
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([
'sendEmail' => true,
'emails' => [
'<string>'
],
'memo' => '<string>',
'transactionLimitCents' => 123,
'expirationDate' => '2023-12-25',
'paymentMethodTypes' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://rest.staging.nickel.com/customer/{customerId}/requestChargeAuthorization"
payload := strings.NewReader("{\n \"sendEmail\": true,\n \"emails\": [\n \"<string>\"\n ],\n \"memo\": \"<string>\",\n \"transactionLimitCents\": 123,\n \"expirationDate\": \"2023-12-25\",\n \"paymentMethodTypes\": []\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://rest.staging.nickel.com/customer/{customerId}/requestChargeAuthorization")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"sendEmail\": true,\n \"emails\": [\n \"<string>\"\n ],\n \"memo\": \"<string>\",\n \"transactionLimitCents\": 123,\n \"expirationDate\": \"2023-12-25\",\n \"paymentMethodTypes\": []\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://rest.staging.nickel.com/customer/{customerId}/requestChargeAuthorization")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"sendEmail\": true,\n \"emails\": [\n \"<string>\"\n ],\n \"memo\": \"<string>\",\n \"transactionLimitCents\": 123,\n \"expirationDate\": \"2023-12-25\",\n \"paymentMethodTypes\": []\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"customerId": "<string>",
"paymentMethod": {
"id": "<string>",
"type": "ACH",
"achDetails": {
"bankName": "JP Morgan Chase",
"routingNumber": "<string>",
"accountNumberLastFour": "<string>"
},
"cardDetails": {
"brand": "visa",
"last4": "<string>",
"holderName": "<string>",
"expMonth": "2",
"expYear": "2030"
},
"billingDetails": {
"name": "<string>",
"companyName": "<string>",
"street": "<string>",
"city": "<string>",
"state": "<string>",
"zip": "<string>",
"email": "<string>"
}
},
"transactionLimitInCents": 123,
"expiresAt": 123,
"active": true,
"url": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
ID of the customer that needs to be fetched
Body
application/json
Charge authorization request details. If emails are omitted, the customer's emails on file are used.
