View as Markdown
API Spec (JSON)
API Spec (YAML)
Compact modeHides field descriptions and other prose for a more compact, scannable view of the API reference.Client CredentialsToken URLhttps://api-m.sandbox.paypal.com/v1/oauth2/tokenInheaderScopes
https://uri.paypal.com/services/vault/payment-tokens/readSetup Token creation with a instrument type optional financial instrument details and customer_id.
TypeScript Definitions
Use the request body type in TypeScript.
customerobject<customer>Optionalidstring<merchant_partner_customer_id>Optionalexpirystring<date_year_month>Optionalbrandenum<card_brand>Optionalbilling_addressobject<Portable Postal Address (Medium-Grained)>Optionaladmin_area_1stringOptionalcountry_codestring<country_code>RequiredNote: The country code for Great Britain isGBand notUKas used in the top-level domain names for that country. Use the `C2` country code for China worldwide for comparable uncontrolled price (CUP) method, bank card, and cross-border transactions.
verification_methodenum<card_verification_method>Optionalexperience_contextobject<card_experience_context>Optionallocalestring<language>Optionalvault_instructionenum<vault_instruction>OptionalDeprecateduser_actionenum<user_action>Optionalnetwork_transaction_referencenetwork_transaction_reference_requestOptionalpaypalobject<paypal_wallet_request>Optionalusage_patternenum<usage_pattern>Optionalemail_addressstring<email_address>Optionalphone_numberobject<phone>Optionalcountry_codestringRequirednational_numberstringRequiredtypeenumOptionaladdressobject<Portable Postal Address (Medium-Grained)>Optionaladmin_area_1stringOptionalcountry_codestring<country_code>RequiredNote: The country code for Great Britain isGBand notUKas used in the top-level domain names for that country. Use the `C2` country code for China worldwide for comparable uncontrolled price (CUP) method, bank card, and cross-border transactions.
permit_multiple_payment_tokensbooleanOptionalusage_typeenumOptionalcustomer_typeenumOptionalbilling_planobject<plan>Optionalbilling_cyclesobject<billing_cycle>[]Requiredtenure_typeenumRequiredpricing_schemeobject<pricing_scheme>Optionalpriceobject<money>Optionalcurrency_codestring<currency_code>RequiredvaluestringRequiredpricing_modelenumRequiredreload_threshold_amountobject<money>Optionalcurrency_codestring<currency_code>RequiredvaluestringRequiredfrequencyfrequencyOptionaltotal_cyclesintegerOptional1 and 999 for total_cycles). Regular billing cycles can be executed infinite times (value of 0 for total_cycles) or a finite number of times (value between 1 and 999 for total_cycles).start_datestring<date_no_time>Optionalproductproduct_overrideOptionalone_time_chargesobject<one_time_charges>Requiredsetup_feeobject<money>Optionalcurrency_codestring<currency_code>RequiredvaluestringRequiredshipping_amountobject<money>Optionalcurrency_codestring<currency_code>RequiredvaluestringRequiredtaxesobject<money>Optionalcurrency_codestring<currency_code>RequiredvaluestringRequiredproduct_priceobject<money>Optionalcurrency_codestring<currency_code>RequiredvaluestringRequiredtotal_amountobject<money>Requiredcurrency_codestring<currency_code>RequiredvaluestringRequiredexperience_contextobject<paypal_wallet_experience_context>Optionallocalestring<language>Optionalshipping_preferenceenumOptionalvault_instructionenum<vault_instruction>OptionalDeprecatedapp_switch_contextobject<app_switch_context>Optionalnative_appobject<native_app_context>OptionalNo fields are defined.
mobile_webobject<mobile_web_context>Optionaluser_actionenum<user_action>Optionalvenmoobject<venmo_request>Optionalusage_patternenum<usage_pattern>Optionalemail_addressstring<email_address>Optionalphone_numberobject<phone>Optionalcountry_codestringRequirednational_numberstringRequiredtypeenumOptionaladdressobject<Portable Postal Address (Medium-Grained)>Optionaladmin_area_1stringOptionalcountry_codestring<country_code>RequiredNote: The country code for Great Britain isGBand notUKas used in the top-level domain names for that country. Use the `C2` country code for China worldwide for comparable uncontrolled price (CUP) method, bank card, and cross-border transactions.
permit_multiple_payment_tokensbooleanOptionalusage_typeenumOptionalcustomer_typeenumOptionalexperience_contextobject<venmo_experience_context>Optionalshipping_preferenceenumOptionalvault_instructionenum<vault_instruction>OptionalDeprecateduser_actionenum<user_action>Optionalapple_payobject<apple_pay_request>Optionaltypeenum<card_type>Optionalbrandenum<card_brand>Optionalbilling_addressobject<Portable Postal Address (Medium-Grained)>Optionaladmin_area_1stringOptionalcountry_codestring<country_code>RequiredNote: The country code for Great Britain isGBand notUKas used in the top-level domain names for that country. Use the `C2` country code for China worldwide for comparable uncontrolled price (CUP) method, bank card, and cross-border transactions.
tokenobject<token_id_request>Optionalbankobject<bank_request>Optionalach_debitobject<ach_debit_request>Optionalverification_intentach_verification_intentOptionalverificationach_debit_verificationOptionalsepa_debitobject<sepa_debit_request>Optionalmandate_intentsepa_mandate_intentOptionalexperience_contextobject<sepa_debit_experience_context>Optionallocalestring<language>Optionalreturn_urlstring<url>Requiredcancel_urlstring<url>Requiredshopper_session_idshopper_session_idOptionalapplication/json
application/json
application/json
application/json
application/json
application/json
Request samples
using Microsoft.Extensions.Logging;
using PaypalServerSdk.Standard;
using PaypalServerSdk.Standard.Authentication;
using PaypalServerSdk.Standard.Controllers;
using PaypalServerSdk.Standard.Exceptions;
using PaypalServerSdk.Standard.Http.Response;
using PaypalServerSdk.Standard.Models;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace TestConsoleProject
{
public class Program
{
public static async Task Main()
{
// Scenario: 201 - Create Setup Token - Card with Empty Request
PaypalServerSdkClient client = new PaypalServerSdkClient.Builder()
.ClientCredentialsAuth(
new ClientCredentialsAuthModel.Builder(
"OAuthClientId",
"OAuthClientSecret"
)
.Build())
.Environment(PaypalServerSdk.Standard.Environment.Sandbox)
.LoggingConfig(config => config
.LogLevel(LogLevel.Information)
.RequestConfig(reqConfig => reqConfig.Body(true))
.ResponseConfig(respConfig => respConfig.Headers(true))
)
.Build();
VaultController vaultController = client.VaultController;
CreateSetupTokenInput createSetupTokenInput = new CreateSetupTokenInput
{
Body = new SetupTokenRequest
{
PaymentSource = new SetupTokenRequestPaymentSource
{
},
},
};
try
{
ApiResponse<SetupTokenResponse> result = await vaultController.CreateSetupTokenAsync(createSetupTokenInput);
}
catch (ApiException e)
{
Console.WriteLine(e.Message);
}
}
}
}Response samples
{ "id": "5C991763VB2781612", "customer": { "id": "BygeLlrpZF", "merchant_customer_id": "customer@example.com" }, "status": "APPROVED", "payment_source": { "card": { "last_digits": "1111", "expiry": "2027-02", "name": "John Doe", "billing_address": { "address_line_1": "2211 N First Street", "address_line_2": "17.3.160", "admin_area_1": "CA", "admin_area_2": "San Jose", "postal_code": "95131", "country_code": "US" }, "bin_details": { "bin": "411111", "issuing_bank": "Advantage One Federal Credit Union", "products": [ "CREDIT" ], "bin_country_code": "US" } } }, "links": [ { "rel": "self", "href": "https://api-m.paypal.com/v3/vault/setup-tokens/5C991763VB2781612", "method": "GET", "encType": "application/json" }, { "rel": "confirm", "href": "https://api-m.paypal.com/v3/vault/payment-token", "method": "POST", "encType": "application/json" } ]}