Skip to main content
This guide walks through the end-to-end implementation of NFC Device Tokenization using Secure Credential Services by PayPal.

Prerequisites

To integrate with Secure Credential Services NFC Device Tokenization, you need:
  • A PayPal business account with a Client ID provisioned for NFC device tokenization
  • OAuth 2.0 credentials (Client ID and Client Secret)
  • A Token Requestor ID (TRID), a unique 11-digit identifier obtained via TRID onboarding with the PayPal integration team
  • A device product configuration and sandbox test card data from your PayPal integration team
  • Registered HTTPS webhook endpoint for receiving PP TSP event notifications
Note: Contact your PayPal integration team to obtain sandbox OAuth credentials, a device product configuration, and test card data before starting. Configure sandbox and production environments separately: never share credentials between environments.

API reference

Use the following base URLs and endpoints for all Payment Tokenization requests.

Base URLs

All paths are prefixed /v1/payment-tokenization/. All PayPal REST API requests target one of two base URLs:

List of APIs

Authentication

All API calls require an OAuth 2.0 Bearer token obtained from the PayPal token endpoint.
Bearer tokens expire after approximately 8-9 hours. Implement token caching and refresh logic in your client: do not request a new token on every API call.

Steps for integration

Complete the following steps to onboard your TRID, register a device, and enroll a card for NFC tokenization. Depending on the card network’s response, enrollment follows either the Green Path, where the card is approved without additional verification, or the Yellow Path, which requires additional identity verification.

1. Complete TRID onboarding

Before initiating any card enrollment, the device partner must complete Token Requestor ID (TRID) onboarding with PayPal TSP. The TRID is a unique 11-digit identifier required in all enrollment and payment credential API calls. Work with your PayPal integration team to complete TRID onboarding and obtain your PP TRID. Include it in the token_requestor.id field of all enrollment and payment credential API requests.

2. Register the device

Device registration is a one-time operation that establishes a trusted device identity with PayPal TSP. The returned device_id is used in all subsequent enrollment calls.
On success, PP TSP returns a unique device_id. Store this securely and include it in all subsequent card enrollment requests. Do not re-register the same device.

3. Enroll a card (Green Path)

The Green Path is the standard provisioning flow where a card is approved for tokenization without additional user identity verification.

3a. Create enrollment

After the user authenticates and selects a card, submit the enrollment request with encrypted card details:
PP TSP checks card eligibility with the card network and returns an enrollment_id, a Terms & Conditions (T&C) ID, and an initial enrollment status of PENDING_TOKEN_CREATION.

3b. Retrieve and display T&C, card art, and other assets

Retrieve the T&C and other content and display it to the user. Capture explicit user consent before proceeding.

3c. Tokenize the card

PP TSP requests token digitization from the card network. The network responds with a Token Unique Reference (TUR), token details, and an initial token status: either ACTIVE, PENDING_TOKEN_ACTIVATION, or PENDING_VERIFICATION_REQUIRED. If the token is not immediately active, PayPal TSP will send a PAYMENT-TOKENIZATION.TOKEN-STATUS.CHANGED notification when the token is activated. PayPal TSP sends a PAYMENT-TOKENIZATION.ENROLLMENT.CREATED webhook followed by a PAYMENT-TOKENIZATION.PAYMENT-CREDENTIAL.CREATED webhook once credentials are provisioned.

4. Enroll a card (Yellow Path)

The Yellow Path extends the Green Path when the card network requires additional identity verification (IDV) before activating the token.

4a. Get verification methods

Returns available IDV methods such as SMS OTP, email, and app-to-app. Present these options to the user.

4b. Submit verification

PP TSP forwards the IDV delivery request to the card network. The response includes OTP expiry details.

4c. Validate OTP

Submit the user’s OTP. Returns HTTP 204 on success. After successful IDV, the card network sends a provisioning notification to PP TSP, which caches the credentials and sends a PAYMENT-TOKENIZATION.PAYMENT-CREDENTIAL.CREATED webhook.

5. Fetch payment credentials

After receiving the PAYMENT-TOKENIZATION.PAYMENT-CREDENTIAL.CREATED webhook, fetch and acknowledge payment credentials. Repeat this step whenever the device’s credential cache needs replenishing.

5a. Retrieve enrollment and credential details

Confirm the enrollment state and retrieve the payment credential metadata:
Use the enrollment_id and payment_credential_id from the webhook payload. Skip this step when replenishing an existing enrollment: you already have this context from the initial fetch.

5b. Fetch credentials

After receiving the PAYMENT-TOKENIZATION.PAYMENT-CREDENTIAL.CREATED webhook, fetch the full encrypted credentials:
Set credential_type based on what the device needs:
PP TSP returns encrypted credential data secured using device certifications.

5c. Acknowledge receipt

After the device successfully receives and stores the full credentials, acknowledge receipt:
PP TSP uses this acknowledgment to notify the card network of the successful provisioning outcome. Repeat 5b and 5c whenever the device needs a dynamic credential.

6. Handle token lifecycle events

PP TSP automatically keeps tokens synchronized with underlying card state. Use the following endpoints for partner-initiated operations: For issuer- or network-initiated changes such as card reissue, fraud replacement, or loss/theft, PP TSP processes the update and notifies Wallet Server via a PAYMENT-TOKENIZATION.TOKEN-STATUS.CHANGED webhook. Call GET enrollment to retrieve the updated state and take appropriate action. Closing an enrollment is irreversible: PP TSP sends a delete request to the card network and the token is permanently deactivated. Use suspend for temporary disabling.

7. Register and handle webhooks

PP TSP publishes signed webhook events to your registered HTTPS endpoint whenever a significant event occurs. Subscribe to all events below and return HTTP 200 to acknowledge receipt. PP TSP retries delivery for unacknowledged events. Set up idempotent handlers to handle duplicate deliveries safely.
Note: PP TSP signs all webhook payloads. Always verify the signature before processing the event. Never process an event from an unverified source.
Sample webhook payloads Each event is delivered to your registered endpoint in the following envelope:
PAYMENT-TOKENIZATION.ENROLLMENT.CREATED
PAYMENT-TOKENIZATION.PAYMENT-CREDENTIAL.CREATED
PAYMENT-TOKENIZATION.PAYMENT-CREDENTIAL.UPDATED
PAYMENT-TOKENIZATION.TOKEN-STATUS.CHANGED
PAYMENT-TOKENIZATION.TOKEN-METADATA.CHANGED
PAYMENT-TOKENIZATION.TRANSACTION.CREATED

Testing and go-live checklist

Complete the following in your sandbox environment before moving to production.
  • Credentials and setup: Obtain sandbox OAuth credentials, test device configuration, and test card data from the PayPal integration team. Confirm OAuth token acquisition and refresh logic.
  • TRID onboarding: Complete TRID onboarding and verify your PP TRID is included in all enrollment and credential requests.
  • Device registration: Confirm device registration returns a valid device_id with ACTIVE status.
  • Green Path enrollment: Complete an end-to-end Green Path enrollment with ACTIVE status confirmed.
  • Yellow Path enrollment: Complete an end-to-end Yellow Path enrollment including all IDV steps.
  • Payment credentials: Test both Full and Dynamic credential fetch and acknowledgment successfully.
  • Lifecycle management: Test activate, suspend, and close operations via API.
  • Webhooks: Verify all webhook event types are delivered and processed correctly in sandbox.
  • Security: Confirm no raw PAN data appears in logs, responses, or stored records.
  • Go-live: Contact your PayPal integration team to confirm production credentials, TRIDs, and webhook endpoints are configured separately from sandbox.