Execute the payment

Important: Integration with checkout.js V3.5 is Deprecated. For the latest integration information, see the PayPal Express Checkout Integration Guide.

When you execute an Express Checkout payment, the transaction completes and moves money from the buyer's PayPal account into your merchant PayPal account.

To execute a payment, include the payment ID in the URI and include a payment object in the JSON body. The payment object includes the PayPal-generated payer ID and any final line item details. These item details include any additional shipping costs and taxes.

Request

The sample request shows the payment ID and payer ID parameters. For brevity, the request omits the line item details.

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

Response

A successful call returns a transaction confirmation with the state set to approved and other transaction information.

{
  "id": "PAY-34629814WL663112AKEE3AWQ",
  "create_time": "2013-01-30T23:44:26Z",
  "update_time": "2013-01-30T23:44:28Z",
  "state": "approved",
  "intent": "sale",
  "payer":
  {
    "payment_method": "paypal",
    "payer_info":
    {
      "email": "bbuyer@example.com",
      "first_name": "Betsy",
      "last_name": "Buyer",
      "payer_id": "CR87QHB7JTRSC"
    }
  },
  "transactions": [
  {
    "amount":
    {
      "total": "7.47",
      "currency": "USD",
      "details":
      {
        "tax": "0.04",
        "shipping": "0.06"
      }
    },
    "description": "This is the payment transaction description.",
    "related_resources": [
    {
      "sale":
      {
        "id": "1KE4800207592173L",
        "create_time": "2013-01-30T23:44:26Z",
        "update_time": "2013-01-30T23:44:28Z",
        "state": "completed",
        "amount":
        {
          "currency": "USD",
          "total": "7.47"
        },
        "transaction_fee":
        {
          "value": "0.50",
          "currency": "USD"
        },
        "parent_payment": "PAY-34629814WL663112AKEE3AWQ",
        "links": [
        {
          "href": "https://api.sandbox.paypal.com/v1/payments/sale/1KE4800207592173L",
          "rel": "self",
          "method": "GET"
        },
        {
          "href": "https://api.sandbox.paypal.com/v1/payments/sale/1KE4800207592173L/refund",
          "rel": "refund",
          "method": "POST"
        },
        {
          "href": "https://api.sandbox.paypal.com/v1/payments/payment/PAY- 34629814WL663112AKEE3AWQ",
          "rel": "parent_payment",
          "method": "GET"
        }]
      }
    }]
  }],
  "links": [
  {
    "href": "https://api.sandbox.paypal.com/v1/payments/payment/PAY- 34629814WL663112AKEE3AWQ",
    "rel": "self",
    "method": "GET"
  }]
}

The transaction is complete and it appears in your PayPal account. You can optionally show a receipt page with the sale ID to the buyer. In this sample response, the sale ID is 1KE4800207592173L.


Additional information

Next

Test your integration.