Create Payment via Card Information (S2S)
This endpoint allows you to create a card payment intent using raw card information.
card_infoobject is required and should contain the card number, expiry month/year, CVV, and cardholder name.webhook_notificationobject is optional. If not provided, we will use your default webhook configuration that you’ve previously set up. If provided, we will send webhook notifications to the specified endpoint for this specific payment.- When the card requires 3DS authentication, we will return a
pay_codeobject containing{3ds_url: ''}. You must direct your customer to this URL to authorise the payment. After successful authorisation, the customer will return toreturn_url, and you can use the capture API normally to collect the payment from the user. - If
captureis set totrue, the payment will be automatically captured after successful authorisation. Ifcaptureis set tofalse, the payment will remain in theauthorisedstatus until you explicitly call the capture API.
When the payment reaches the authorised status, a token object will be returned in the API response and also included in the webhook notification.
You should save this token to create future payments without requiring your customer to re-enter their card details.
curl --request POST \
--url https://sandbox-api.lightningpay.me/api/v2/cards/charges \
--header 'Content-Type: application/json' \
--header 'app-id: <api-key>' \
--header 'secret-key: <api-key>' \
--data '
{
"amount": 1000,
"currency": "AUD",
"email": "email@gmail.com",
"first_name": "John",
"last_name": "Doe",
"billing_address": {
"city": "Sydney",
"state": "NSW",
"country": "AU",
"postal_code": "2000",
"address": "123 Main Street"
},
"card_info": {
"card_number": "4111111111111111",
"card_expiry_month": 12,
"card_expiry_year": 2028,
"card_cvv_number": "123",
"card_holder_name": "John Doe"
},
"external_id": "order_test_xxx",
"return_url": "https://example.com",
"description": "Payment for invoice #1234",
"payment_type": "regular",
"charge_reason": "resubmission",
"previous_payment_uuid": "1GKPTU7E",
"ip_address": "192.168.1.1",
"capture": false
}
'import requests
url = "https://sandbox-api.lightningpay.me/api/v2/cards/charges"
payload = {
"amount": 1000,
"currency": "AUD",
"email": "email@gmail.com",
"first_name": "John",
"last_name": "Doe",
"billing_address": {
"city": "Sydney",
"state": "NSW",
"country": "AU",
"postal_code": "2000",
"address": "123 Main Street"
},
"card_info": {
"card_number": "4111111111111111",
"card_expiry_month": 12,
"card_expiry_year": 2028,
"card_cvv_number": "123",
"card_holder_name": "John Doe"
},
"external_id": "order_test_xxx",
"return_url": "https://example.com",
"description": "Payment for invoice #1234",
"payment_type": "regular",
"charge_reason": "resubmission",
"previous_payment_uuid": "1GKPTU7E",
"ip_address": "192.168.1.1",
"capture": False
}
headers = {
"app-id": "<api-key>",
"secret-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'app-id': '<api-key>',
'secret-key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
amount: 1000,
currency: 'AUD',
email: 'email@gmail.com',
first_name: 'John',
last_name: 'Doe',
billing_address: {
city: 'Sydney',
state: 'NSW',
country: 'AU',
postal_code: '2000',
address: '123 Main Street'
},
card_info: {
card_number: '4111111111111111',
card_expiry_month: 12,
card_expiry_year: 2028,
card_cvv_number: '123',
card_holder_name: 'John Doe'
},
external_id: 'order_test_xxx',
return_url: 'https://example.com',
description: 'Payment for invoice #1234',
payment_type: 'regular',
charge_reason: 'resubmission',
previous_payment_uuid: '1GKPTU7E',
ip_address: '192.168.1.1',
capture: false
})
};
fetch('https://sandbox-api.lightningpay.me/api/v2/cards/charges', 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://sandbox-api.lightningpay.me/api/v2/cards/charges",
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([
'amount' => 1000,
'currency' => 'AUD',
'email' => 'email@gmail.com',
'first_name' => 'John',
'last_name' => 'Doe',
'billing_address' => [
'city' => 'Sydney',
'state' => 'NSW',
'country' => 'AU',
'postal_code' => '2000',
'address' => '123 Main Street'
],
'card_info' => [
'card_number' => '4111111111111111',
'card_expiry_month' => 12,
'card_expiry_year' => 2028,
'card_cvv_number' => '123',
'card_holder_name' => 'John Doe'
],
'external_id' => 'order_test_xxx',
'return_url' => 'https://example.com',
'description' => 'Payment for invoice #1234',
'payment_type' => 'regular',
'charge_reason' => 'resubmission',
'previous_payment_uuid' => '1GKPTU7E',
'ip_address' => '192.168.1.1',
'capture' => false
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"app-id: <api-key>",
"secret-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://sandbox-api.lightningpay.me/api/v2/cards/charges"
payload := strings.NewReader("{\n \"amount\": 1000,\n \"currency\": \"AUD\",\n \"email\": \"email@gmail.com\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"billing_address\": {\n \"city\": \"Sydney\",\n \"state\": \"NSW\",\n \"country\": \"AU\",\n \"postal_code\": \"2000\",\n \"address\": \"123 Main Street\"\n },\n \"card_info\": {\n \"card_number\": \"4111111111111111\",\n \"card_expiry_month\": 12,\n \"card_expiry_year\": 2028,\n \"card_cvv_number\": \"123\",\n \"card_holder_name\": \"John Doe\"\n },\n \"external_id\": \"order_test_xxx\",\n \"return_url\": \"https://example.com\",\n \"description\": \"Payment for invoice #1234\",\n \"payment_type\": \"regular\",\n \"charge_reason\": \"resubmission\",\n \"previous_payment_uuid\": \"1GKPTU7E\",\n \"ip_address\": \"192.168.1.1\",\n \"capture\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("app-id", "<api-key>")
req.Header.Add("secret-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://sandbox-api.lightningpay.me/api/v2/cards/charges")
.header("app-id", "<api-key>")
.header("secret-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 1000,\n \"currency\": \"AUD\",\n \"email\": \"email@gmail.com\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"billing_address\": {\n \"city\": \"Sydney\",\n \"state\": \"NSW\",\n \"country\": \"AU\",\n \"postal_code\": \"2000\",\n \"address\": \"123 Main Street\"\n },\n \"card_info\": {\n \"card_number\": \"4111111111111111\",\n \"card_expiry_month\": 12,\n \"card_expiry_year\": 2028,\n \"card_cvv_number\": \"123\",\n \"card_holder_name\": \"John Doe\"\n },\n \"external_id\": \"order_test_xxx\",\n \"return_url\": \"https://example.com\",\n \"description\": \"Payment for invoice #1234\",\n \"payment_type\": \"regular\",\n \"charge_reason\": \"resubmission\",\n \"previous_payment_uuid\": \"1GKPTU7E\",\n \"ip_address\": \"192.168.1.1\",\n \"capture\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox-api.lightningpay.me/api/v2/cards/charges")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["app-id"] = '<api-key>'
request["secret-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": 1000,\n \"currency\": \"AUD\",\n \"email\": \"email@gmail.com\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"billing_address\": {\n \"city\": \"Sydney\",\n \"state\": \"NSW\",\n \"country\": \"AU\",\n \"postal_code\": \"2000\",\n \"address\": \"123 Main Street\"\n },\n \"card_info\": {\n \"card_number\": \"4111111111111111\",\n \"card_expiry_month\": 12,\n \"card_expiry_year\": 2028,\n \"card_cvv_number\": \"123\",\n \"card_holder_name\": \"John Doe\"\n },\n \"external_id\": \"order_test_xxx\",\n \"return_url\": \"https://example.com\",\n \"description\": \"Payment for invoice #1234\",\n \"payment_type\": \"regular\",\n \"charge_reason\": \"resubmission\",\n \"previous_payment_uuid\": \"1GKPTU7E\",\n \"ip_address\": \"192.168.1.1\",\n \"capture\": false\n}"
response = http.request(request)
puts response.read_body{
"example": {
"uuid": "PSADT5CE",
"name": "Hello Clever",
"email": "test@example.com",
"external_id": "order_test_xxx",
"status": "pending",
"pay_code": {
"3ds_url": "https://3ds-auth.example.com/verify"
},
"currency": "AUD",
"amount": "200.0",
"total": "200.0",
"paid_amount": "0.0",
"is_refundable": false,
"payment_method": "card",
"expired_at": "",
"webhook_notification": {
"endpoint_url": "https://webhook.site/12da7803-c4cf-4f32-812d-aaeaecf20d9d",
"authorization_header": "****"
},
"refund_information": null,
"sender_details": {
"card": {
"card_type": "card",
"card_brand": "visa",
"card_last_4": "1111",
"card_country": "US"
}
},
"capture": false,
"token": {
"id": "tok_dfe1988a1ffc0d6562d3",
"type": "card"
},
"created_at": "2025-05-29T01:29:16.826+0000"
}
}{
"errors": {
"code": "REQUIRE_LOGIN",
"message": "Not Authorised"
}
}{
"errors": {
"code": "currency_required",
"message": "Currency is required."
}
}Authorizations
A unique identifier assigned to each application.
A secure token associated with the app-id.
Body
Amount in smallest currency unit (e.g., cents)
1000
ISO 4217 currency code (e.g., AUD)
"AUD"
Customer's email.
"email@gmail.com"
Customer's first name.
"John"
Customer's last name.
"Doe"
Customer’s billing address details.
Show child attributes
Show child attributes
Card information.
Show child attributes
Show child attributes
External ID
"order_test_xxx"
Return URL
"https://example.com"
Description for the payment.
"Payment for invoice #1234"
The type of payment.
regular, unscheduled Indicates the reason for a merchant-initiated payment request. Should be provided if payment_type is unscheduled.
resubmission, delayed_charge, no_show, reauthorisation "resubmission"
An identifier that links the payment to an existing series of payments. Should be provided if payment_type is unscheduled.
"1GKPTU7E"
Browser details information.
Show child attributes
Show child attributes
The IP address of the cardholder
"192.168.1.1"
Whether to auto capture the payment (if applicable)
Show child attributes
Show child attributes
Response
Payment created
"7PPPMXIGH"
"Testing"
"test@example.com"
"wc_order_6C1hcvg4T7Pom"
pending, authorised, waiting, received, expired, return_pending, return_expired, partially_refunded, return_received, return_rejected, failed, in_dispute, dispute_lost "waiting"
Show child attributes
Show child attributes
"USD"
10000
10000
0
true
"card"
""
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
false
"regular"
Show child attributes
Show child attributes
"2025-05-28T04:22:21.567+0000"
curl --request POST \
--url https://sandbox-api.lightningpay.me/api/v2/cards/charges \
--header 'Content-Type: application/json' \
--header 'app-id: <api-key>' \
--header 'secret-key: <api-key>' \
--data '
{
"amount": 1000,
"currency": "AUD",
"email": "email@gmail.com",
"first_name": "John",
"last_name": "Doe",
"billing_address": {
"city": "Sydney",
"state": "NSW",
"country": "AU",
"postal_code": "2000",
"address": "123 Main Street"
},
"card_info": {
"card_number": "4111111111111111",
"card_expiry_month": 12,
"card_expiry_year": 2028,
"card_cvv_number": "123",
"card_holder_name": "John Doe"
},
"external_id": "order_test_xxx",
"return_url": "https://example.com",
"description": "Payment for invoice #1234",
"payment_type": "regular",
"charge_reason": "resubmission",
"previous_payment_uuid": "1GKPTU7E",
"ip_address": "192.168.1.1",
"capture": false
}
'import requests
url = "https://sandbox-api.lightningpay.me/api/v2/cards/charges"
payload = {
"amount": 1000,
"currency": "AUD",
"email": "email@gmail.com",
"first_name": "John",
"last_name": "Doe",
"billing_address": {
"city": "Sydney",
"state": "NSW",
"country": "AU",
"postal_code": "2000",
"address": "123 Main Street"
},
"card_info": {
"card_number": "4111111111111111",
"card_expiry_month": 12,
"card_expiry_year": 2028,
"card_cvv_number": "123",
"card_holder_name": "John Doe"
},
"external_id": "order_test_xxx",
"return_url": "https://example.com",
"description": "Payment for invoice #1234",
"payment_type": "regular",
"charge_reason": "resubmission",
"previous_payment_uuid": "1GKPTU7E",
"ip_address": "192.168.1.1",
"capture": False
}
headers = {
"app-id": "<api-key>",
"secret-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'app-id': '<api-key>',
'secret-key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
amount: 1000,
currency: 'AUD',
email: 'email@gmail.com',
first_name: 'John',
last_name: 'Doe',
billing_address: {
city: 'Sydney',
state: 'NSW',
country: 'AU',
postal_code: '2000',
address: '123 Main Street'
},
card_info: {
card_number: '4111111111111111',
card_expiry_month: 12,
card_expiry_year: 2028,
card_cvv_number: '123',
card_holder_name: 'John Doe'
},
external_id: 'order_test_xxx',
return_url: 'https://example.com',
description: 'Payment for invoice #1234',
payment_type: 'regular',
charge_reason: 'resubmission',
previous_payment_uuid: '1GKPTU7E',
ip_address: '192.168.1.1',
capture: false
})
};
fetch('https://sandbox-api.lightningpay.me/api/v2/cards/charges', 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://sandbox-api.lightningpay.me/api/v2/cards/charges",
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([
'amount' => 1000,
'currency' => 'AUD',
'email' => 'email@gmail.com',
'first_name' => 'John',
'last_name' => 'Doe',
'billing_address' => [
'city' => 'Sydney',
'state' => 'NSW',
'country' => 'AU',
'postal_code' => '2000',
'address' => '123 Main Street'
],
'card_info' => [
'card_number' => '4111111111111111',
'card_expiry_month' => 12,
'card_expiry_year' => 2028,
'card_cvv_number' => '123',
'card_holder_name' => 'John Doe'
],
'external_id' => 'order_test_xxx',
'return_url' => 'https://example.com',
'description' => 'Payment for invoice #1234',
'payment_type' => 'regular',
'charge_reason' => 'resubmission',
'previous_payment_uuid' => '1GKPTU7E',
'ip_address' => '192.168.1.1',
'capture' => false
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"app-id: <api-key>",
"secret-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://sandbox-api.lightningpay.me/api/v2/cards/charges"
payload := strings.NewReader("{\n \"amount\": 1000,\n \"currency\": \"AUD\",\n \"email\": \"email@gmail.com\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"billing_address\": {\n \"city\": \"Sydney\",\n \"state\": \"NSW\",\n \"country\": \"AU\",\n \"postal_code\": \"2000\",\n \"address\": \"123 Main Street\"\n },\n \"card_info\": {\n \"card_number\": \"4111111111111111\",\n \"card_expiry_month\": 12,\n \"card_expiry_year\": 2028,\n \"card_cvv_number\": \"123\",\n \"card_holder_name\": \"John Doe\"\n },\n \"external_id\": \"order_test_xxx\",\n \"return_url\": \"https://example.com\",\n \"description\": \"Payment for invoice #1234\",\n \"payment_type\": \"regular\",\n \"charge_reason\": \"resubmission\",\n \"previous_payment_uuid\": \"1GKPTU7E\",\n \"ip_address\": \"192.168.1.1\",\n \"capture\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("app-id", "<api-key>")
req.Header.Add("secret-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://sandbox-api.lightningpay.me/api/v2/cards/charges")
.header("app-id", "<api-key>")
.header("secret-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 1000,\n \"currency\": \"AUD\",\n \"email\": \"email@gmail.com\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"billing_address\": {\n \"city\": \"Sydney\",\n \"state\": \"NSW\",\n \"country\": \"AU\",\n \"postal_code\": \"2000\",\n \"address\": \"123 Main Street\"\n },\n \"card_info\": {\n \"card_number\": \"4111111111111111\",\n \"card_expiry_month\": 12,\n \"card_expiry_year\": 2028,\n \"card_cvv_number\": \"123\",\n \"card_holder_name\": \"John Doe\"\n },\n \"external_id\": \"order_test_xxx\",\n \"return_url\": \"https://example.com\",\n \"description\": \"Payment for invoice #1234\",\n \"payment_type\": \"regular\",\n \"charge_reason\": \"resubmission\",\n \"previous_payment_uuid\": \"1GKPTU7E\",\n \"ip_address\": \"192.168.1.1\",\n \"capture\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox-api.lightningpay.me/api/v2/cards/charges")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["app-id"] = '<api-key>'
request["secret-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": 1000,\n \"currency\": \"AUD\",\n \"email\": \"email@gmail.com\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"billing_address\": {\n \"city\": \"Sydney\",\n \"state\": \"NSW\",\n \"country\": \"AU\",\n \"postal_code\": \"2000\",\n \"address\": \"123 Main Street\"\n },\n \"card_info\": {\n \"card_number\": \"4111111111111111\",\n \"card_expiry_month\": 12,\n \"card_expiry_year\": 2028,\n \"card_cvv_number\": \"123\",\n \"card_holder_name\": \"John Doe\"\n },\n \"external_id\": \"order_test_xxx\",\n \"return_url\": \"https://example.com\",\n \"description\": \"Payment for invoice #1234\",\n \"payment_type\": \"regular\",\n \"charge_reason\": \"resubmission\",\n \"previous_payment_uuid\": \"1GKPTU7E\",\n \"ip_address\": \"192.168.1.1\",\n \"capture\": false\n}"
response = http.request(request)
puts response.read_body{
"example": {
"uuid": "PSADT5CE",
"name": "Hello Clever",
"email": "test@example.com",
"external_id": "order_test_xxx",
"status": "pending",
"pay_code": {
"3ds_url": "https://3ds-auth.example.com/verify"
},
"currency": "AUD",
"amount": "200.0",
"total": "200.0",
"paid_amount": "0.0",
"is_refundable": false,
"payment_method": "card",
"expired_at": "",
"webhook_notification": {
"endpoint_url": "https://webhook.site/12da7803-c4cf-4f32-812d-aaeaecf20d9d",
"authorization_header": "****"
},
"refund_information": null,
"sender_details": {
"card": {
"card_type": "card",
"card_brand": "visa",
"card_last_4": "1111",
"card_country": "US"
}
},
"capture": false,
"token": {
"id": "tok_dfe1988a1ffc0d6562d3",
"type": "card"
},
"created_at": "2025-05-29T01:29:16.826+0000"
}
}{
"errors": {
"code": "REQUIRE_LOGIN",
"message": "Not Authorised"
}
}{
"errors": {
"code": "currency_required",
"message": "Currency is required."
}
}