Skip to main content

Datacap Pay API

The Datacap Pay API provides a secure, hosted credit card payment form. Card data is tokenized by Datacap's secure script — the raw card number never touches your server.

Prerequisites

An admin must configure the Datacap Pay API before it can be used. This requires:

  • A Datacap merchant account with a merchant ID (MID)
  • The Datacap public key configured in the system

Once configured, the credit card payment form appears at checkout.

Payment Details Panel

When the customer reaches the payment step, a card shows the payment breakdown:

  • Amount — The order subtotal
  • Gratuity — Any tip or service fee added to the order
  • Surcharge — An admin-configured percentage added to credit card transactions (if enabled)
  • Total — The total amount to be charged

Accepted card types are shown via the accepted cards image.

Card Entry

The customer enters their card details:

  • Card number — 13 to 19 digits
  • Month (MM) — Expiration month (1–12)
  • Year (YYYY) — Expiration year
  • CVV — 3 or 4 digit security code

Each field is validated as the customer types. Invalid values (bad expiry, wrong card format, invalid CVV) show an alert icon.

Cards on File

Returning customers can select a previously saved card instead of entering a new one. Saved cards are available when the customer is assigned to the order.

Surcharge

An admin can configure a surcharge percentage that is added to credit card transactions. The surcharge appears on the payment details panel and is included in the total. If no surcharge is configured, this line is hidden.

Pre-Authorization

Pre-authorization places a hold on the customer's card without charging it. The charge is captured later when the order is finalized. This is common in restaurants and hotels: the card is authorized at seating, then charged when the bill is ready.

How Pre-Auth Works

When the order is flagged for pre-authorization, the Datacap payment form runs in pre-auth mode. After the customer's card is authorized:

  1. A confirmation appears: "Your order is now authorized. Go to the menu to add items, then fire them off to be made."
  2. A "Go to Menu" button takes the customer to the ordering screen.
  3. When the order is finalized, the authorized amount is captured (or a new total is charged).
  4. If the order is cancelled, the authorization can be reversed, releasing the hold on the card.

Pre-Auth Buttons

When pre-authorization is enabled, the following buttons appear on the payment screen after authorization:

ButtonAction
AuthorizePlaces a hold on the card without charging it
Complete PaymentCaptures the authorized amount and charges the card
Reverse AuthorizationCancels the hold and releases the funds on the card

Status Messages

StateWhat You See
Loading"Prepping Credit Card Payment" while the payment script loads
ProcessingSpinner while the transaction is being processed
ApprovedPayment response with status and confirmation
DeclinedError message with details about the decline

Validation Errors

ErrorMeaning
Invalid EXPCard expiration date is invalid
Invalid CardCard number format is incorrect
Invalid CVVCVV does not match expected 3 or 4 digits

Security

Card data is tokenized by Datacap's hosted form. The raw card number never touches your server. A Security & Policies link (set by the admin) is shown below the payment form.

Troubleshooting

ProblemSolution
"No MID Present"The Datacap merchant ID is not configured. Check with your admin.
"No Key Present"The Datacap public key is not configured. Check with your admin.
Payment form not showingThe payment API may not be enabled, or the order has no remaining balance.
Card declinedThe customer's card may be declined or have insufficient funds. Ask the customer to try another card.
  • Payments — General payment options and workflows
  • Apple Pay — Apple Pay payment method (also uses Datacap)