Payments API

Use the Payments REST API to easily and securely accept online and mobile payments. The payments name space contains resource collections for payments, sales, refunds, authorizations, captures, and orders.
Important: The use of the PayPal REST /payments APIs to accept credit card payments is restricted. Instead, you can accept credit card payments with Braintree Direct.
You can enable customers to make PayPal and credit card payments with only a few clicks, depending on the country. You can accept an immediate payment or authorize a payment and capture it later. You can show details for completed payments, refunds, and authorizations. You can make full or partial refunds. You also can void or re-authorize authorizations. For more information, see the Payments overview.

Payment (resource group)

Use the /payment resource to create a sale, an authorized payment, or an order. A sale is a direct credit card payment, stored credit card payment, or PayPal payment. An authorized payment places funds on hold to be captured later. An order is a purchase that a customer has approved but for which the funds are not placed on hold. You can also use this resource to execute approved PayPal payments and show details for, update, and list payments. For more information, see also Payments.

Create payment

POST /v1/payments/payment
Creates 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 intent to sale, authorize, or order. Include payer, transaction details, and, for PayPal payments only, redirect URLs. The combination of the payment_method and funding_instrument determines the type of payment that is created. For more information, see Payments REST API.
Notes:
  • Some countries restrict direct credit card payment and related features.
  • Authorizations are guaranteed for up to three days, though you can attempt to capture an authorization for up to 29 days. After the three-day honor period authorization expires, you can reauthorize the payment.

Parameters

  • payment

    body object

    A payment. Use this object to create, process, and manage payments.

Sample Request

curl -v -X POST https://api.sandbox.paypal.com/v1/payments/payment \
-H "Content-Type:application/json" \
-H "Authorization: Bearer Access-Token" \
-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": "http://www.paypal.com/return",
  "cancel_url": "http://www.paypal.com/cancel"
  }
}'

Response

A successful request returns the HTTP 201 Created status code and a JSON response body that shows payment details.
  • id

    string

    The ID of the payment.
  • intent

    enum

    required

    The payment intent. Value is:

    Possible values: sale, authorize, order.

  • payer

    object

    required

    The source of the funds for this payment. Payment method is PayPal Wallet payment or bank direct debit.
  • transactions

    array (contains the transaction object)

    An array of payment-related transactions. A transaction defines what the payment is for and who fulfills the payment. For update and execute payment calls, the transactions object accepts the amount object only.
  • state

    enum

    The state of the payment, authorization, or order transaction. Value is:
    • created. The transaction was successfully created.
    • approved. The buyer approved the transaction.
    • failed. The transaction request failed.

    Possible values: created, approved, failed.

  • experience_profile_id

    string

    The PayPal-generated ID for the merchant's payment experience profile. For information, see create web experience profile.
  • note_to_payer

    string

    A free-form field that clients can use to send a note to the payer.

    Maximum length: 165.

  • redirect_urls

    object

    A set of redirect URLs that you provide for PayPal-based payments.
  • failure_reason

    enum

    The reason code for a payment failure.

    Possible values: UNABLE_TO_COMPLETE_TRANSACTION, INVALID_PAYMENT_METHOD, PAYER_CANNOT_PAY, CANNOT_PAY_THIS_PAYEE, REDIRECT_REQUIRED, PAYEE_FILTER_RESTRICTIONS.

  • create_time

    string

    The date and time when the payment was created, in Internet date and time format.
  • update_time

    string

    The date and time when the payment was updated, in Internet date and time format.
  • links

    array (contains the link_description object)

    An array of request-related HATEOAS links.

Sample Response

{
  "id": "PAY-1B56960729604235TKQQIYVY",
  "create_time": "2017-09-22T20:53:43Z",
  "update_time": "2017-09-22T20:53:44Z",
  "state": "created",
  "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",
          "insurance": "0.01",
          "shipping_discount": "-1.00"
        }
      },
      "description": "The payment transaction description.",
      "custom": "EBAY_EMS_90048630024435",
      "invoice_number": "48787589673",
      "item_list": {
        "items": [
          {
            "name": "hat",
            "sku": "1",
            "price": "3.00",
            "currency": "USD",
            "quantity": "5",
            "description": "Brown hat.",
            "tax": "0.01"
          },
          {
            "name": "handbag",
            "sku": "product34",
            "price": "15.00",
            "currency": "USD",
            "quantity": "1",
            "description": "Black handbag.",
            "tax": "0.02"
          }
        ],
        "shipping_address": {
          "recipient_name": "Brian Robinson",
          "line1": "4th Floor",
          "line2": "Unit #34",
          "city": "San Jose",
          "state": "CA",
          "phone": "011862212345678",
          "postal_code": "95131",
          "country_code": "US"
        }
      }
    }
  ],
  "links": [
    {
      "href": "https://api.sandbox.paypal.com/v1/payments/payment/PAY-1B56960729604235TKQQIYVY",
      "rel": "self",
      "method": "GET"
    },
    {
      "href": "https://api.sandbox.paypal.com/v1/payments//cgi-bin/webscr?cmd=_express-checkout&token=EC-60385559L1062554J",
      "rel": "approval_url",
      "method": "REDIRECT"
    },
    {
      "href": "https://api.sandbox.paypal.com/v1/payments/payment/PAY-1B56960729604235TKQQIYVY/execute",
      "rel": "execute",
      "method": "POST"
    }
  ]
}

List payments

GET /v1/payments/payment
Lists payments that were created by the create payment call and that are in any state. The list shows the payments that are made to the merchant who makes the call. To filter the payments that appear in the response, you can specify one or more optional query and pagination parameters. See Filtering and pagination.

Parameters

  • count

    query integer

    The number of items to list in the response.

    Default: 10.

  • start_id

    query string

    The ID of the starting resource in the response. When results are paged, you can use the next_id value as the start_id to continue with the next set of results.
  • start_index

    query integer

    The start index of the payments to list. Typically, you use the start_index to jump to a specific position in the resource history based on its cart. For example, to start at the second item in a list of results, specify ?start_index=2.
  • start_time

    query string

    The start date and time for the range to show in the response, in Internet date and time format. For example, start_time=2016-03-06T11:00:00Z.
  • end_time

    query string

    The end date and time for the range to show in the response, in Internet date and time format. For example, start_time=2016-03-06T11:00:00Z.
  • payee_id

    query string

    Filters the payments in the response by a PayPal-assigned merchant ID that identifies the payee.
  • sort_by

    query enum

    Sorts the payments in the response by a create time.

    Allowed values: create_time.

  • sort_order

    query enum

    Sorts the payments in the response in descending order.

    Allowed values: desc.

SDK samples: JAVA, Node, PHP, Python, Ruby

Sample Request

curl -v -X GET https://api.sandbox.paypal.com/v1/payments/payment?count=10&start_index=0&sort_by=create_time&sort_order=desc \
-H "Content-Type:application/json" \
-H "Authorization: Bearer Access-Token" \
-d '{}'

Response

A successful request returns the HTTP 200 OK status code and a JSON response body that lists payments with payment details.
  • payments

    array (contains the payment object)

    An array of payments.
  • count

    integer

    The number of items returned in each range of results. Note that the last results range might have fewer items than the requested number of items. The maximum value is 20.
  • next_id

    string

    The ID of the next element. Use to get the next range of results.

Sample Response

{
  "payments": [
    {
      "id": "PAY-0US81985GW1191216KOY7OXA",
      "create_time": "2017-06-30T23:48:44Z",
      "update_time": "2017-06-30T23:49:27Z",
      "state": "approved",
      "intent": "order",
      "payer": {
        "payment_method": "paypal"
      },
      "transactions": [
        {
          "amount": {
            "total": "41.15",
            "currency": "USD",
            "details": {
              "subtotal": "30.00",
              "tax": "1.15",
              "shipping": "10.00"
            }
          },
          "description": "The payment transaction description.",
          "item_list": {
            "items": [
              {
                "name": "hat",
                "sku": "1",
                "price": "3.00",
                "currency": "USD",
                "quantity": "5"
              },
              {
                "name": "handbag",
                "sku": "product34",
                "price": "15.00",
                "currency": "USD",
                "quantity": "1"
              }
            ],
            "shipping_address": {
              "recipient_name": "John Doe",
              "line1": "4th Floor, One Lagoon Drive",
              "line2": "Unit #34",
              "city": "Redwood City",
              "state": "CA",
              "phone": "4084217591",
              "postal_code": "94065",
              "country_code": "US"
            }
          },
          "related_resources": [
            {
              "authorization": {
                "id": "53P09338XY5426455",
                "create_time": "2017-06-30T23:50:01Z",
                "update_time": "2017-06-30T23:50:01Z",
                "amount": {
                  "total": "41.15",
                  "currency": "USD"
                },
                "parent_payment": "PAY-0US81985GW1191216KOY7OXA",
                "valid_until": "2017-07-29T23:49:52Z",
                "links": [
                  {
                    "href": "https://api.sandbox.paypal.com/v1/payments/payment/PAY-0US81985GW1191216KOY7OXA",
                    "rel": "parent_payment",
                    "method": "GET"
                  }
                ]
              }
            }
          ]
        }
      ],
      "links": [
        {
          "href": "https://api.sandbox.paypal.com/v1/payments/payment/PAY-0US81985GW1191216KOY7OXA",
          "rel": "self",
          "method": "GET"
        }
      ]
    },
    {
      "id": "PAY-53485002LD6169910KOZQ25I",
      "create_time": "2017-07-01T19:35:17Z",
      "update_time": "2017-07-01T19:36:05Z",
      "state": "approved",
      "intent": "order",
      "payer": {
        "payment_method": "paypal"
      },
      "transactions": [
        {
          "amount": {
            "total": "33.00",
            "currency": "USD",
            "details": {
              "subtotal": "21.00",
              "tax": "2.00",
              "shipping": "10.00"
            }
          },
          "description": "The payment transaction description.",
          "item_list": {
            "items": [
              {
                "name": "hat",
                "sku": "1",
                "price": "3.00",
                "currency": "USD",
                "quantity": "2"
              },
              {
                "name": "handbag",
                "sku": "product34",
                "price": "15.00",
                "currency": "USD",
                "quantity": "1"
              }
            ],
            "shipping_address": {
              "recipient_name": "Hannah Lu",
              "line1": "1602 Crane ct",
              "line2": "",
              "city": "San Jose",
              "state": "CA",
              "phone": "4084217591",
              "postal_code": "95052",
              "country_code": "US"
            }
          },
          "related_resources": [
            {
              "authorization": {
                "id": "91527087GH224122L",
                "create_time": "2017-07-01T19:36:22Z",
                "update_time": "2017-07-01T19:36:22Z",
                "amount": {
                  "total": "33.00",
                  "currency": "USD"
                },
                "parent_payment": "PAY-53485002LD6169910KOZQ25I",
                "valid_until": "2017-07-30T19:36:22Z",
                "links": [
                  {
                    "href": "https://api.sandbox.paypal.com/v1/payments/payment/PAY-53485002LD6169910KOZQ25I",
                    "rel": "parent_payment",
                    "method": "GET"
                  }
                ]
              }
            }
          ]
        }
      ],
      "links": [
        {
          "href": "https://api.sandbox.paypal.com/v1/payments/payment/PAY-53485002LD6169910KOZQ25I",
          "rel": "self",
          "method": "GET"
        }
      ]
    },
    {
      "id": "PAY-7F5790198P134484LKOZSG7Q",
      "create_time": "2017-07-01T21:09:18Z",
      "update_time": "2017-07-01T22:31:56Z",
      "state": "approved",
      "intent": "order",
      "payer": {
        "payment_method": "paypal"
      },
      "transactions": [
        {
          "amount": {
            "total": "42.00",
            "currency": "USD",
            "details": {
              "subtotal": "36.00",
              "tax": "1.00",
              "shipping": "5.00"
            }
          },
          "description": "The payment transaction description.",
          "item_list": {
            "items": [
              {
                "name": "handbag",
                "sku": "product34",
                "price": "36.00",
                "currency": "USD",
                "quantity": "1"
              }
            ],
            "shipping_address": {
              "recipient_name": "Anna Joseph",
              "line1": "2525 North 1st street",
              "line2": "unit 4",
              "city": "San Jose",
              "state": "CA",
              "phone": "011862212345678",
              "postal_code": "95031",
              "country_code": "US"
            }
          },
          "related_resources": [
            {
              "capture": {
                "id": "26062838D7499294V",
                "create_time": "2017-07-01T21:16:22Z",
                "update_time": "2017-07-01T21:16:24Z",
                "amount": {
                  "total": "7.00",
                  "currency": "USD"
                },
                "state": "completed",
                "parent_payment": "PAY-7F5790198P134484LKOZSG7Q",
                "links": [
                  {
                    "href": "https://api.sandbox.paypal.com/v1/payments/capture/26062838D7499294V",
                    "rel": "self",
                    "method": "GET"
                  },
                  {
                    "href": "https://api.sandbox.paypal.com/v1/payments/capture/26062838D7499294V/refund",
                    "rel": "refund",
                    "method": "POST"
                  },
                  {
                    "href": "https://api.sandbox.paypal.com/v1/payments/payment/PAY-7F5790198P134484LKOZSG7Q",
                    "rel": "parent_payment",
                    "method": "GET"
                  }
                ]
              }
            },
            {
              "capture": {
                "id": "0YU20012P1477553M",
                "create_time": "2017-07-01T22:31:54Z",
                "update_time": "2017-07-01T22:31:56Z",
                "amount": {
                  "total": "35.00",
                  "currency": "USD"
                },
                "state": "completed",
                "parent_payment": "PAY-7F5790198P134484LKOZSG7Q",
                "links": [
                  {
                    "href": "https://api.sandbox.paypal.com/v1/payments/capture/0YU20012P1477553M",
                    "rel": "self",
                    "method": "GET"
                  },
                  {
                    "href": "https://api.sandbox.paypal.com/v1/payments/capture/0YU20012P1477553M/refund",
                    "rel": "refund",
                    "method": "POST"
                  },
                  {
                    "href": "https://api.sandbox.paypal.com/v1/payments/payment/PAY-7F5790198P134484LKOZSG7Q",
                    "rel": "parent_payment",
                    "method": "GET"
                  }
                ]
              }
            }
          ]
        }
      ],
      "links": [
        {
          "href": "https://api.sandbox.paypal.com/v1/payments/payment/PAY-7F5790198P134484LKOZSG7Q",
          "rel": "self",
          "method": "GET"
        }
      ]
    }
  ],
  "count": 3,
  "next_id": "PAY-9X4935091L753623RKOZTRHI"
}

Update payment

PATCH /v1/payments/payment/{payment_id}
Partially updates a payment, by ID. You can update the amount, shipping address, invoice ID, and custom data. You cannot update a payment after the payment executes.

Parameters

  • payment_id

    path string

    required

    The ID of the payment to update.
  • patch_request

    body object

    An array of JSON patch objects to apply partial updates to resources.
SDK samples: JAVA

Sample Request

curl -v -X PATCH https://api.sandbox.paypal.com/v1/payments/payment/PAY-5YK922393D847794YKER7MUI \
-H "Content-Type:application/json" \
-H "Authorization: Bearer Access-Token" \
-d '[
  {
  "op": "replace",
  "path": "/transactions/0/amount",
  "value": {
    "total": "18.37",
    "currency": "EUR",
    "details": {
    "subtotal": "13.37",
    "shipping": "5.00"
    }
  }
  },
  {
  "op": "add",
  "path": "/transactions/0/item_list/shipping_address",
  "value": {
    "recipient_name": "Anna Gruneberg",
    "line1": "Kathwarinenhof 1",
    "city": "Flensburg",
    "postal_code": "24939",
    "country_code": "DE"
  }
  }
]'

Response

A successful request returns the HTTP 200 OK status code and a JSON response body that shows payment details.
  • id

    string

    The ID of the payment.
  • intent

    enum

    required

    The payment intent. Value is:

    Possible values: sale, authorize, order.

  • payer

    object

    required

    The source of the funds for this payment. Payment method is PayPal Wallet payment or bank direct debit.
  • transactions

    array (contains the transaction object)

    An array of payment-related transactions. A transaction defines what the payment is for and who fulfills the payment. For update and execute payment calls, the transactions object accepts the amount object only.
  • state

    enum

    The state of the payment, authorization, or order transaction. Value is:
    • created. The transaction was successfully created.
    • approved. The buyer approved the transaction.
    • failed. The transaction request failed.

    Possible values: created, approved, failed.

  • experience_profile_id

    string

    The PayPal-generated ID for the merchant's payment experience profile. For information, see create web experience profile.
  • note_to_payer

    string

    A free-form field that clients can use to send a note to the payer.

    Maximum length: 165.

  • redirect_urls

    object

    A set of redirect URLs that you provide for PayPal-based payments.
  • failure_reason

    enum

    The reason code for a payment failure.

    Possible values: UNABLE_TO_COMPLETE_TRANSACTION, INVALID_PAYMENT_METHOD, PAYER_CANNOT_PAY, CANNOT_PAY_THIS_PAYEE, REDIRECT_REQUIRED, PAYEE_FILTER_RESTRICTIONS.

  • create_time

    string

    The date and time when the payment was created, in Internet date and time format.
  • update_time

    string

    The date and time when the payment was updated, in Internet date and time format.
  • links

    array (contains the link_description object)

    An array of request-related HATEOAS links.

Sample Response

{
  "id": "PAY-5YK922393D847794YKER7MUI",
  "intent": "authorize",
  "create_time": "2017-04-24T14:26:59.059Z",
  "payer": {
    "payer_info": {
      "country_code": "DE",
      "email": "a@paypal.com",
      "first_name": "Gruneberg",
      "last_name": "Anna",
      "payer_id": "8J4VWY56VUXQ6",
      "phone": "605-521-1234"
    },
    "payment_method": "paypal",
    "status": "VERIFIED"
  },
  "state": "approved",
  "transactions": [
    {
      "amount": {
        "total": "18.37",
        "currency": "EUR",
        "details": {
          "subtotal": "13.37",
          "shipping": "5.00"
        }
      },
      "description": "Uber",
      "item_list": {
        "items": [
          {
            "currency": "EUR",
            "name": "iPad",
            "price": "13.37",
            "quantity": "1"
          }
        ],
        "shipping_address": {
          "recipient_name": "Anna Gruneberg",
          "line1": "Kathwarinenhof 1",
          "city": "Flensburg",
          "postal_code": "24939",
          "country_code": "DE"
        }
      },
      "payee": {
        "email": "paypal-de@paypal.com"
      }
    }
  ],
  "links": [
    {
      "href": "https://api.sandbox.paypal.com/v1/payments/payment/PAY-5YK922393D847794YKER7MUI",
      "method": "GET",
      "rel": "self"
    }
  ]
}

Show payment details

GET /v1/payments/payment/{payment_id}
Shows details for a payment, by ID, that has yet to complete. For example, shows details for a payment that was created, approved, or failed.

Parameters

  • payment_id

    path string

    required

    The ID of the payment for which to show details.
SDK samples: JAVA, Node, PHP, Python, Ruby

Sample Request

curl -v -X GET https://api.sandbox.paypal.com/v1/payments/payment/PAY-0US81985GW1191216KOY7OXA \
-H "Content-Type:application/json" \
-H "Authorization: Bearer Access-Token" \
-d '{}'

Response

A successful request returns the HTTP 200 OK status code and a JSON response body that shows payment details.
  • id

    string

    The ID of the payment.
  • intent

    enum

    required

    The payment intent. Value is:

    Possible values: sale, authorize, order.

  • payer

    object

    required

    The source of the funds for this payment. Payment method is PayPal Wallet payment or bank direct debit.
  • transactions

    array (contains the transaction object)

    An array of payment-related transactions. A transaction defines what the payment is for and who fulfills the payment. For update and execute payment calls, the transactions object accepts the amount object only.
  • state

    enum

    The state of the payment, authorization, or order transaction. Value is:
    • created. The transaction was successfully created.
    • approved. The buyer approved the transaction.
    • failed. The transaction request failed.

    Possible values: created, approved, failed.

  • experience_profile_id

    string

    The PayPal-generated ID for the merchant's payment experience profile. For information, see create web experience profile.
  • note_to_payer

    string

    A free-form field that clients can use to send a note to the payer.

    Maximum length: 165.

  • redirect_urls

    object

    A set of redirect URLs that you provide for PayPal-based payments.
  • failure_reason

    enum

    The reason code for a payment failure.

    Possible values: UNABLE_TO_COMPLETE_TRANSACTION, INVALID_PAYMENT_METHOD, PAYER_CANNOT_PAY, CANNOT_PAY_THIS_PAYEE, REDIRECT_REQUIRED, PAYEE_FILTER_RESTRICTIONS.

  • create_time

    string

    The date and time when the payment was created, in Internet date and time format.
  • update_time

    string

    The date and time when the payment was updated, in Internet date and time format.
  • links

    array (contains the link_description object)

    An array of request-related HATEOAS links.

Sample Response

{
  "id": "PAY-0US81985GW1191216KOY7OXA",
  "create_time": "2017-06-30T23:48:44Z",
  "update_time": "2017-06-30T23:49:27Z",
  "state": "approved",
  "intent": "order",
  "payer": {
    "payment_method": "paypal"
  },
  "transactions": [
    {
      "amount": {
        "total": "41.15",
        "currency": "USD",
        "details": {
          "subtotal": "30.00",
          "tax": "1.15",
          "shipping": "10.00"
        }
      },
      "description": "The payment transaction description.",
      "item_list": {
        "items": [
          {
            "name": "hat",
            "sku": "1",
            "price": "3.00",
            "currency": "USD",
            "quantity": "5"
          },
          {
            "name": "handbag",
            "sku": "product34",
            "price": "15.00",
            "currency": "USD",
            "quantity": "1"
          }
        ],
        "shipping_address": {
          "recipient_name": "John Doe",
          "line1": "4th Floor, One Lagoon Drive",
          "line2": "Unit #34",
          "city": "Redwood City",
          "state": "CA",
          "phone": "4084217591",
          "postal_code": "94065",
          "country_code": "US"
        }
      },
      "related_resources": [
        {
          "authorization": {
            "id": "53P09338XY5426455",
            "create_time": "2017-06-30T23:50:01Z",
            "update_time": "2017-06-30T23:50:01Z",
            "amount": {
              "total": "41.15",
              "currency": "USD"
            },
            "parent_payment": "PAY-0US81985GW1191216KOY7OXA",
            "valid_until": "2017-07-29T23:49:52Z",
            "links": [
              {
                "href": "https://api.sandbox.paypal.com/v1/payments/payment/PAY-0US81985GW1191216KOY7OXA",
                "rel": "parent_payment",
                "method": "GET"
              }
            ]
          }
        }
      ]
    }
  ],
  "links": [
    {
      "href": "https://api.sandbox.paypal.com/v1/payments/payment/PAY-0US81985GW1191216KOY7OXA",
      "rel": "self",
      "method": "GET"
    }
  ]
}

Execute approved PayPal payment

POST /v1/payments/payment/{payment_id}/execute
Executes a PayPal payment that the customer has approved. You can optionally update one or more transactions when you execute the payment.
Important: This call works only after a customer has approved the payment. For more information, learn about PayPal payments.

Parameters

  • payment_id

    path string

    required

    The ID of the payment to execute.
  • payment_execution

    body object

    Executes a PayPal account-based payment with the payer_id obtained from the web approval URL.
SDK samples: Node, PHP, Python, Ruby

Sample Request

curl -v -X POST https://api.sandbox.paypal.com/v1/payments/payment/PAY-9N9834337A9191208KOZOQWI/execute \
-H "Content-Type:application/json" \
-H "Authorization: Bearer Access-Token" \
-d '{
  "payer_id": "CR87QHB7JTRSC"
}'

Response

A successful request returns the HTTP 200 OK status code and a JSON response body that shows details for the executed payment.
  • id

    string

    The ID of the payment.
  • intent

    enum

    required

    The payment intent. Value is:

    Possible values: sale, authorize, order.

  • payer

    object

    required

    The source of the funds for this payment. Payment method is PayPal Wallet payment or bank direct debit.
  • transactions

    array (contains the transaction object)

    An array of payment-related transactions. A transaction defines what the payment is for and who fulfills the payment. For update and execute payment calls, the transactions object accepts the amount object only.
  • state

    enum

    The state of the payment, authorization, or order transaction. Value is:
    • created. The transaction was successfully created.
    • approved. The buyer approved the transaction.
    • failed. The transaction request failed.

    Possible values: created, approved, failed.

  • experience_profile_id

    string

    The PayPal-generated ID for the merchant's payment experience profile. For information, see create web experience profile.
  • note_to_payer

    string

    A free-form field that clients can use to send a note to the payer.

    Maximum length: 165.

  • redirect_urls

    object

    A set of redirect URLs that you provide for PayPal-based payments.
  • failure_reason

    enum

    The reason code for a payment failure.

    Possible values: UNABLE_TO_COMPLETE_TRANSACTION, INVALID_PAYMENT_METHOD, PAYER_CANNOT_PAY, CANNOT_PAY_THIS_PAYEE, REDIRECT_REQUIRED, PAYEE_FILTER_RESTRICTIONS.

  • create_time

    string

    The date and time when the payment was created, in Internet date and time format.
  • update_time

    string

    The date and time when the payment was updated, in Internet date and time format.
  • links

    array (contains the link_description object)

    An array of request-related HATEOAS links.

Sample Response

{
  "id": "PAY-9N9834337A9191208KOZOQWI",
  "create_time": "2017-07-01T16:56:57Z",
  "update_time": "2017-07-01T17:05:41Z",
  "state": "approved",
  "intent": "order",
  "payer": {
    "payment_method": "paypal",
    "payer_info": {
      "email": "qa152-biz@paypal.com",
      "first_name": "Thomas",
      "last_name": "Miller",
      "payer_id": "PUP87RBJV8HPU",
      "shipping_address": {
        "line1": "4th Floor, One Lagoon Drive",
        "line2": "Unit #34",
        "city": "Redwood City",
        "state": "CA",
        "postal_code": "94065",
        "country_code": "US",
        "phone": "011862212345678",
        "recipient_name": "Thomas Miller"
      }
    }
  },
  "transactions": [
    {
      "amount": {
        "total": "41.15",
        "currency": "USD",
        "details": {
          "subtotal": "30.00",
          "tax": "0.15",
          "shipping": "11.00"
        }
      },
      "description": "The payment transaction description.",
      "item_list": {
        "items": [
          {
            "name": "hat",
            "sku": "1",
            "price": "3.00",
            "currency": "USD",
            "quantity": "5"
          },
          {
            "name": "handbag",
            "sku": "product34",
            "price": "15.00",
            "currency": "USD",
            "quantity": "1"
          }
        ],
        "shipping_address": {
          "recipient_name": "Thomas Miller",
          "line1": "4th Floor, One Lagoon Drive",
          "line2": "Unit #34",
          "city": "Redwood City",
          "state": "CA",
          "phone": "011862212345678",
          "postal_code": "94065",
          "country_code": "US"
        }
      },
      "related_resources": [
        {
          "order": {
            "id": "O-3SP845109F051535C",
            "create_time": "2017-07-01T16:56:58Z",
            "update_time": "2017-07-01T17:05:41Z",
            "state": "pending",
            "amount": {
              "total": "41.15",
              "currency": "USD"
            },
            "parent_payment": "PAY-9N9834337A9191208KOZOQWI",
            "links": [
              {
                "href": "https://api.sandbox.paypal.com/v1/payments/orders/O-3SP845109F051535C",
                "rel": "self",
                "method": "GET"
              },
              {
                "href": "https://api.sandbox.paypal.com/v1/payments/payment/PAY-9N9834337A9191208KOZOQWI",
                "rel": "parent_payment",
                "method": "GET"
              },
              {
                "href": "https://api.sandbox.paypal.com/v1/payments/orders/O-3SP845109F051535C/void",
                "rel": "void",
                "method": "POST"
              },
              {
                "href": "https://api.sandbox.paypal.com/v1/payments/orders/O-3SP845109F051535C/authorize",
                "rel": "authorization",
                "method": "POST"
              },
              {
                "href": "https://api.sandbox.paypal.com/v1/payments/orders/O-3SP845109F051535C/capture",
                "rel": "capture",
                "method": "POST"
              }
            ]
          }
        }
      ]
    }
  ],
  "links": [
    {
      "href": "https://api.sandbox.paypal.com/v1/payments/payment/PAY-9N9834337A9191208KOZOQWI",
      "rel": "self",
      "method": "GET"
    }
  ]
}

Sale (resource group)

A sale is a completed payment. Use the /sale resource to show sale details and refund a sale. For more information, see also Refund payments.

Show sale details

GET /v1/payments/sale/{sale_id}
Shows details for a sale, by ID. Returns only sales that were created through the REST API.

Parameters

  • sale_id

    path string

    required

    The ID of the sale for which to show details.
SDK samples: C#, JAVA, Node, PHP, Python, Ruby

Sample Request

curl -v -X GET https://api.sandbox.paypal.com/v1/payments/sale/36C38912MN9658832 \
-H "Content-Type:application/json" \
-H "Authorization: Bearer Access-Token" \
-d '{}'

Response

A successful request returns the HTTP 200 OK status code and a JSON response body that shows sale details.
  • id

    string

    required

    The ID of the sale transaction.
  • purchase_unit_reference_id

    string

    The ID of the transaction that corresponds to this sale transaction.
  • amount

    object

    required

    The amount being collected.
  • payment_mode

    enum

    The transaction payment mode. Supported only when payment_method is paypal.

    Possible values: INSTANT_TRANSFER, MANUAL_BANK_TRANSFER, DELAYED_TRANSFER, ECHECK.

  • state

    enum

    required

    The sale transaction state.

    Possible values: completed, partially_refunded, pending, refunded, denied.

  • reason_code

    enum

    A reason code that describes why the transaction state is pending or reversed. Supported only when the payment_method is paypal.

    Possible values: CHARGEBACK, GUARANTEE, BUYER_COMPLAINT, REFUND, UNCONFIRMED_SHIPPING_ADDRESS, ECHECK, INTERNATIONAL_WITHDRAWAL, RECEIVING_PREFERENCE_MANDATES_MANUAL_ACTION, PAYMENT_REVIEW, REGULATORY_REVIEW, UNILATERAL, VERIFICATION_REQUIRED, TRANSACTION_APPROVED_AWAITING_FUNDING.

  • protection_eligibility

    enum

    The seller protection level in effect for the transaction. Supported only when the payment_method is paypal.

    Possible values: ELIGIBLE, PARTIALLY_ELIGIBLE, INELIGIBLE.

  • protection_eligibility_type

    enum

    The seller protection type in effect for the transaction. Returned only when protection_eligibility is ELIGIBLE or PARTIALLY_ELIGIBLE. Supported only when the payment_method is paypal.

    Possible values: ITEM_NOT_RECEIVED_ELIGIBLE, UNAUTHORIZED_PAYMENT_ELIGIBLE, ITEM_NOT_RECEIVED_ELIGIBLE,UNAUTHORIZED_PAYMENT_ELIGIBLE.

  • clearing_time

    string

    The date and time when the eCheck transaction is expected to clear, in Internet date and time format. Returned for eCheck payments. Supported only when the payment_method is paypal.
  • payment_hold_status

    enum

    The recipient fund status. Returned only when the fund status is held.

    Possible values: HELD.

  • payment_hold_reasons

    array (contains the payment_hold_reason object)

    An array of reasons that PayPal holds the recipient fund. Set only if the payment hold status is HELD.
  • transaction_fee

    object

    The transaction fee that applies to this payment.
  • receivable_amount

    object

    The net amount that the merchant receives for this transaction in their receivable currency. Returned only in cross-currency use cases where a merchant bills a buyer in a non-primary currency for that buyer.
  • exchange_rate

    string

    The exchange rate for this transaction. Returned only in cross-currency use cases where a merchant bills a buyer in a non-primary currency for that buyer.
  • fmf_details

    object

    The fraud management filter (FMF) details for the payment that might result in accept, deny, or pending action. Returned in a payment response only if the merchant has enabled FMF in the profile settings and one of the fraud filters was triggered based on those settings. For more information, see Fraud Management Filters Summary.
  • receipt_id

    string

    The receipt ID, which is a payment ID number that is returned for guest users to identify the payment.

    Pattern: ^[0-9]{4}-[0-9]{4}-[0-9]{4}-[0-9]{4}$.

  • parent_payment

    string

    required

    The ID of the payment on which this transaction is based.
  • processor_response

    object

    The response codes that the processor returns for the submitted payment. Supported only when the payment_method is credit_card.
    Important: The use of the PayPal REST /payments APIs to accept credit card payments is restricted. Instead, you can accept credit card payments with Braintree Direct.
  • billing_agreement_id

    string

    The ID of the billing agreement. Used as reference to execute this transaction.
  • create_time

    string

    required

    The date and time of the sale, in Internet date and time format.
  • update_time

    string

    The date and time when the resource was last updated, in Internet date and time format.
  • links

    array (contains the link_description object)

    An array of request-related HATEOAS links.

Sample Response

{
  "id": "36C38912MN9658832",
  "create_time": "2017-02-19T22:01:53Z",
  "update_time": "2017-02-19T22:01:55Z",
  "state": "completed",
  "amount": {
    "total": "7.47",
    "currency": "USD"
  },
  "protection_eligibility": "ELIGIBLE",
  "protection_eligibility_type": "ITEM_NOT_RECEIVED_ELIGIBLE,UNAUTHORIZED_PAYMENT_ELIGIBLE",
  "transaction_fee": {
    "value": "1.75",
    "currency": "USD"
  },
  "parent_payment": "PAY-5YK922393D847794YKER7MUI",
  "links": [
    {
      "href": "https://api.sandbox.paypal.com/v1/payments/sale/36C38912MN9658832",
      "rel": "self",
      "method": "GET"
    },
    {
      "href": "https://api.sandbox.paypal.com/v1/payments/sale/36C38912MN9658832/refund",
      "rel": "refund",
      "method": "POST"
    },
    {
      "href": "https://api.sandbox.paypal.com/v1/payments/payment/PAY-5YK922393D847794YKER7MUI",
      "rel": "parent_payment",
      "method": "GET"
    }
  ]
}

Refund sale

POST /v1/payments/sale/{sale_id}/refund
Refunds a sale, by ID. For a full refund, include an empty payload in the JSON request body. For a partial refund, include an amount object in the JSON request body.

Parameters

  • sale_id

    path string

    required

    The ID of the sale transaction to refund.
  • refund_request

    body object

    A refund request.
SDK samples: C#, JAVA, Node, PHP, Python, Ruby

Sample Request

curl -v -X POST https://api.sandbox.paypal.com/v1/payments/sale/2MU78835H4515710F/refund \
-H "Content-Type:application/json" \
-H "Authorization: Bearer Access-Token" \
-d '{
  "amount": {
  "total": "2.34",
  "currency": "USD"
  },
  "invoice_number": "INV-1234567"
}'

Response

A successful request returns the HTTP 201 Created status code and a JSON response body that shows details for the refunded sale.
  • id

    string

    The ID of the refund transaction.

    Maximum length: 17.

  • amount

    object

    The refund amount. Includes both the amount refunded to the payer and the fee refunded to the payee.
  • state

    enum

    The state of the refund.

    Possible values: pending, completed, cancelled, failed.

  • reason

    string

    The reason that the transaction is being refunded.
  • invoice_number

    string

    The invoice number to track this payment.

    Maximum length: 127.

  • sale_id

    string

    The ID of the sale transaction being refunded.
  • capture_id

    string

    The ID of the sale transaction being refunded.
  • parent_payment

    string

    The ID of the payment on which this transaction is based.
  • description

    string

    The refund description.
  • create_time

    string

    The date and time when the refund was created, in Internet date and time format.
  • update_time

    string

    The date and time when the resource was last updated, in Internet date and time format.
  • links

    array (contains the link_description object)

    An array of request-related HATEOAS links.
  • custom

    string

    A free-form field for the clients' use.

    Maximum length: 127.

  • refund_from_transaction_fee

    object

    The transaction fee that is refunded to original the recipient of payment.
  • refund_from_received_amount

    object

    The amount subtracted from the original payment recipient's PayPal balance to make this refund.
  • total_refunded_amount

    object

    The total amount refunded from the original purchase. For example, if a payer makes $100 purchase and the payer was refunded $20 a week ago and $30 in this transaction, the gross refund amount is $30 for this transaction and the total refunded amount is $50.

Sample Response

{
  "id": "4CF18861HF410323U",
  "create_time": "2017-01-31T04:13:34Z",
  "update_time": "2017-01-31T04:13:36Z",
  "state": "completed",
  "amount": {
    "total": "2.34",
    "currency": "USD"
  },
  "sale_id": "2MU78835H4515710F",
  "parent_payment": "PAY-46E69296BH2194803KEE662Y",
  "invoice_number": "INV-1234567",
  "links": [
    {
      "href": "https://api.sandbox.paypal.com/v1/payments/refund/4CF18861HF410323U",
      "rel": "self",
      "method": "GET"
    },
    {
      "href": "https://api.sandbox.paypal.com/v1/payments/payment/PAY-46E69296BH2194803KEE662Y",
      "rel": "parent_payment",
      "method": "GET"
    },
    {
      "href": "https://api.sandbox.paypal.com/v1/payments/sale/2MU78835H4515710F",
      "rel": "sale",
      "method": "GET"
    }
  ]
}

Authorization (resource group)

Use the /authorization resource and related sub-resources to show details for, capture, void, and reauthorize an authorization.

Show authorization details

GET /v1/payments/authorization/{authorization_id}
Shows details for an authorization, by ID.

Parameters

  • authorization_id

    path string

    required

    The ID of the authorization for which to show details.
SDK samples: C#, JAVA, Node, PHP, Python, Ruby

Sample Request

curl -v -X GET https://api.sandbox.paypal.com/v1/payments/authorization/2DC87612EK520411B \
-H "Content-Type:application/json" \
-H "Authorization: Bearer Access-Token" \
-d '{}'

Response

A successful request returns the HTTP 200 OK status code and a JSON response body that shows authorization details.
  • id

    string

    The ID of the authorization.
  • amount

    object

    required

    The amount being authorized.
  • payment_mode

    enum

    The payment mode of the authorization.

    Possible values: INSTANT_TRANSFER.

  • state

    enum

    The authorization state.

    Possible values: pending, authorized, partially_captured, captured, expired, voided.

  • reason_code

    enum

    The reason code for the pending transaction state.

    Possible values: AUTHORIZATION.

  • pending_reason

    enum

    [DEPRECATED] The reason code for the pending transaction state. Obsolete. Use reason_code instead.

    Possible values: AUTHORIZATION.

  • protection_eligibility

    enum

    The level of seller protection present for the transaction. Supported for the PayPal payment method only. Value is:
    • ELIGIBLE. Merchant is protected by PayPal's Seller Protection Policy for Unauthorized Payments and Item Not Received.
    • PARTIALLY_ELIGIBLE. Merchant is protected by PayPal's Seller Protection Policy for Item Not Received or Unauthorized Payments. For details, see protection_eligibility_type.
    • INELIGIBLE. Merchant is not protected under the Seller Protection Policy.

    Possible values: ELIGIBLE, PARTIALLY_ELIGIBLE, INELIGIBLE.

  • protection_eligibility_type

    enum

    The type of seller protection present for the transaction. Returned only when the protection_eligibility property is ELIGIBLE or PARTIALLY_ELIGIBLE. Supported for the PayPal payment method only.

    Returns one or both of the allowed values.

    Value is:
    • ITEM_NOT_RECEIVED_ELIGIBLE. Sellers are protected against claims for items not received.
    • UNAUTHORIZED_PAYMENT_ELIGIBLE. Sellers are protected against claims for unauthorized payments.

    Possible values: ITEM_NOT_RECEIVED_ELIGIBLE, UNAUTHORIZED_PAYMENT_ELIGIBLE, ITEM_NOT_RECEIVED_ELIGIBLE,UNAUTHORIZED_PAYMENT_ELIGIBLE.

  • fmf_details

    object

    The Fraud Management Filter (FMF) details that are applied to the payment that result in an accept, deny, or pending action. Returned in a payment response only if the merchant has enabled FMF in the profile settings and one of the fraud filters was triggered based on those settings. For more information, see Fraud Management Filters Summary.
  • parent_payment

    string

    The ID of the payment on which this transaction is based.
  • processor_response

    object

    The processor-provided response codes that describe the submitted payment. Supported only when the payment_method is set to credit_card.
  • valid_until

    string

    The date and time when the authorization expires, in Internet date and time format.
  • create_time

    string

    The date and time when the authorization was created, in Internet date and time format.
  • update_time

    string

    The date and time when the authorization was last updated, in Internet date and time format.
  • reference_id

    string

    The ID of the purchase or transaction unit that corresponds to this authorization transaction.

    Maximum length: 256.

  • receipt_id

    string

    The receipt ID, which identifies the payment. Value is 16-digit numeric payment ID number that is returned for guest users.

    Pattern: ^[0-9]{4}-[0-9]{4}-[0-9]{4}-[0-9]{4}$.

  • links

    array (contains the link_description object)

    An array of request-related HATEOAS links.

Sample Response

{
  "id": "2DC87612EK520411B",
  "create_time": "2017-06-25T21:39:15Z",
  "update_time": "2017-06-25T21:39:17Z",
  "state": "authorized",
  "amount": {
    "total": "7.47",
    "currency": "USD",
    "details": {
      "subtotal": "7.47"
    }
  },
  "parent_payment": "PAY-36246664YD343335CKHFA4AY",
  "valid_until": "2017-07-24T21:39:15Z",
  "links": [
    {
      "href": "https://api.sandbox.paypal.com/v1/payments/authorization/2DC87612EK520411B",
      "rel": "self",
      "method": "GET"
    },
    {
      "href": "https://api.sandbox.paypal.com/v1/payments/authorization/2DC87612EK520411B/capture",
      "rel": "capture",
      "method": "POST"
    },
    {
      "href": "https://api.sandbox.paypal.com/v1/payments/authorization/2DC87612EK520411B/void",
      "rel": "void",
      "method": "POST"
    },
    {
      "href": "https://api.sandbox.paypal.com/v1/payments/payment/PAY-36246664YD343335CKHFA4AY",
      "rel": "parent_payment",
      "method": "GET"
    }
  ]
}

Capture authorization

POST /v1/payments/authorization/{authorization_id}/capture
Captures and processes an authorization, by ID. The original payment call must specify an intent of authorize.

Parameters

  • authorization_id

    path string

    required

    The ID of the authorization to capture.
  • capture

    body object

    A capture transaction.
SDK samples: C#, JAVA, Node, PHP, Python, Ruby

Sample Request

curl -v -X POST https://api.sandbox.paypal.com/v1/payments/authorization/2DC87612EK520411B/capture \
-H "Content-Type:application/json" \
-H "Authorization: Bearer Access-Token" \
-d '{
  "amount": {
  "currency": "USD",
  "total": "4.54"
  },
  "is_final_capture": true
}'

Response

A successful request returns the HTTP 201 Created status code and a JSON response body that shows details for the captured authorization.
  • id

    string

    The ID of the capture transaction.
  • amount

    object

    The amount to capture. If the amount matches the originally authorized amount, the state of the authorization changes to captured. Otherwise, the state of the authorization changes to partially_captured.
  • is_final_capture

    boolean

    Indicates whether to release all remaining funds that the authorization holds in the funding instrument (FI). Default is false.
  • state

    enum

    The capture state. Value is:
    • pending. The capture is pending.
    • completed. The capture has successfully completed.
    • refunded. The capture was fully refunded.
    • partially_refunded. The capture was partially refunded.

    Possible values: pending, completed, refunded, partially_refunded.

  • reason_code

    enum

    The reason code that describes why the transaction state is pending or reversed.

    Possible values: CHARGEBACK, GUARANTEE, BUYER_COMPLAINT, REFUND, UNCONFIRMED_SHIPPING_ADDRESS, ECHECK, INTERNATIONAL_WITHDRAWAL, RECEIVING_PREFERENCE_MANDATES_MANUAL_ACTION, PAYMENT_REVIEW, REGULATORY_REVIEW, UNILATERAL, VERIFICATION_REQUIRED, TRANSACTION_APPROVED_AWAITING_FUNDING.

  • parent_payment

    string

    The ID of the payment on which this transaction is based.
  • invoice_number

    string

    The invoice number to track this payment.

    Maximum length: 127.

  • transaction_fee

    object

    The transaction fee for this payment.
  • create_time

    string

    The date and time when the capture occurred, in Internet date and time format as defined in RFC 3339 Section 5.6.
  • update_time

    string

    The date and time when the resource was last updated, in Internet date and time format as defined in RFC 3339 Section 5.6.
  • links

    array (contains the link_description object)

    An array of request-related HATEOAS links.

Sample Response

{
  "id": "6BA17599X0950293U",
  "create_time": "2017-05-06T22:32:24Z",
  "update_time": "2017-05-06T22:32:25Z",
  "amount": {
    "total": "4.54",
    "currency": "USD"
  },
  "is_final_capture": true,
  "state": "completed",
  "parent_payment": "PAY-44664305570317015KGEC5DI",
  "links": [
    {
      "href": "https://api.sandbox.paypal.com/v1/payments/capture/6BA17599X0950293U",
      "rel": "self",
      "method": "GET"
    },
    {
      "href": "https://api.sandbox.paypal.com/v1/payments/capture/6BA17599X0950293U/refund",
      "rel": "refund",
      "method": "POST"
    },
    {
      "href": "https://api.sandbox.paypal.com/v1/payments/authorization/5RA45624N3531924N",
      "rel": "authorization",
      "method": "GET"
    },
    {
      "href": "https://api.sandbox.paypal.com/v1/payments/payment/PAY-44664305570317015KGEC5DI",
      "rel": "parent_payment",
      "method": "GET"
    }
  ]
}

Re-authorize payment

POST /v1/payments/authorization/{authorization_id}/reauthorize
Re-authorizes a PayPal account payment, by authorization ID. To ensure that funds are still available, re-authorize a payment after the initial three-day honor period. Supports only the amount request parameter. You can re-authorize a payment only once from four to 29 days after three-day honor period for the original authorization expires. If 30 days have passed from the original authorization, you must create a new authorization instead. A re-authorized payment itself has a new three-day honor period. You can re-authorize a transaction once for up to 115% of the originally authorized amount, not to exceed an increase of $75 USD.

Parameters

  • authorization_id

    path string

    required

    The ID of the authorization to re-authorize.
  • authorization

    body object

    An authorization.
SDK samples: C#, JAVA, Node, PHP, Python, Ruby

Sample Request

curl -v -X POST https://api.sandbox.paypal.com/v1/payments/authorization/2DC87612EK520411B/reauthorize \
-H "Content-Type:application/json" \
-H "Authorization: Bearer Access-Token" \
-d '{
  "amount": {
  "total": "7.00",
  "currency": "USD"
  }
}'

Response

A successful request returns the HTTP 201 Created status code and a JSON response body that shows details for the re-authorized authorization.
  • id

    string

    The ID of the authorization.
  • amount

    object

    required

    The amount being authorized.
  • payment_mode

    enum

    The payment mode of the authorization.

    Possible values: INSTANT_TRANSFER.

  • state

    enum

    The authorization state.

    Possible values: pending, authorized, partially_captured, captured, expired, voided.

  • reason_code

    enum

    The reason code for the pending transaction state.

    Possible values: AUTHORIZATION.

  • pending_reason

    enum

    [DEPRECATED] The reason code for the pending transaction state. Obsolete. Use reason_code instead.

    Possible values: AUTHORIZATION.

  • protection_eligibility

    enum

    The level of seller protection present for the transaction. Supported for the PayPal payment method only. Value is:
    • ELIGIBLE. Merchant is protected by PayPal's Seller Protection Policy for Unauthorized Payments and Item Not Received.
    • PARTIALLY_ELIGIBLE. Merchant is protected by PayPal's Seller Protection Policy for Item Not Received or Unauthorized Payments. For details, see protection_eligibility_type.
    • INELIGIBLE. Merchant is not protected under the Seller Protection Policy.

    Possible values: ELIGIBLE, PARTIALLY_ELIGIBLE, INELIGIBLE.

  • protection_eligibility_type

    enum

    The type of seller protection present for the transaction. Returned only when the protection_eligibility property is ELIGIBLE or PARTIALLY_ELIGIBLE. Supported for the PayPal payment method only.

    Returns one or both of the allowed values.

    Value is:
    • ITEM_NOT_RECEIVED_ELIGIBLE. Sellers are protected against claims for items not received.
    • UNAUTHORIZED_PAYMENT_ELIGIBLE. Sellers are protected against claims for unauthorized payments.

    Possible values: ITEM_NOT_RECEIVED_ELIGIBLE, UNAUTHORIZED_PAYMENT_ELIGIBLE, ITEM_NOT_RECEIVED_ELIGIBLE,UNAUTHORIZED_PAYMENT_ELIGIBLE.

  • fmf_details

    object

    The Fraud Management Filter (FMF) details that are applied to the payment that result in an accept, deny, or pending action. Returned in a payment response only if the merchant has enabled FMF in the profile settings and one of the fraud filters was triggered based on those settings. For more information, see Fraud Management Filters Summary.
  • parent_payment

    string

    The ID of the payment on which this transaction is based.
  • processor_response

    object

    The processor-provided response codes that describe the submitted payment. Supported only when the payment_method is set to credit_card.
  • valid_until

    string

    The date and time when the authorization expires, in Internet date and time format.
  • create_time

    string

    The date and time when the authorization was created, in Internet date and time format.
  • update_time

    string

    The date and time when the authorization was last updated, in Internet date and time format.
  • reference_id

    string

    The ID of the purchase or transaction unit that corresponds to this authorization transaction.

    Maximum length: 256.

  • receipt_id

    string

    The receipt ID, which identifies the payment. Value is 16-digit numeric payment ID number that is returned for guest users.

    Pattern: ^[0-9]{4}-[0-9]{4}-[0-9]{4}-[0-9]{4}$.

  • links

    array (contains the link_description object)

    An array of request-related HATEOAS links.

Sample Response

{
  "id": "8AA831015G517922L",
  "create_time": "2017-06-25T21:39:15Z",
  "update_time": "2017-06-25T21:39:17Z",
  "state": "authorized",
  "amount": {
    "total": "7.00",
    "currency": "USD"
  },
  "parent_payment": "PAY-7LD317540C810384EKHFAGYA",
  "valid_until": "2017-07-24T21:39:15Z",
  "links": [
    {
      "href": "https://api.sandbox.paypal.com/v1/payments/authorization/8AA831015G517922L",
      "rel": "self",
      "method": "GET"
    },
    {
      "href": "https://api.sandbox.paypal.com/v1/payments/payment/PAY-7LD317540C810384EKHFAGYA",
      "rel": "parent_payment",
      "method": "GET"
    },
    {
      "href": "https://api.sandbox.paypal.com/v1/payments/authorization/8AA831015G517922L/capture",
      "rel": "capture",
      "method": "POST"
    }
  ]
}

Void authorization

POST /v1/payments/authorization/{authorization_id}/void
Voids, or cancels, an authorization, by ID. You cannot void a fully captured authorization.

Parameters

  • authorization_id

    path string

    required

    The ID of the authorization to void.
SDK samples: C#, JAVA, Node, PHP, Python, Ruby

Sample Request

curl -v -X POST https://api.sandbox.paypal.com/v1/payments/authorization/2DC87612EK520411B/void \
-H "Content-Type:application/json" \
-H "Authorization: Bearer Access-Token" \
-d '{}'

Response

A successful request returns the HTTP 200 OK status code and a JSON response body that shows details for the voided authorization.
  • id

    string

    The ID of the authorization.
  • amount

    object

    required

    The amount being authorized.
  • payment_mode

    enum

    The payment mode of the authorization.

    Possible values: INSTANT_TRANSFER.

  • state

    enum

    The authorization state.

    Possible values: pending, authorized, partially_captured, captured, expired, voided.

  • reason_code

    enum

    The reason code for the pending transaction state.

    Possible values: AUTHORIZATION.

  • pending_reason

    enum

    [DEPRECATED] The reason code for the pending transaction state. Obsolete. Use reason_code instead.

    Possible values: AUTHORIZATION.

  • protection_eligibility

    enum

    The level of seller protection present for the transaction. Supported for the PayPal payment method only. Value is:
    • ELIGIBLE. Merchant is protected by PayPal's Seller Protection Policy for Unauthorized Payments and Item Not Received.
    • PARTIALLY_ELIGIBLE. Merchant is protected by PayPal's Seller Protection Policy for Item Not Received or Unauthorized Payments. For details, see protection_eligibility_type.
    • INELIGIBLE. Merchant is not protected under the Seller Protection Policy.

    Possible values: ELIGIBLE, PARTIALLY_ELIGIBLE, INELIGIBLE.

  • protection_eligibility_type

    enum

    The type of seller protection present for the transaction. Returned only when the protection_eligibility property is ELIGIBLE or PARTIALLY_ELIGIBLE. Supported for the PayPal payment method only.

    Returns one or both of the allowed values.

    Value is:
    • ITEM_NOT_RECEIVED_ELIGIBLE. Sellers are protected against claims for items not received.
    • UNAUTHORIZED_PAYMENT_ELIGIBLE. Sellers are protected against claims for unauthorized payments.

    Possible values: ITEM_NOT_RECEIVED_ELIGIBLE, UNAUTHORIZED_PAYMENT_ELIGIBLE, ITEM_NOT_RECEIVED_ELIGIBLE,UNAUTHORIZED_PAYMENT_ELIGIBLE.

  • fmf_details

    object

    The Fraud Management Filter (FMF) details that are applied to the payment that result in an accept, deny, or pending action. Returned in a payment response only if the merchant has enabled FMF in the profile settings and one of the fraud filters was triggered based on those settings. For more information, see Fraud Management Filters Summary.
  • parent_payment

    string

    The ID of the payment on which this transaction is based.
  • processor_response

    object

    The processor-provided response codes that describe the submitted payment. Supported only when the payment_method is set to credit_card.
  • valid_until

    string

    The date and time when the authorization expires, in Internet date and time format.
  • create_time

    string

    The date and time when the authorization was created, in Internet date and time format.
  • update_time

    string

    The date and time when the authorization was last updated, in Internet date and time format.
  • reference_id

    string

    The ID of the purchase or transaction unit that corresponds to this authorization transaction.

    Maximum length: 256.

  • receipt_id

    string

    The receipt ID, which identifies the payment. Value is 16-digit numeric payment ID number that is returned for guest users.

    Pattern: ^[0-9]{4}-[0-9]{4}-[0-9]{4}-[0-9]{4}$.

  • links

    array (contains the link_description object)

    An array of request-related HATEOAS links.

Sample Response

{
  "id": "6CR34526N64144512",
  "create_time": "2017-05-06T21:56:50Z",
  "update_time": "2017-05-06T21:57:51Z",
  "state": "voided",
  "amount": {
    "total": "110.54",
    "currency": "USD",
    "details": {
      "subtotal": "110.54"
    }
  },
  "parent_payment": "PAY-0PL82432AD7432233KGECOIQ",
  "links": [
    {
      "href": "https://api.sandbox.paypal.com/v1/payments/authorization/6CR34526N64144512",
      "rel": "self",
      "method": "GET"
    },
    {
      "href": "https://api.sandbox.paypal.com/v1/payments/payment/PAY-0PL82432AD7432233KGECOIQ",
      "rel": "parent_payment",
      "method": "GET"
    }
  ]
}

Order (resource group)

Use the /orders resource to authorize, capture, void, and show details for an order.
Note: You cannot refund an order directly. Instead, you must refund a completed payment for an order. For integration information, see Orders and refund a payment.
For more information, see also Orders.

Show order details

GET /v1/payments/orders/{order_id}
Shows details for an order, by ID.

Parameters

  • order_id

    path string

    required

    The ID of the order for which to show details.
SDK samples: C#, Node, PHP, Python

Sample Request

curl -v -X GET https://api.sandbox.paypal.com/v1/payments/orders/O-0PW72302W3743444R \
-H "Content-Type:application/json" \
-H "Authorization: Bearer Access-Token"

Response

A successful request returns the HTTP 200 OK status code and a JSON response body that shows details for the voided authorization.
  • id

    string

    The ID of the order transaction.
  • reference_id

    string

    The ID of the purchase unit that is associated with this object. Obsolete. Used only in cart_base.
  • amount

    object

    required

    The amount to collect.
  • payment_mode

    enum

    The transaction payment mode.

    Possible values: INSTANT_TRANSFER, MANUAL_BANK_TRANSFER, DELAYED_TRANSFER, ECHECK.

  • state

    enum

    The order transaction state.

    Possible values: pending, completed, voided, authorized, captured.

  • reason_code

    enum

    The reason code that describes why the transaction state is pending or reversed. Eventually, this parameter will replace the pending_reason parameter. Supported only when the payment_method is paypal.

    Possible values: PAYER_SHIPPING_UNCONFIRMED, MULTI_CURRENCY, RISK_REVIEW, REGULATORY_REVIEW, VERIFICATION_REQUIRED, ORDER, OTHER.

  • pending_reason

    enum

    [DEPRECATED] The reason code for the pending transaction state. Obsolete. Use reason_code instead.

    Possible values: payer_shipping_unconfirmed, multi_currency, risk_review, regulatory_review, verification_required, order, other.

  • protection_eligibility

    enum

    The level of seller protection in effect for the transaction.

    Possible values: ELIGIBLE, PARTIALLY_ELIGIBLE, INELIGIBLE.

  • protection_eligibility_type

    enum

    The kind of seller protection in effect for the transaction. Returned only when the protection_eligibility property is ELIGIBLE or PARTIALLY_ELIGIBLE. Supported only when the payment_method is paypal. One or both of these values can be returned:
    • ITEM_NOT_RECEIVED_ELIGIBLE. Sellers are protected against claims for items not received.
    • UNAUTHORIZED_PAYMENT_ELIGIBLE. Sellers are protected against claims for unauthorized payments.

    Possible values: ITEM_NOT_RECEIVED_ELIGIBLE, UNAUTHORIZED_PAYMENT_ELIGIBLE, ITEM_NOT_RECEIVED_ELIGIBLE,UNAUTHORIZED_PAYMENT_ELIGIBLE.

  • parent_payment

    string

    The ID of the payment on which this transaction is based.
  • fmf_details

    object

    The fraud management filter (FMF) details applied for the payment that can result in an accept, deny, or pending action.
  • create_time

    string

    The date and time when the resource was created, in Internet date and time format.
  • update_time

    string

    The date and time when the resource was last updated, in Internet date and time format.
  • links

    array (contains the link_description object)

    An array of request-related HATEOAS links.

Sample Response

{
  "id": "O-0PW72302W3743444R",
  "create_time": "2017-06-19T22:05:06Z",
  "update_time": "2017-06-19T22:08:36Z",
  "state": "pending",
  "amount": {
    "total": "41.15",
    "currency": "USD"
  },
  "pending_reason": "order",
  "parent_payment": "PAY-4D805864V5423372TKOQLRUQ",
  "links": [
    {
      "href": "https://api.sandbox.paypal.com/v1/payments/orders/O-0PW72302W3743444R",
      "rel": "self",
      "method": "GET"
    },
    {
      "href": "https://api.sandbox.paypal.com/v1/payments/payment/PAY-4D805864V5423372TKOQLRUQ",
      "rel": "parent_payment",
      "method": "GET"
    },
    {
      "href": "https://api.sandbox.paypal.com/v1/payments/orders/O-0PW72302W3743444R/authorization",
      "rel": "authorize",
      "method": "POST"
    },
    {
      "href": "https://api.sandbox.paypal.com/v1/payments/orders/O-0PW72302W3743444R/capture",
      "rel": "capture",
      "method": "POST"
    },
    {
      "href": "https://api.sandbox.paypal.com/v1/payments/orders/O-0PW72302W3743444R/void",
      "rel": "void",
      "method": "POST"
    }
  ]
}

Authorize order

POST /v1/payments/orders/{order_id}/authorize
Authorizes an order, by ID. In the JSON request body, include an amount object.

Parameters

  • order_id

    path string

    required

    The ID of the order to authorize.
  • order

    body object

    An order transaction.
SDK samples: C#, Node, PHP, Python

Sample Request

curl -v -X POST https://api.sandbox.paypal.com/v1/payments/orders/O-0NR488530V5211123/authorize \
-H "Content-Type:application/json" \
-H "Authorization: Bearer Access-Token" \
-d '{
  "amount": {
  "currency": "USD",
  "total": "4.54"
  }
}'

Response

A successful request returns the HTTP 201 Created status code and a JSON response body that shows details for the authorized order.
  • id

    string

    The ID of the authorization.
  • amount

    object

    required

    The amount being authorized.
  • payment_mode

    enum

    The payment mode of the authorization.

    Possible values: INSTANT_TRANSFER.

  • state

    enum

    The authorization state.

    Possible values: pending, authorized, partially_captured, captured, expired, voided.

  • reason_code

    enum

    The reason code for the pending transaction state.

    Possible values: AUTHORIZATION.

  • pending_reason

    enum

    [DEPRECATED] The reason code for the pending transaction state. Obsolete. Use reason_code instead.

    Possible values: AUTHORIZATION.

  • protection_eligibility

    enum

    The level of seller protection present for the transaction. Supported for the PayPal payment method only. Value is:
    • ELIGIBLE. Merchant is protected by PayPal's Seller Protection Policy for Unauthorized Payments and Item Not Received.
    • PARTIALLY_ELIGIBLE. Merchant is protected by PayPal's Seller Protection Policy for Item Not Received or Unauthorized Payments. For details, see protection_eligibility_type.
    • INELIGIBLE. Merchant is not protected under the Seller Protection Policy.

    Possible values: ELIGIBLE, PARTIALLY_ELIGIBLE, INELIGIBLE.

  • protection_eligibility_type

    enum

    The type of seller protection present for the transaction. Returned only when the protection_eligibility property is ELIGIBLE or PARTIALLY_ELIGIBLE. Supported for the PayPal payment method only.

    Returns one or both of the allowed values.

    Value is:
    • ITEM_NOT_RECEIVED_ELIGIBLE. Sellers are protected against claims for items not received.
    • UNAUTHORIZED_PAYMENT_ELIGIBLE. Sellers are protected against claims for unauthorized payments.

    Possible values: ITEM_NOT_RECEIVED_ELIGIBLE, UNAUTHORIZED_PAYMENT_ELIGIBLE, ITEM_NOT_RECEIVED_ELIGIBLE,UNAUTHORIZED_PAYMENT_ELIGIBLE.

  • fmf_details

    object

    The Fraud Management Filter (FMF) details that are applied to the payment that result in an accept, deny, or pending action. Returned in a payment response only if the merchant has enabled FMF in the profile settings and one of the fraud filters was triggered based on those settings. For more information, see Fraud Management Filters Summary.
  • parent_payment

    string

    The ID of the payment on which this transaction is based.
  • processor_response

    object

    The processor-provided response codes that describe the submitted payment. Supported only when the payment_method is set to credit_card.
  • valid_until

    string

    The date and time when the authorization expires, in Internet date and time format.
  • create_time

    string

    The date and time when the authorization was created, in Internet date and time format.
  • update_time

    string

    The date and time when the authorization was last updated, in Internet date and time format.
  • reference_id

    string

    The ID of the purchase or transaction unit that corresponds to this authorization transaction.

    Maximum length: 256.

  • receipt_id

    string

    The receipt ID, which identifies the payment. Value is 16-digit numeric payment ID number that is returned for guest users.

    Pattern: ^[0-9]{4}-[0-9]{4}-[0-9]{4}-[0-9]{4}$.

  • links

    array (contains the link_description object)

    An array of request-related HATEOAS links.

Sample Response

{
  "id": "0PG032325D352531H",
  "create_time": "2017-06-28T07:38:10Z",
  "update_time": "2017-06-28T07:38:12Z",
  "state": "pending",
  "amount": {
    "total": "41.15",
    "currency": "USD"
  },
  "parent_payment": "O-0NR488530V5211123",
  "links": [
    {
      "href": "https://api.sandbox.paypal.com/v1/payments/orders/O-0NR488530V5211123",
      "rel": "self",
      "method": "GET"
    },
    {
      "href": "https://api.sandbox.paypal.com/v1/payments/authorization/0PG032325D352531H",
      "rel": "self",
      "method": "GET"
    },
    {
      "href": "https://api.sandbox.paypal.com/v1/payments/authorization/0PG032325D352531H/capture",
      "rel": "capture",
      "method": "POST"
    },
    {
      "href": "https://api.sandbox.paypal.com/v1/payments/payment/PAY-0AY778532K612520BKOXHAKY",
      "rel": "parent_payment",
      "method": "GET"
    }
  ]
}

Capture order

POST /v1/payments/orders/{order_id}/capture
Captures a payment for an order, by ID. To use this call, the original payment call must specify an order intent. In the JSON request body, include the payment amount and indicate whether this capture is the final capture for the authorization.

Parameters

  • order_id

    path string

    required

    The ID of the order to capture.
  • capture

    body object

    A capture transaction.
SDK samples: C#, Node, PHP, Python

Sample Request

curl -v -X POST https://api.sandbox.paypal.com/v1/payments/orders/O-3SP845109F051535C/capture \
-H "Content-Type:application/json" \
-H "Authorization: Bearer Access-Token" \
-d '{
  "amount": {
  "currency": "USD",
  "total": "4.54"
  },
  "is_final_capture": true
}'

Response

A successful request returns the HTTP 201 Created status code and a JSON response body that shows details for the captured order.
  • id

    string

    The ID of the capture transaction.
  • amount

    object

    The amount to capture. If the amount matches the originally authorized amount, the state of the authorization changes to captured. Otherwise, the state of the authorization changes to partially_captured.
  • is_final_capture

    boolean

    Indicates whether to release all remaining funds that the authorization holds in the funding instrument (FI). Default is false.
  • state

    enum

    The capture state. Value is:
    • pending. The capture is pending.
    • completed. The capture has successfully completed.
    • refunded. The capture was fully refunded.
    • partially_refunded. The capture was partially refunded.

    Possible values: pending, completed, refunded, partially_refunded.

  • reason_code

    enum

    The reason code that describes why the transaction state is pending or reversed.

    Possible values: CHARGEBACK, GUARANTEE, BUYER_COMPLAINT, REFUND, UNCONFIRMED_SHIPPING_ADDRESS, ECHECK, INTERNATIONAL_WITHDRAWAL, RECEIVING_PREFERENCE_MANDATES_MANUAL_ACTION, PAYMENT_REVIEW, REGULATORY_REVIEW, UNILATERAL, VERIFICATION_REQUIRED, TRANSACTION_APPROVED_AWAITING_FUNDING.

  • parent_payment

    string

    The ID of the payment on which this transaction is based.
  • invoice_number

    string

    The invoice number to track this payment.

    Maximum length: 127.

  • transaction_fee

    object

    The transaction fee for this payment.
  • create_time

    string

    The date and time when the capture occurred, in Internet date and time format as defined in RFC 3339 Section 5.6.
  • update_time

    string

    The date and time when the resource was last updated, in Internet date and time format as defined in RFC 3339 Section 5.6.
  • links

    array (contains the link_description object)

    An array of request-related HATEOAS links.

Sample Response

{
  "id": "51366113MA710110S",
  "create_time": "2017-07-01T17:13:45Z",
  "update_time": "2017-07-01T17:13:47Z",
  "amount": {
    "total": "7.00",
    "currency": "USD"
  },
  "is_final_capture": false,
  "state": "completed",
  "parent_payment": "PAY-9N9834337A9191208KOZOQWI",
  "links": [
    {
      "href": "https://api.sandbox.paypal.com/v1/payments/capture/51366113MA710110S",
      "rel": "self",
      "method": "GET"
    },
    {
      "href": "https://api.sandbox.paypal.com/v1/payments/capture/51366113MA710110S/refund",
      "rel": "refund",
      "method": "POST"
    },
    {
      "href": "https://api.sandbox.paypal.com/v1/payments/orders/O-3SP845109F051535C",
      "rel": "order",
      "method": "GET"
    },
    {
      "href": "https://api.sandbox.paypal.com/v1/payments/payment/PAY-9N9834337A9191208KOZOQWI",
      "rel": "parent_payment",
      "method": "GET"
    }
  ]
}

Void order

POST /v1/payments/orders/{order_id}/do-void
Voids, or cancels, an order, by ID. You cannot void an order if the payment has already been partially or fully captured.

Parameters

  • order_id

    path string

    required

    The ID of the order to void.
SDK samples: C#, Node, PHP, Python

Sample Request

curl -v -X POST https://api.sandbox.paypal.com/v1/payments/orders/O-0NR488530V5211123/do-void \
-H "Content-Type:application/json" \
-H "Authorization: Bearer Access-Token" \
-d '{}'

Response

A successful request returns the HTTP 200 OK status code and a JSON response body that shows details for the voided order.
  • id

    string

    The ID of the order transaction.
  • reference_id

    string

    The ID of the purchase unit that is associated with this object. Obsolete. Used only in cart_base.
  • amount

    object

    required

    The amount to collect.
  • payment_mode

    enum

    The transaction payment mode.

    Possible values: INSTANT_TRANSFER, MANUAL_BANK_TRANSFER, DELAYED_TRANSFER, ECHECK.

  • state

    enum

    The order transaction state.

    Possible values: pending, completed, voided, authorized, captured.

  • reason_code

    enum

    The reason code that describes why the transaction state is pending or reversed. Eventually, this parameter will replace the pending_reason parameter. Supported only when the payment_method is paypal.

    Possible values: PAYER_SHIPPING_UNCONFIRMED, MULTI_CURRENCY, RISK_REVIEW, REGULATORY_REVIEW, VERIFICATION_REQUIRED, ORDER, OTHER.

  • pending_reason

    enum

    [DEPRECATED] The reason code for the pending transaction state. Obsolete. Use reason_code instead.

    Possible values: payer_shipping_unconfirmed, multi_currency, risk_review, regulatory_review, verification_required, order, other.

  • protection_eligibility

    enum

    The level of seller protection in effect for the transaction.

    Possible values: ELIGIBLE, PARTIALLY_ELIGIBLE, INELIGIBLE.

  • protection_eligibility_type

    enum

    The kind of seller protection in effect for the transaction. Returned only when the protection_eligibility property is ELIGIBLE or PARTIALLY_ELIGIBLE. Supported only when the payment_method is paypal. One or both of these values can be returned:
    • ITEM_NOT_RECEIVED_ELIGIBLE. Sellers are protected against claims for items not received.
    • UNAUTHORIZED_PAYMENT_ELIGIBLE. Sellers are protected against claims for unauthorized payments.

    Possible values: ITEM_NOT_RECEIVED_ELIGIBLE, UNAUTHORIZED_PAYMENT_ELIGIBLE, ITEM_NOT_RECEIVED_ELIGIBLE,UNAUTHORIZED_PAYMENT_ELIGIBLE.

  • parent_payment

    string

    The ID of the payment on which this transaction is based.
  • fmf_details

    object

    The fraud management filter (FMF) details applied for the payment that can result in an accept, deny, or pending action.
  • create_time

    string

    The date and time when the resource was created, in Internet date and time format.
  • update_time

    string

    The date and time when the resource was last updated, in Internet date and time format.
  • links

    array (contains the link_description object)

    An array of request-related HATEOAS links.

Sample Response

{
  "id": "O-0NR488530V5211123",
  "create_time": "2017-06-28T07:35:08Z",
  "update_time": "2017-06-28T07:36:25Z",
  "state": "voided",
  "amount": {
    "total": "41.15",
    "currency": "USD",
    "details": {
      "subtotal": "30.00",
      "tax": "0.15",
      "shipping": "11.00"
    }
  },
  "parent_payment": "PAY-0AY778532K612520BKOXHAKY",
  "links": [
    {
      "href": "https://api.sandbox.paypal.com/v1/payments/authorization/O-0NR488530V5211123",
      "rel": "self",
      "method": "GET"
    },
    {
      "href": "https://api.sandbox.paypal.com/v1/payments/payment/PAY-0AY778532K612520BKOXHAKY",
      "rel": "parent_payment",
      "method": "GET"
    }
  ]
}

Capture (resource group)

Use the /capture resource and sub-resources to show details for and refund captured payments.

Show captured payment details

GET /v1/payments/capture/{capture_id}
Shows details for a captured payment, by ID.

Parameters

  • capture_id

    path string

    required

    The ID of the captured payment for which to show details.
SDK samples: C#, JAVA, Node, PHP, Python, Ruby

Sample Request

curl -v -X GET https://api.sandbox.paypal.com/v1/payments/capture/8F148933LY9388354 \
-H "Content-Type:application/json" \
-H "Authorization: Bearer Access-Token" \
-d '{}'

Response

A successful request returns the HTTP 200 OK status code and a JSON response body that shows details for the captured payment.
  • id

    string

    The ID of the capture transaction.
  • amount

    object

    The amount to capture. If the amount matches the originally authorized amount, the state of the authorization changes to captured. Otherwise, the state of the authorization changes to partially_captured.
  • is_final_capture

    boolean

    Indicates whether to release all remaining funds that the authorization holds in the funding instrument (FI). Default is false.
  • state

    enum

    The capture state. Value is:
    • pending. The capture is pending.
    • completed. The capture has successfully completed.
    • refunded. The capture was fully refunded.
    • partially_refunded. The capture was partially refunded.

    Possible values: pending, completed, refunded, partially_refunded.

  • reason_code

    enum

    The reason code that describes why the transaction state is pending or reversed.

    Possible values: CHARGEBACK, GUARANTEE, BUYER_COMPLAINT, REFUND, UNCONFIRMED_SHIPPING_ADDRESS, ECHECK, INTERNATIONAL_WITHDRAWAL, RECEIVING_PREFERENCE_MANDATES_MANUAL_ACTION, PAYMENT_REVIEW, REGULATORY_REVIEW, UNILATERAL, VERIFICATION_REQUIRED, TRANSACTION_APPROVED_AWAITING_FUNDING.

  • parent_payment

    string

    The ID of the payment on which this transaction is based.
  • invoice_number

    string

    The invoice number to track this payment.

    Maximum length: 127.

  • transaction_fee

    object

    The transaction fee for this payment.
  • create_time

    string

    The date and time when the capture occurred, in Internet date and time format as defined in RFC 3339 Section 5.6.
  • update_time

    string

    The date and time when the resource was last updated, in Internet date and time format as defined in RFC 3339 Section 5.6.
  • links

    array (contains the link_description object)

    An array of request-related HATEOAS links.

Sample Response

{
  "id": "8F148933LY9388354",
  "amount": {
    "total": "110.54",
    "currency": "USD",
    "details": {
      "subtotal": "110.54"
    }
  },
  "state": "completed",
  "parent_payment": "PAY-8PT597110X687430LKGECATA",
  "transaction_fee": {
    "value": "3.74",
    "currency": "USD"
  },
  "links": [
    {
      "href": "https://api.sandbox.paypal.com/v1/payments/capture/8F148933LY9388354",
      "rel": "self",
      "method": "GET"
    },
    {
      "href": "https://api.sandbox.paypal.com/v1/payments/capture/8F148933LY9388354/refund",
      "rel": "refund",
      "method": "POST"
    },
    {
      "href": "https://api.sandbox.paypal.com/v1/payments/payment/PAY-8PT597110X687430LKGECATA",
      "rel": "parent_payment",
      "method": "GET"
    }
  ]
}

Refund captured payment

POST /v1/payments/capture/{capture_id}/refund
Refunds a captured payment, by ID. In the JSON request body, include an amount object.

Parameters

  • capture_id

    path string

    required

    The ID of the captured payment to refund.
  • refund_request

    body object

    A refund request.
SDK samples: C#, JAVA, Node, PHP, Python, Ruby

Sample Request

curl -v -X POST https://api.sandbox.paypal.com/v1/payments/capture/2MU78835H4515710F/refund \
-H "Content-Type:application/json" \
-H "Authorization: Bearer Access-Token" \
-d '{
  "amount": {
  "currency": "USD",
  "total": "110.54"
  }
}'

Response

A successful request returns the HTTP 200 OK status code and a JSON response body that shows details for the captured payment.
  • id

    string

    The ID of the refund transaction.

    Maximum length: 17.

  • amount

    object

    The refund amount. Includes both the amount refunded to the payer and the fee refunded to the payee.
  • state

    enum

    The state of the refund.

    Possible values: pending, completed, cancelled, failed.

  • reason

    string

    The reason that the transaction is being refunded.
  • invoice_number

    string

    The invoice number to track this payment.

    Maximum length: 127.

  • sale_id

    string

    The ID of the sale transaction being refunded.
  • capture_id

    string

    The ID of the sale transaction being refunded.
  • parent_payment

    string

    The ID of the payment on which this transaction is based.
  • description

    string

    The refund description.
  • create_time

    string

    The date and time when the refund was created, in Internet date and time format.
  • update_time

    string

    The date and time when the resource was last updated, in Internet date and time format.
  • links

    array (contains the link_description object)

    An array of request-related HATEOAS links.
  • custom

    string

    A free-form field for the clients' use.

    Maximum length: 127.

  • refund_from_transaction_fee

    object

    The transaction fee that is refunded to original the recipient of payment.
  • refund_from_received_amount

    object

    The amount subtracted from the original payment recipient's PayPal balance to make this refund.
  • total_refunded_amount

    object

    The total amount refunded from the original purchase. For example, if a payer makes $100 purchase and the payer was refunded $20 a week ago and $30 in this transaction, the gross refund amount is $30 for this transaction and the total refunded amount is $50.

Sample Response

{
  "id": "0P209507D6694645N",
  "create_time": "2017-05-06T22:11:51Z",
  "update_time": "2017-05-06T22:11:51Z",
  "state": "completed",
  "amount": {
    "total": "110.54",
    "currency": "USD"
  },
  "capture_id": "8F148933LY9388354",
  "parent_payment": "PAY-8PT597110X687430LKGECATA",
  "invoice_number": "INV-1234567",
  "links": [
    {
      "href": "https://api.sandbox.paypal.com/v1/payments/refund/0P209507D6694645N",
      "rel": "self",
      "method": "GET"
    },
    {
      "href": "https://api.sandbox.paypal.com/v1/payments/payment/PAY-8PT597110X687430LKGECATA",
      "rel": "parent_payment",
      "method": "GET"
    },
    {
      "href": "https://api.sandbox.paypal.com/v1/payments/capture/8F148933LY9388354",
      "rel": "capture",
      "method": "GET"
    }
  ]
}

Refund (resource group)

Use the /refund resource to show details for a refund on direct and captured payments.

Show refund details

GET /v1/payments/refund/{refund_id}
Shows details for a refund, by ID.

Parameters

  • refund_id

    path string

    required

    The ID of the refund for which to show details.
SDK samples: C#

Sample Request

curl -v -X GET https://api.sandbox.paypal.com/v1/payments/refund/4GU360220B627614A \
-H "Content-Type:application/json" \
-H "Authorization: Bearer Access-Token" \
-d '{}'

Response

successful request returns the HTTP 200 OK status code and a JSON response body that shows refund details.
  • id

    string

    The ID of the refund transaction. Maximum length is 17 characters.
  • amount

    object

    The refund amount. Includes both the amount refunded to the payer and amount of the fee refunded to the payee.
  • state

    enum

    The state of the refund.

    Possible values: pending, completed, cancelled, failed.

  • reason

    string

    The reason that the transaction is being refunded.
  • invoice_number

    string

    The invoice or tracking ID number.

    Maximum length: 127.

  • sale_id

    string

    The ID of the sale transaction being refunded.
  • capture_id

    string

    The ID of the sale transaction being refunded.
  • parent_payment

    string

    The ID of the payment on which this transaction is based.
  • description

    string

    The refund description.
  • create_time

    string

    The date and time when the refund was created, in Internet date and time format.
  • update_time

    string

    The date and time when the resource was last updated, in Internet date and time format.
  • links

    array (contains the link_description object)

    An array of request-related HATEOAS links.

Sample Response

{
  "id": "4GU360220B627614A",
  "create_time": "2017-01-01T02:00:00Z",
  "update_time": "2017-01-01T03:00:02Z",
  "state": "completed",
  "amount": {
    "total": "2.34",
    "currency": "USD"
  },
  "sale_id": "36C38912MN9658832",
  "parent_payment": "PAY-5YK922393D847794YKER7MUI",
  "invoice_number": "INV-1234567",
  "links": [
    {
      "href": "https://api.sandbox.paypal.com/v1/payments/refund/4GU360220B627614A",
      "rel": "self",
      "method": "GET"
    },
    {
      "href": "https://api.sandbox.paypal.com/v1/payments/payment/PAY-5YK922393D847794YKER7MUI",
      "rel": "parent_payment",
      "method": "GET"
    },
    {
      "href": "https://api.sandbox.paypal.com/v1/payments/sale/36C38912MN9658832",
      "rel": "sale",
      "method": "GET"
    }
  ]
}

Common object definitions

address

  • line1

    string

    required

    The first line of the address. For example, number, street, and so on.
  • line2

    string

    Optional. The second line of the address. For example, suite, apartment number, and so on.
  • city

    string

    The city name.
  • country_code

    string

    required

    The two-character ISO 3166-1 code that identifies the country or region.
    Note: The country code for Great Britain is GB and not UK as is used in that country's top-level domain names. Use the C2 country code for CHINA WORLDWIDE for CUP, bank card, and cross-border transactions.
  • postal_code

    string

    The postal code, which is the zip code or equivalent. Typically required for countries with a postal code or an equivalent. See Postal code.
  • state

    string

    The code for a US state or the equivalent for other countries. Required for transactions if the address is in one of these countries: Argentina, Brazil, Canada, India, Italy, Japan, Mexico, Thailand, or United States. Maximum length is 40 single-byte characters.
  • phone

    string

    The phone number, in E.123 format. Maximum length is 50 characters.
  • normalization_status

    enum

    The address normalization status. Returned only for payers from Brazil.

    Possible values: UNKNOWN, UNNORMALIZED_USER_PREFERRED, NORMALIZED, UNNORMALIZED.

  • status

    enum

    The address status.

    Possible values: CONFIRMED, UNCONFIRMED.

  • type

    string

    The type of address. For example, HOME_OR_WORK, GIFT, and so on.

amount

  • currency

    string

    required

    The three-character ISO-4217 currency code. PayPal does not support all currencies.
  • total

    string

    required

    The total amount charged to the payee by the payer. For refunds, represents the amount that the payee refunds to the original payer. Maximum length is 10 characters. Supports two decimal places.
  • details

    object

    The additional details about the payment amount.

authorization

  • id

    string

    The ID of the authorization.
  • amount

    object

    required

    The amount being authorized.
  • payment_mode

    enum

    The payment mode of the authorization.

    Possible values: INSTANT_TRANSFER.

  • state

    enum

    The authorization state.

    Possible values: pending, authorized, partially_captured, captured, expired, voided.

  • reason_code

    enum

    The reason code for the pending transaction state.

    Possible values: AUTHORIZATION.

  • pending_reason

    enum

    [DEPRECATED] The reason code for the pending transaction state. Obsolete. Use reason_code instead.

    Possible values: AUTHORIZATION.

  • protection_eligibility

    enum

    The level of seller protection present for the transaction. Supported for the PayPal payment method only. Value is:
    • ELIGIBLE. Merchant is protected by PayPal's Seller Protection Policy for Unauthorized Payments and Item Not Received.
    • PARTIALLY_ELIGIBLE. Merchant is protected by PayPal's Seller Protection Policy for Item Not Received or Unauthorized Payments. For details, see protection_eligibility_type.
    • INELIGIBLE. Merchant is not protected under the Seller Protection Policy.

    Possible values: ELIGIBLE, PARTIALLY_ELIGIBLE, INELIGIBLE.

  • protection_eligibility_type

    enum

    The type of seller protection present for the transaction. Returned only when the protection_eligibility property is ELIGIBLE or PARTIALLY_ELIGIBLE. Supported for the PayPal payment method only.

    Returns one or both of the allowed values.

    Value is:
    • ITEM_NOT_RECEIVED_ELIGIBLE. Sellers are protected against claims for items not received.
    • UNAUTHORIZED_PAYMENT_ELIGIBLE. Sellers are protected against claims for unauthorized payments.

    Possible values: ITEM_NOT_RECEIVED_ELIGIBLE, UNAUTHORIZED_PAYMENT_ELIGIBLE, ITEM_NOT_RECEIVED_ELIGIBLE,UNAUTHORIZED_PAYMENT_ELIGIBLE.

  • fmf_details

    object

    The Fraud Management Filter (FMF) details that are applied to the payment that result in an accept, deny, or pending action. Returned in a payment response only if the merchant has enabled FMF in the profile settings and one of the fraud filters was triggered based on those settings. For more information, see Fraud Management Filters Summary.
  • parent_payment

    string

    The ID of the payment on which this transaction is based.
  • processor_response

    object

    The processor-provided response codes that describe the submitted payment. Supported only when the payment_method is set to credit_card.
  • valid_until

    string

    The date and time when the authorization expires, in Internet date and time format.
  • create_time

    string

    The date and time when the authorization was created, in Internet date and time format.
  • update_time

    string

    The date and time when the authorization was last updated, in Internet date and time format.
  • reference_id

    string

    The ID of the purchase or transaction unit that corresponds to this authorization transaction.

    Maximum length: 256.

  • receipt_id

    string

    The receipt ID, which identifies the payment. Value is 16-digit numeric payment ID number that is returned for guest users.

    Pattern: ^[0-9]{4}-[0-9]{4}-[0-9]{4}-[0-9]{4}$.

  • links

    array (contains the link_description object)

    An array of request-related HATEOAS links.

bank_account

  • account_number

    string

    required

    The account number in either:

    Maximum length: 34.

  • account_number_type

    enum

    required

    The type of the bank account number, which is an International Bank Account Number (IBAN) or Basic Bank Account Number (BBAN).

    Possible values: BBAN, IBAN.

  • routing_number

    string

    The routing transit number, or bank code, of the bank. Typically used for domestic accounts only. For international accounts, the IBAN includes the bank code. For more information, see Bank code.

    Maximum length: 34.

  • account_type

    enum

    The bank account type.

    Possible values: CHECKING, SAVINGS.

  • account_name

    string

    The customer-designated account name.

    Maximum length: 64.

  • check_type

    enum

    The check type. Valid when the facilitator or merchant obtained this information from a check.

    Possible values: PERSONAL, COMPANY.

  • auth_type

    enum

    The method by which the check was obtained from the customer, if a check was the source of the information.

    Possible values: CCD, PPD, TEL, POP, ARC, RCK, WEB.

  • auth_capture_timestamp

    string

    The date and time when the authorization was captured, in Internet date and time format. Use this field if the user authorization must be captured due to any privacy requirements.
  • bank_name

    string

    The bank name.

    Maximum length: 64.

  • country_code

    string

    The two-character ISO 3166-1 code that identifies the country or region of the account holder.
    Note: The country code for Great Britain is GB and not UK as is used in that country's top-level domain names. Use the C2 country code for CHINA WORLDWIDE for CUP, bank card, and cross-border transactions.
  • first_name

    string

    The account holder's first name.

    Maximum length: 64.

  • last_name

    string

    The account holder's last name.

    Maximum length: 64.

  • birth_date

    string

    The account holder's birth date, in Internet date format.
  • billing_address

    object

    The billing address.
  • state

    enum

    The funding instrument's state.

    Possible values: ACTIVE, INACTIVE, DELETED.

  • confirmation_status

    enum

    The bank account's confirmation status.

    Possible values: UNCONFIRMED, CONFIRMED.

  • payer_id

    string

    [DEPRECATED] The payer ID. Use external_customer_id instead.
  • external_customer_id

    string

    The facilitor-provided ID of the customer to whom this bank account belongs. Required when you create or use a funding instrument that is stored in the vault.

    Maximum length: 256.

  • merchant_id

    string

    The facilitator-provided ID of the merchant for which this bank account has been stored. Usage of the bank account is restricted to the specific merchant.

    Maximum length: 256.

  • create_time

    string

    The date and time when the resource was created, in Internet date and time format.
  • update_time

    string

    The date and time when the resource was last updated, in Internet date and time format.
  • valid_until

    string

    The date and time when the resource can no longer be used to fund a payment, in Internet date and time format.
  • links

    array (contains the link_description object)

    An array of request-related HATEOAS links.

capture

  • id

    string

    The ID of the capture transaction.
  • amount

    object

    The amount to capture. If the amount matches the originally authorized amount, the state of the authorization changes to captured. Otherwise, the state of the authorization changes to partially_captured.
  • is_final_capture

    boolean

    Indicates whether to release all remaining funds that the authorization holds in the funding instrument (FI). Default is false.
  • state

    enum

    The capture state. Value is:
    • pending. The capture is pending.
    • completed. The capture has successfully completed.
    • refunded. The capture was fully refunded.
    • partially_refunded. The capture was partially refunded.

    Possible values: pending, completed, refunded, partially_refunded.

  • reason_code

    enum

    The reason code that describes why the transaction state is pending or reversed.

    Possible values: CHARGEBACK, GUARANTEE, BUYER_COMPLAINT, REFUND, UNCONFIRMED_SHIPPING_ADDRESS, ECHECK, INTERNATIONAL_WITHDRAWAL, RECEIVING_PREFERENCE_MANDATES_MANUAL_ACTION, PAYMENT_REVIEW, REGULATORY_REVIEW, UNILATERAL, VERIFICATION_REQUIRED, TRANSACTION_APPROVED_AWAITING_FUNDING.

  • parent_payment

    string

    The ID of the payment on which this transaction is based.
  • invoice_number

    string

    The invoice number to track this payment.

    Maximum length: 127.

  • transaction_fee

    object

    The transaction fee for this payment.
  • create_time

    string

    The date and time when the capture occurred, in Internet date and time format as defined in RFC 3339 Section 5.6.
  • update_time

    string

    The date and time when the resource was last updated, in Internet date and time format as defined in RFC 3339 Section 5.6.
  • links

    array (contains the link_description object)

    An array of request-related HATEOAS links.

cart_base

  • reference_id

    string

    Optional. The merchant-provided ID for the purchase unit.

    Maximum length: 256.

  • amount

    object

    required

    The amount to collect.
  • payee

    object

    The recipient of the funds in this transaction.
  • description

    string

    The description of the purchase.

    Maximum length: 127.

  • note_to_payee

    string

    Optional. A note to the recipient of the funds in this transaction.

    Maximum length: 255.

  • custom

    string

    A free-form field for the client's use.

    Maximum length: 127.

  • invoice_number

    string

    The invoice number to track this payment.

    Maximum length: 127.

  • purchase_order

    string

    The purchase order number or ID. Identifies this payment.

    Maximum length: 127.

  • soft_descriptor

    string

    The soft descriptor that is used when charging this funding source. Maximum length is 22 characters. If you include a value that is greater than 22 characters, the API truncates the string.

    Maximum length: 22.

  • payment_options

    object

    The payment options requested for this transaction.
  • item_list

    object

    An array of items that are being purchased.
  • notify_url

    string

    The URL to send payment notifications.

    Maximum length: 2048.

  • order_url

    string

    The URL on the merchant site related to this payment.

    Maximum length: 2048.

country_code

  • country_code

    string

    The two-character ISO 3166-1 code that identifies the country or region.
    Note: The country code for Great Britain is GB and not UK as 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.

    Minimum length: 2.

    Maximum length: 2.

    Pattern: ^([A-Z]{2}|C2)$.

credit_card

  • number

    string

    required

    The credit card number. Value is numeric characters only with no spaces or punctuation. Must conform to the modulo and length required by each credit card type. Redacted in responses.
  • type

    string

    required

    The credit card type. Value is visa, mastercard, discover, or amex.
  • expire_month

    integer

    required

    The expiration month with no leading zero. Value is from 1 to 12.
  • expire_year

    integer

    required

    The four-digit expiration year.
  • cvv2

    string

    The three- to four-digit card validation code.
  • first_name

    string

    The card holder's first name.
  • last_name

    string

    The card holder's last name.
  • billing_address

    object

    The billing address associated with this card.
  • links

    array (contains the link_description object)

    An array of request-related HATEOAS links.

credit_card_token

  • credit_card_id

    string

    required

    The ID of credit card that is stored in the PayPal vault.
  • payer_id

    string

    A unique ID that you can assign and track when you store a credit card in the vault or use a vaulted credit card. This ID can help to avoid unintentional use or misuse of credit cards. This ID can be any value you would like to associate with the saved card, such as a UUID, user name, or email address. Required when you use a vaulted credit card if a payer_id was originally provided when you vaulted the credit card.
  • last4

    string

    The last four digits of the stored credit card number.
  • type

    string

    The credit card type. Value is visa, mastercard, discover, or amex. Values are in lowercase; do not use these values for display.
  • expire_month

    integer

    The expiration month with no leading zero. Value is from 1 to 12.
  • expire_year

    integer

    The four-digit expiration year.

currency

  • currency

    string

    required

    The three-character ISO-4217 currency code. PayPal does not support all currencies.
  • value

    string

    required

    The amount, up to N digits after the decimal separator, as defined in ISO-4217 for the appropriate currency code.

currency_conversion

  • conversion_date

    string

    The date and time when the conversion rate becomes no longer valid, in Internet date and time format.
  • from_currency

    string

    required

    The three-character ISO-4217 currency code of the currency from which to convert the from amount.
  • from_amount

    string

    required

    The from amount, which is the pre-currency conversion value. Default is 1.

    Minimum value: 1.

  • to_currency

    string

    required

    The three-character ISO-4217 currency code of the currency into which to convert the from amount.
  • to_amount

    string

    required

    The to amount, which is the post-currency conversion value.

    Minimum value: 0.

  • conversion_type

    enum

    The conversion type to apply.

    Possible values: PAYPAL, VENDOR.

    Default: PAYPAL.

  • conversion_type_changeable

    boolean

    Indicates whether the payer can or cannot change the conversion type.
  • spread

    string

    The rate, as a percentage, that PayPal charges above the foreign exchange rate provided by PayPal’s financial partners.

    Minimum value: 0.

    Maximum value: 100.

  • links

    array (contains the link_description object)

    An array of request-related HATEOAS links.

detailed_refund

  • id

    string

    The ID of the refund transaction.

    Maximum length: 17.

  • amount

    object

    The refund amount. Includes both the amount refunded to the payer and the fee refunded to the payee.
  • state

    enum

    The state of the refund.

    Possible values: pending, completed, cancelled, failed.

  • reason

    string

    The reason that the transaction is being refunded.
  • invoice_number

    string

    Your own invoice or tracking ID number. Value is a string of single-byte alphanumeric characters.

    Maximum length: 127.

  • sale_id

    string

    The ID of the sale transaction being refunded.
  • capture_id

    string

    The ID of the sale transaction being refunded.
  • parent_payment

    string

    The ID of the payment on which this transaction is based.
  • description

    string

    The refund description.
  • create_time

    string

    The date and time when the refund was created, in Internet date and time format.
  • update_time

    string

    The date and time when the resource was last updated, in Internet date and time format.
  • links

    array (contains the link_description object)

    An array of request-related HATEOAS links.
  • custom

    string

    A free-form field for the clients' use.

    Maximum length: 127.

  • invoice_number

    string

    The invoice number to track this payment.

    Maximum length: 127.

  • refund_from_transaction_fee

    object

    The transaction fee that is refunded to original the recipient of payment.
  • refund_from_received_amount

    object

    The amount subtracted from the original payment recipient's PayPal balance to make this refund.
  • total_refunded_amount

    object

    The total amount refunded from the original purchase. For example, if a payer makes $100 purchase and the payer was refunded $20 a week ago and $30 in this transaction, the gross refund amount is $30 for this transaction and the total refunded amount is $50.

details

  • subtotal

    string

    The subtotal amount for the items. If the request includes line items, this property is required. Maximum length is 10 characters. Supports two decimal places.
  • shipping

    string

    The shipping fee. Maximum length is 10 characters. Supports two decimal places.
  • tax

    string

    The tax. Maximum length is 10 characters. Supports two decimal places.
  • handling_fee

    string

    The handling fee. Supported for the PayPal payment method only.
  • shipping_discount

    string

    The shipping fee discount. Supported for the PayPal payment method only.
  • insurance

    string

    The insurance fee. Supported only for the PayPal payment method.
  • gift_wrap

    string

    The gift wrap fee.

display_phone

email_address

  • email_address

    string

    A valid internationalized email address.
    Note: 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.

    Minimum length: 3.

    Maximum length: 254.

    Pattern: ^.+@[^"\-].+$.

error

  • name

    string

    required

    A human-readable, unique name of the error.
  • message

    string

    required

    A message that describes the error.
  • debug_id

    string

    required

    PayPal internal ID that is used for correlation purposes.
  • information_link

    string

    An information link, or URI, that shows detailed information about this error for the developer.
  • details

    array (contains the error_details object)

    An array of additional details about the error.
  • links

    array (contains the link_description object)

    An array of request-related HATEOAS links.

error_details

  • field

    string

    The field that caused the error. If the field is in the body, set this value to the JSON pointer to that field. Required for client-side errors.
  • value

    string

    The value of the field that caused the error.
  • location

    string

    The location of the field that caused the error. A valid value is body, path, or query. Default is body.
  • issue

    string

    required

    The reason for the error.

fmf_details

  • filter_type

    enum

    required

    The filter type.

    Possible values: ACCEPT, PENDING, DENY, REPORT.

  • filter_id

    enum

    required

    The filter ID.

    Possible values: AVS_NO_MATCH, AVS_PARTIAL_MATCH, AVS_UNAVAILABLE_OR_UNSUPPORTED, CARD_SECURITY_CODE_MISMATCH, MAXIMUM_TRANSACTION_AMOUNT, UNCONFIRMED_ADDRESS, COUNTRY_MONITOR, LARGE_ORDER_NUMBER, BILLING_OR_SHIPPING_ADDRESS_MISMATCH, RISKY_ZIP_CODE, SUSPECTED_FREIGHT_FORWARDER_CHECK, TOTAL_PURCHASE_PRICE_MINIMUM, IP_ADDRESS_VELOCITY, RISKY_EMAIL_ADDRESS_DOMAIN_CHECK, RISKY_BANK_IDENTIFICATION_NUMBER_CHECK, RISKY_IP_ADDRESS_RANGE, PAYPAL_FRAUD_MODEL.

  • name

    string

    The filter name.
  • description

    string

    The filter description.

funding_detail

  • clearing_time

    string

    The date and time when the funds are expected to clear, in Internet date and time format.
  • payment_hold_date

    string

    [DEPRECATED] The date and time when the payment will no longer be held, in Internet date and time format. Instead, use the payment_debit_date.
  • payment_debit_date

    string

    The date and time when the funds will be debited from the payer's account, in Internet date and time format.
  • processing_type

    enum

    The processing type of the payment card.

    Possible values: CUP_SECURE, PINLESS_DEBIT.

funding_instrument

  • credit_card

    object

    The credit card instrument.
  • credit_card_token

    object

    The PayPal vaulted credit card instrument.

funding_source

  • credit_card

    object

    The credit card instrument.
  • credit_card_token

    object

    The PayPal vaulted credit card instrument.
  • funding_mode

    enum

    required

    The funding mode of the funding source.

    Possible values: INSTANT_TRANSFER, MANUAL_BANK_TRANSFER, DELAYED_TRANSFER, ECHECK, PAY_UPON_INVOICE.

  • funding_instrument_type

    enum

    required

    The instrument type for this funding source.

    Possible values: BALANCE, PAYMENT_CARD, BANK_ACCOUNT, CREDIT, INCENTIVE, EXTERNAL_FUNDING, TAB.

  • soft_descriptor

    string

    The soft descriptor for charging this funding source.

    Maximum length: 22.

  • amount

    object

    required

    The total amount to pull from the funding source.
  • negative_balance_amount

    array

    An array of additional amounts to pull from the source to recover a negative balance on the buyer's account that is owed to PayPal.
  • legal_text

    string

    The localized legal text for the funding source.
  • terms

    string

    The URL to legal terms for the funding source.
  • funding_detail

    object

    The additional details for the funding source.
  • funding_selection_preference

    enum

    The preferred way to select this funding source.

    Possible values: NONE, WALLET_PREFERRED, PAYMENT_PREFERRED, SYSTEM_DEFAULTED.

  • additional_text

    string

    Additional text for the funding source.
  • links

    array (contains the link_description object)

    An array of request-related HATEOAS links.

installment_info

  • installment_id

    string

    The installment ID.
  • network

    enum

    The credit card network.

    Possible values: VISA, MASTERCARD.

  • issuer

    string

    The credit card issuer.
  • installment_options

    array (contains the installment_option object)

    required

    An array of installment options and the cost associated with each one.

installment_option

  • term

    integer

    required

    The number of installments.
  • monthly_payment

    object

    required

    The monthly payment.
  • discount_amount

    object

    The discount amount applied to the payment, if any.
  • discount_percentage

    string

    The discount percentage applied to the payment, if any.

item

  • sku

    string

    The stock keeping unit (SKU) for the item.

    Maximum length: 127.

  • name

    string

    required

    The item name. Maximum length is 127 characters.
  • description

    string

    The item description. Supported only for the PayPal payment method.

    Maximum length: 127.

  • quantity

    string

    required

    The item quantity. Maximum length is 10 characters.
  • price

    string

    required

    The item cost. Maximum length is 10 characters.
  • currency

    string

    required

  • tax

    string

    The item tax. Supported only for the PayPal payment method.
  • url

    string

    The URL to item information. Available to the payer in the transaction history.

item_list

  • items

    array (contains the item object)

    An array of items that are being purchased.
  • shipping_address

    object

    The shipping address.
  • shipping_method

    string

    The shipping method used for this payment, such as USPS Parcel.
  • shipping_phone_number

    string

    The shipping phone number, in its canonical international format as defined by the E.164 numbering plan. Enables merchants to share payer’s contact number with PayPal for the current payment. The final contact number for the payer who is associated with the transaction might be the same as or different from the shipping_phone_number based on the payer’s action on PayPal.

order

  • id

    string

    The ID of the order transaction.
  • reference_id

    string

    The ID of the purchase unit that is associated with this object. Obsolete. Used only in cart_base.
  • amount

    object

    required

    The amount to collect.
  • payment_mode

    enum

    The transaction payment mode.

    Possible values: INSTANT_TRANSFER, MANUAL_BANK_TRANSFER, DELAYED_TRANSFER, ECHECK.

  • state

    enum

    The order transaction state.

    Possible values: pending, completed, voided, authorized, captured.

  • reason_code

    enum

    The reason code that describes why the transaction state is pending or reversed. Eventually, this parameter will replace the pending_reason parameter. Supported only when the payment_method is paypal.

    Possible values: PAYER_SHIPPING_UNCONFIRMED, MULTI_CURRENCY, RISK_REVIEW, REGULATORY_REVIEW, VERIFICATION_REQUIRED, ORDER, OTHER.

  • pending_reason

    enum

    [DEPRECATED] The reason code for the pending transaction state. Obsolete. Use reason_code instead.

    Possible values: payer_shipping_unconfirmed, multi_currency, risk_review, regulatory_review, verification_required, order, other.

  • protection_eligibility

    enum

    The level of seller protection in effect for the transaction.

    Possible values: ELIGIBLE, PARTIALLY_ELIGIBLE, INELIGIBLE.

  • protection_eligibility_type

    enum

    The kind of seller protection in effect for the transaction. Returned only when the protection_eligibility property is ELIGIBLE or PARTIALLY_ELIGIBLE. Supported only when the payment_method is paypal. One or both of these values can be returned:
    • ITEM_NOT_RECEIVED_ELIGIBLE. Sellers are protected against claims for items not received.
    • UNAUTHORIZED_PAYMENT_ELIGIBLE. Sellers are protected against claims for unauthorized payments.

    Possible values: ITEM_NOT_RECEIVED_ELIGIBLE, UNAUTHORIZED_PAYMENT_ELIGIBLE, ITEM_NOT_RECEIVED_ELIGIBLE,UNAUTHORIZED_PAYMENT_ELIGIBLE.

  • parent_payment

    string

    The ID of the payment on which this transaction is based.
  • fmf_details

    object

    The fraud management filter (FMF) details applied for the payment that can result in an accept, deny, or pending action.
  • create_time

    string

    The date and time when the resource was created, in Internet date and time format.
  • update_time

    string

    The date and time when the resource was last updated, in Internet date and time format.
  • links

    array (contains the link_description object)

    An array of request-related HATEOAS links.

patch

  • op

    enum

    required

    The operation to complete.

    Possible values: add, remove, replace, move, copy, test.

  • path

    string

    A JSON pointer to a location in the target document at which to complete the operation.
  • value

    number,integer,string,boolean,null,array,object

    The value to apply. The remove operation does not require a value.
  • from

    string

    A JSON pointer to the location in the target document from which to move the value. Required for the move operation.

patch_request

  • patch_request

    array (contains the patch object)

    An array of JSON patch objects to apply partial updates to resources.

payee

  • email

    string

    The email address associated with the payee's PayPal account. If the provided email address is not associated with any PayPal account, the payee can only receive PayPal Wallet payments. Direct credit card payments are denied due to card compliance requirements.
  • merchant_id

    string

    The encrypted PayPal account ID for the payee.
  • payee_display_metadata

    object

    Payee metadata references display only metadata for the Payee

payee_display_metadata

  • email

    string

    The email address for the payer. Maximum length is 127 characters.
  • display_phone

    object

    The payee's phone number.
  • brand_name

    string

    The payer's business name.

payer

  • payment_method

    enum

    The payment method. Value is PayPal Wallet payment, bank direct debit, or direct credit card.

    Possible values: credit_card, paypal.

  • status

    enum

    The status of payer's PayPal account.

    Possible values: VERIFIED, UNVERIFIED.

  • funding_instruments

    array (contains the funding_instrument object)

    An array of a single funding instrument for the current payment. Valid only and required for the credit card payment method. The array must include either a credit_card or credit_card_token object. If the array contains more than one instrument, the payment is declined.
  • payer_info

    object

    The payer-related information. If the payment_method is paypal, you must set the email address of the PayPal account that funds the transaction in the payer_info.

payer_info

  • email

    string

    The payer's email address. Maximum length is 127 characters.
  • salutation

    string

    The payer's salutation.
  • first_name

    string

    The payer's first name.
  • middle_name

    string

    The payer's middle name.
  • last_name

    string

    The payer's last name.
  • suffix

    string

    The payer's suffix.
  • payer_id

    string

    The PayPal-assigned encrypted payer ID.
  • phone

    string

    The payer's phone number. Maximum length is 20 characters.
  • phone_type

    enum

    The phone type.

    Possible values: HOME, WORK, MOBILE, OTHER.

  • birth_date

    string

    The birth date of the payer, in Internet date format. For example, 1990-04-12.
  • tax_id

    string

    The payer’s tax ID. Supported for the PayPal payment method only.

    Maximum length: 14.

  • tax_id_type

    enum

    The payer’s tax ID type. Supported for the PayPal payment method only.

    Possible values: BR_CPF, BR_CNPJ.

  • country_code

    string

  • billing_address

    object

    The payer's billing address.
  • shipping_address

    object

    [DEPRECATED] The shipping address. Use the shipping address for the purchase unit or at the root level of the checkout session.

payer_notification

  • email

    object

    The email address that is associated with the payer's PayPal account.

payment

  • id

    string

    The ID of the payment.
  • intent

    enum

    required

    The payment intent. Value is:

    Possible values: sale, authorize, order.

  • payer

    object

    required

    The source of the funds for this payment. Payment method is PayPal Wallet payment or bank direct debit.
  • transactions

    array (contains the transaction object)

    An array of payment-related transactions. A transaction defines what the payment is for and who fulfills the payment. For update and execute payment calls, the transactions object accepts the amount object only.
  • state

    enum

    The state of the payment, authorization, or order transaction. Value is:
    • created. The transaction was successfully created.
    • approved. The buyer approved the transaction.
    • failed. The transaction request failed.

    Possible values: created, approved, failed.

  • experience_profile_id

    string

    The PayPal-generated ID for the merchant's payment experience profile. For information, see create web experience profile.
  • note_to_payer

    string

    A free-form field that clients can use to send a note to the payer.

    Maximum length: 165.

  • redirect_urls

    object

    A set of redirect URLs that you provide for PayPal-based payments.
  • failure_reason

    enum

    The reason code for a payment failure.

    Possible values: UNABLE_TO_COMPLETE_TRANSACTION, INVALID_PAYMENT_METHOD, PAYER_CANNOT_PAY, CANNOT_PAY_THIS_PAYEE, REDIRECT_REQUIRED, PAYEE_FILTER_RESTRICTIONS.

  • create_time

    string

    The date and time when the payment was created, in Internet date and time format.
  • update_time

    string

    The date and time when the payment was updated, in Internet date and time format.
  • links

    array (contains the link_description object)

    An array of request-related HATEOAS links.

payment_execution

  • payer_id

    string

    The ID of the payer that PayPal passes in the return_url.
  • transactions

    array (contains the cart_base object)

    An array of transaction details. Includes the amount and item details. For update and execute payment calls, the transactions object accepts only the amount object.

payment_history

  • payments

    array (contains the payment object)

    An array of payments.
  • count

    integer

    The number of items returned in each range of results. Note that the last results range might have fewer items than the requested number of items. The maximum value is 20.
  • next_id

    string

    The ID of the next element. Use to get the next range of results.

payment_hold_reason

  • payment_hold_reason

    enum

    The payment hold reason.

    Possible values: PAYMENT_HOLD, SHIPPING_RISK_HOLD.

payment_instruction

  • reference_number

    string

    required

    The ID of the payment instruction.

    Maximum length: 128.

  • instruction_type

    enum

    required

    The payment instruction type.

    Possible values: MANUAL_BANK_TRANSFER, PAY_UPON_INVOICE.

  • recipient_banking_instruction

    object

    required

    The recipient bank details.
  • amount

    object

    required

    The amount to transfer.
  • payment_due_date

    string

    The date and time when the payment is due, in Internet date and time format.
  • note

    string

    A note about payment handling.

    Maximum length: 256.

  • links

    array (contains the link_description object)

    An array of request-related HATEOAS links.

payment_options

  • allowed_payment_method

    enum

    The payment method requested for this transaction. This field does not apply to the credit card payment method.

    Possible values: UNRESTRICTED, INSTANT_FUNDING_SOURCE, IMMEDIATE_PAY.

percentage

  • percentage

    string

    A percentage as a fixed-point, signed decimal value. Use for all interest rates. For example, represent an interest rate of 19.99% as 19.99. The allowed number formats are plain decimal numbers and whole numbers. Unlike a JSON number or JSON Schema number type, this value MUST NOT be deserialized in JavaScript into a JavaScript Number object, which is 64-bit floating-point and cannot accurately represent all values transmitted by this type. Likewise, in Java, this type MUST be deserialized into a BigDecimal or other fixed-point numeric type.

    Pattern: ^((-?[0-9]+)|(-?([0-9]+)?[.][0-9]+))$.

processor_response

  • response_code

    string

    required

    The PayPal normalized response code, which is generated from the processor's specific response code.

    Maximum length: 4.

  • avs_code

    string

    Maximum length: 1.

    Pattern: [A-z0-9]{1}.

  • cvv_code

    string

    The CVV system response code.

    Maximum length: 1.

    Pattern: [A-z0-9]{1}.

  • advice_code

    enum

    The merchant advice on how to handle declines for recurring payments.

    Possible values: 01_NEW_ACCOUNT_INFORMATION, 02_TRY_AGAIN_LATER, 02_STOP_SPECIFIC_PAYMENT, 03_DO_NOT_TRY_AGAIN, 03_REVOKE_AUTHORIZATION_FOR_FUTURE_PAYMENT, 21_DO_NOT_TRY_AGAIN_CARD_HOLDER_CANCELLED_RECURRRING_CHARGE, 21_CANCEL_ALL_RECURRING_PAYMENTS.

  • eci_submitted

    string

    The processor-provided authorization response.
  • vpas

    string

    The processor-provided Visa Payer Authentication Service status.

receipt

  • id

    string

    The ID of the receipt that was created for guest payments.
  • transaction_id

    string

    The ID of the receipt that was created for member payments. This ID is a debit-side transaction ID.
  • funding_sources

    array (contains the funding_source object)

    An array of funding sources that are used for payment.
  • items

    array (contains the item object)

    An array of items.
  • shipping_address

    object

    The shipping address.
  • exchange_rate

    string

    The exchange rate that is applied for this transaction. Returned when the merchant-receiving currency is different from the transaction currency.

    Pattern: ^(([0-9]+)|(([0-9]+)?[.][0-9]+))$.

  • payee

    object

    The receiver of funds for this payment. Readonly for PayPal external REST payments.
  • payer_notification

    object (contains the payer_notification object)

    The notification information for a payer.
  • amount

    object

    The amount being collected.
  • create_time

    string

    The date and time when the payment was created, in Internet date and time format.
  • links

    array (contains the link_description object)

    An array of request-related HATEOAS links.

recipient_banking_instruction

  • bank_name

    string

    required

    The financial institution name.

    Maximum length: 64.

  • account_holder_name

    string

    required

    The account holder name.

    Maximum length: 128.

  • account_number

    string

    The bank account number.

    Maximum length: 34.

  • routing_number

    string

    The bank routing number.

    Maximum length: 34.

  • international_bank_account_number

    string

    required

    The international bank account number (IBAN) equivalent of the bank.

    Maximum length: 34.

  • bank_identifier_code

    string

    The bank identifier code (BIC) of the financial institution.

    Maximum length: 34.

redirect_urls

  • return_url

    string

    The URL where the payer is redirected after he or she approves the payment. Required for PayPal account payments.
  • cancel_url

    string

    The URL where the payer is redirected after he or she cancels the payment. Required for PayPal account payments.

refund

  • id

    string

    The ID of the refund transaction.

    Maximum length: 17.

  • amount

    object

    The refund amount. Includes both the amount refunded to the payer and the fee refunded to the payee.
  • state

    enum

    The state of the refund.

    Possible values: pending, completed, cancelled, failed.

  • reason

    string

    The reason that the transaction is being refunded.
  • invoice_number

    string

    Your own invoice or tracking ID number. Value is a string of single-byte alphanumeric characters.

    Maximum length: 127.

  • sale_id

    string

    The ID of the sale transaction being refunded.
  • capture_id

    string

    The ID of the sale transaction being refunded.
  • parent_payment

    string

    The ID of the payment on which this transaction is based.
  • description

    string

    The refund description.
  • create_time

    string

    The date and time when the refund was created, in Internet date and time format.
  • update_time

    string

    The date and time when the resource was last updated, in Internet date and time format.
  • links

    array (contains the link_description object)

    An array of request-related HATEOAS links.

refund

  • id

    string

    The ID of the refund transaction. Maximum length is 17 characters.
  • amount

    object

    The refund amount. Includes both the amount refunded to the payer and amount of the fee refunded to the payee.
  • state

    enum

    The state of the refund.

    Possible values: pending, completed, cancelled, failed.

  • reason

    string

    The reason that the transaction is being refunded.
  • invoice_number

    string

    The invoice or tracking ID number.

    Maximum length: 127.

  • sale_id

    string

    The ID of the sale transaction being refunded.
  • capture_id

    string

    The ID of the sale transaction being refunded.
  • parent_payment

    string

    The ID of the payment on which this transaction is based.
  • description

    string

    The refund description.
  • create_time

    string

    The date and time when the refund was created, in Internet date and time format.
  • update_time

    string

    The date and time when the resource was last updated, in Internet date and time format.
  • links

    array (contains the link_description object)

    An array of request-related HATEOAS links.

refund_request

  • amount

    object

    The refund amount. Includes both the amount refunded to the payer and amount of the fee refunded to the payee.
  • description

    string

    The refund description. Value is a string of single-byte alphanumeric characters.

    Maximum length: 255.

  • reason

    string

    The refund reason description.

    Maximum length: 30.

  • invoice_number

    string

    The invoice number that is used to track this payment. Value is a string of single-byte alphanumeric characters.

    Maximum length: 127.

sale

  • id

    string

    required

    The ID of the sale transaction.
  • purchase_unit_reference_id

    string

    The ID of the transaction that corresponds to this sale transaction.
  • amount

    object

    required

    The amount being collected.
  • payment_mode

    enum

    The transaction payment mode. Supported only when payment_method is paypal.

    Possible values: INSTANT_TRANSFER, MANUAL_BANK_TRANSFER, DELAYED_TRANSFER, ECHECK.

  • state

    enum

    required

    The sale transaction state.

    Possible values: completed, partially_refunded, pending, refunded, denied.

  • reason_code

    enum

    A reason code that describes why the transaction state is pending or reversed. Supported only when the payment_method is paypal.

    Possible values: CHARGEBACK, GUARANTEE, BUYER_COMPLAINT, REFUND, UNCONFIRMED_SHIPPING_ADDRESS, ECHECK, INTERNATIONAL_WITHDRAWAL, RECEIVING_PREFERENCE_MANDATES_MANUAL_ACTION, PAYMENT_REVIEW, REGULATORY_REVIEW, UNILATERAL, VERIFICATION_REQUIRED, TRANSACTION_APPROVED_AWAITING_FUNDING.

  • protection_eligibility

    enum

    The seller protection level in effect for the transaction. Supported only when the payment_method is paypal.

    Possible values: ELIGIBLE, PARTIALLY_ELIGIBLE, INELIGIBLE.

  • protection_eligibility_type

    enum

    The seller protection type in effect for the transaction. Returned only when protection_eligibility is ELIGIBLE or PARTIALLY_ELIGIBLE. Supported only when the payment_method is paypal.

    Possible values: ITEM_NOT_RECEIVED_ELIGIBLE, UNAUTHORIZED_PAYMENT_ELIGIBLE, ITEM_NOT_RECEIVED_ELIGIBLE,UNAUTHORIZED_PAYMENT_ELIGIBLE.

  • clearing_time

    string

    The date and time when the eCheck transaction is expected to clear, in Internet date and time format. Returned for eCheck payments. Supported only when the payment_method is paypal.
  • payment_hold_status

    enum

    The recipient fund status. Returned only when the fund status is held.

    Possible values: HELD.

  • payment_hold_reasons

    array (contains the payment_hold_reason object)

    An array of reasons that PayPal holds the recipient fund. Set only if the payment hold status is HELD.
  • transaction_fee

    object

    The transaction fee that applies to this payment.
  • receivable_amount

    object

    The net amount that the merchant receives for this transaction in their receivable currency. Returned only in cross-currency use cases where a merchant bills a buyer in a non-primary currency for that buyer.
  • exchange_rate

    string

    The exchange rate for this transaction. Returned only in cross-currency use cases where a merchant bills a buyer in a non-primary currency for that buyer.
  • fmf_details

    object

    The fraud management filter (FMF) details for the payment that might result in accept, deny, or pending action. Returned in a payment response only if the merchant has enabled FMF in the profile settings and one of the fraud filters was triggered based on those settings. For more information, see Fraud Management Filters Summary.
  • receipt_id

    string

    The receipt ID, which is a payment ID number that is returned for guest users to identify the payment.

    Pattern: ^[0-9]{4}-[0-9]{4}-[0-9]{4}-[0-9]{4}$.

  • parent_payment

    string

    required

    The ID of the payment on which this transaction is based.
  • processor_response

    object

    The response codes that the processor returns for the submitted payment. Supported only when the payment_method is credit_card.
    Important: The use of the PayPal REST /payments APIs to accept credit card payments is restricted. Instead, you can accept credit card payments with Braintree Direct.
  • billing_agreement_id

    string

    The ID of the billing agreement. Used as reference to execute this transaction.
  • create_time

    string

    required

    The date and time of the sale, in Internet date and time format.
  • update_time

    string

    The date and time when the resource was last updated, in Internet date and time format.
  • links

    array (contains the link_description object)

    An array of request-related HATEOAS links.

shipping_address

  • line1

    string

    required

    The first line of the address. For example, number, street, and so on.
  • line2

    string

    Optional. The second line of the address. For example, suite, apartment number, and so on.
  • city

    string

    The city name.
  • country_code

    string

    required

    The two-character ISO 3166-1 code that identifies the country or region.
    Note: The country code for Great Britain is GB and not UK as is used in that country's top-level domain names. Use the C2 country code for CHINA WORLDWIDE for CUP, bank card, and cross-border transactions.
  • postal_code

    string

    The postal code, which is the zip code or equivalent. Typically required for countries with a postal code or an equivalent. See Postal code.
  • state

    string

    The code for a US state or the equivalent for other countries. Required for transactions if the address is in one of these countries: Argentina, Brazil, Canada, India, Italy, Japan, Mexico, Thailand, or United States. Maximum length is 40 single-byte characters.
  • phone

    string

    The phone number, in E.123 format. Maximum length is 50 characters.
  • normalization_status

    enum

    The address normalization status. Returned only for payers from Brazil.

    Possible values: UNKNOWN, UNNORMALIZED_USER_PREFERRED, NORMALIZED, UNNORMALIZED.

  • status

    enum

    The address status.

    Possible values: CONFIRMED, UNCONFIRMED.

  • type

    string

    The type of address. For example, HOME_OR_WORK, GIFT, and so on.
  • recipient_name

    string

    The name of the recipient at this address.

    Maximum length: 127.

transaction

  • reference_id

    string

    Optional. The merchant-provided ID for the purchase unit.

    Maximum length: 256.

  • amount

    object

    required

    The amount to collect.
  • payee

    object

    The recipient of the funds in this transaction.
  • description

    string

    The description of the purchase.

    Maximum length: 127.

  • note_to_payee

    string

    Optional. A note to the recipient of the funds in this transaction.

    Maximum length: 255.

  • custom

    string

    A free-form field for the client's use.

    Maximum length: 127.

  • invoice_number

    string

    The invoice number to track this payment.

    Maximum length: 127.

  • purchase_order

    string

    The purchase order number or ID. Identifies this payment.

    Maximum length: 127.

  • soft_descriptor

    string

    The soft descriptor that is used when charging this funding source. Maximum length is 22 characters. If you include a value that is greater than 22 characters, the API truncates the string.

    Maximum length: 22.

  • payment_options

    object

    The payment options requested for this transaction.
  • item_list

    object

    An array of items that are being purchased.
  • notify_url

    string

    The URL to send payment notifications.

    Maximum length: 2048.

  • order_url

    string

    The URL on the merchant site related to this payment.

    Maximum length: 2048.

  • related_resources

    array (contains the related_resources object)

    An array of payment-related transactions. A transaction defines what the payment is for and who fulfills the payment.

Additional API information

Error messages

In addition to common HTTP status codes that the REST APIs return, the Payments API can return the following errors.

  • AGREEMENT_ALREADY_CANCELLED

    The requested agreement is already canceled. This error occurs when the agreement used to make the payment is already canceled.

  • AMOUNT_MISMATCH

    The totals of the cart item amounts do not match sale amounts. The amount total does not match the item amount totals.

  • AUTHORIZATION_ALREADY_COMPLETED

    Capture refused - this authorization has already been completed. Capture attempt on the authorization failed because it was already completed by one or more previous captures on authorization.

  • AUTHORIZATION_CANNOT_BE_VOIDED

    Authorization is in [x] state and hence cannot be voided. You cannot void this authorization because it is in a state, such as captured or expired, that cannot be voided.

  • AUTHORIZATION_EXPIRED

    Authorization has expired. The authorization related to this request has expired. You must reauthorize the transaction.

  • AUTHORIZATION_ID_DOES_NOT_EXIST

    The requested authorization ID does not exist. Authorization ID passed in request does not exist in PayPal system.

  • AUTHORIZATION_VOIDED

    Authorization has been voided. Authorization is already voided. You can show authorization details for a voided authorization.

  • BANK_ACCOUNT_VALIDATION_FAILED

    Bank account validation failed.

  • BUYER_NOT_SET

    Buyer is not yet set for this purchase.

  • CANNOT_PAY_SELF

    Payer cannot pay him- or herself.

  • CANNOT_REAUTH_CHILD_AUTHORIZATION

    Can only reauthorize the original authorization, not a reauthorization. Reauthorization only works on an original authorization ID.

  • CANNOT_REAUTH_INSIDE_HONOR_PERIOD

    Reauthorization is not allowed within the honor period. You can only reauthorize a payment after the three-day honor period concludes.

  • CAPTURE_AMOUNT_LIMIT_EXCEEDED

    Capture amount specified exceeded allowable limit. You can only capture up to the original authorization amount.

  • CARD_TOKEN_PAYER_MISMATCH

    payer_id does not match ID for this token. The payer_id must match the one that was provided when the credit card was stored.

  • CREDIT_CARD_CVV_CHECK_FAILED

    The credit card CVV check failed. The CVV provided for the credit card was invalid. Resend the payment with a valid CVV associated with the provided credit card.

  • CREDIT_CARD_REFUSED

    Credit card was refused. The credit card used for payment was refused. Resend the request by using another credit card.

  • CREDIT_PAYMENT_NOT_ALLOWED

    Buyer cannot use credit to complete the payment. Credit cannot be used to complete this payment. Ask the buyer to retry with alternate funding instrument.

  • CURRENCY_MISMATCH

    Currency of capture must be the same as currency of authorization. The currency used when capturing an authorization must match the original currency of the authorization.

  • CURRENCY_NOT_ALLOWED

    Currency is not supported. You are using a currency that is not currently supported.

  • DUPLICATE_REQUEST_ID

    The value of PayPal-Request-Id header has already been used. Resend the request by using a unique PayPal-Request-Id header value.

  • EXPIRED_CREDIT_CARD_TOKEN

    Credit card token is expired. Store the credit card again by using the Vault API.

  • FEATURE_UNSUPPORTED_FOR_PAYEE

    This feature is unsupported.

  • FULL_REFUND_NOT_ALLOWED_AFTER_PARTIAL_REFUND

    Full refund refused - partial refund has already been done on this payment. You cannot refund the full payment amount after you have partially refunded a payment.

  • IMMEDIATE_PAY_NOT_SUPPORTED

    Immediate pay is not supported for the specified payment intent.

  • INSTRUMENT_DECLINED

    The specified instrument was either declined by the processor or bank or it cannot be used for this payment. If the buyer's funding source has insufficient funds, restart the payment and prompt the buyer to choose another payment method that is available on your site.

  • INSUFFICIENT_FUNDS

    Buyer cannot pay - insufficient funds. The buyer must add a valid funding instrument, such as a credit card or bank account, to their PayPal account.

  • INTERNAL_SERVICE_ERROR

    An internal service error has occurred. Resend the request at another time. If this error persists, contact PayPal Merchant Technical Support.

  • INVALID_ACCOUNT_NUMBER

    Account number does not exist. Provide a valid account number and resend the request.

  • INVALID_CITY_STATE_ZIP

    The combination of city, state, and zip in the address is invalid.

  • INVALID_EXPERIENCE_PROFILE_ID

    The requested experience profile ID was not found. To get the profile ID for a merchant, list web experience profiles.

  • INVALID_FACILITATOR_CONFIGURATION

    This transaction cannot be processed due to an invalid facilitator configuration. You must have the right account configuration to process this transaction type.

  • INVALID_PAYER_ID

    Payer ID is invalid. The specified payer_id is invalid. Resend the request by using a valid payer_id.

  • INVALID_RESOURCE_ID

    The requested resource ID was not found. Provide a valid resource ID and resend the request.

  • MALFORMED_REQUEST

    JSON request is malformed. Review the JSON request.

  • MAXIMUM_ALLOWED_AUTHORIZATION_REACHED_FOR_ORDER

    Maximum number of allowed authorizations for the order is reached. You have reached the maximum number of authorizations allowed for this order.

  • MERCHANT_NOT_ENABLED_FOR_CHANNEL_INITIATED_BILLING

    Merchant is not enabled for channel-initiated billing. The merchant is not enabled for channel-initiated billing.

  • MERCHANT_NOT_ENABLED_FOR_REFERENCE_TRANSACTION

    Merchant is not enabled for reference transaction. The merchant is not enabled for the reference transaction.

  • NEED_CREDIT_CARD

    Need credit card to complete the payment.

  • NEED_CREDIT_CARD_OR_BANK_ACCOUNT

    Need bank or credit card to complete the payment.

  • NOT_IMPLEMENTED

    Not implemented. API capability is not implemented.

  • ORDER_ALREADY_COMPLETED

    Order has already been voided, expired, or completed.

  • ORDER_CANNOT_BE_VOIDED

    Order is in {0} state and hence cannot be voided.

  • ORDER_VOIDED

    Order has been voided. Order is already voided. You can show order details.

  • PAYEE_ACCOUNT_LOCKED_OR_CLOSED

    Payee account is locked or closed. The account receiving this payment is locked or closed and cannot receive payments.

  • PAYEE_ACCOUNT_NO_CONFIRMED_EMAIL

    Refused - payee account does not have a confirmed email. The payment recipient must have a confirmed email for this transaction to proceed.

  • PAYEE_ACCOUNT_RESTRICTED

    Refused - payee account is restricted. The account receiving this payment is restricted and cannot receive payments at this time.

  • PAYEE_BLOCKED_TRANSACTION

    The Fraud settings for this seller are such that this payment cannot be executed. The fraud filter configuration for the seller blocks this payment.

  • PAYEE_COUNTRY_NOT_ENABLED

    Payee country is not enabled for this feature. The payee country is not enabled for billing product.

  • PAYER_ACCOUNT_RESTRICTED

    The payer account is restricted. The payer account cannot be used for this transaction.

  • PAYER_CANNOT_PAY

    The combination of payer and payee settings mean that this buyer can't pay this seller.

  • PAYER_COUNTRY_NOT_ENABLED

    Payer country is not enabled for this feature. The payer country is not enabled for billing product.

  • PAYER_EMPTY_BILLING_ADDRESS

    Billing address is empty. The billing address is required for credit card transactions without a PayPal account.

  • PAYER_ID_MISSING_FOR_CARD_TOKEN

    payer_id is required for payments made with this token. A payer_id is required when one was used to store the credit card.

  • PAYMENT_ALREADY_DONE

    Payment has been done already for this cart. You have completed the payment for this request already. Look up the transaction to get the details.

  • PAYMENT_APPROVAL_EXPIRED

    Payment approval has expired. Inform buyers that the transaction has expired and that they must restart the transaction. Offer buyers a link to restart the payment flow starting from payment creation and redirect the customer back to PayPal.

  • PAYMENT_CANNOT_BE_INITIATED

    Payment cannot be processed. PayPal cannot start processing the payment due to an issue with the specified information.

  • PAYMENT_DENIED

    PayPal has declined to process this transaction. PayPal declined the payment due to one or more buyer issues.

  • PAYMENT_EXPIRED

    The payment is expired. The payment expired because too much time has passed between payment creation or approval and execution of that payment. Restart the payment request starting from payment creation.

  • PAYMENT_METHOD_UNUSABLE

    Payer cannot pay with this payment method. The specified payment method is not usable. For example, PayPal business rules disallow the payment method or the payment method information was incorrect in the request.

  • PAYMENT_NOT_APPROVED_FOR_EXECUTION

    Payer has not approved payment. The payer must approve all payments that use the PayPal payment method.

  • PAYMENT_REQUEST_ID_INVALID

    PayPal request ID is invalid. Please try a different one.

  • PAYMENT_STATE_INVALID

    This request is invalid due to the current state of the payment. The payment state does not allow this kind of request.

  • PERMISSION_DENIED

    No permission for the requested operation. You do not have the proper permissions to perform this request.

  • PHONE_NUMBER_REQUIRED

    This transaction requires the payer to provide a valid phone number. Payer must provide a phone number to PayPal to proceed with the payment.

  • REFUND_EXCEEDED_TRANSACTION_AMOUNT

    Refund refused - the requested refund amount would exceed the amount of transaction being refunded. The requested refund must be less than or equal to the original transaction amount. To see the original transaction amount, show the refund details.

  • REFUND_TIME_LIMIT_EXCEEDED

    This transaction is too old to refund. Read about refund time limits on the PayPal Customer Support page. After the time limit expires, you must send a payment instead of issuing a refund.

  • REQUIRED_SCOPE_MISSING

    Access token does not have required scope. Get user consent by using the correct scope required for this type of request.

  • SENDING_LIMIT_EXCEEDED

    The transaction exceeds the buyer's sending limit.

  • SHIPPING_ADDRESS_INVALID

    Provided shipping address is invalid. The specified shipping address is not a valid address.

  • TOO_MANY_REAUTHORIZATIONS

    Maximum number of reauthorizations for this authorization has been reached. You can only reauthorize a payment once.

  • TRANSACTION_ALREADY_REFUNDED

    Refund transaction refused - this transaction has already been refunded. You can only refund a transaction up to the original amount. While you can do multiple partial refunds up to the original amount, you can only do a full refund once.

  • TRANSACTION_LIMIT_EXCEEDED

    Total payment amount exceeded transaction limit. The transaction limit was exceeded. For information about the PayPal transaction limits, see the PayPal Customer Support page.

  • TRANSACTION_REFUSED

    This request was refused. Possible reasons:

    • The partial refund amount must be less than or equal to the original transaction amount.
    • The partial refund amount must be less than or equal to the remaining amount.
    • The partial refund amount is not valid.
    • The partial refund must be the same currency as the original transaction.
    • Because a complaint case exists on this transaction, only a refund of the full or full remaining amount of the transaction can be messaged.
    • You are over the time limit to perform a refund on this transaction.
    • Cannot do a full refund after a partial refund.
    • Transaction was fully refunded.
    • You cannot refund this type of transaction.
    • You cannot do a partial refund on this transaction.
    • The merchant account has limitations or restrictions.

  • TRANSACTION_REFUSED_PAYEE_PREFERENCE

    Merchant profile preference is set to automatically deny certain transactions. The merchant account preferences are set to deny this kind of transaction.

  • UNSUPPORTED_PAYEE_COUNTRY

    Payee country is not supported for this transaction. Seller is not accepting payments from this country.

  • UNSUPPORTED_PAYEE_CURRENCY

    The currency is not accepted by payee. Seller is not accepting payments in this currency.

  • VALIDATION_ERROR

    Invalid request - see details. A validation error occurred with your request.