{"_id":"59a45d2bd12e81000f842f0a","category":{"_id":"59a45d2bd12e81000f842ef0","version":"59a45d2bd12e81000f842ee2","project":"57336fd5a6a9c40e00e13a0b","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-11-03T20:45:01.593Z","from_sync":false,"order":13,"slug":"topics","title":"Guides & Tools"},"parentDoc":null,"user":"560d5913af97231900938124","project":"57336fd5a6a9c40e00e13a0b","version":{"_id":"59a45d2bd12e81000f842ee2","project":"57336fd5a6a9c40e00e13a0b","__v":1,"createdAt":"2017-08-28T18:12:59.168Z","releaseDate":"2017-08-28T18:12:59.168Z","categories":["59a45d2bd12e81000f842ee3","59a45d2bd12e81000f842ee4","59a45d2bd12e81000f842ee5","59a45d2bd12e81000f842ee6","59a45d2bd12e81000f842ee7","59a45d2bd12e81000f842ee8","59a45d2bd12e81000f842ee9","59a45d2bd12e81000f842eea","59a45d2bd12e81000f842eeb","59a45d2bd12e81000f842eec","59a45d2bd12e81000f842eed","59a45d2bd12e81000f842eee","59a45d2bd12e81000f842eef","59a45d2bd12e81000f842ef0","59a45d2bd12e81000f842ef1"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":false,"codename":"3.22.1","version_clean":"8976.0.0-JSON","version":"8976-JSON"},"__v":0,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-01-07T20:13:20.427Z","link_external":false,"link_url":"/v1.0/docs/paypal","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":111,"body":"This guide describes how to use the **Payment API** to process PayPal transactions. For a general overview of our PayPal offering [go here](/v1.0/docs/paypal).\n\nSee:\n  * [Prerequisites](#section-prerequisites)\n  * [Processing PayPal transactions](#section-processing-paypal-transactions)\n[block:callout]\n{\n  \"type\": \"info\",\n  \"body\": \"If you are managing subscriptions yourself (or through a third party) and want to offer the PayPal payment method for recurring subscription payments, this option is also available via the Payment API. For a tutorial, see [Processing merchant-managed PayPal subscription payments](/v2.0/docs/subscription-management#section-processing-merchant-managed-paypal-subscription-payments).\",\n  \"title\": \"Using PayPal for merchant-managed subscriptions\"\n}\n[/block]\n#Prerequisites\n\n###PayPal account\nTo offer PayPal as a payment option for your shoppers, you must have a PayPal Business or Premier account. If you do not yet have a PayPal account, you can sign up for one on the PayPal website.\n\n###Connecting your PayPal account with BlueSnap\nTo use PayPal with BlueSnap, begin by connecting your PayPal and BlueSnap accounts. For instructions, see [Connecting PayPal and BlueSnap](http://support.bluesnap.com/docs/connecting-paypal-and-bluesnap).\n\n#Processing PayPal transactions\n[block:callout]\n{\n  \"type\": \"info\",\n  \"body\": \"**Standard Re-direct/One-Step flow:** This is the standard PayPal flow that directs your shopper to a PayPal page to confirm the purchase.\\n\\n**Two-Step Flow:** The objective of the two-step flow is to provide the ability retrieve your shopper's address from their PayPal wallet and then include any necessary taxes and/or fees based on their location.\\n\\n**Three-Step Flow:** The objective of the three-step flow is to separate the authorization from the capture step.  This is beneficial for business who may not have the goods on hand at the time of the sale.\",\n  \"title\": \"PayPal checkout options\"\n}\n[/block]\n  * [Step 1:Build and send the Create PayPal Transaction request](#section-step-1-build-and-send-the-create-paypal-transaction-request)\n  * [Step 2: Response to the Create PayPal Transaction request & possible errors](#section-step-2-response-to-the-create-paypal-transaction-request-possible-errors)\n  * [Step 3: Redirect the shopper to the PayPal URL](#section-step-3-redirect-the-shopper-to-the-paypal-url)\n  * [Step 4: Shopper is redirected to a confirmation page](#section-step-4-shopper-is-redirected-to-a-confirmation-page)\n  * [Step 5: Complete the process or create pending authorization](#section-step-5-complete-the-process-or-create-pending-authorization)\n  * [Step 6: Complete the transaction by sending capture with final amount](#section-step-6-complete-the-transaction-by-sending-capture-with-final-amount)\n\n##Step 1: Build and send the Create PayPal Transaction request\nWhen the shopper selects the PayPal checkout option, you will use the [Create PayPal Transaction](doc:create-paypal-transaction) request to process the PayPal payment. The `transaction-type` should be AUTH/CAPTURE or omitted for the standard re-direct, AUTH_ONLY for the two-step flow, and SET_ORDER for the three step flow.\n\nThe request should be sent to the `services/2/alt-transactions` endpoint. Following is an example request:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n    \\\"amount\\\": 100,\\n    \\\"vaultedShopperId\\\": 12345678,\\n    \\\"softDescriptor\\\": \\\"ABC COMPANY\\\",\\n    \\\"currency\\\": \\\"USD\\\",\\n    \\\"paypalTransaction\\\": {\\n        \\\"noShipping\\\": 0,\\n        \\\"cancelUrl\\\": \\\"http://www.cancelURL.com\\\",\\n        \\\"reqConfirmShipping\\\": 1,\\n        \\\"returnUrl\\\": \\\"http://www.returnURL.com\\\"\\n    }\\n}\",\n      \"language\": \"json\",\n      \"name\": \"Sample Request: Standard redirect\"\n    },\n    {\n      \"code\": \"{\\n    \\\"merchantTransactionId\\\": \\\"testtransaction1\\\",\\n    \\\"softDescriptor\\\": \\\"ABC COMPANY\\\",\\n    \\\"amount\\\": \\\"100.00\\\",\\n    \\\"currency\\\": \\\"USD\\\",\\n    \\\"payerInfo\\\": {\\n        \\\"firstName\\\": \\\"John\\\",\\n        \\\"lastName\\\": \\\"Doe\\\"\\n    },\\n    \\\"paypalTransaction\\\": {\\n        \\\"transactionType\\\": \\\"AUTH_ONLY\\\",\\n        \\\"returnUrl\\\": \\\"http://www.returnURL.com\\\",\\n        \\\"cancelUrl\\\": \\\"http://www.cancelURL.com\\\",\\n        \\\"maxAmount\\\": \\\"120.00\\\"\\n    }\\n}\\n\",\n      \"language\": \"json\",\n      \"name\": \"with two-step flow\"\n    },\n    {\n      \"code\": \"{\\n    \\\"merchantTransactionId\\\": \\\"testtransaction1\\\",\\n    \\\"softDescriptor\\\": \\\"ABC COMPANY\\\",\\n    \\\"amount\\\": \\\"100.00\\\",\\n    \\\"currency\\\": \\\"USD\\\",\\n    \\\"payerInfo\\\": {\\n        \\\"firstName\\\": \\\"John\\\",\\n        \\\"lastName\\\": \\\"Doe\\\"\\n    },\\n    \\\"paypalTransaction\\\": {\\n        \\\"transactionType\\\": \\\"SET_ORDER\\\",\\n        \\\"returnUrl\\\": \\\"http://www.returnURL.com\\\",\\n        \\\"cancelUrl\\\": \\\"http://www.cancelURL.com\\\",\\n        \\\"maxAmount\\\": \\\"120.00\\\"\\n    }\\n}\",\n      \"language\": \"json\",\n      \"name\": \"with three-step flow\"\n    }\n  ]\n}\n[/block]\nThese are some important properties of the [Create PayPal Transaction](doc:create-paypal-transaction) request:\n\n###PayPal URLs\nWithin the [paypalTransaction](doc:paypal-transaction) object, you will need to specify two different URLs:\n  * `returnUrl`: URL where the shopper will be redirected upon completing the PayPal purchase (i.e. your \"thank you\" page)\n  * `cancelUrl`: URL where the shopper will be redirected if cancelling the PayPal purchase.\n\n###Shopper information\nYou can send the request with any of the following:\n  * **No information about the shopper**: For example, if it is a new or guest shopper, you can keep the request simple and not include any shopper details.\n  * **Some information about the shopper**: For example, if you would like to use some of the shopper's info in order to customize the thank you page, then you can include the [payerInfo](doc:payer-info) object and send the shopper's name, address or other details.\n  * **A vaulted shopper ID**: If you have already vaulted the shopper with BlueSnap, you can send the relevant `vaultedShopperId` within the [altTransaction](doc:alt-transaction) object. If you collect the shipping info from PayPal, then this will also be automatically updated in the vaulted shopper's profile in BlueSnap.\n\nSee [Create PayPal Transaction](doc:create-paypal-transaction) for examples of each of the above options.\n\n###Shipping details from PayPal (for vaulted shoppers)\nIf you send a vaulted shopper in your [Create PayPal Transaction](doc:create-paypal-transaction) request, you can retrieve the shopper's shipping details from PayPal. If you do so, then the vaulted shopper's record in BlueSnap will be automatically updated with the new shipping details from PayPal. To retrieve shipping info from PayPal for a vaulted shopper:\n  * In the [paypalTransaction](doc:paypal-transaction) object, set the `noShipping` property to **0**\n  * If you only want the shipping info to be retrieved if it has been specifically confirmed by the shopper in PayPal, then you should also include the `reqConfirmShipping` property, with the value set to **1**. \n\n * *Note: This feature is not available if BlueSnap collects US sales tax or EU VAT for you.* \n[block:callout]\n{\n  \"type\": \"info\",\n  \"body\": \"The shopper’s phone number will not be automatically retrieved. If you are specifically interested in retrieving the phone number, please ensure you configure the **Contact Telephone Number** setting to **Off**. This setting is in your PayPal account under **My Account > Profile > My selling tools > Website Preferences**.\",\n  \"title\": \"Retrieving the shopper's phone number\"\n}\n[/block]\n###In-Context checkout\nIf you would like to enable In-Context PayPal checkout, set the `inContext` property in the [paypalTransaction](doc:paypal-transaction) object to **true**.\n\nFor more information about the shopper experience with PayPal, see [The shopper experience with PayPal (Express checkout vs In-Context checkout)](/docs/paypal#section-the-shopper-experience-with-paypal-express-checkout-vs-in-context-checkout-).\n\n##Step 2: Response to the Create PayPal Transaction request & possible errors\nIf successful, the response HTTP status code is 200 OK.\nThe response contains an [altTransaction](doc:alt-transaction) resource with the request properties plus these additions:\n      `paypalTransaction` is returned with the `paypalUrl` and `orderId` (see [paypalTransaction](doc:paypal-transaction))\n      `processingInfo`\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n    \\\"amount\\\": 100,\\n    \\\"vaultedShopperId\\\": 12345678,\\n    \\\"processingInfo\\\": {\\\"processingStatus\\\": \\\"PENDING\\\"},\\n    \\\"softDescriptor\\\": \\\"ABC COMPANY\\\",\\n    \\\"currency\\\": \\\"USD\\\",\\n    \\\"paypalTransaction\\\": {\\n        \\\"paypalUrl\\\": \\\"https://www.sandbox.paypal.com/us/cgi-bin/webscr?cmd=_express-checkout&token=EC-9GY47037JY601890L\\\",\\n        \\\"orderId\\\": 9876543\\n    }\\n}\",\n      \"language\": \"json\",\n      \"name\": \"Sample Response: standard redirect\"\n    }\n  ]\n}\n[/block]\nOtherwise, any of the [Alt Transaction Errors](doc:alt-transaction-errors) related to PayPal may occur.\n\n##Step 3: Redirect the shopper to the PayPal URL\nThe response includes a `paypalUrl` field. This is the URL for the checkout page in PayPal where the shopper can complete the purchase. In the example response above, the `paypalUrl` is:\n`https://www.sandbox.paypal.com/us/cgi-bin/webscr?cmd=_express-checkout&token=EC-9GY47037JY601890L`\n\nWhen you receive the response, you should redirect the shopper to this URL so that he or she can finish the checkout process in PayPal.\n\n##Step 4: Shopper is redirected to a confirmation page\n**Standard Checkout Flow:** Upon completing checkout in PayPal, the shopper is automatically sent to the \"thank you\" page you indicated in the `return-url` field in the [Create PayPal Transaction](doc:create-paypal-transaction) request. On this page, you may wish to display the PayPal order number and other details about the purchase.\n\n**Two & Three Step Flows:** Upon completion in PayPal, the shopper is automatically sent to the final confirmation page indicated in the `return-url` field in the [Create PayPal Transaction](doc:create-paypal-transaction) request. \n\nThe return URL will contain additional parameters that you can use to display to your shoppers. \n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"PayPal flow\",\n    \"h-1\": \"URL example\",\n    \"h-2\": \"Parameters included\",\n    \"0-0\": \"**Standard redirect**\",\n    \"1-0\": \"**Two-step flow & \\nThree-step flow**\",\n    \"0-1\": \"http://merchant-site.com/paypal-success?ERROR=0&INVOICE_ID=987654&PAYPAL_TRANSACTION_ID=9M8R7X6LYE7P4&MERCHANT-TRANSACTION-ID=null\\n\\n*Note:* In the event of an error from PayPal there will be an exception included as part of the URL\",\n    \"1-1\": \"http://merchant-site.com/paypal-success?ERROR=0&PAYPAL_TRANSACTION_ID=9M8R7X6LYE7P4&VAULTED-SHOPPER-ID=19598172&MERCHANT-TRANSACTION-ID=null\",\n    \"0-2\": \"PayPal error (success or error code), Invoice_ID (BlueSnap’s InvoiceId), PayPal Transaction ID, and merchantTransactionId (your own transaction ID)\",\n    \"1-2\": \"PayPal (success or error code), vaultedShopperId (BlueSnap’s Shopper ID), and merchantTransactionId (your own transaction ID)\\n\\n**Note:** You can then do a Retrieve Vaulted Shopper call, with the vaulted shopper ID, to retrieve the shopper’s information and to update the final price accordingly.\"\n  },\n  \"cols\": 3,\n  \"rows\": 2\n}\n[/block]\n##Step 5: Complete the process or Create Pending Authorization \n\n**Standard Checkout Flow:** Step 5 is not applicable when using the PayPal standard flow.\n\n**Two-Step Flow:**  To finalize this order and have the payment processed, you must send an  [Update PayPal Transaction](doc:update-paypal-transaction) request with the `orderId` from the original transaction, the new price (if applicable), and set the parameter `transactionType` to capture. \n\nYou can now redirect your shopper to a final thank you page confirming transaction details.\n\n**Three-Step flow:** In the previous step you presented your shopper with the final amount including any additional charges.  You now need to create an [Update PayPal Transaction](doc:update-paypal-transaction) request, with the `orderId` from the original transaction, the new price (if applicable), and set the parameter `transactionType` to DO_ORDER.  This will create a pending authorization on your shopper's PayPal account for the actual amount including a new charges. \n\nLater on, when you are ready to deliver the goods/services, you will need to create a new [Update PayPal Transaction](doc:update-paypal-transaction) request to complete the order.\n\n*Note: A pending authorization can be left open several weeks.* \n\nIf there were additional charges, you will need to modify the `amount` parameter with the final amount you wish to charge.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n    \\\"amount\\\": \\\"105.00\\\",\\n    \\\"currency\\\": \\\"USD\\\",\\n    \\\"paypalTransaction\\\": {\\n        \\\"orderId\\\": \\\"4006145\\\",\\n        \\\"transactionType\\\": \\\"CAPTURE\\\"\\n    }\\n}\",\n      \"language\": \"json\",\n      \"name\": \"Two-step flow\"\n    },\n    {\n      \"code\": \"{\\n    \\\"amount\\\": \\\"105.00\\\",\\n    \\\"currency\\\": \\\"USD\\\",\\n    \\\"paypalTransaction\\\": {\\n        \\\"orderId\\\": \\\"4006145\\\",\\n        \\\"transactionType\\\": \\\"DO_ORDER\\\"\\n    }\\n}\",\n      \"language\": \"json\",\n      \"name\": \"Three-step flow\"\n    }\n  ]\n}\n[/block]\n##Step 6: Complete the transaction by sending capture with final amount\n\n**Three-Step flow:** When the goods/services are ready to be delivered and you have informed your customer you will debiting the final amount from their PayPal account.  You now need to send a final [Update PayPal Transaction](doc:update-paypal-transaction) request to complete the transaction and move it from a pending authorization to a captured charge. \n\nTo accomplish this you will need to change the value of the `transactionType` parameter from DO_ORDER to CAPTURE.\n\nIt is still possible to modify this final amount once more, but please make sure the shopper is aware of the final amount being charged and that they have received an updated receipt/invoice.","excerpt":"Learn how to work with PayPal in BlueSnap's Payment API","slug":"paypal","type":"basic","title":"PayPal Guide"}

PayPal Guide

Learn how to work with PayPal in BlueSnap's Payment API

This guide describes how to use the Payment API to process PayPal transactions. For a general overview of our PayPal offering go here.

See:

Using PayPal for merchant-managed subscriptions

If you are managing subscriptions yourself (or through a third party) and want to offer the PayPal payment method for recurring subscription payments, this option is also available via the Payment API. For a tutorial, see Processing merchant-managed PayPal subscription payments.

Prerequisites

PayPal account

To offer PayPal as a payment option for your shoppers, you must have a PayPal Business or Premier account. If you do not yet have a PayPal account, you can sign up for one on the PayPal website.

Connecting your PayPal account with BlueSnap

To use PayPal with BlueSnap, begin by connecting your PayPal and BlueSnap accounts. For instructions, see Connecting PayPal and BlueSnap.

Processing PayPal transactions

PayPal checkout options

Standard Re-direct/One-Step flow: This is the standard PayPal flow that directs your shopper to a PayPal page to confirm the purchase.

Two-Step Flow: The objective of the two-step flow is to provide the ability retrieve your shopper's address from their PayPal wallet and then include any necessary taxes and/or fees based on their location.

Three-Step Flow: The objective of the three-step flow is to separate the authorization from the capture step. This is beneficial for business who may not have the goods on hand at the time of the sale.

Step 1: Build and send the Create PayPal Transaction request

When the shopper selects the PayPal checkout option, you will use the Create PayPal Transaction request to process the PayPal payment. The transaction-type should be AUTH/CAPTURE or omitted for the standard re-direct, AUTH_ONLY for the two-step flow, and SET_ORDER for the three step flow.

The request should be sent to the services/2/alt-transactions endpoint. Following is an example request:

{
    "amount": 100,
    "vaultedShopperId": 12345678,
    "softDescriptor": "ABC COMPANY",
    "currency": "USD",
    "paypalTransaction": {
        "noShipping": 0,
        "cancelUrl": "http://www.cancelURL.com",
        "reqConfirmShipping": 1,
        "returnUrl": "http://www.returnURL.com"
    }
}
{
    "merchantTransactionId": "testtransaction1",
    "softDescriptor": "ABC COMPANY",
    "amount": "100.00",
    "currency": "USD",
    "payerInfo": {
        "firstName": "John",
        "lastName": "Doe"
    },
    "paypalTransaction": {
        "transactionType": "AUTH_ONLY",
        "returnUrl": "http://www.returnURL.com",
        "cancelUrl": "http://www.cancelURL.com",
        "maxAmount": "120.00"
    }
}
{
    "merchantTransactionId": "testtransaction1",
    "softDescriptor": "ABC COMPANY",
    "amount": "100.00",
    "currency": "USD",
    "payerInfo": {
        "firstName": "John",
        "lastName": "Doe"
    },
    "paypalTransaction": {
        "transactionType": "SET_ORDER",
        "returnUrl": "http://www.returnURL.com",
        "cancelUrl": "http://www.cancelURL.com",
        "maxAmount": "120.00"
    }
}

These are some important properties of the Create PayPal Transaction request:

PayPal URLs

Within the paypalTransaction object, you will need to specify two different URLs:

  • returnUrl: URL where the shopper will be redirected upon completing the PayPal purchase (i.e. your "thank you" page)
  • cancelUrl: URL where the shopper will be redirected if cancelling the PayPal purchase.

Shopper information

You can send the request with any of the following:

  • No information about the shopper: For example, if it is a new or guest shopper, you can keep the request simple and not include any shopper details.
  • Some information about the shopper: For example, if you would like to use some of the shopper's info in order to customize the thank you page, then you can include the payerInfo object and send the shopper's name, address or other details.
  • A vaulted shopper ID: If you have already vaulted the shopper with BlueSnap, you can send the relevant vaultedShopperId within the altTransaction object. If you collect the shipping info from PayPal, then this will also be automatically updated in the vaulted shopper's profile in BlueSnap.

See Create PayPal Transaction for examples of each of the above options.

Shipping details from PayPal (for vaulted shoppers)

If you send a vaulted shopper in your Create PayPal Transaction request, you can retrieve the shopper's shipping details from PayPal. If you do so, then the vaulted shopper's record in BlueSnap will be automatically updated with the new shipping details from PayPal. To retrieve shipping info from PayPal for a vaulted shopper:

  • In the paypalTransaction object, set the noShipping property to 0
  • If you only want the shipping info to be retrieved if it has been specifically confirmed by the shopper in PayPal, then you should also include the reqConfirmShipping property, with the value set to 1.

    • Note: This feature is not available if BlueSnap collects US sales tax or EU VAT for you.

Retrieving the shopper's phone number

The shopper’s phone number will not be automatically retrieved. If you are specifically interested in retrieving the phone number, please ensure you configure the Contact Telephone Number setting to Off. This setting is in your PayPal account under My Account > Profile > My selling tools > Website Preferences.

In-Context checkout

If you would like to enable In-Context PayPal checkout, set the inContext property in the paypalTransaction object to true.

For more information about the shopper experience with PayPal, see The shopper experience with PayPal (Express checkout vs In-Context checkout).

Step 2: Response to the Create PayPal Transaction request & possible errors

If successful, the response HTTP status code is 200 OK.
The response contains an altTransaction resource with the request properties plus these additions:
      paypalTransaction is returned with the paypalUrl and orderId (see paypalTransaction)
      processingInfo

{
    "amount": 100,
    "vaultedShopperId": 12345678,
    "processingInfo": {"processingStatus": "PENDING"},
    "softDescriptor": "ABC COMPANY",
    "currency": "USD",
    "paypalTransaction": {
        "paypalUrl": "https://www.sandbox.paypal.com/us/cgi-bin/webscr?cmd=_express-checkout&token=EC-9GY47037JY601890L",
        "orderId": 9876543
    }
}

Otherwise, any of the Alt Transaction Errors related to PayPal may occur.

Step 3: Redirect the shopper to the PayPal URL

The response includes a paypalUrl field. This is the URL for the checkout page in PayPal where the shopper can complete the purchase. In the example response above, the paypalUrl is:
https://www.sandbox.paypal.com/us/cgi-bin/webscr?cmd=_express-checkout&token=EC-9GY47037JY601890L

When you receive the response, you should redirect the shopper to this URL so that he or she can finish the checkout process in PayPal.

Step 4: Shopper is redirected to a confirmation page

Standard Checkout Flow: Upon completing checkout in PayPal, the shopper is automatically sent to the "thank you" page you indicated in the return-url field in the Create PayPal Transaction request. On this page, you may wish to display the PayPal order number and other details about the purchase.

Two & Three Step Flows: Upon completion in PayPal, the shopper is automatically sent to the final confirmation page indicated in the return-url field in the Create PayPal Transaction request.

The return URL will contain additional parameters that you can use to display to your shoppers.

PayPal flow
URL example
Parameters included

Standard redirect

http://merchant-site.com/paypal-success?ERROR=0&INVOICE_ID=987654&PAYPAL_TRANSACTION_ID=9M8R7X6LYE7P4&MERCHANT-TRANSACTION-ID=null

Note: In the event of an error from PayPal there will be an exception included as part of the URL

PayPal error (success or error code), Invoice_ID (BlueSnap’s InvoiceId), PayPal Transaction ID, and merchantTransactionId (your own transaction ID)

Two-step flow &
Three-step flow

PayPal (success or error code), vaultedShopperId (BlueSnap’s Shopper ID), and merchantTransactionId (your own transaction ID)

Note: You can then do a Retrieve Vaulted Shopper call, with the vaulted shopper ID, to retrieve the shopper’s information and to update the final price accordingly.

Step 5: Complete the process or Create Pending Authorization

Standard Checkout Flow: Step 5 is not applicable when using the PayPal standard flow.

Two-Step Flow: To finalize this order and have the payment processed, you must send an Update PayPal Transaction request with the orderId from the original transaction, the new price (if applicable), and set the parameter transactionType to capture.

You can now redirect your shopper to a final thank you page confirming transaction details.

Three-Step flow: In the previous step you presented your shopper with the final amount including any additional charges. You now need to create an Update PayPal Transaction request, with the orderId from the original transaction, the new price (if applicable), and set the parameter transactionType to DO_ORDER. This will create a pending authorization on your shopper's PayPal account for the actual amount including a new charges.

Later on, when you are ready to deliver the goods/services, you will need to create a new Update PayPal Transaction request to complete the order.

Note: A pending authorization can be left open several weeks.

If there were additional charges, you will need to modify the amount parameter with the final amount you wish to charge.

{
    "amount": "105.00",
    "currency": "USD",
    "paypalTransaction": {
        "orderId": "4006145",
        "transactionType": "CAPTURE"
    }
}
{
    "amount": "105.00",
    "currency": "USD",
    "paypalTransaction": {
        "orderId": "4006145",
        "transactionType": "DO_ORDER"
    }
}

Step 6: Complete the transaction by sending capture with final amount

Three-Step flow: When the goods/services are ready to be delivered and you have informed your customer you will debiting the final amount from their PayPal account. You now need to send a final Update PayPal Transaction request to complete the transaction and move it from a pending authorization to a captured charge.

To accomplish this you will need to change the value of the transactionType parameter from DO_ORDER to CAPTURE.

It is still possible to modify this final amount once more, but please make sure the shopper is aware of the final amount being charged and that they have received an updated receipt/invoice.