Choose an integration method
Compare PaymentElements, Apple Pay and Google Pay, and server-side tokenization, and pick how your platform collects payment details.
Your platform collects a customer's payment details in one of three ways. Each way returns a Preczn token, and you charge the token with Process Transaction. These options range from fully isolated, iframe-based card capture to direct API access, and differ significantly in the PCI DSS validation effort they impose on the Platform.
- PaymentElements: Preczn-hosted fields on your checkout page collect a card or a bank account.
- Apple Pay and Google Pay: the customer pays with a card saved in their wallet.
- Server-side tokenization: your server sends card or bank account details that your systems already hold. This is also called the direct API.
PaymentElements and the wallets run in the customer's browser. They load through the Preczn browser client, preczn.min.js, with your public API key. For the resources the client loads, see Browser client reference.
flowchart TD
A{"Do your systems already<br/>hold the details?"} -->|Yes| B["Server-side tokenization"]
A -->|No| C["PaymentElements"]
C -.->|"Optional"| D["Add Apple Pay or Google Pay"]
classDef decision fill:#475569,stroke:#334155,color:#ffffff
classDef server fill:#4013be,stroke:#300e90,color:#ffffff
classDef browser fill:#059669,stroke:#047857,color:#ffffff
classDef wallet fill:#2563eb,stroke:#1d4ed8,color:#ffffff
class A decision
class B server
class C browser
class D wallet
Compare the methods
| PaymentElements | Apple Pay and Google Pay | Server-side tokenization | |
|---|---|---|---|
| Collects | A card or a bank account | A card in the customer's wallet | A card or a bank account |
| Customer enters details in | Preczn-hosted fields on your page | Apple's or Google's payment sheet | Your own system |
| Runs in | The browser | The browser | Your server |
| API key | Public | Public | Private |
| Token you get | Single-use | Single-use, for one merchant | Multi-use, or single-use for a card sent with its CVV |
Recommendation
Use PaymentElements for any checkout where the customer types in a card or a bank account. Add Apple Pay or Google Pay next to it when your customers pay with a wallet. Wallet tokens are single-use, so you can't save a wallet payment for later.
Use server-side tokenization only when your systems already hold the details, such as bank accounts your platform stores. You can also skip the token and send the details directly in Process Transaction.
To get started with a method, use its guide:
- PaymentElements: Collect payment details with PaymentElements.
- Apple Pay and Google Pay: Wallets.
- Server-side tokenization: for bank accounts, Tokenize bank accounts. For cards, see the Tokenize a card from your server section.
Tokenize a card from your server
-
Send Create Token (
POST /v1/tokens) with your private API key. Settypetocard, and put the card number and itsMMYYexpiration date incard. To make the token a merchant token, also sendmerchantId. See Choose a token scope.{ "type": "card", "card": { "number": "{cardNumber}", "expiration": "{MMYY}" }, "firstName": "{firstName}", "lastName": "{lastName}" }{ "token": "tkn_test_{tokenId}", "type": "credit", "brand": "VISA", "bin": "432100", "last4": "0012" }This response is abbreviated. In test mode, use a card from Test data.
-
Store the
tokenvalue with the customer's record. Charge it later with Process Transaction, as described in Save a card for later use.
The request above returns a multi-use token. If you also send card.cvv, Preczn returns a single-use token instead, for a charge you make right away. A multi-use token never stores the CVV.
PCI DSS SAQ implications
The two integrations differ in where cardholder data exists, and that placement is what drives which Self-Assessment Questionnaire a Platform completes.
| PaymentElements | Direct API | |
|---|---|---|
| Card input rendered by | Preczn (iframes) | Platform |
| PAN present in Platform page/DOM | No | Yes |
| PAN present on Platform servers | No | Yes |
| Markup control | Styling API | Full |
| Relative PCI scope | Smallest | Largest |
PaymentElements is designed for the narrowest scope. Because every element of the card-entry interface is delivered to the consumer's browser from Preczn's origin and the PAN never enters the Platform's page, this integration is intended to support the shortest SAQ available to an e-commerce merchant that does not touch cardholder data. Note that the platform still hosts the parent page that embeds the Preczn frames, so controls over that page remain relevant to the Platform's assessment.
Direct API places cardholder data on Platform systems and carries the most extensive validation obligations of the two.
A Platform's actual SAQ eligibility is determined by its processors or QSA against its full environment, not by its Preczn integration alone. Platforms should confirm their SAQ type with their processors before relying on any scope reduction described here.
Updated 10 days ago
