Create payment method
curl --request POST \
--url https://api.wizcommerce.com/v1/payment-methods \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"reference_id": "CRD_1234567890",
"customer_id": "00000000-0000-0000-0000-000000000000",
"provider": "stripe",
"payment_method_type": "card",
"card_type": "debit",
"brand": "visa",
"card_expiry": "09/25",
"last_four_digits": "1111",
"token": "PIuTv1UgBqESZ2KRDixPtDJt~1234567890",
"external_customer_id": "cus_ABC123456",
"display_name": "John Doe",
"is_default": false,
"address_line_1": "123 Main St",
"address_line_2": "Apt 101",
"city": "Anytown",
"state": "CA",
"country": "US",
"zip_code": "12345",
"email": "john.doe@example.com",
"phone": "+14155552671",
"first_name": "John",
"last_name": "Doe"
}
'import requests
url = "https://api.wizcommerce.com/v1/payment-methods"
payload = {
"reference_id": "CRD_1234567890",
"customer_id": "00000000-0000-0000-0000-000000000000",
"provider": "stripe",
"payment_method_type": "card",
"card_type": "debit",
"brand": "visa",
"card_expiry": "09/25",
"last_four_digits": "1111",
"token": "PIuTv1UgBqESZ2KRDixPtDJt~1234567890",
"external_customer_id": "cus_ABC123456",
"display_name": "John Doe",
"is_default": False,
"address_line_1": "123 Main St",
"address_line_2": "Apt 101",
"city": "Anytown",
"state": "CA",
"country": "US",
"zip_code": "12345",
"email": "john.doe@example.com",
"phone": "+14155552671",
"first_name": "John",
"last_name": "Doe"
}
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({
reference_id: 'CRD_1234567890',
customer_id: '00000000-0000-0000-0000-000000000000',
provider: 'stripe',
payment_method_type: 'card',
card_type: 'debit',
brand: 'visa',
card_expiry: '09/25',
last_four_digits: '1111',
token: 'PIuTv1UgBqESZ2KRDixPtDJt~1234567890',
external_customer_id: 'cus_ABC123456',
display_name: 'John Doe',
is_default: false,
address_line_1: '123 Main St',
address_line_2: 'Apt 101',
city: 'Anytown',
state: 'CA',
country: 'US',
zip_code: '12345',
email: 'john.doe@example.com',
phone: '+14155552671',
first_name: 'John',
last_name: 'Doe'
})
};
fetch('https://api.wizcommerce.com/v1/payment-methods', 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.wizcommerce.com/v1/payment-methods",
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([
'reference_id' => 'CRD_1234567890',
'customer_id' => '00000000-0000-0000-0000-000000000000',
'provider' => 'stripe',
'payment_method_type' => 'card',
'card_type' => 'debit',
'brand' => 'visa',
'card_expiry' => '09/25',
'last_four_digits' => '1111',
'token' => 'PIuTv1UgBqESZ2KRDixPtDJt~1234567890',
'external_customer_id' => 'cus_ABC123456',
'display_name' => 'John Doe',
'is_default' => false,
'address_line_1' => '123 Main St',
'address_line_2' => 'Apt 101',
'city' => 'Anytown',
'state' => 'CA',
'country' => 'US',
'zip_code' => '12345',
'email' => 'john.doe@example.com',
'phone' => '+14155552671',
'first_name' => 'John',
'last_name' => 'Doe'
]),
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.wizcommerce.com/v1/payment-methods"
payload := strings.NewReader("{\n \"reference_id\": \"CRD_1234567890\",\n \"customer_id\": \"00000000-0000-0000-0000-000000000000\",\n \"provider\": \"stripe\",\n \"payment_method_type\": \"card\",\n \"card_type\": \"debit\",\n \"brand\": \"visa\",\n \"card_expiry\": \"09/25\",\n \"last_four_digits\": \"1111\",\n \"token\": \"PIuTv1UgBqESZ2KRDixPtDJt~1234567890\",\n \"external_customer_id\": \"cus_ABC123456\",\n \"display_name\": \"John Doe\",\n \"is_default\": false,\n \"address_line_1\": \"123 Main St\",\n \"address_line_2\": \"Apt 101\",\n \"city\": \"Anytown\",\n \"state\": \"CA\",\n \"country\": \"US\",\n \"zip_code\": \"12345\",\n \"email\": \"john.doe@example.com\",\n \"phone\": \"+14155552671\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\"\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.wizcommerce.com/v1/payment-methods")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"reference_id\": \"CRD_1234567890\",\n \"customer_id\": \"00000000-0000-0000-0000-000000000000\",\n \"provider\": \"stripe\",\n \"payment_method_type\": \"card\",\n \"card_type\": \"debit\",\n \"brand\": \"visa\",\n \"card_expiry\": \"09/25\",\n \"last_four_digits\": \"1111\",\n \"token\": \"PIuTv1UgBqESZ2KRDixPtDJt~1234567890\",\n \"external_customer_id\": \"cus_ABC123456\",\n \"display_name\": \"John Doe\",\n \"is_default\": false,\n \"address_line_1\": \"123 Main St\",\n \"address_line_2\": \"Apt 101\",\n \"city\": \"Anytown\",\n \"state\": \"CA\",\n \"country\": \"US\",\n \"zip_code\": \"12345\",\n \"email\": \"john.doe@example.com\",\n \"phone\": \"+14155552671\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wizcommerce.com/v1/payment-methods")
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 \"reference_id\": \"CRD_1234567890\",\n \"customer_id\": \"00000000-0000-0000-0000-000000000000\",\n \"provider\": \"stripe\",\n \"payment_method_type\": \"card\",\n \"card_type\": \"debit\",\n \"brand\": \"visa\",\n \"card_expiry\": \"09/25\",\n \"last_four_digits\": \"1111\",\n \"token\": \"PIuTv1UgBqESZ2KRDixPtDJt~1234567890\",\n \"external_customer_id\": \"cus_ABC123456\",\n \"display_name\": \"John Doe\",\n \"is_default\": false,\n \"address_line_1\": \"123 Main St\",\n \"address_line_2\": \"Apt 101\",\n \"city\": \"Anytown\",\n \"state\": \"CA\",\n \"country\": \"US\",\n \"zip_code\": \"12345\",\n \"email\": \"john.doe@example.com\",\n \"phone\": \"+14155552671\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "01f5d171-d3e3-4b2b-bd57-0727194b5bed",
"reference_id": "EXT-878",
"customer_id": "CST-137",
"provider": "stax",
"payment_method_type": "card",
"card_type": "debit",
"brand": "visa",
"status": "active",
"card_expiry": "09/25",
"last_four_digits": "1234",
"display_name": "John Doe",
"address_line_1": "123 Main St",
"address_line_2": "Apt 101",
"city": "Anytown",
"state": "CA",
"country": "US",
"zip_code": "12345",
"email": "john.doe@example.com",
"phone": "+14155552671",
"first_name": "John",
"last_name": "Doe",
"created_at": "2025-01-01T15:04:05Z",
"updated_at": "2025-01-01T15:04:05Z",
"is_default": false
}
}{
"code": "<string>",
"message": "<string>",
"details": [
{
"field": "<string>",
"reason": "<string>"
}
]
}{
"code": "<string>",
"message": "<string>",
"details": [
{
"field": "<string>",
"reason": "<string>"
}
]
}{
"code": "<string>",
"message": "<string>",
"details": [
{
"field": "<string>",
"reason": "<string>"
}
]
}{
"code": "<string>",
"message": "<string>",
"details": [
{
"field": "<string>",
"reason": "<string>"
}
]
}Payment Method
Create payment method
Create payment method
POST
/
v1
/
payment-methods
Create payment method
curl --request POST \
--url https://api.wizcommerce.com/v1/payment-methods \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"reference_id": "CRD_1234567890",
"customer_id": "00000000-0000-0000-0000-000000000000",
"provider": "stripe",
"payment_method_type": "card",
"card_type": "debit",
"brand": "visa",
"card_expiry": "09/25",
"last_four_digits": "1111",
"token": "PIuTv1UgBqESZ2KRDixPtDJt~1234567890",
"external_customer_id": "cus_ABC123456",
"display_name": "John Doe",
"is_default": false,
"address_line_1": "123 Main St",
"address_line_2": "Apt 101",
"city": "Anytown",
"state": "CA",
"country": "US",
"zip_code": "12345",
"email": "john.doe@example.com",
"phone": "+14155552671",
"first_name": "John",
"last_name": "Doe"
}
'import requests
url = "https://api.wizcommerce.com/v1/payment-methods"
payload = {
"reference_id": "CRD_1234567890",
"customer_id": "00000000-0000-0000-0000-000000000000",
"provider": "stripe",
"payment_method_type": "card",
"card_type": "debit",
"brand": "visa",
"card_expiry": "09/25",
"last_four_digits": "1111",
"token": "PIuTv1UgBqESZ2KRDixPtDJt~1234567890",
"external_customer_id": "cus_ABC123456",
"display_name": "John Doe",
"is_default": False,
"address_line_1": "123 Main St",
"address_line_2": "Apt 101",
"city": "Anytown",
"state": "CA",
"country": "US",
"zip_code": "12345",
"email": "john.doe@example.com",
"phone": "+14155552671",
"first_name": "John",
"last_name": "Doe"
}
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({
reference_id: 'CRD_1234567890',
customer_id: '00000000-0000-0000-0000-000000000000',
provider: 'stripe',
payment_method_type: 'card',
card_type: 'debit',
brand: 'visa',
card_expiry: '09/25',
last_four_digits: '1111',
token: 'PIuTv1UgBqESZ2KRDixPtDJt~1234567890',
external_customer_id: 'cus_ABC123456',
display_name: 'John Doe',
is_default: false,
address_line_1: '123 Main St',
address_line_2: 'Apt 101',
city: 'Anytown',
state: 'CA',
country: 'US',
zip_code: '12345',
email: 'john.doe@example.com',
phone: '+14155552671',
first_name: 'John',
last_name: 'Doe'
})
};
fetch('https://api.wizcommerce.com/v1/payment-methods', 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.wizcommerce.com/v1/payment-methods",
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([
'reference_id' => 'CRD_1234567890',
'customer_id' => '00000000-0000-0000-0000-000000000000',
'provider' => 'stripe',
'payment_method_type' => 'card',
'card_type' => 'debit',
'brand' => 'visa',
'card_expiry' => '09/25',
'last_four_digits' => '1111',
'token' => 'PIuTv1UgBqESZ2KRDixPtDJt~1234567890',
'external_customer_id' => 'cus_ABC123456',
'display_name' => 'John Doe',
'is_default' => false,
'address_line_1' => '123 Main St',
'address_line_2' => 'Apt 101',
'city' => 'Anytown',
'state' => 'CA',
'country' => 'US',
'zip_code' => '12345',
'email' => 'john.doe@example.com',
'phone' => '+14155552671',
'first_name' => 'John',
'last_name' => 'Doe'
]),
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.wizcommerce.com/v1/payment-methods"
payload := strings.NewReader("{\n \"reference_id\": \"CRD_1234567890\",\n \"customer_id\": \"00000000-0000-0000-0000-000000000000\",\n \"provider\": \"stripe\",\n \"payment_method_type\": \"card\",\n \"card_type\": \"debit\",\n \"brand\": \"visa\",\n \"card_expiry\": \"09/25\",\n \"last_four_digits\": \"1111\",\n \"token\": \"PIuTv1UgBqESZ2KRDixPtDJt~1234567890\",\n \"external_customer_id\": \"cus_ABC123456\",\n \"display_name\": \"John Doe\",\n \"is_default\": false,\n \"address_line_1\": \"123 Main St\",\n \"address_line_2\": \"Apt 101\",\n \"city\": \"Anytown\",\n \"state\": \"CA\",\n \"country\": \"US\",\n \"zip_code\": \"12345\",\n \"email\": \"john.doe@example.com\",\n \"phone\": \"+14155552671\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\"\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.wizcommerce.com/v1/payment-methods")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"reference_id\": \"CRD_1234567890\",\n \"customer_id\": \"00000000-0000-0000-0000-000000000000\",\n \"provider\": \"stripe\",\n \"payment_method_type\": \"card\",\n \"card_type\": \"debit\",\n \"brand\": \"visa\",\n \"card_expiry\": \"09/25\",\n \"last_four_digits\": \"1111\",\n \"token\": \"PIuTv1UgBqESZ2KRDixPtDJt~1234567890\",\n \"external_customer_id\": \"cus_ABC123456\",\n \"display_name\": \"John Doe\",\n \"is_default\": false,\n \"address_line_1\": \"123 Main St\",\n \"address_line_2\": \"Apt 101\",\n \"city\": \"Anytown\",\n \"state\": \"CA\",\n \"country\": \"US\",\n \"zip_code\": \"12345\",\n \"email\": \"john.doe@example.com\",\n \"phone\": \"+14155552671\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wizcommerce.com/v1/payment-methods")
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 \"reference_id\": \"CRD_1234567890\",\n \"customer_id\": \"00000000-0000-0000-0000-000000000000\",\n \"provider\": \"stripe\",\n \"payment_method_type\": \"card\",\n \"card_type\": \"debit\",\n \"brand\": \"visa\",\n \"card_expiry\": \"09/25\",\n \"last_four_digits\": \"1111\",\n \"token\": \"PIuTv1UgBqESZ2KRDixPtDJt~1234567890\",\n \"external_customer_id\": \"cus_ABC123456\",\n \"display_name\": \"John Doe\",\n \"is_default\": false,\n \"address_line_1\": \"123 Main St\",\n \"address_line_2\": \"Apt 101\",\n \"city\": \"Anytown\",\n \"state\": \"CA\",\n \"country\": \"US\",\n \"zip_code\": \"12345\",\n \"email\": \"john.doe@example.com\",\n \"phone\": \"+14155552671\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "01f5d171-d3e3-4b2b-bd57-0727194b5bed",
"reference_id": "EXT-878",
"customer_id": "CST-137",
"provider": "stax",
"payment_method_type": "card",
"card_type": "debit",
"brand": "visa",
"status": "active",
"card_expiry": "09/25",
"last_four_digits": "1234",
"display_name": "John Doe",
"address_line_1": "123 Main St",
"address_line_2": "Apt 101",
"city": "Anytown",
"state": "CA",
"country": "US",
"zip_code": "12345",
"email": "john.doe@example.com",
"phone": "+14155552671",
"first_name": "John",
"last_name": "Doe",
"created_at": "2025-01-01T15:04:05Z",
"updated_at": "2025-01-01T15:04:05Z",
"is_default": false
}
}{
"code": "<string>",
"message": "<string>",
"details": [
{
"field": "<string>",
"reason": "<string>"
}
]
}{
"code": "<string>",
"message": "<string>",
"details": [
{
"field": "<string>",
"reason": "<string>"
}
]
}{
"code": "<string>",
"message": "<string>",
"details": [
{
"field": "<string>",
"reason": "<string>"
}
]
}{
"code": "<string>",
"message": "<string>",
"details": [
{
"field": "<string>",
"reason": "<string>"
}
]
}Authorizations
API Key for authentication
Body
application/json
body
Maximum string length:
255Example:
"CRD_1234567890"
Example:
"00000000-0000-0000-0000-000000000000"
Maximum string length:
50Example:
"stripe"
Maximum string length:
50Example:
"card"
Maximum string length:
50Example:
"debit"
Maximum string length:
50Example:
"visa"
Example:
"09/25"
Maximum string length:
4Example:
"1111"
Example:
"PIuTv1UgBqESZ2KRDixPtDJt~1234567890"
Maximum string length:
255Example:
"cus_ABC123456"
Maximum string length:
50Example:
"John Doe"
Maximum string length:
255Example:
"123 Main St"
Maximum string length:
255Example:
"Apt 101"
Maximum string length:
50Example:
"Anytown"
Maximum string length:
50Example:
"CA"
Example:
"US"
Maximum string length:
50Example:
"12345"
Example:
"john.doe@example.com"
Example:
"+14155552671"
Maximum string length:
50Example:
"John"
Maximum string length:
50Example:
"Doe"
Response
Created
Show child attributes
Show child attributes
Was this page helpful?
⌘I
