Last updated: November 17, 2026
Save Venmo accounts to charge payers after a set amount of time. For example, offer a free trial and charge payers after the trial expires. Payers don't need to be present when charged, and no checkout is required.
Customers with a saved Venmo account can:
Venmo is available only in the US.
Save a Venmo account if you want customers to:
Complete the following before you start:
PayPal requires Risk Data Acquisition (RDA) to reduce fraud. Collect device data with FraudNet and Magnes. Send the client metadata ID (CMID) that FraudNet used in the PayPal-Client-Metadata-Id header on every customer-initiated transaction (CIT) that charges a saved Venmo payment token. When the payer isn't present, store the CMID from the session that collected the device data, and send it with the charge. A CMID with no matching FraudNet session doesn't link the charge to device data. Payment attempts without RDA data are likely to be declined because of insufficient risk identifiers.
PayPal encrypts Venmo account information and stores it in a digital vault for that customer.
Confirm that PayPal approved your business account to save Venmo accounts.
Set up your sandbox and live business accounts to save payment methods.
Only your sandbox business account is enabled to save payment methods. Your developer account is unaffected. To go live, start the vetting process from the Developer Dashboard.
Set the response_type parameter of the PayPal OAuth 2.0 API to id_token to get a unique ID token for a payer. The id_token identifies each payer and expires in a few minutes. Generate a new token each time payment fields render on your page.
Replace the following values, then run the code to generate a user ID token for a payer who saves a Venmo account for the first time:
The REST examples below use live endpoints. For sandbox testing, replace https://api-m.paypal.com with https://api-m.sandbox.paypal.com throughout this guide and use your sandbox app's credentials and tokens.
CLIENT-ID: Your client ID.CLIENT-SECRET: Your client secret.AUTH-ASSERTION-TOKEN: Your PayPal-Auth-Assertion token.BN-CODE: Your PayPal Attribution ID.curl -s -X POST https://api-m.paypal.com/v1/oauth2/token \
-u CLIENT-ID:CLIENT-SECRET \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'PayPal-Auth-Assertion: AUTH-ASSERTION-TOKEN' \
-H 'PayPal-Partner-Attribution-Id: BN-CODE' \
-d 'grant_type=client_credentials' \
-d 'response_type=id_token'For a returning payer, add the saved PayPal-generated customer ID in the target_customer_id body parameter. The target_customer_id value is available when you capture the order or retrieve saved payment information. This parameter is optional. Include it to show a recognized returning payer, so the Venmo button shows the payer's @handle.
Replace CUSTOMER-ID with the PayPal-generated customer ID stored in your system:
curl -s -X POST https://api-m.paypal.com/v1/oauth2/token \
-u CLIENT-ID:CLIENT-SECRET \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'PayPal-Auth-Assertion: AUTH-ASSERTION-TOKEN' \
-H 'PayPal-Partner-Attribution-Id: BN-CODE' \
-d 'grant_type=client_credentials' \
-d 'response_type=id_token' \
-d 'target_customer_id=CUSTOMER-ID'Replace CLIENT-ID and CLIENT-SECRET with your client ID and client secret. Run the code to generate a user ID token for a payer who saves a Venmo account for the first time:
curl -s -X POST https://api-m.paypal.com/v1/oauth2/token \
-u CLIENT-ID:CLIENT-SECRET \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d 'grant_type=client_credentials' \
-d 'response_type=id_token'For a returning payer, replace CUSTOMER-ID with the PayPal-generated customer ID stored in your system:
curl -s -X POST https://api-m.paypal.com/v1/oauth2/token \
-u CLIENT-ID:CLIENT-SECRET \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d 'grant_type=client_credentials' \
-d 'response_type=id_token' \
-d 'target_customer_id=CUSTOMER-ID'A successful response returns an id_token value. You pass it to the SDK in the next step.
Pass the id_token from your server to the JavaScript SDK in the data-user-id-token attribute. Add enable-funding=venmo as a query parameter to render the Venmo button.
Replace the following values:
CLIENT-ID: Your client ID.MERCHANT-ID: Your merchant ID. Platform integrations only. Include this parameter when you process Venmo transactions for another merchant. See the JavaScript SDK script configuration.ID-TOKEN: The id_token from the previous step.<script
src="https://www.paypal.com/sdk/js?client-id=CLIENT-ID&merchant-id=MERCHANT-ID&enable-funding=venmo"
data-user-id-token="ID-TOKEN">
</script>Add a container for the button and render it with the client-side callbacks that handle API calls, payer approval, and errors. Set fundingSource to window.paypal.FUNDING.VENMO so only the Venmo button renders. The enable-funding=venmo parameter makes Venmo eligible but doesn't hide other eligible buttons, and these callbacks create only Venmo setup tokens. Replace venmo-buttons-container with a container ID of your choice, and update .render() to match.
<div id="venmo-buttons-container"></div>
<script>
window.paypal.Buttons({
fundingSource: window.paypal.FUNDING.VENMO,
createVaultSetupToken: async () => {},
onApprove: async ({ vaultSetupToken }) => {},
onError: (error) => {}
}).render("#venmo-buttons-container");
</script>Request a setup token from your server, and pass it to the SDK in the createVaultSetupToken callback. The callback calls the server endpoint that creates the setup token and returns the token as a string. Errors that occur while the server creates a setup token appear in the onError callback.
| Callback | Returns | Description |
|---|---|---|
createVaultSetupToken | Setup token (string) | Creates a setup token for Venmo on your server. The SDK saves the payment method and updates the setup token with payment method details. |
The following sample calls your server endpoint and returns the setup token:
window.paypal.Buttons({
fundingSource: window.paypal.FUNDING.VENMO,
createVaultSetupToken: async () => {
// Call your server API to generate a setup token
// and return it here as a string
const result = await fetch("/create/setup/token", {
method: "POST"
});
const { id } = await result.json();
return id;
}
})Set up your server to call the Payment Method Tokens API. The SDK uses this API to save Venmo accounts in the background.
Replace the following values:
ACCESS-TOKEN: Your app's access token.BN-CODE: Your PayPal Attribution ID, for revenue attribution. Platform integrations only. To find your BN code, see Code and credential reference.AUTH-ASSERTION-JWT: Your PayPal-Auth-Assertion token. Platform integrations only.REQUEST-ID: A unique alphanumeric string, such as a timestamp.In the createVaultSetupToken callback, call this endpoint on your server and return the setup token string to the SDK.
curl -v -X POST https://api-m.paypal.com/v3/vault/setup-tokens \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer ACCESS-TOKEN' \
-H 'PayPal-Partner-Attribution-Id: BN-CODE' \
-H 'PayPal-Auth-Assertion: AUTH-ASSERTION-JWT' \
-H 'PayPal-Request-Id: REQUEST-ID' \
-d '{
"payment_source": {
"venmo": {
"usage_type": "PLATFORM",
"experience_context": {
"return_url": "https://example.com/returnUrl",
"cancel_url": "https://example.com/cancelUrl",
"app_switch_context": {
"source": "NATIVE_APP"
}
}
}
}
}'A status of PAYER_ACTION_REQUIRED means the payer needs to authorize the vault connection in the Venmo app. Return the id to your client to start the payer approval flow.
{
"id": "4G4976650J0948357",
"customer": {},
"status": "PAYER_ACTION_REQUIRED",
"payment_source": {
"venmo": {
"usage_type": "PLATFORM",
"experience_context": {
"return_url": "https://example.com/returnUrl",
"cancel_url": "https://example.com/cancelUrl"
}
}
},
"links": [
{
"href": "https://api-m.paypal.com/v3/vault/setup-tokens/4G4976650J0948357",
"rel": "self",
"method": "GET",
"encType": "application/json"
},
{
"href": "https://account.venmo.com/go/web/paypal?vault_token=4G4976650J0948357&return_flow=AUTO",
"rel": "payer-action",
"method": "GET",
"encType": "application/json"
}
]
}When the status is PAYER_ACTION_REQUIRED, the SDK starts the payer approval flow. The payer authorizes only the vault connection. The payer doesn't go through a traditional checkout, and no purchase amount appears.
Exchange the approved setup token for a permanent payment token. To save the payer's Venmo account to the vault, call the Payment Method Tokens API from your server.
Optionally, store a merchant customer ID that matches your system to simplify mapping customer information between your system and PayPal.
| Callback | Returns | Description |
|---|---|---|
onApprove | { vaultSetupToken: string } | Runs when the payer approves the vault connection in the Venmo app. Your server exchanges the returned vaultSetupToken for a payment token. |
The following sample sends the vaultSetupToken to your server:
window.paypal.Buttons({
fundingSource: window.paypal.FUNDING.VENMO,
onApprove: async ({ vaultSetupToken }) => {
// Send the vaultSetupToken to your server
// so your server can generate a permanent payment token
const response = await fetch("/create/payment/token", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ vaultSetupToken })
});
if (!response.ok) throw new Error("Could not save the payment method");
return response.json();
},
})Replace the following values:
ACCESS-TOKEN: Your access token.BN-CODE: Your PayPal Attribution ID. Platform integrations only.AUTH-ASSERTION-JWT: Your PayPal-Auth-Assertion token. Platform integrations only.REQUEST-ID: A unique alphanumeric string, such as a timestamp.SETUP-TOKEN-ID: The setup token ID from the previous step.curl -v -X POST https://api-m.paypal.com/v3/vault/payment-tokens \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer ACCESS-TOKEN' \
-H 'PayPal-Partner-Attribution-Id: BN-CODE' \
-H 'PayPal-Auth-Assertion: AUTH-ASSERTION-JWT' \
-H 'PayPal-Request-Id: REQUEST-ID' \
-d '{
"payment_source": {
"token": {
"id": "SETUP-TOKEN-ID",
"type": "SETUP_TOKEN"
}
}
}'A successful request returns HTTP 201, or 200 for an idempotent request. Store the id (the payment token) and the customer.id (the PayPal-generated customer ID) in your system for future transactions. The Venmo button shows the payer's Venmo username from the user_name field.
The response includes the following links:
| Rel | Method | Description |
|---|---|---|
self | GET | Retrieve data about the saved Venmo payment method. |
delete | DELETE | Delete the payment token. |
{
"id": "hg654s1t",
"customer": {
"id": "BygeLlrpZF",
"merchant_customer_id": "your-customer-id-123"
},
"payment_source": {
"venmo": {
"description": "Description for Venmo to be shown to Venmo payer",
"email_address": "payer@example.com",
"user_name": "johndoe",
"account_id": "VYYFH3WJ4JPJQ",
"shipping": {
"name": {
"full_name": "Firstname Lastname"
},
"address": {
"address_line_1": "123 Main St.",
"address_line_2": "Unit 1",
"admin_area_2": "San Jose",
"admin_area_1": "CA",
"postal_code": "95131",
"country_code": "US"
}
},
"usage_pattern": "IMMEDIATE",
"usage_type": "MERCHANT",
"customer_type": "CONSUMER",
"name": {
"given_name": "Firstname",
"surname": "Lastname"
},
"address": {
"address_line_1": "123 Main St.",
"address_line_2": "Unit 1",
"admin_area_1": "CA",
"admin_area_2": "San Jose",
"postal_code": "95131",
"country_code": "US"
}
}
},
"links": [
{
"rel": "self",
"href": "https://api-m.paypal.com/v3/vault/payment-tokens/hg654s1t",
"method": "GET",
"encType": "application/json"
},
{
"rel": "delete",
"href": "https://api-m.paypal.com/v3/vault/payment-tokens/hg654s1t",
"method": "DELETE",
"encType": "application/json"
}
]
}The following sample is a complete back-end integration that saves Venmo for purchase later. The PayPal-Partner-Attribution-Id and PayPal-Auth-Assertion headers apply to platform integrations only. Omit them for merchant integrations. Set the ACCESS_TOKEN environment variable to your app's access token before you run the sample.
import "dotenv/config";
import express from "express";
const { PORT = 8888, ACCESS_TOKEN } = process.env;
const app = express();
app.set("view engine", "ejs");
app.use(express.static("public"));
app.use(express.json());
// Create setup token
app.post("/create/setup/token", async (req, res) => {
try {
const vaultResponse = await fetch("https://api-m.paypal.com/v3/vault/setup-tokens", {
method: "POST",
body: JSON.stringify({
payment_source: {
venmo: {
usage_type: "MERCHANT",
experience_context: {
return_url: "https://example.com/returnUrl",
cancel_url: "https://example.com/cancelUrl"
}
}
}
}),
headers: {
"Content-Type": "application/json",
"Authorization": `Bearer ${ACCESS_TOKEN}`,
"PayPal-Request-Id": Date.now(),
"PayPal-Partner-Attribution-Id": "BN-CODE", // Platform only
"PayPal-Auth-Assertion": "AUTH-ASSERTION-JWT" // Platform only
}
});
const vaultData = await vaultResponse.json();
res.json(vaultData);
} catch (err) {
res.status(500).send(err.message);
}
});
// Create payment token from a setup token
app.post("/create/payment/token", async (req, res) => {
const { vaultSetupToken } = req.body;
try {
const paymentTokenResult = await fetch(
"https://api-m.paypal.com/v3/vault/payment-tokens",
{
method: "POST",
body: JSON.stringify({
payment_source: {
token: {
id: vaultSetupToken,
type: "SETUP_TOKEN"
}
}
}),
headers: {
"Content-Type": "application/json",
"Authorization": `Bearer ${ACCESS_TOKEN}`,
"PayPal-Request-Id": Date.now(),
"PayPal-Partner-Attribution-Id": "BN-CODE", // Platform only
"PayPal-Auth-Assertion": "AUTH-ASSERTION-JWT" // Platform only
}
}
);
const paymentTokenData = await paymentTokenResult.json();
const paymentMethodToken = paymentTokenData.id;
const customerId = paymentTokenData.customer.id;
await save(paymentMethodToken, customerId);
res.json(paymentTokenData);
} catch (err) {
res.status(500).send(err.message);
}
});
const save = async function(paymentMethodToken, customerId) {
// Specify where to save the payment method token and customer ID
// Associate these with the payer in your system
};
app.listen(PORT, () => {
console.log(`Server listening at http://localhost:${PORT}/`);
});The following sample is a complete front-end integration that saves Venmo for purchase later. The enable-funding=venmo parameter renders the Venmo button.
<div id="venmo-buttons-container"></div>
<script
src="https://www.paypal.com/sdk/js?client-id=CLIENT-ID&merchant-id=MERCHANT-ID&enable-funding=venmo"
data-user-id-token="ID-TOKEN">
</script>
<script>
window.paypal.Buttons({
fundingSource: window.paypal.FUNDING.VENMO,
createVaultSetupToken: async () => {
const result = await fetch("/create/setup/token", {
method: "POST",
});
const { id } = await result.json();
return id;
},
onApprove: async ({ vaultSetupToken }) => {
const response = await fetch("/create/payment/token", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ vaultSetupToken })
});
if (!response.ok) throw new Error("Could not save the payment method");
return response.json();
},
onError: (error) => {
console.log("An error occurred: ", error);
}
}).render("#venmo-buttons-container");
</script>Create a page on your site where payers can see their saved Venmo accounts. Show the Venmo username from the user_name field in the payment token response, so payers recognize which account is on file.
The following restrictions apply to saving Venmo accounts:
This guide covers JavaScript SDK v5. JavaScript SDK v6 uses a different client-side integration and returns different callback payloads. To save Venmo with v6, see Save Venmo for purchase later with JavaScript SDK v6.
Continue with the following: