Server-to-Server (S2S) Integration
Supported currency: AUD only.
The Server-to-Server (S2S) API allows you to securely create card payments directly from your backend without using the JavaScript SDK.
This method is designed for PCI DSSβcompliant servers that collect and send raw card details (card_info) directly to the Hello Clever API.
π§ Environmentsβ
| Environment | Base URL |
|---|---|
| Sandbox | https://sandbox-api.lightningpay.me |
| Production | https://api.lightningpay.me |
β Endpointβ
POST /api/v2/cards/charges
This endpoint creates a payment intent using raw card information.
π Authenticationβ
Server-to-Server API requests must include the following headers:
| Header | Type | Required | Description |
|---|---|---|---|
app-id | string | β | The App ID registered and secured inside the Hello Clever system. |
secret-key | string | β | The client's confidential key used to authenticate API requests from your server to Hello Clever. |
Content-Type | string | β | Always application/json. |
β Integration Stepsβ
Step 1: Register Your App ID & Get Credentialsβ
- Contact the Hello Clever team to register your domain and receive your
app_idandsecret-key. - Ensure your server is PCI DSS compliant before handling raw card data.
Step 2: Set Up Authentication Headersβ
Include the following headers in all API requests:
app-id: YOUR_APP_ID
secret-key: YOUR_SECRET_KEY
Content-Type: application/json
Step 3: Make API Call and Handle Responseβ
Create a JSON request body with the required fields. See the π₯ Detail here for the complete schema.
POST https://sandbox-api.lightningpay.me/api/v2/cards/charges
- Request Example
- Response Example
{
"amount": 1000,
"currency": "AUD",
"email": "[email protected]",
"first_name": "John",
"last_name": "Doe",
"billing_address": {
"address": "123 Main Street",
"city": "Sydney",
"state": "NSW",
"country": "AU",
"postal_code": "2000"
},
"card_info": {
"card_number": "4111111111111111",
"card_expiry_month": 12,
"card_expiry_year": 2028,
"card_cvv_number": "123",
"card_holder_name": "John Doe"
},
"payment_type": "regular",
"capture": false,
"external_id": "order_test_xxx",
"return_url": "https://example.com",
"description": "Payment for invoice #1234",
"webhook_notification": {
"endpoint_url": "https://merchant.com/webhook",
"authorization_header": "Bearer xxxxxx"
}
}
{
"uuid": "7PPPMXIGH",
"name": "Testing",
"email": "[email protected]",
"external_id": "wc_order_6C1hcvg4T7Pom",
"status": "pending",
"pay_code": {
"3ds_url": "https://3ds-auth.example.com/verify"
},
"currency": "AUD",
"amount": 100,
"total": 100,
"paid_amount": 0,
"is_refundable": true,
"payment_method": "card",
"expired_at": "",
"webhook_notification": {
"endpoint_url": "https://webhook.site/456adb8f-4407-4bce-90fe-2c431db19696",
"authorization_header": "****"
},
"refund_information": null,
"sender_details": {
"card": {
"card_type": "card",
"card_brand": "visa",
"card_last_4": "1111",
"card_country": "US"
}
},
"capture": false,
"payment_type": "regular",
"token": {
"id": "tok_dfe1988a1ffc0d6562d3",
"type": "card"
},
"created_at": "2025-05-28T04:22:21.567+0000"
}
Handle the response:
-
If the payment requires 3DS authentication, redirect the customer to
pay_code.3ds_url -
When the payment reaches
authorisedorwaitingstatus, atokenobject is returned in this response or webhook notification - save thistokenobject for future paymentsToken object example:
{
"token": {
"id": "tok_dfe1988a1ffc0d6562d3",
"type": "card"
}
}
Step 4: Reusing tokens for future paymentsβ
Call the Create Payment via Tokenisation API using your saved token. (token.id and token.type).
POST https://sandbox-api.lightningpay.me/api/v2/cards/create_payment
- Request Example
- Response Example
{
"amount": 100,
"currency": "AUD",
"token": {
"id": "tok_dfe1988a1ffc0d6562d3",
"type": "card"
},
"external_id": "order_test_xxx",
"return_url": "https://example.com",
"capture": false,
"webhook_notification": {
"endpoint_url": "https://merchant.com/webhook",
"authorization_header": "Bearer xxxxxx"
}
}
{
"uuid": "7PPPMXIGH",
"name": "Testing",
"email": "[email protected]",
"external_id": "wc_order_6C1hcvg4T7Pom",
"status": "pending",
"pay_code": {
"3ds_url": "https://3ds-auth.example.com/verify"
},
"currency": "AUD",
"amount": 100,
"total": 100,
"paid_amount": 0,
"is_refundable": true,
"payment_method": "card",
"expired_at": "",
"webhook_notification": {
"endpoint_url": "https://webhook.site/456adb8f-4407-4bce-90fe-2c431db19696",
"authorization_header": "****"
},
"refund_information": null,
"sender_details": {
"card": {
"card_type": "card",
"card_brand": "visa",
"card_last_4": "1111",
"card_country": "US"
}
},
"capture": false,
"payment_type": "regular",
"token": {
"id": "tok_dfe1988a1ffc0d6562d3",
"type": "card"
},
"created_at": "2025-05-28T04:22:21.567+0000"
}
π₯ Request Bodyβ
- Schema
- Example Request
| Field | Type | Required | Description |
|---|---|---|---|
amount | number | β | Amount in the smallest currency unit (e.g., cents). |
currency | string | β | ISO 4217 currency code (e.g., AUD). |
email | string | β | Customerβs email address. |
first_name | string | β | Customerβs first name. |
last_name | string | β | Customerβs last name. |
billing_address | object | β | Customerβs billing address details. |
ββ address | string | β | Address (building number, road name, etc.). |
ββ city | string | β | City, district, or locality. |
ββ state | string | β | State, province, or region. |
ββ country | string | β | ISO 3166-1 alpha-2 country code. |
ββ postal_code | string | β | ZIP or postal code. |
card_info | object | β | Card information. |
ββ card_number | string | β | The card number. |
ββ card_expiry_month | integer | β | Expiry month of the card (1β12). |
ββ card_expiry_year | integer | β | Expiry year of the card (4-digit). |
ββ card_cvv_number | string | β | The card verification value/code (3β4 digits). |
ββ card_holder_name | string | β | Cardholderβs name as printed on the card. |
payment_type | string | β | The type of payment. One of regular | unscheduled. Default: regular. |
charge_reason | string | β | Indicates the reason for a merchant-initiated payment request. One of resubmission | delayed_charge | no_show | reauthorisation. Should be provided if payment_type is unscheduled. |
previous_payment_uuid | string | β | An identifier that links the payment to an existing series of payments. Should be provided if payment_type is unscheduled. |
browser_details | object | β | Browser details information. |
ββ user_agent | string | β | Exact content of the HTTP user-agent header. |
ββ language | string | β | The browser language as defined in IETF BCP47. |
ββ color_depth | number | β | The bit depth of the colour palette for displaying images, in bits per pixel. |
ββ screen_height | number | β | Total height of the Cardholderβs screen in pixels. |
ββ screen_width | number | β | Total width of the cardholderβs screen in pixels. |
ββ java_enabled | boolean | β | The ability of the cardholder browser execute JavaScript. |
ββ time_zone | number | β | Time-zone offset in minutes between UTC and the Cardholder browser local time. |
ββ accept_header | string | β | Exact content of the HTTP accept headers. |
ββ javascript_enabled | boolean | β | The ability of the cardholder browser execute JavaScript. |
ip_address | string | β | The IP address of the cardholder. |
capture | boolean | β | Whether to auto capture the payment (if applicable). Default: false |
external_id | string | β | Unique identifier for the order. |
return_url | string | β | URL to redirect after success/failure. |
description | string | β | Description for the payment. |
webhook_notification | object | β | Webhook configuration details. |
ββ endpoint_url | string | β | URL where webhooks will be sent. |
ββ authorization_header | string | β | Authorization header for webhook. |
{
"amount": 1000,
"currency": "AUD",
"email": "[email protected]",
"first_name": "John",
"last_name": "Doe",
"billing_address": {
"address": "123 Main Street",
"city": "Sydney",
"state": "NSW",
"country": "AU",
"postal_code": "2000"
},
"card_info": {
"card_number": "4111111111111111",
"card_expiry_month": 12,
"card_expiry_year": 2028,
"card_cvv_number": "123",
"card_holder_name": "John Doe"
},
"payment_type": "regular",
"charge_reason": "resubmission",
"previous_payment_uuid": "1GKPTU7E",
"browser_details": {
"user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
"language": "en-US",
"color_depth": 24,
"screen_height": 1080,
"screen_width": 1920,
"java_enabled": true,
"time_zone": -600,
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8",
"javascript_enabled": true
},
"ip_address": "192.168.1.1",
"capture": false,
"external_id": "order_test_xxx",
"return_url": "https://example.com",
"description": "Payment for invoice #1234",
"webhook_notification": {
"endpoint_url": "https://merchant.com/webhook",
"authorization_header": "Bearer xxxxxx"
}
}
π³ Payment Types In S2S Integrationβ
1οΈβ£ Regular Paymentβ
Customers can request to store their card details during a payment, which you can then use for future payments without customers having to re-enter the details.
SCA requirements
In regions that require Strong Customer Authentication (SCA) β the customer must complete a 3D Secure (3DS) challenge during the payment process.
When SCA is required, the API response includes apay_code.3ds_urlfield β redirect your customer to this URL to complete the authentication.
Set up an regular payment
The payment request can include the following (optional, defaults to "regular" if not provided):
payment_type="regular"
Request Example
- Create Payment via Tokenisation
- Create Payment via Card Information
POST https://sandbox-api.lightningpay.me/api/v2/cards/create_payment
{
"amount": 100,
"currency": "AUD",
"token": {
"id": "tok_dfe1988a1ffc0d6562d3",
"type": "card"
},
"external_id": "order_test_xxx",
"return_url": "https://example.com",
"capture": false,
"payment_type": "regular",
"webhook_notification": {
"endpoint_url": "https://merchant.com/webhook",
"authorization_header": "Bearer xxxxxx"
}
}
POST https://sandbox-api.lightningpay.me/api/v2/cards/charges
{
"amount": 1000,
"currency": "AUD",
"email": "[email protected]",
"first_name": "John",
"last_name": "Doe",
"billing_address": {
"address": "123 Main Street",
"city": "Sydney",
"state": "NSW",
"country": "AU",
"postal_code": "2000"
},
"card_info": {
"card_number": "4111111111111111",
"card_expiry_month": 12,
"card_expiry_year": 2028,
"card_cvv_number": "123",
"card_holder_name": "John Doe"
},
"capture": false,
"payment_type": "regular",
"external_id": "order_test_xxx",
"return_url": "https://example.com",
"description": "Payment for invoice #1234",
"webhook_notification": {
"endpoint_url": "https://merchant.com/webhook",
"authorization_header": "Bearer xxxxxx"
}
}
Response Example
{
"uuid": "7PPPMXIGH",
"name": "Testing",
"email": "[email protected]",
"external_id": "wc_order_6C1hcvg4T7Pom",
"status": "pending",
"pay_code": {
"3ds_url": "https://3ds-auth.example.com/verify"
},
"currency": "AUD",
"amount": 100,
"total": 100,
"paid_amount": 0,
"is_refundable": true,
"payment_method": "card",
"expired_at": "",
"webhook_notification": {
"endpoint_url": "https://webhook.site/456adb8f-4407-4bce-90fe-2c431db19696",
"authorization_header": "****"
},
"refund_information": null,
"sender_details": {
"card": {
"card_type": "card",
"card_brand": "visa",
"card_last_4": "1111",
"card_country": "US"
}
},
"capture": false,
"payment_type": "regular",
"token": {
"id": "tok_dfe1988a1ffc0d6562d3",
"type": "card"
},
"created_at": "2025-05-28T04:22:21.567+0000"
}
2οΈβ£ Unscheduled Paymentβ
With an unscheduled payment agreement, you can request to store a customerβs card details during an initial transaction and perform a card-not-present transaction with the stored card at a later date.
For example, a customer may provide their card details when checking in to a hotel, but will only be charged after they check out, at which point they may have incurred additional charges.
SCA requirements
Merchant-initiated transactions fall out of scope of SCA and qualify for exemption under Merchant Initiated Exclusion, meaning 3DS authentication is not required
Set up an unscheduled payment
The payment request must include the following:
payment_type="unscheduled"
It is recommended to include the payment uuid returned in the initial paymentβs response in the previous_payment_uuid field to reference the original SCA-authorised transaction and improve approval rates.
To improve your approval rates and chargeback processes, we recommend that you include the charge_reason field and set it to one of the following:
resubmissionβ Use when the original purchase has occurred, but you could not get authorization at the time that goods or services were provided.delayed_chargeβ Use when there is a delayed charge.no_showβ Use when the cardholder entered into an agreement to purchase but they failed to meet the terms of the agreement.reauthorisationβ Use when an additional purchase was made after the original purchase, typically for delayed or split orders.
Request Example
- Create Payment via Tokenisation
- Create Payment via Card Information
POST https://sandbox-api.lightningpay.me/api/v2/cards/create_payment
{
"amount": 100,
"currency": "AUD",
"token": {
"id": "tok_dfe1988a1ffc0d6562d3",
"type": "card"
},
"external_id": "order_test_xxx",
"return_url": "https://example.com",
"capture": false,
"payment_type": "unscheduled",
"charge_reason": "delayed_charge",
"previous_payment_uuid": "7PPPMXIGH",
"webhook_notification": {
"endpoint_url": "https://merchant.com/webhook",
"authorization_header": "Bearer xxxxxx"
}
}
POST https://sandbox-api.lightningpay.me/api/v2/cards/charges
{
"amount": 1000,
"currency": "AUD",
"email": "[email protected]",
"first_name": "John",
"last_name": "Doe",
"billing_address": {
"address": "123 Main Street",
"city": "Sydney",
"state": "NSW",
"country": "AU",
"postal_code": "2000"
},
"card_info": {
"card_number": "4111111111111111",
"card_expiry_month": 12,
"card_expiry_year": 2028,
"card_cvv_number": "123",
"card_holder_name": "John Doe"
},
"capture": false,
"payment_type": "unscheduled",
"charge_reason": "delayed_charge",
"previous_payment_uuid": "7PPPMXIGH",
"external_id": "order_test_xxx",
"return_url": "https://example.com",
"description": "Payment for invoice #1234",
"webhook_notification": {
"endpoint_url": "https://merchant.com/webhook",
"authorization_header": "Bearer xxxxxx"
}
}
β οΈ Important Note
Unscheduled payments using the Create Payment via Card Information may require 3DS authentication. If the response includespay_code.3ds_url, redirect the customer to complete authentication.
Response Example
{
"uuid": "7PPPMXIGH",
"name": "Testing",
"email": "[email protected]",
"external_id": "wc_order_6C1hcvg4T7Pom",
"status": "authorised",
"pay_code": {
"3ds_url": "https://3ds-auth.example.com/verify"
},
"currency": "AUD",
"amount": 100,
"total": 100,
"paid_amount": 0,
"is_refundable": true,
"payment_method": "card",
"expired_at": "",
"webhook_notification": {
"endpoint_url": "https://webhook.site/456adb8f-4407-4bce-90fe-2c431db19696",
"authorization_header": "****"
},
"refund_information": null,
"sender_details": {
"card": {
"card_type": "card",
"card_brand": "visa",
"card_last_4": "1111",
"card_country": "US"
}
},
"capture": false,
"payment_type": "unscheduled",
"token": {
"id": "tok_dfe1988a1ffc0d6562d3",
"type": "card"
},
"created_at": "2025-05-28T04:22:21.567+0000"
}
π Webhook Notificationsβ
When the payment status changes (e.g., pending β authorised β received),
Hello Clever will send a webhook event to your configured endpoint.
See the Webhook Documentation for:
- Webhook object structure
- Token inclusion after authorisation
- Setting up webhooks and webhook security
π§ Notesβ
- The
tokenreturned in both the response and webhook can be reused for future payments without re-entering card details. - Ensure your server is PCI DSS compliant before handling raw card data.
- Use HTTPS and secure header authentication for all API calls.
- For client-side integrations, use the JavaScript SDK instead.
π Payment Statusesβ
| Status | Meaning |
|---|---|
pending | Customer started a new payment but hasn't proceeded yet |
authorised | Payment has been authorised, ready to be captured |
waiting | Payment has been approved, awaiting funds to settle |
received | Funds have been received |
expired | Payment session expired before completion |
return_pending | Refund request initiated, awaiting processing |
partially_refunded | Partial refund has been issued to the customer |
return_received | Full amount has been refunded to the customer |
return_expired | Refund expired (after 10 days) |
return_rejected | Refund request was denied |
failed | Payment failed due to an error or decline |
in_dispute | Customer has raised a dispute, under review |
dispute_lost | Dispute has been resolved in customer's favour |