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.Deprecation notice: TheCreates a sale, an authorized payment to be captured later, or an order. To create a sale, authorization, or order, include the payment details in the JSON request body. Set the/v1/paymentsendpoint is deprecated. Use the/v2/paymentsendpoint instead. For details, see PayPal Checkout Basic Integration.
intent to sale, authorize, or order. Note: TPP Clients (Third Party Providers in the context of PSD2 regulation) are restricted from usingInclude payer, transaction details, and, for PayPal payments only, redirect URLs. The combination of theauthorizeandorderintents.
payment_method and funding_instrument determines the type of payment that is created. For more information, see Payments REST API.Oauth 2.0 authentication
In: header
Scope: https://api.paypal.com/v1/payments/.*
application/json
TypeScript Definitions
Use the request body type in TypeScript.
intentenumRequiredsale. Makes an immediate payment.authorize. [Authorizes a payment for capture later](/docs/integration/direct/payments/authorize-and-capture-payments/).order. [Creates an order](/docs/integration/direct/payments/orders/).payerobject<payer>Requiredfunding_instrumentsobject<funding_instrument>[]Optionalcredit_card_tokenobject<credit_card_token>Optionalpayer_idstringOptionalpayer_infoobject<payer_info>Optionalbilling_addressobject<address>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.
statestringOptionalapplication_contextobject<application_context>Optionaluser_actionstringOptional| Flow | Action | Description |
|---|---|---|
| Pay Now | user_action=commit | After the customer is redirected to the PayPal payment page, shows the Pay Now button. Use this option when you know the final amount when checkout is initiated and you want to process the payment immediately when the customer clicks Pay Now. |
| Continue | user_action=continue | After the customer is redirected to the PayPal payment page, shows the Continue button. Use this option when you do not know the final amount when you initiate the checkout flow and you want to redirect the customer to the merchant page without processing the payment. |
preferred_payment_sourceobject<payment_source>Optionaltokenobject<token>Optionalpayment_patternenum<payment_pattern>Optionaltransactionsobject<transaction>[]Optionalamountobject<amount>OptionaltotalstringRequiredsubtotalstringOptionalNote: For an order authorization or capture, you cannot include the subtotal parameter.handling_feestringOptionalNote: For an order authorization or capture, you cannot include the handling_fee parameter.shipping_discountstringOptionalNote: For an order authorization or capture, you cannot include the shipping_discount parameter.insurancestringOptionalNote: For an order authorization or capture, you cannot include the insurance parameter.payeeobject<payee>OptionalemailstringOptionalitemsobject<item>[]Optionalcurrencystring<currency_code>Requiredshipping_addressobject<shipping_address>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.
statestringOptionalshipping_phone_numberstringOptionalapplication/json
application/json
curl -X POST "https://example.com/v1/payments/payment" \ -H "Content-Type: application/json" \ -d '{ "intent": "sale", "payer": { "payment_method": "paypal" }, "transactions": [ { "amount": { "total": "30.11", "currency": "USD", "details": { "subtotal": "30.00", "tax": "0.07", "shipping": "0.03", "handling_fee": "1.00", "shipping_discount": "-1.00", "insurance": "0.01" } }, "description": "The payment transaction description.", "custom": "EBAY_EMS_90048630024435", "invoice_number": "48787589673", "payment_options": { "allowed_payment_method": "INSTANT_FUNDING_SOURCE" }, "soft_descriptor": "ECHI5786786", "item_list": { "items": [ { "name": "hat", "description": "Brown hat.", "quantity": "5", "price": "3", "tax": "0.01", "sku": "1", "currency": "USD" }, { "name": "handbag", "description": "Black handbag.", "quantity": "1", "price": "15", "tax": "0.02", "sku": "product34", "currency": "USD" } ], "shipping_address": { "recipient_name": "Brian Robinson", "line1": "4th Floor", "line2": "Unit #34", "city": "San Jose", "country_code": "US", "postal_code": "95131", "phone": "011862212345678", "state": "CA" } } } ], "note_to_payer": "Contact us for any questions on your order.", "redirect_urls": { "return_url": "https://example.com/return", "cancel_url": "https://example.com/cancel" } }'{ "id": "string", "intent": "sale", "payer": { "payment_method": "credit_card", "status": "VERIFIED", "funding_instruments": [ { "credit_card_token": { "credit_card_id": "string", "payer_id": "string", "external_customer_id": "string", "last4": "stri", "type": "string", "expire_month": 1, "expire_year": "stri" } } ], "payer_info": { "email": "[email protected]", "salutation": "string", "first_name": "string", "middle_name": "string", "last_name": "string", "suffix": "string", "payer_id": "string", "birth_date": "2019-08-24T14:15:22Z", "tax_id": "string", "tax_id_type": "BR_CPF", "billing_address": { "line1": "string", "line2": "string", "city": "string", "country_code": "st", "postal_code": "string", "state": "string", "phone": "string", "normalization_status": "UNKNOWN", "type": "string" }, "shipping_address": { "line1": "string", "line2": "string", "city": "string", "country_code": "st", "postal_code": "string", "state": "string", "phone": "string", "normalization_status": "UNKNOWN", "type": "string", "recipient_name": "string" } } }, "application_context": { "brand_name": "string", "locale": "string", "landing_page": "string", "shipping_preference": "NO_SHIPPING", "user_action": "string", "preferred_payment_source": { "token": { "id": "string", "type": "BILLING_AGREEMENT" } }, "payment_pattern": "CUSTOMER_PRESENT_ONETIME_PURCHASE" }, "transactions": [ { "amount": { "currency": "string", "total": "string", "details": { "subtotal": "string", "shipping": "string", "tax": "string", "handling_fee": "string", "shipping_discount": "string", "insurance": "string", "gift_wrap": "string" } }, "payee": { "email": "[email protected]", "merchant_id": "string" }, "description": "string", "note_to_payee": "string", "custom": "string", "invoice_number": "string", "soft_descriptor": "string", "payment_options": { "allowed_payment_method": "UNRESTRICTED" }, "item_list": { "items": [ { "sku": "string", "name": "string", "description": "string", "quantity": "string", "price": "string", "currency": "str", "tax": "string" } ], "shipping_address": { "line1": "string", "line2": "string", "city": "string", "country_code": "st", "postal_code": "string", "state": "string", "phone": "string", "normalization_status": "UNKNOWN", "type": "string", "recipient_name": "string" }, "shipping_method": "string", "shipping_phone_number": "string" }, "notify_url": "http://example.com", "related_resources": [ { "sale": { "id": "string", "amount": { "currency": "string", "total": "string", "details": { "subtotal": "string", "shipping": "string", "tax": "string", "handling_fee": "string", "shipping_discount": "string", "insurance": "string", "gift_wrap": "string" } }, "payment_mode": "INSTANT_TRANSFER", "state": "completed", "reason_code": "CHARGEBACK", "protection_eligibility": "ELIGIBLE", "protection_eligibility_type": "ITEM_NOT_RECEIVED_ELIGIBLE", "clearing_time": "2019-08-24T14:15:22Z", "payment_hold_status": "HELD", "payment_hold_reasons": [ { "payment_hold_reason": "PAYMENT_HOLD" } ], "transaction_fee": { "currency": "string", "value": "string" }, "receivable_amount": { "currency": "string", "value": "string" }, "transaction_fee_in_receivable_currency": { "currency": "string", "value": "string" }, "exchange_rate": "string", "fmf_details": { "filter_type": "ACCEPT", "filter_id": "AVS_NO_MATCH", "name": "string", "description": "string" }, "receipt_id": "string", "parent_payment": "string", "processor_response": { "response_code": "stri", "avs_code": "s", "cvv_code": "s", "advice_code": "01_NEW_ACCOUNT_INFORMATION", "eci_submitted": "string", "vpas": "string" }, "billing_agreement_id": "string", "create_time": "2019-08-24T14:15:22Z", "update_time": "2019-08-24T14:15:22Z", "links": [ { "href": "string", "rel": "string", "method": "GET" } ] }, "authorization": { "id": "string", "amount": { "currency": "string", "total": "string", "details": { "subtotal": "string", "shipping": "string", "tax": "string", "handling_fee": "string", "shipping_discount": "string", "insurance": "string", "gift_wrap": "string" } }, "payment_mode": "INSTANT_TRANSFER", "state": "pending", "reason_code": "AUTHORIZATION", "pending_reason": "AUTHORIZATION", "protection_eligibility": "ELIGIBLE", "protection_eligibility_type": "ITEM_NOT_RECEIVED_ELIGIBLE", "fmf_details": { "filter_type": "ACCEPT", "filter_id": "AVS_NO_MATCH", "name": "string", "description": "string" }, "parent_payment": "string", "processor_response": { "response_code": "stri", "avs_code": "s", "cvv_code": "s", "advice_code": "01_NEW_ACCOUNT_INFORMATION", "eci_submitted": "string", "vpas": "string" }, "valid_until": "2019-08-24T14:15:22Z", "create_time": "2019-08-24T14:15:22Z", "update_time": "2019-08-24T14:15:22Z", "receipt_id": "string", "links": [ { "href": "string", "rel": "string", "method": "GET" } ] }, "order": { "id": "string", "amount": { "currency": "string", "total": "string", "details": { "subtotal": "string", "shipping": "string", "tax": "string", "handling_fee": "string", "shipping_discount": "string", "insurance": "string", "gift_wrap": "string" } }, "payment_mode": "INSTANT_TRANSFER", "state": "PENDING", "reason_code": "PAYER_SHIPPING_UNCONFIRMED", "pending_reason": "payer_shipping_unconfirmed", "protection_eligibility": "ELIGIBLE", "protection_eligibility_type": "ITEM_NOT_RECEIVED_ELIGIBLE", "parent_payment": "string", "fmf_details": { "filter_type": "ACCEPT", "filter_id": "AVS_NO_MATCH", "name": "string", "description": "string" }, "create_time": "2019-08-24T14:15:22Z", "update_time": "2019-08-24T14:15:22Z", "links": [ { "href": "string", "rel": "string", "method": "GET" } ] }, "capture": { "id": "string", "amount": { "currency": "string", "total": "string", "details": { "subtotal": "string", "shipping": "string", "tax": "string", "handling_fee": "string", "shipping_discount": "string", "insurance": "string", "gift_wrap": "string" } }, "is_final_capture": false, "state": "pending", "reason_code": "CHARGEBACK", "parent_payment": "string", "invoice_number": "string", "transaction_fee": { "currency": "string", "value": "string" }, "transaction_fee_in_receivable_currency": { "currency": "string", "value": "string" }, "receivable_amount": { "currency": "string", "value": "string" }, "exchange_rate": "string", "note_to_payer": "string", "create_time": "2019-08-24T14:15:22Z", "update_time": "2019-08-24T14:15:22Z", "links": [ { "href": "string", "rel": "string", "method": "GET" } ] }, "refund": { "id": "string", "amount": { "currency": "string", "total": "string", "details": { "subtotal": "string", "shipping": "string", "tax": "string", "handling_fee": "string", "shipping_discount": "string", "insurance": "string", "gift_wrap": "string" } }, "state": "pending", "reason": "string", "invoice_number": "string", "sale_id": "string", "capture_id": "string", "parent_payment": "string", "description": "string", "create_time": "2019-08-24T14:15:22Z", "update_time": "2019-08-24T14:15:22Z", "links": [ { "href": "string", "rel": "string", "method": "GET" } ] } } ] } ], "state": "created", "experience_profile_id": "string", "note_to_payer": "string", "redirect_urls": { "return_url": "http://example.com", "cancel_url": "http://example.com" }, "failure_reason": "UNABLE_TO_COMPLETE_TRANSACTION", "create_time": "2019-08-24T14:15:22Z", "update_time": "2019-08-24T14:15:22Z", "links": [ { "href": "string", "rel": "string", "method": "GET" } ]}