REST APIs
    Get Started with PayPal REST APIs
    Authentication
    Postman Guide
    API requests
    API responses
    Core Resources
    Overview
    API Integration
    Release Notes
    Add Tracking
    Catalog Products
    Disputes
    Identity
    Invoicing
    Orders
    Partner Referrals
    Payment Experience
    Payment Method Tokens
    Payments
    Payouts
    Referenced Payouts
    Subscriptions
    Transaction Search
    Webhooks Management
    Webhooks
    Overview
    Webhook event names
    Webhooks Events dashboard
    Webhooks simulator
    Integration
    Sandbox
    Overview
    Accounts
    Bulk Accounts
    Card testing
    Codespaces
    PayPal for Visual Studio Code
    Negative Testing
    Go Live
    Production Environment
    PayPal Application Guidelines
    PayPal Security Guidelines
    Rate Limiting Guidelines
    Idempotency
    Troubleshooting
    Not authorized
    Resource not found
    Unprocessable entity
    Validation error
    Reference
    Currency Codes
    Country Codes
    State & Province Codes
    Locale codes
    Deprecated Resources
    Deprecated resources
    Billing Agreements
    Billing Plans
    Invoicing v1
    Orders v1
    Partner Referrals v1
    Payments v1

Card testing

APICurrentLast updated: August 4th 2023, @ 3:40:00 pm

Test your card integration in the sandbox environment by simulating:

  • Successful payments for Expanded Checkout integrations using test card numbers.
  • Card error scenarios by using rejection triggers.
  • 3D Secure authentication scenarios.
  • Recommended use cases for Expanded Checkout integration.

Tip: Use the credit card generator to generate test credit cards for sandbox testing.

Simulate successful payments

To simulate a successful card capture with Expanded Checkout integration in sandbox:

  • Ensure the integration is in sandbox mode, with a sandbox client ID, and connected to api-m.sandbox.paypal.com endpoints.
  • Use a test card number with a future expiration date and a 3-digit CVV, or a 4-digit CVV for American Express.

Test static card numbers

Test card numbers

Test Expanded Checkout payments and saved payment method use cases with these test card numbers:

Note: The test cards on this page only work for Purchase flows. Don’t use the cards on this page to test Save payment methods.

Tip: Enter a future expiration date and a 3-digit CVV, or 4-digit CVV for American Express, to proceed.

Test numberCard type
371449635398431American Express
376680816376961American Express
36259600000004Diners Club
6304000000000000Maestro
5063516945005047Maestro

Test generated card numbers

Credit card generator

Generate additional credit cards for sandbox testing and PayPal Checkout. You can add generated credit cards to a PayPal sandbox account or use them to test credit card payments.

Input


Generated credit card details

Bank account (IBAN) generator

Generate bank accounts for sandbox testing.

Input

Generated bank account details

Simulate card error scenarios

Enter a rejection trigger in the First Name or Name on Card to simulate credit card error scenarios in Expanded Checkout integrations.

Note: Test using a Visa card number, such as 4012 8888 8888 1881, with a future expiration date and any 3-digit CVV.

Simulate card error

Rejection triggers

Rejection test simulations show a response_code that changes based on the test trigger you use. Rejection trigger values are case-sensitive.

Note: All rejection scenarios return the AVS code as globally unavailable and the CVV code as not processed.

Test nameTriggerProcessor response codeCode description
Card refusedCCREJECT-REFUSED0500DO_NOT_HONOR
Fraudulent cardCCREJECT-SF9500SUSPECTED_FRAUD. Try using another card. Do not retry the same card.
Card expiredCCREJECT-EC5400EXPIRED_CARD
Luhn Check failsCCREJECT-IRC5180INVALID_OR_RESTRICTED_CARD. Try using another card. Do not retry the same card.
Insufficient fundsCCREJECT-IF5120INSUFFICIENT_FUNDS
Card lost, stolenCCREJECT-LS9520LOST_OR_STOLEN. Try using another card. Do not retry the same card.
Card not validCCREJECT-IA1330INVALID_ACCOUNT
Card is declinedCCREJECT-BANK_ERROR5100GENERIC_DECLINE
CVC check failsCCREJECT-CVV_F00N7CVV2_FAILURE_POSSIBLE_RETRY_WITH_CVV or CVV2_FAILURE

Venmo rejection triggers

Test nameTriggerCode description
Suspected FraudCCREJECT-SFTry using different funding source.
Insufficient fundsCCREJECT-IFNot enough funds.
Account closedCCREJECT-ACAccount is closed.
ACCOUNT FROZENCCREJECT-ARAccount is frozen.
GENERIC DECLINE CCREJECT-ELGeneric Decline.

Sample response

The response shows that the order is successfully created, but because a refusal was passed, the card payment status is DECLINED:

  • Line 18 shows status=DECLINED. The card was refused.
  • Line 51 shows avs_code=G. The card is globally unavailable.
  • Line 52 shows cvv_code=P. The card wasn't processed.
  • Line 53 shows response_code=5400. The card is expired.
1{
2 "id": "3M049991JF5624929",
3 "status": "COMPLETED",
4 "payment_source": {
5 "card": {
6 "last_digits": "6889",
7 "brand": "VISA",
8 "type": "CREDIT",
9 },
10 },
11 "purchase_units": [
12 {
13 "reference_id": "default",
14 "payments": {
15 "captures": [
16 {
17 "id": "2FB04508RA686960W",
18 "status": "DECLINED",
19 "amount": {
20 "currency_code": "USD",
21 "value": "500.00",
22 },
23 "final_capture": true,
24 "disbursement_mode": "INSTANT",
25 "seller_protection": { "status": "NOT_ELIGIBLE" },
26 "seller_receivable_breakdown": {
27 "gross_amount": { "currency_code": "USD", "value": "500.00" },
28 "paypal_fee": { "currency_code": "USD", "value": "13.44" },
29 "net_amount": { "currency_code": "USD", "value": "486.56" },
30 },
31 "links": [
32 {
33 "href": "https://api-m.sandbox.paypal.com/v2/payments/captures/2FB04508RA686960W",
34 "rel": "self",
35 "method": "GET",
36 },
37 {
38 "href": "https://api-m.sandbox.paypal.com/v2/payments/captures/2FB04508RA686960W/refund",
39 "rel": "refund",
40 "method": "POST",
41 },
42 {
43 "href": "https://api-m.sandbox.paypal.com/v2/checkout/orders/3M049991JF5624929",
44 "rel": "up",
45 "method": "GET",
46 },
47 ],
48 "create_time": "2022-08-09T22:20:05Z",
49 "update_time": "2022-08-09T22:20:05Z",
50 "processor_response": {
51 "avs_code": "G",
52 "cvv_code": "P",
53 "response_code": "5400",
54 },
55 },
56 ],
57 },
58 },
59 ],
60 "links": [
61 {
62 "href": "https://api-m.sandbox.paypal.com/v2/checkout/orders/3M049991JF5624929",
63 "rel": "self",
64 "method": "GET",
65 },
66 ],
67}

Processor response and error codes

To understand why a card payment was declined, review the Orders v2 processor response object in the Orders API response.

For more information about card payment decline reasons and possible values, see:

  • Card decline errors.
  • Error responses for CVV and AVS.
  • Processor response codes for non-PayPal payment processors.

Simulate 3D Secure card payments

Use 3D Secure to authenticate cardholders through card issuers. When your customer submits their card details on your website for processing, you can trigger 3D Secure. When triggered, customers are prompted by their card-issuing bank to complete an additional verification step to enter a one-time or static password, depending on the issuer's method.

For more information about including 3D Secure authentication in your payment flow, see:

  • Learn more about 3D Secure for Expanded Checkout using the Orders API.
  • Simulate 3D Secure-supported scenarios using 3D Secure test cards to verify your card integration.

Test integration

Test the recommended use cases for Expanded Checkout integration before you go live.

Accept payment

Test a successful card payment:

  1. Go to the checkout page for your integration.
  2. Choose a test card from this list.
  3. Enter the card details in the hosted field, including the name on the card, billing address, and 2-character country code. Then submit the order.
  4. Confirm that the order was processed.
  5. Log in to your merchant sandbox account and navigate to the activity page to ensure the payment amount shows up in the account.

Decline payment

Decline a test card payment from the checkout page:

  1. Go to the checkout page for your integration.
  2. Choose a test card from this list.
  3. Select a rejection trigger from this list and enter it in the card's name field.
  4. Enter the other card details in the card fields, including the card number, billing address, and a 2-character country code.
  5. Submit the order.
  6. Verify that the declined payment error message shows up.

Authorize payment

Test authorization and capture of a card payment:

  1. Make a create order call with intent as AUTHORIZE that includes a payment_source object with a valid card number.
  2. Authorize the order.
  3. Complete the authorized order using capture authorized payment call.
  4. Confirm that the capture status is COMPLETED in the authorization response.

See also

Optional
Postman Collection

Test additional positive and 4xx error conditions.

Optional
Simulate negative responses

Use API request headers to trigger negative responses.

Optional
Error messages

Explore error messages supported by the Orders API.

Reference
PayPal.com
Privacy
Support
Legal
Contact