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.Note: For error handling and troubleshooting, see Orders v2 errors.
Client CredentialsToken URLhttps://api-m.sandbox.paypal.com/v1/oauth2/tokenInheaderScopes
https://uri.paypal.com/services/payments/paymenthttps://uri.paypal.com/services/payments/orders/deprecating-jssdk-migration-for-limited-merchantsPayPal-Request-Idstring<currency_code>OptionalPayPal-Partner-Attribution-Idstring<currency_code>OptionalPayPal-Client-Metadata-Idstring<guid>OptionalPreferstringOptionalreturn=minimal. The server returns a minimal response to optimize communication between the API caller and the server. A minimal response includes the id, status and HATEOAS links.return=representation. The server returns a complete resource representation, including the current state of the resource.TypeScript Definitions
Use the request body type in TypeScript.
intentenum<checkout_payment_intent>Requiredpayerobject<payer>OptionalDeprecated| See | Since Version |
|---|---|
| payment_source.paypal | 2.9 |
email_addressstring<email>OptionalNote: Up to 64 characters are allowed before and 255 characters are allowed after the@sign. However, the generally accepted maximum length for an email address is 254 characters. The pattern verifies that an unquoted@sign exists.
nameobject<name>Optionalprefixstring<currency_code>Optionalgiven_namestring<currency_code>Optionalsurnamestring<currency_code>Optionalmiddle_namestring<currency_code>Optionalsuffixstring<currency_code>Optionalfull_namestring<currency_code>Optionalphoneobject<phone_with_type>Optionalphone_typeenum<phone_type>Optionalphone_numberobject<phone_number_without_country_code>Requirednational_numberstringRequiredbirth_datestring<date_no_time>Optionaltax_infoobject<tax_info>Optionaladdressobject<address_portable>Optionaladdress_line_1string<currency_code>Optionaladdress_line_2string<currency_code>Optionaladdress_line_3string<currency_code>Optionaladmin_area_4string<currency_code>Optionaladmin_area_3string<currency_code>Optionaladmin_area_2string<currency_code>Optionaladmin_area_1string<currency_code>Optionalpostal_codestring<currency_code>Optionalcountry_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.
address_detailsobject<Address Details>Optionalstreet_namestring<currency_code>Optionalstreet_typestring<currency_code>Optionaldelivery_servicestring<currency_code>Optionalbuilding_namestring<currency_code>OptionalCraven House.sub_buildingstring<currency_code>Optionalpurchase_unitsobject<purchase_unit_request>[]Requiredreference_idstring<currency_code>Optionalamountobject<amount_with_breakdown>Requiredcurrency_codestring<currency_code>RequiredvaluestringRequiredbreakdownobject<amount_breakdown>Optionalitem_totalobject<money>Optionalcurrency_codestring<currency_code>RequiredvaluestringRequiredshippingobject<money>Optionalcurrency_codestring<currency_code>RequiredvaluestringRequiredhandlingobject<money>Optionalcurrency_codestring<currency_code>RequiredvaluestringRequiredtax_totalobject<money>Optionalcurrency_codestring<currency_code>RequiredvaluestringRequiredinsuranceobject<money>Optionalcurrency_codestring<currency_code>RequiredvaluestringRequiredshipping_discountobject<money>Optionalcurrency_codestring<currency_code>RequiredvaluestringRequireddiscountobject<discount_with_breakdown>Optionalcurrency_codestring<currency_code>RequiredvaluestringRequiredpayeeobject<payee>Optionalemail_addressstring<email>OptionalNote: Up to 64 characters are allowed before and 255 characters are allowed after the@sign. However, the generally accepted maximum length for an email address is 254 characters. The pattern verifies that an unquoted@sign exists.
merchant_idstring<account_id>Optionalpayment_instructionobject<payment_instruction>Optionalplatform_feesobject<platform_fee>[]Optionalamountobject<money>Requiredcurrency_codestring<currency_code>RequiredvaluestringRequiredpayeeobject<payee_base>Optionalemail_addressstring<email>OptionalNote: Up to 64 characters are allowed before and 255 characters are allowed after the@sign. However, the generally accepted maximum length for an email address is 254 characters. The pattern verifies that an unquoted@sign exists.
merchant_idstring<account_id>Optionaldisbursement_modeenum<disbursement_mode>Optionalpayee_pricing_tier_idstringOptionaldescriptionstring<currency_code>OptionalThis field supports up to 3,000 characters, but any content beyond 127 characters (including spaces) will be truncated. The 127 character limit is reflected in the response representation of this field.The purchase description. The maximum length of the character is dependent on the type of characters used. The character length is specified assuming a US ASCII character. Depending on type of character; (e.g. accented character, Japanese characters) the number of characters that that can be specified as input might not equal the permissible max length.
custom_idstring<currency_code>Optionalinvoice_idstring<currency_code>Optionalsoft_descriptorstring<currency_code>OptionalThis field supports up to 127 characters, but any content beyond 22 characters (including spaces) will be truncated. The 22 character limit is reflected in the response representation of this field.The soft descriptor is the dynamic text used to construct the statement descriptor that appears on a payer's card statement.
PAYPAL_prefix+(space)+merchant_descriptor+(space)+ soft_descriptorNote: The merchant descriptor is the descriptor of the merchant’s payment receiving preferences which can be seen by logging into the merchant account https://www.sandbox.paypal.com/businessprofile/settings/info/editThe
PAYPAL prefix uses 8 characters. Only the first 22 characters will be displayed in the statement. PAYPAL *.Janes Gift.800-123-1234.PAYPAL * Janes Gift 80.itemsobject<item_request>[]Optionalnamestring<currency_code>RequiredThis field supports up to 3000 characters, but any content beyond 127 characters (including spaces) will be truncated. The 127 character limit is reflected in the response representation of this field.
unit_amountobject<money>Requiredcurrency_codestring<currency_code>RequiredvaluestringRequiredtaxobject<money>Optionalcurrency_codestring<currency_code>RequiredvaluestringRequireddescriptionstring<currency_code>OptionalThis field supports up to 4000 characters, but any content beyond 2048 characters (including spaces) will be truncated. The 2048 character limit is reflected in the response representation of this field.
skustring<currency_code>Optionalupcobject<universal_product_code>Optionalbilling_planobject<order_billing_plan>Optionalbilling_cyclesobject<billing_cycle>[]Requiredpricing_schemeobject<pricing_scheme>Optionalpriceobject<money>Optionalcurrency_codestring<currency_code>RequiredvaluestringRequiredreload_threshold_amountobject<money>Optionalcurrency_codestring<currency_code>RequiredvaluestringRequiredtotal_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>Optionalsetup_feeobject<money>Optionalcurrency_codestring<currency_code>RequiredvaluestringRequiredshippingobject<shipping_detail>Optionalnameobject<name>Optionalprefixstring<currency_code>Optionalgiven_namestring<currency_code>Optionalsurnamestring<currency_code>Optionalmiddle_namestring<currency_code>Optionalsuffixstring<currency_code>Optionalfull_namestring<currency_code>Optionalemail_addressstring<email_address>OptionalNote: Up to 64 characters are allowed before and 255 characters are allowed after the@sign. However, the generally accepted maximum length for an email address is 254 characters. The pattern verifies that an unquoted@sign exists.
phone_numberobject<phone>Optionalcountry_codestring<country_calling_code>Requirednational_numberstringRequiredoptionsobject<shipping_option>[]Optionalidstring<currency_code>Requiredlabelstring<currency_code>Requiredtypeenum<shipping_type>Optionalamountobject<money>Optionalcurrency_codestring<currency_code>RequiredvaluestringRequiredselectedbooleanRequiredaddressobject<address_portable>Optionaladdress_line_1string<currency_code>Optionaladdress_line_2string<currency_code>Optionaladdress_line_3string<currency_code>Optionaladmin_area_4string<currency_code>Optionaladmin_area_3string<currency_code>Optionaladmin_area_2string<currency_code>Optionaladmin_area_1string<currency_code>Optionalpostal_codestring<currency_code>Optionalcountry_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.
address_detailsobject<Address Details>Optionalstreet_namestring<currency_code>Optionalstreet_typestring<currency_code>Optionaldelivery_servicestring<currency_code>Optionalbuilding_namestring<currency_code>OptionalCraven House.sub_buildingstring<currency_code>Optionalsupplementary_dataobject<supplementary_data>Optionalcardobject<card_supplementary_data>Optionallevel_2object<level_2_card_processing_data>Optionalinvoice_idstringOptionaltax_totalobject<money>Optionalcurrency_codestring<currency_code>RequiredvaluestringRequiredlevel_3object<level_3_card_processing_data>Optionalshipping_amountobject<money>Optionalcurrency_codestring<currency_code>RequiredvaluestringRequiredduty_amountobject<money>Optionalcurrency_codestring<currency_code>RequiredvaluestringRequireddiscount_amountobject<money>Optionalcurrency_codestring<currency_code>RequiredvaluestringRequiredshipping_addressobject<address_portable>Optionaladdress_line_1string<currency_code>Optionaladdress_line_2string<currency_code>Optionaladdress_line_3string<currency_code>Optionaladmin_area_4string<currency_code>Optionaladmin_area_3string<currency_code>Optionaladmin_area_2string<currency_code>Optionaladmin_area_1string<currency_code>Optionalpostal_codestring<currency_code>Optionalcountry_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.
address_detailsobject<Address Details>Optionalstreet_namestring<currency_code>Optionalstreet_typestring<currency_code>Optionaldelivery_servicestring<currency_code>Optionalbuilding_namestring<currency_code>OptionalCraven House.sub_buildingstring<currency_code>Optionalline_itemsobject<line_item>[]Optionaldescriptionstring<currency_code>Optionalskustring<currency_code>Optionalupcobject<universal_product_code>Optionalbilling_planobject<order_billing_plan>Optionalbilling_cyclesobject<billing_cycle>[]Requiredpricing_schemeobject<pricing_scheme>Optionalpriceobject<money>Optionalcurrency_codestring<currency_code>RequiredvaluestringRequiredreload_threshold_amountobject<money>Optionalcurrency_codestring<currency_code>RequiredvaluestringRequiredtotal_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>Optionalsetup_feeobject<money>Optionalcurrency_codestring<currency_code>RequiredvaluestringRequiredunit_amountobject<money>Optionalcurrency_codestring<currency_code>RequiredvaluestringRequiredtaxobject<money>Optionalcurrency_codestring<currency_code>RequiredvaluestringRequiredcommodity_codestringOptionaldiscount_amountobject<money>Optionalcurrency_codestring<currency_code>RequiredvaluestringRequiredtotal_amountobject<money>Optionalcurrency_codestring<currency_code>RequiredvaluestringRequiredunit_of_measurestringOptionalriskobject<risk_supplementary_data>Optionalcustomerobject<participant_metadata>Optionalip_addressstring<ip_address>Optionalpayment_sourceobject<payment_source>Optionalcardobject<card_request>OptionalNote: Passing card number, cvv and expiry directly via the API requires PCI SAQ D compliance.
*PayPal offers a mechanism by which you do not have to take on the PCI SAQ D burden by using hosted fields - refer to this Integration Guide*.
expirystring<date_year_month>Optionaltypeenum<card_type>Optionalbrandenum<card_brand>Optionalbilling_addressobject<address_portable>Optionaladdress_line_1string<currency_code>Optionaladdress_line_2string<currency_code>Optionaladdress_line_3string<currency_code>Optionaladmin_area_4string<currency_code>Optionaladmin_area_3string<currency_code>Optionaladmin_area_2string<currency_code>Optionaladmin_area_1string<currency_code>Optionalpostal_codestring<currency_code>Optionalcountry_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.
address_detailsobject<Address Details>Optionalstreet_namestring<currency_code>Optionalstreet_typestring<currency_code>Optionaldelivery_servicestring<currency_code>Optionalbuilding_namestring<currency_code>OptionalCraven House.sub_buildingstring<currency_code>Optionalattributesobject<card_attributes>Optionalcustomerobject<card_customer>Optionalidstring<merchant_partner_customer_id>Optionalemail_addressstring<email>OptionalNote: Up to 64 characters are allowed before and 255 characters are allowed after the@sign. However, the generally accepted maximum length for an email address is 254 characters. The pattern verifies that an unquoted@sign exists.
phoneobject<phone_with_type>Optionalphone_typeenum<phone_type>Optionalphone_numberobject<phone_number_without_country_code>Requirednational_numberstringRequirednameobject<name>Optionalprefixstring<currency_code>Optionalgiven_namestring<currency_code>Optionalsurnamestring<currency_code>Optionalmiddle_namestring<currency_code>Optionalsuffixstring<currency_code>Optionalfull_namestring<currency_code>Optionalvaultobject<vault_instruction_base>Optionalstore_in_vaultenum<store_in_vault_instruction>Optionalverificationobject<card_verification>Optionalvault_idstring<vault_id>Optionalsingle_use_tokenstring<single_use_token>Optionalstored_credentialobject<card_stored_credential>Optionalpayment_initiatorenum<payment_initiator>Requiredpayment_typeenum<stored_payment_source_payment_type>Requiredusageenum<stored_payment_source_usage_type>Optionalprevious_network_transaction_referenceobject<network_transaction_reference>OptionalidstringRequireddatestringOptionalnetworkenum<card_brand>Optionalnetwork_tokenobject<network_token_request>Optionalexpirystring<date_year_month>Requiredeci_flagenum<eci_flag>Optionaltoken_requestor_idstringOptionalexperience_contextobject<card_experience_context>Optionaltokenobject<token>Optionalpaypalobject<paypal_wallet>Optionalvault_idstring<vault_id>Optionalemail_addressstring<email>OptionalNote: Up to 64 characters are allowed before and 255 characters are allowed after the@sign. However, the generally accepted maximum length for an email address is 254 characters. The pattern verifies that an unquoted@sign exists.
nameobject<name>Optionalprefixstring<currency_code>Optionalgiven_namestring<currency_code>Optionalsurnamestring<currency_code>Optionalmiddle_namestring<currency_code>Optionalsuffixstring<currency_code>Optionalfull_namestring<currency_code>Optionalphoneobject<phone_with_type>Optionalphone_typeenum<phone_type>Optionalphone_numberobject<phone_number_without_country_code>Requirednational_numberstringRequiredbirth_datestring<date_no_time>Optionaltax_infoobject<tax_info>Optionaladdressobject<address_portable>Optionaladdress_line_1string<currency_code>Optionaladdress_line_2string<currency_code>Optionaladdress_line_3string<currency_code>Optionaladmin_area_4string<currency_code>Optionaladmin_area_3string<currency_code>Optionaladmin_area_2string<currency_code>Optionaladmin_area_1string<currency_code>Optionalpostal_codestring<currency_code>Optionalcountry_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.
address_detailsobject<Address Details>Optionalstreet_namestring<currency_code>Optionalstreet_typestring<currency_code>Optionaldelivery_servicestring<currency_code>Optionalbuilding_namestring<currency_code>OptionalCraven House.sub_buildingstring<currency_code>Optionalattributesobject<paypal_wallet_attributes>Optionalcustomerobject<paypal_wallet_customer>Optionalidstring<merchant_partner_customer_id>Optionalemail_addressstring<email>OptionalNote: Up to 64 characters are allowed before and 255 characters are allowed after the@sign. However, the generally accepted maximum length for an email address is 254 characters. The pattern verifies that an unquoted@sign exists.
phoneobject<phone_with_type>Optionalphone_typeenum<phone_type>Optionalphone_numberobject<phone_number_without_country_code>Requirednational_numberstringRequirednameobject<name>Optionalprefixstring<currency_code>Optionalgiven_namestring<currency_code>Optionalsurnamestring<currency_code>Optionalmiddle_namestring<currency_code>Optionalsuffixstring<currency_code>Optionalfull_namestring<currency_code>Optionalvaultobject<vault_paypal_wallet_base>Optionalstore_in_vaultenum<store_in_vault_instruction>Optionaldescriptionstring<currency_code>Optionalusage_patternenumOptionalshippingobject<shipping_detail>Optionalnameobject<name>Optionalprefixstring<currency_code>Optionalgiven_namestring<currency_code>Optionalsurnamestring<currency_code>Optionalmiddle_namestring<currency_code>Optionalsuffixstring<currency_code>Optionalfull_namestring<currency_code>Optionalemail_addressstring<email_address>OptionalNote: Up to 64 characters are allowed before and 255 characters are allowed after the@sign. However, the generally accepted maximum length for an email address is 254 characters. The pattern verifies that an unquoted@sign exists.
phone_numberobject<phone>Optionalcountry_codestring<country_calling_code>Requirednational_numberstringRequiredoptionsobject<shipping_option>[]Optionalidstring<currency_code>Requiredlabelstring<currency_code>Requiredtypeenum<shipping_type>Optionalamountobject<money>Optionalcurrency_codestring<currency_code>RequiredvaluestringRequiredselectedbooleanRequiredaddressobject<address_portable>Optionaladdress_line_1string<currency_code>Optionaladdress_line_2string<currency_code>Optionaladdress_line_3string<currency_code>Optionaladmin_area_4string<currency_code>Optionaladmin_area_3string<currency_code>Optionaladmin_area_2string<currency_code>Optionaladmin_area_1string<currency_code>Optionalpostal_codestring<currency_code>Optionalcountry_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.
address_detailsobject<Address Details>Optionalstreet_namestring<currency_code>Optionalstreet_typestring<currency_code>Optionaldelivery_servicestring<currency_code>Optionalbuilding_namestring<currency_code>OptionalCraven House.sub_buildingstring<currency_code>Optionalpermit_multiple_payment_tokensbooleanOptionalexperience_contextobject<paypal_wallet_experience_context>OptionalNote: Partners and Marketplaces might configurebrand_nameandshipping_preferenceduring partner account setup, which overrides the request values.
localestring<language>Optionalapp_switch_contextobject<app_switch_context>Optionalnative_appobject<native_app_context>OptionalNo fields are defined.
mobile_webobject<mobile_web_context>Optionalorder_update_callback_configobject<callback_configuration>Optionalcallback_urlstringRequiredbilling_agreement_idstring<billing_agreement_id>Optionalstored_credentialobject<paypal_wallet_stored_credential>Optionalpayment_initiatorenum<payment_initiator>Requiredcharge_patternenum<charge_pattern>OptionalDeprecated| See |
|---|
| usage_pattern |
usage_patternenum<charge_pattern>Optionalusageenum<stored_payment_source_usage_type>Optionalbancontactobject<bancontact_request>Optionalnamestring<full_name>Requiredcountry_codestring<country_code-2>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.
experience_contextobject<experience_context_base>Optionallocalestring<language>Optionalblikobject<blik_request>Optionalnamestring<full_name>Requiredcountry_codestring<country_code-2>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.
emailstring<email_address>OptionalNote: Up to 64 characters are allowed before and 255 characters are allowed after the@sign. However, the generally accepted maximum length for an email address is 254 characters. The pattern verifies that an unquoted@sign exists.
experience_contextobject<blik_experience_context>Optionallocalestring<language>Optionalconsumer_ipstring<ip_address>Optionallevel_0object<blik_seamless>Optionalone_clickobject<blik_one_click>Optionalepsobject<eps_request>Optionalnamestring<full_name>Requiredcountry_codestring<country_code-2>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.
experience_contextobject<experience_context_base>Optionallocalestring<language>Optionalgiropayobject<giropay_request>Optionalnamestring<full_name>Requiredcountry_codestring<country_code-2>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.
experience_contextobject<experience_context_base>Optionallocalestring<language>Optionalidealobject<ideal_request>Optionalnamestring<full_name>Requiredcountry_codestring<country_code-2>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.
bicstring<bic>Optionalexperience_contextobject<experience_context_base>Optionallocalestring<language>Optionalmybankobject<mybank_request>Optionalnamestring<full_name>Requiredcountry_codestring<country_code-2>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.
experience_contextobject<experience_context_base>Optionallocalestring<language>Optionalp24object<p24_request>Optionalnamestring<full_name>Requiredemailstring<email_address>RequiredNote: Up to 64 characters are allowed before and 255 characters are allowed after the@sign. However, the generally accepted maximum length for an email address is 254 characters. The pattern verifies that an unquoted@sign exists.
country_codestring<country_code-2>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.
experience_contextobject<experience_context_base>Optionallocalestring<language>Optionalsofortobject<sofort_request>Optionalnamestring<full_name>Requiredcountry_codestring<country_code-2>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.
experience_contextobject<experience_context_base>Optionallocalestring<language>Optionaltrustlyobject<trustly_request>Optionalnamestring<full_name>Requiredcountry_codestring<country_code-2>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.
emailstring<email_address>RequiredNote: Up to 64 characters are allowed before and 255 characters are allowed after the@sign. However, the generally accepted maximum length for an email address is 254 characters. The pattern verifies that an unquoted@sign exists.
experience_contextobject<experience_context_base>Optionallocalestring<language>Optionalapple_payobject<apple_pay_request>Optionalnamestring<full_name>Optionalemail_addressstring<email_address>OptionalNote: Up to 64 characters are allowed before and 255 characters are allowed after the@sign. However, the generally accepted maximum length for an email address is 254 characters. The pattern verifies that an unquoted@sign exists.
phone_numberobject<phone_number_without_country_code>Optionalnational_numberstringRequireddecrypted_tokenobject<apple_pay_decrypted_token_data>Optionaltransaction_amountobject<money>Optionalcurrency_codestring<currency_code>RequiredvaluestringRequiredtokenized_cardobject<card>Requiredexpirystring<date_year_month>Optionaltypeenum<card_type>Optionalbrandenum<card_brand>Optionalbilling_addressobject<address_portable>Optionaladdress_line_1string<currency_code>Optionaladdress_line_2string<currency_code>Optionaladdress_line_3string<currency_code>Optionaladmin_area_4string<currency_code>Optionaladmin_area_3string<currency_code>Optionaladmin_area_2string<currency_code>Optionaladmin_area_1string<currency_code>Optionalpostal_codestring<currency_code>Optionalcountry_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.
address_detailsobject<Address Details>Optionalstreet_namestring<currency_code>Optionalstreet_typestring<currency_code>Optionaldelivery_servicestring<currency_code>Optionalbuilding_namestring<currency_code>OptionalCraven House.sub_buildingstring<currency_code>Optionalattributesobject<card_attributes>Optionalcustomerobject<card_customer>Optionalidstring<merchant_partner_customer_id>Optionalemail_addressstring<email>OptionalNote: Up to 64 characters are allowed before and 255 characters are allowed after the@sign. However, the generally accepted maximum length for an email address is 254 characters. The pattern verifies that an unquoted@sign exists.
phoneobject<phone_with_type>Optionalphone_typeenum<phone_type>Optionalphone_numberobject<phone_number_without_country_code>Requirednational_numberstringRequirednameobject<name>Optionalprefixstring<currency_code>Optionalgiven_namestring<currency_code>Optionalsurnamestring<currency_code>Optionalmiddle_namestring<currency_code>Optionalsuffixstring<currency_code>Optionalfull_namestring<currency_code>Optionalvaultobject<vault_instruction_base>Optionalstore_in_vaultenum<store_in_vault_instruction>Optionalverificationobject<card_verification>Optionalpayment_dataobject<apple_pay_payment_data>Optionalstored_credentialobject<card_stored_credential>Optionalpayment_initiatorenum<payment_initiator>Requiredpayment_typeenum<stored_payment_source_payment_type>Requiredusageenum<stored_payment_source_usage_type>Optionalprevious_network_transaction_referenceobject<network_transaction_reference>OptionalidstringRequireddatestringOptionalnetworkenum<card_brand>Optionalvault_idstring<vault_id>Optionalattributesobject<apple_pay_attributes>Optionalcustomerobject<customer>Optionalidstring<merchant_partner_customer_id>Optionalemail_addressstring<email>OptionalNote: Up to 64 characters are allowed before and 255 characters are allowed after the@sign. However, the generally accepted maximum length for an email address is 254 characters. The pattern verifies that an unquoted@sign exists.
phoneobject<phone_with_type>Optionalphone_typeenum<phone_type>Optionalphone_numberobject<phone_number_without_country_code>Requirednational_numberstringRequirednameobject<name>Optionalprefixstring<currency_code>Optionalgiven_namestring<currency_code>Optionalsurnamestring<currency_code>Optionalmiddle_namestring<currency_code>Optionalsuffixstring<currency_code>Optionalfull_namestring<currency_code>Optionalvaultobject<v3_vault_instruction_base>Optionalstore_in_vaultenum<store_in_vault_instruction>Requiredexperience_contextobject<apple_pay_experience_context>Optionalgoogle_payobject<google_pay_request>Optionalnamestring<full_name>Optionalemail_addressstring<email_address>OptionalNote: Up to 64 characters are allowed before and 255 characters are allowed after the@sign. However, the generally accepted maximum length for an email address is 254 characters. The pattern verifies that an unquoted@sign exists.
phone_numberobject<phone_with_national_required_and_country_code>Optionalcountry_codestring<country_calling_code>Optionalnational_numberstringRequiredcardobject<google_pay_card>Optionalexpirystring<date_year_month>Optionaltypeenum<card_type>Optionalbrandenum<card_brand>Optionalbilling_addressobject<address_portable>Optionaladdress_line_1string<currency_code>Optionaladdress_line_2string<currency_code>Optionaladdress_line_3string<currency_code>Optionaladmin_area_4string<currency_code>Optionaladmin_area_3string<currency_code>Optionaladmin_area_2string<currency_code>Optionaladmin_area_1string<currency_code>Optionalpostal_codestring<currency_code>Optionalcountry_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.
address_detailsobject<Address Details>Optionalstreet_namestring<currency_code>Optionalstreet_typestring<currency_code>Optionaldelivery_servicestring<currency_code>Optionalbuilding_namestring<currency_code>OptionalCraven House.sub_buildingstring<currency_code>Optionaldecrypted_tokenobject<google_pay_decrypted_token_data>Optionalcardobject<google_pay_card>Requiredexpirystring<date_year_month>Requiredtypeenum<card_type>Optionalbrandenum<card_brand>Optionalbilling_addressobject<address_portable>Optionaladdress_line_1string<currency_code>Optionaladdress_line_2string<currency_code>Optionaladdress_line_3string<currency_code>Optionaladmin_area_4string<currency_code>Optionaladmin_area_3string<currency_code>Optionaladmin_area_2string<currency_code>Optionaladmin_area_1string<currency_code>Optionalpostal_codestring<currency_code>Optionalcountry_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.
address_detailsobject<Address Details>Optionalstreet_namestring<currency_code>Optionalstreet_typestring<currency_code>Optionaldelivery_servicestring<currency_code>Optionalbuilding_namestring<currency_code>OptionalCraven House.sub_buildingstring<currency_code>Optionalcryptogramstring<currency_code>Optionalassurance_detailsobject<assurance_details>Optionalcard_holder_authenticatedbooleanOptionalexperience_contextobject<google_pay_experience_context>Optionalvenmoobject<venmo_wallet_request>Optionalvault_idstring<vault_id>Optionalemail_addressstring<email>OptionalNote: Up to 64 characters are allowed before and 255 characters are allowed after the@sign. However, the generally accepted maximum length for an email address is 254 characters. The pattern verifies that an unquoted@sign exists.
experience_contextobject<venmo_wallet_experience_context>OptionalNote: Partners and Marketplaces might configure shipping_preference during partner account setup, which overrides the request values.order_update_callback_configobject<callback_configuration>Optionalcallback_urlstringRequiredattributesobject<venmo_wallet_attributes>Optionalcustomerobject<venmo_wallet_customer>Optionalidstring<merchant_partner_customer_id>Optionalemail_addressstring<email>OptionalNote: Up to 64 characters are allowed before and 255 characters are allowed after the@sign. However, the generally accepted maximum length for an email address is 254 characters. The pattern verifies that an unquoted@sign exists.
phoneobject<phone_with_type>Optionalphone_typeenum<phone_type>Optionalphone_numberobject<phone_number_without_country_code>Requirednational_numberstringRequirednameobject<name>Optionalprefixstring<currency_code>Optionalgiven_namestring<currency_code>Optionalsurnamestring<currency_code>Optionalmiddle_namestring<currency_code>Optionalsuffixstring<currency_code>Optionalfull_namestring<currency_code>Optionalvaultobject<vault_venmo_wallet_base>Optionalstore_in_vaultenum<store_in_vault_instruction>Requiredpermit_multiple_payment_tokensbooleanOptionalcryptoobject<crypto_request>Optionalcountry_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.
nameobject<crypto_account_holder_name>Requiredprefixstring<currency_code>Optionalgiven_namestring<currency_code>Requiredsurnamestring<currency_code>Requiredmiddle_namestring<currency_code>Optionalexperience_contextobject<experience_context_base_without_brand_shipping>Requiredlocalestring<language>Optionalapplication_contextobject<order_application_context>OptionalNote: Partners and Marketplaces might configurebrand_nameandshipping_preferenceduring partner account setup, which overrides the request values.
brand_namestring<currency_code>Optionallocalestring<language>Optionallanding_pageenumOptionalDeprecated| See | Since Version |
|---|---|
| payment_source.paypal.experience_context.landing_page | 2.9 |
shipping_preferenceenumOptionalDeprecated| See | Since Version |
|---|---|
| payment_source.paypal.experience_context.shipping_preference | 2.9 |
user_actionenumOptionalpayment_methodobject<payment_method>Optionalpayee_preferredenum<payee_payment_method_preference>Optionalstandard_entry_class_codeenumOptionalreturn_urlstringOptionalcancel_urlstringOptionalstored_payment_sourceobject<stored_payment_source>OptionalDeprecated| See | Since Version |
|---|---|
| payment_source.card.stored_credential | 2.9 |
payment_initiatorenum<payment_initiator>Requiredpayment_typeenum<stored_payment_source_payment_type>Requiredusageenum<stored_payment_source_usage_type>Optionalprevious_network_transaction_referenceobject<network_transaction_reference>OptionalidstringRequireddatestringOptionalnetworkenum<card_brand>Optionalapplication/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()
{
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();
OrdersController ordersController = client.OrdersController;
// Request body for this sample:
// {
// "payment_source": {
// "paypal": {
// "experience_context": {
// "payment_method_preference": "IMMEDIATE_PAYMENT_REQUIRED",
// "landing_page": "LOGIN",
// "shipping_preference": "GET_FROM_FILE",
// "user_action": "PAY_NOW",
// "return_url": "https://example.com/returnUrl",
// "cancel_url": "https://example.com/cancelUrl"
// }
// }
// },
// "purchase_units": [
// {
// "invoice_id": "90210",
// "amount": {
// "currency_code": "USD",
// "value": "230.00",
// "breakdown": {
// "item_total": {
// "currency_code": "USD",
// "value": "220.00"
// },
// "shipping": {
// "currency_code": "USD",
// "value": "10.00"
// }
// }
// },
// "items": [
// {
// "name": "T-Shirt",
// "description": "Super Fresh Shirt",
// "unit_amount": {
// "currency_code": "USD",
// "value": "20.00"
// },
// "quantity": "1",
// "category": "PHYSICAL_GOODS",
// "sku": "sku01",
// "image_url": "https://example.com/static/images/items/1/tshirt_green.jpg",
// "url": "https://example.com/url-to-the-item-being-purchased-1",
// "upc": {
// "type": "UPC-A",
// "code": "123456789012"
// }
// },
// {
// "name": "Shoes",
// "description": "Running, Size 10.5",
// "sku": "sku02",
// "unit_amount": {
// "currency_code": "USD",
// "value": "100.00"
// },
// "quantity": "2",
// "category": "PHYSICAL_GOODS",
// "image_url": "https://example.com/static/images/items/1/shoes_running.jpg",
// "url": "https://example.com/url-to-the-item-being-purchased-2",
// "upc": {
// "type": "UPC-A",
// "code": "987654321012"
// }
// }
// ]
// }
// ]
// }
CreateOrderInput createOrderInput = new CreateOrderInput
{
Body = new OrderRequest
{
Intent = CheckoutPaymentIntent.Capture,
PurchaseUnits = new List<PurchaseUnitRequest>
{
new PurchaseUnitRequest
{
Amount = new AmountWithBreakdown
{
CurrencyCode = "USD",
MValue = "100.00",
},
},
},
},
Prefer = "return=minimal",
};
try
{
ApiResponse<Order> result = await ordersController.CreateOrderAsync(createOrderInput);
}
catch (ApiException e)
{
Console.WriteLine(e.Message);
}
}
}
}Request Body
{
"payment_source": {
"paypal": {
"experience_context": {
"payment_method_preference": "IMMEDIATE_PAYMENT_REQUIRED",
"landing_page": "LOGIN",
"shipping_preference": "GET_FROM_FILE",
"user_action": "PAY_NOW",
"return_url": "https://example.com/returnUrl",
"cancel_url": "https://example.com/cancelUrl"
}
}
},
"purchase_units": [
{
"invoice_id": "90210",
"amount": {
"currency_code": "USD",
"value": "230.00",
"breakdown": {
"item_total": {
"currency_code": "USD",
"value": "220.00"
},
"shipping": {
"currency_code": "USD",
"value": "10.00"
}
}
},
"items": [
{
"name": "T-Shirt",
"description": "Super Fresh Shirt",
"unit_amount": {
"currency_code": "USD",
"value": "20.00"
},
"quantity": "1",
"category": "PHYSICAL_GOODS",
"sku": "sku01",
"image_url": "https://example.com/static/images/items/1/tshirt_green.jpg",
"url": "https://example.com/url-to-the-item-being-purchased-1",
"upc": {
"type": "UPC-A",
"code": "123456789012"
}
},
{
"name": "Shoes",
"description": "Running, Size 10.5",
"sku": "sku02",
"unit_amount": {
"currency_code": "USD",
"value": "100.00"
},
"quantity": "2",
"category": "PHYSICAL_GOODS",
"image_url": "https://example.com/static/images/items/1/shoes_running.jpg",
"url": "https://example.com/url-to-the-item-being-purchased-2",
"upc": {
"type": "UPC-A",
"code": "987654321012"
}
}
]
}
]
}Response samples
{ "id": "5O190127TN364715T", "payment_source": { "paypal": {} }, "links": [ { "href": "https://api-m.paypal.com/v2/checkout/orders/5O190127TN364715T", "rel": "self", "method": "GET" }, { "href": "https://www.paypal.com/checkoutnow?token=5O190127TN364715T", "rel": "payer-action", "method": "GET" } ]}