curl --request POST \
--url https://api-sandbox.revolv3.com/api/PaymentMethod \
--header 'Content-Type: application/json-patch+json' \
--header 'x-revolv3-token: <api-key>' \
--data '
{
"billingAddress": {
"addressId": null,
"addressLine1": "100 Main Street",
"addressLine2": null,
"city": "Santa Ana",
"state": "CA",
"postalCode": "90000",
"phoneNumber": null,
"email": null,
"country": "US"
},
"creditCard": {
"paymentAccountNumber": "4111111111111111",
"expirationDate": "1025",
"securityCode": null,
"networkToken": null
},
"ach": null,
"googlePay": null,
"applePay": null,
"merchantPaymentMethodRefId": "payment-method-ref-id_hgays-213-4rf4",
"billingFirstName": "John",
"billingLastName": "Smith",
"billingFullName": null
}
'import requests
url = "https://api-sandbox.revolv3.com/api/PaymentMethod"
payload = {
"billingAddress": {
"addressId": None,
"addressLine1": "100 Main Street",
"addressLine2": None,
"city": "Santa Ana",
"state": "CA",
"postalCode": "90000",
"phoneNumber": None,
"email": None,
"country": "US"
},
"creditCard": {
"paymentAccountNumber": "4111111111111111",
"expirationDate": "1025",
"securityCode": None,
"networkToken": None
},
"ach": None,
"googlePay": None,
"applePay": None,
"merchantPaymentMethodRefId": "payment-method-ref-id_hgays-213-4rf4",
"billingFirstName": "John",
"billingLastName": "Smith",
"billingFullName": None
}
headers = {
"x-revolv3-token": "<api-key>",
"Content-Type": "application/json-patch+json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-revolv3-token': '<api-key>', 'Content-Type': 'application/json-patch+json'},
body: JSON.stringify({
billingAddress: {
addressId: null,
addressLine1: '100 Main Street',
addressLine2: null,
city: 'Santa Ana',
state: 'CA',
postalCode: '90000',
phoneNumber: null,
email: null,
country: 'US'
},
creditCard: {
paymentAccountNumber: '4111111111111111',
expirationDate: '1025',
securityCode: null,
networkToken: null
},
ach: null,
googlePay: null,
applePay: null,
merchantPaymentMethodRefId: 'payment-method-ref-id_hgays-213-4rf4',
billingFirstName: 'John',
billingLastName: 'Smith',
billingFullName: null
})
};
fetch('https://api-sandbox.revolv3.com/api/PaymentMethod', 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-sandbox.revolv3.com/api/PaymentMethod",
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([
'billingAddress' => [
'addressId' => null,
'addressLine1' => '100 Main Street',
'addressLine2' => null,
'city' => 'Santa Ana',
'state' => 'CA',
'postalCode' => '90000',
'phoneNumber' => null,
'email' => null,
'country' => 'US'
],
'creditCard' => [
'paymentAccountNumber' => '4111111111111111',
'expirationDate' => '1025',
'securityCode' => null,
'networkToken' => null
],
'ach' => null,
'googlePay' => null,
'applePay' => null,
'merchantPaymentMethodRefId' => 'payment-method-ref-id_hgays-213-4rf4',
'billingFirstName' => 'John',
'billingLastName' => 'Smith',
'billingFullName' => null
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json-patch+json",
"x-revolv3-token: <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-sandbox.revolv3.com/api/PaymentMethod"
payload := strings.NewReader("{\n \"billingAddress\": {\n \"addressId\": null,\n \"addressLine1\": \"100 Main Street\",\n \"addressLine2\": null,\n \"city\": \"Santa Ana\",\n \"state\": \"CA\",\n \"postalCode\": \"90000\",\n \"phoneNumber\": null,\n \"email\": null,\n \"country\": \"US\"\n },\n \"creditCard\": {\n \"paymentAccountNumber\": \"4111111111111111\",\n \"expirationDate\": \"1025\",\n \"securityCode\": null,\n \"networkToken\": null\n },\n \"ach\": null,\n \"googlePay\": null,\n \"applePay\": null,\n \"merchantPaymentMethodRefId\": \"payment-method-ref-id_hgays-213-4rf4\",\n \"billingFirstName\": \"John\",\n \"billingLastName\": \"Smith\",\n \"billingFullName\": null\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-revolv3-token", "<api-key>")
req.Header.Add("Content-Type", "application/json-patch+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-sandbox.revolv3.com/api/PaymentMethod")
.header("x-revolv3-token", "<api-key>")
.header("Content-Type", "application/json-patch+json")
.body("{\n \"billingAddress\": {\n \"addressId\": null,\n \"addressLine1\": \"100 Main Street\",\n \"addressLine2\": null,\n \"city\": \"Santa Ana\",\n \"state\": \"CA\",\n \"postalCode\": \"90000\",\n \"phoneNumber\": null,\n \"email\": null,\n \"country\": \"US\"\n },\n \"creditCard\": {\n \"paymentAccountNumber\": \"4111111111111111\",\n \"expirationDate\": \"1025\",\n \"securityCode\": null,\n \"networkToken\": null\n },\n \"ach\": null,\n \"googlePay\": null,\n \"applePay\": null,\n \"merchantPaymentMethodRefId\": \"payment-method-ref-id_hgays-213-4rf4\",\n \"billingFirstName\": \"John\",\n \"billingLastName\": \"Smith\",\n \"billingFullName\": null\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sandbox.revolv3.com/api/PaymentMethod")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-revolv3-token"] = '<api-key>'
request["Content-Type"] = 'application/json-patch+json'
request.body = "{\n \"billingAddress\": {\n \"addressId\": null,\n \"addressLine1\": \"100 Main Street\",\n \"addressLine2\": null,\n \"city\": \"Santa Ana\",\n \"state\": \"CA\",\n \"postalCode\": \"90000\",\n \"phoneNumber\": null,\n \"email\": null,\n \"country\": \"US\"\n },\n \"creditCard\": {\n \"paymentAccountNumber\": \"4111111111111111\",\n \"expirationDate\": \"1025\",\n \"securityCode\": null,\n \"networkToken\": null\n },\n \"ach\": null,\n \"googlePay\": null,\n \"applePay\": null,\n \"merchantPaymentMethodRefId\": \"payment-method-ref-id_hgays-213-4rf4\",\n \"billingFirstName\": \"John\",\n \"billingLastName\": \"Smith\",\n \"billingFullName\": null\n}"
response = http.request(request)
puts response.read_body{
"paymentMethodId": 1,
"billingAddressId": 1,
"billingAddress": {
"addressId": 1,
"addressLine1": "123 Main",
"addressLine2": null,
"city": "Santa Ana",
"state": "CA",
"postalCode": "90000",
"phoneNumber": null,
"email": null,
"country": "US"
},
"billingFirstName": "John",
"billingLastName": "Smith",
"merchantPaymentMethodRefId": "payment-method-ref-id_hgays-213-4rf4",
"paymentMethodAchDetails": null,
"paymentMethodCreditCardDetails": {
"binNumber": "411111",
"paymentLast4Digit": "1111",
"paymentExpirationDate": "1025",
"accountUpdateMessage": null,
"accountUpdateDateTime": null,
"accountUpdateCode": null
}
}{
"message": "Unable to perform the request action with provided data."
}{
"message": "Attempted to perform an unauthorized operation."
}Create Payment Method
Creates and stores a new payment method for a customer, such as a credit card, ACH account, or digital wallet token. This endpoint accepts full payment method details and securely tokenizes them for future use.
It’s typically used during onboarding, checkout, or when a customer wants to add a new card or bank account to their profile. The created payment method can later be used for subscriptions, or one-time payments.
curl --request POST \
--url https://api-sandbox.revolv3.com/api/PaymentMethod \
--header 'Content-Type: application/json-patch+json' \
--header 'x-revolv3-token: <api-key>' \
--data '
{
"billingAddress": {
"addressId": null,
"addressLine1": "100 Main Street",
"addressLine2": null,
"city": "Santa Ana",
"state": "CA",
"postalCode": "90000",
"phoneNumber": null,
"email": null,
"country": "US"
},
"creditCard": {
"paymentAccountNumber": "4111111111111111",
"expirationDate": "1025",
"securityCode": null,
"networkToken": null
},
"ach": null,
"googlePay": null,
"applePay": null,
"merchantPaymentMethodRefId": "payment-method-ref-id_hgays-213-4rf4",
"billingFirstName": "John",
"billingLastName": "Smith",
"billingFullName": null
}
'import requests
url = "https://api-sandbox.revolv3.com/api/PaymentMethod"
payload = {
"billingAddress": {
"addressId": None,
"addressLine1": "100 Main Street",
"addressLine2": None,
"city": "Santa Ana",
"state": "CA",
"postalCode": "90000",
"phoneNumber": None,
"email": None,
"country": "US"
},
"creditCard": {
"paymentAccountNumber": "4111111111111111",
"expirationDate": "1025",
"securityCode": None,
"networkToken": None
},
"ach": None,
"googlePay": None,
"applePay": None,
"merchantPaymentMethodRefId": "payment-method-ref-id_hgays-213-4rf4",
"billingFirstName": "John",
"billingLastName": "Smith",
"billingFullName": None
}
headers = {
"x-revolv3-token": "<api-key>",
"Content-Type": "application/json-patch+json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-revolv3-token': '<api-key>', 'Content-Type': 'application/json-patch+json'},
body: JSON.stringify({
billingAddress: {
addressId: null,
addressLine1: '100 Main Street',
addressLine2: null,
city: 'Santa Ana',
state: 'CA',
postalCode: '90000',
phoneNumber: null,
email: null,
country: 'US'
},
creditCard: {
paymentAccountNumber: '4111111111111111',
expirationDate: '1025',
securityCode: null,
networkToken: null
},
ach: null,
googlePay: null,
applePay: null,
merchantPaymentMethodRefId: 'payment-method-ref-id_hgays-213-4rf4',
billingFirstName: 'John',
billingLastName: 'Smith',
billingFullName: null
})
};
fetch('https://api-sandbox.revolv3.com/api/PaymentMethod', 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-sandbox.revolv3.com/api/PaymentMethod",
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([
'billingAddress' => [
'addressId' => null,
'addressLine1' => '100 Main Street',
'addressLine2' => null,
'city' => 'Santa Ana',
'state' => 'CA',
'postalCode' => '90000',
'phoneNumber' => null,
'email' => null,
'country' => 'US'
],
'creditCard' => [
'paymentAccountNumber' => '4111111111111111',
'expirationDate' => '1025',
'securityCode' => null,
'networkToken' => null
],
'ach' => null,
'googlePay' => null,
'applePay' => null,
'merchantPaymentMethodRefId' => 'payment-method-ref-id_hgays-213-4rf4',
'billingFirstName' => 'John',
'billingLastName' => 'Smith',
'billingFullName' => null
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json-patch+json",
"x-revolv3-token: <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-sandbox.revolv3.com/api/PaymentMethod"
payload := strings.NewReader("{\n \"billingAddress\": {\n \"addressId\": null,\n \"addressLine1\": \"100 Main Street\",\n \"addressLine2\": null,\n \"city\": \"Santa Ana\",\n \"state\": \"CA\",\n \"postalCode\": \"90000\",\n \"phoneNumber\": null,\n \"email\": null,\n \"country\": \"US\"\n },\n \"creditCard\": {\n \"paymentAccountNumber\": \"4111111111111111\",\n \"expirationDate\": \"1025\",\n \"securityCode\": null,\n \"networkToken\": null\n },\n \"ach\": null,\n \"googlePay\": null,\n \"applePay\": null,\n \"merchantPaymentMethodRefId\": \"payment-method-ref-id_hgays-213-4rf4\",\n \"billingFirstName\": \"John\",\n \"billingLastName\": \"Smith\",\n \"billingFullName\": null\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-revolv3-token", "<api-key>")
req.Header.Add("Content-Type", "application/json-patch+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-sandbox.revolv3.com/api/PaymentMethod")
.header("x-revolv3-token", "<api-key>")
.header("Content-Type", "application/json-patch+json")
.body("{\n \"billingAddress\": {\n \"addressId\": null,\n \"addressLine1\": \"100 Main Street\",\n \"addressLine2\": null,\n \"city\": \"Santa Ana\",\n \"state\": \"CA\",\n \"postalCode\": \"90000\",\n \"phoneNumber\": null,\n \"email\": null,\n \"country\": \"US\"\n },\n \"creditCard\": {\n \"paymentAccountNumber\": \"4111111111111111\",\n \"expirationDate\": \"1025\",\n \"securityCode\": null,\n \"networkToken\": null\n },\n \"ach\": null,\n \"googlePay\": null,\n \"applePay\": null,\n \"merchantPaymentMethodRefId\": \"payment-method-ref-id_hgays-213-4rf4\",\n \"billingFirstName\": \"John\",\n \"billingLastName\": \"Smith\",\n \"billingFullName\": null\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sandbox.revolv3.com/api/PaymentMethod")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-revolv3-token"] = '<api-key>'
request["Content-Type"] = 'application/json-patch+json'
request.body = "{\n \"billingAddress\": {\n \"addressId\": null,\n \"addressLine1\": \"100 Main Street\",\n \"addressLine2\": null,\n \"city\": \"Santa Ana\",\n \"state\": \"CA\",\n \"postalCode\": \"90000\",\n \"phoneNumber\": null,\n \"email\": null,\n \"country\": \"US\"\n },\n \"creditCard\": {\n \"paymentAccountNumber\": \"4111111111111111\",\n \"expirationDate\": \"1025\",\n \"securityCode\": null,\n \"networkToken\": null\n },\n \"ach\": null,\n \"googlePay\": null,\n \"applePay\": null,\n \"merchantPaymentMethodRefId\": \"payment-method-ref-id_hgays-213-4rf4\",\n \"billingFirstName\": \"John\",\n \"billingLastName\": \"Smith\",\n \"billingFullName\": null\n}"
response = http.request(request)
puts response.read_body{
"paymentMethodId": 1,
"billingAddressId": 1,
"billingAddress": {
"addressId": 1,
"addressLine1": "123 Main",
"addressLine2": null,
"city": "Santa Ana",
"state": "CA",
"postalCode": "90000",
"phoneNumber": null,
"email": null,
"country": "US"
},
"billingFirstName": "John",
"billingLastName": "Smith",
"merchantPaymentMethodRefId": "payment-method-ref-id_hgays-213-4rf4",
"paymentMethodAchDetails": null,
"paymentMethodCreditCardDetails": {
"binNumber": "411111",
"paymentLast4Digit": "1111",
"paymentExpirationDate": "1025",
"accountUpdateMessage": null,
"accountUpdateDateTime": null,
"accountUpdateCode": null
}
}{
"message": "Unable to perform the request action with provided data."
}{
"message": "Attempted to perform an unauthorized operation."
}Authorizations
Body
Conditional: either both BillingFirstName and BillingLastName or BillingFullName must be provided.
The customers’s first name associated with a payment method that is used for billing purposes.
100Conditional: either both BillingFirstName and BillingLastName or BillingFullName must be provided.
The customers’s last name associated with a payment method that is used for billing purposes.
100Conditional: either BillingFullName or both BillingFirstName and BillingLastName must be provided.
The customers’s full name associated with a payment method that is used for billing purposes.
200The address associated with a payment method that is used for billing purposes. Either an Address ID or detailed address information can be provided.
Show child attributes
Show child attributes
Conditional: one payment method type is required.
Payment card information.
Show child attributes
Show child attributes
Conditional: one payment method type is required.
ACH account information.
Show child attributes
Show child attributes
Conditional: one payment method type is required.
Google Pay information.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Merchant's unique identifier for the payment method.
100Response
The payment method was successfully created
The unique identifier for the payment method information.
1 <= x <= 1000000000The unique identifier of the address.
1 <= x <= 1000000000Show child attributes
Show child attributes
100100Merchant's unique identifier for the payment method.
100ACH account information.
Show child attributes
Show child attributes
The details of credit card payment method.
Show child attributes
Show child attributes

