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

PaymentElementsApple Pay and Google PayServer-side tokenization
CollectsA card or a bank accountA card in the customer's walletA card or a bank account
Customer enters details inPreczn-hosted fields on your pageApple's or Google's payment sheetYour own system
Runs inThe browserThe browserYour server
API keyPublicPublicPrivate
Token you getSingle-useSingle-use, for one merchantMulti-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:


Tokenize a card from your server

  1. Send Create Token (POST /v1/tokens) with your private API key. Set type to card, and put the card number and its MMYY expiration date in card. To make the token a merchant token, also send merchantId. 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.

  2. Store the token value 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.

PaymentElementsDirect API
Card input rendered byPreczn (iframes)Platform
PAN present in Platform page/DOMNoYes
PAN present on Platform serversNoYes
Markup controlStyling APIFull
Relative PCI scopeSmallestLargest

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.


Did this page help you?