Overview
The Direct Card Charge API lets you process card payments entirely from your backend, no redirect to Novac’s checkout page, no hosted UI. This is a server-to-server integration designed for fintechs and platforms that need full control over the payment experience.Prerequisites
Before you begin
Before you begin
- Create a merchant account with KYC completed.
- Obtain your secret API keys.
- Set your Webhook URL and Redirect URL on the dashboard. You can also pass a Redirect URL directly in the charge request.
Two Ways to Initialize a Charge
Depending on your security posture, you can integrate in one of two ways. Both achieve the same result, the difference is whether you encrypt card data before sending it.With Card Encryption
Encrypt card details on your server before sending. Recommended for teams that want an extra layer of security beyond HTTPS.
Without Card Encryption
Send card details over HTTPS without pre-encrypting. Suitable for compliant integrations on secure infrastructure.
With Card Encryption
Use this approach if you want to encrypt card data before transmitting it, even over HTTPS. Novac provides a utility to encrypt card details, you don’t need to implement your own encryption algorithm. See how to encrypt with Novac before proceeding.The
reference you use to encrypt the card data must be the same reference passed when initiating the charge. Mismatched references will cause the request to fail.Amount to charge, in the smallest currency unit (e.g. kobo for NGN).
ISO 4217 currency code, e.g.
NGN, USD.Unique transaction reference, at least 16 alphanumeric characters. Must match the reference used to encrypt the card data.
Customer’s email address.
Novac-encrypted card string.
Must be
sale.Controls 3DS authentication. Set to
true to enforce 3DS, or false for No-Auth (2D) if enabled on your account.URL to redirect the customer to after payment. If omitted, Novac displays a default confirmation page.
A JSON string of key-value pairs to associate with this transaction.
Why 16 characters for
reference? The minimum length is enforced for cryptographic integrity, it ensures the reference is sufficiently unique and safe to use as part of the card data encryption process.Without Card Encryption
Use this approach if you prefer to send raw card data over HTTPS. This is acceptable for compliant integrations running on secure infrastructure.cardData.pin is only required if the currency is NGN. transactionType must still be sale.Handling 3DS and No-Auth (2D) Responses
3DS Authentication
WhenenforceSecureAuth is true, the charge triggers a 3DS challenge and returns a response like the one below. Redirect the customer to the redirectUrl in the response to complete the challenge.
Response
No-Auth (2D) Approved Directly
IfenforceSecureAuth is false and your account supports No-Auth processing, the charge may be approved without further customer interaction.
Response Approved (No-Auth)
The charge endpoint intentionally returns only
status and message. All transaction details amount, card info, customer data and fees are returned by the verification endpoint.PIN Authentication Scenarios (NGN Cards Only)
PIN Required
If a PIN is required but wasn’t included in the initial request, the API returns the response below. Add thepin field to the card data and resubmit to the same endpoint.
Response
PIN Not Supported
If the card is not enrolled for PIN authentication:Response
What’s Next?
-
Using Webhooks: Automatically receive payment status updates from Novac when a transaction is completed.
Learn how to verify a transaction via webhooks -
Using the Transaction Reference: Manually verify the payment using the
referenceused during the custom checkout session.
Learn how to verify a transaction using a callback reference - Recurring Payment: Learn how to save and charge customer’s card for subscriptions based services.
- Request Refund: Initiate a full or partial refund.