| Use case | Endpoint |
|---|---|
| Create payment links and buttons | POST /v1/checkout/payment-resources |
| List payment links | GET /v1/checkout/payment-resources |
| Get payment link details | GET /v1/checkout/payment-resources/{id} |
| Update payment link | PUT /v1/checkout/payment-resources/{id} |
| Delete payment link | DELETE /v1/checkout/payment-resources/{id} |
Prerequisites
- Set up a PayPal Business Account.
- Navigate to the Apps and Credentials section on the PayPal Developer Dashboard to ensure the Payment Links and Buttons option is checked.
- Implement OAuth 2.0 to obtain an access token for each API call.
Create payment links and buttons (POST)
Create a buy now payment URL that links directly to a PayPal-hosted checkout experience. Use this endpoint to generate shareable payment URLs or various purchase flows.
Endpoint: POST /v1/checkout/payment-resources
Request
The following sample request includes these key settings:- Creates a reusable payment link for Premium Wireless Headphones with Noise Cancellation.
- Includes variant-specific pricing for four primary colors.
- Includes three variants where the color dimension is marked as primary and includes four options. The other two variants are
Warranty, which has three options, andPackage Type, which has two options. These variants do not affect pricing. - Adds an 8.25% tax, applies a flat shipping rate, and requires customers to provide a shipping address.
- Provides customers with the option to add a gift message at checkout.
- Sets a maximum order quantity of 10 units.
- Redirects customers to a return URL after the transaction.
Response
The following response contains a fixed-price payment resource link with product details and variants. The API returns HTTP status code201 Created and content type application/json.
Additional use cases
The following use cases demonstrate how to create payment links for additional scenarios.Create a payment link with a return URL
Create a payment link for a wireless mouse priced at $39.99 USD. After completing payment, customers are redirected to the specified return URL, such ashttps://merchant.example.com/thank-you.
Create a payment link with variants
Create a payment link for a T-shirt priced at $20.00 USD. TheColor dimension is marked as primary and includes two options: White and Black. The Size dimension is secondary and includes 11oz and 15oz options. The base price of $20.00 applies to all variant combinations.
Create a payment link with variant-level pricing
Create a payment link for a T-shirt with variant-specific pricing. TheColor dimension is marked as primary and includes two options: White priced at $19.00 USD, and Black priced at $20.00 USD. The Size dimension is secondary and includes 11oz and 15oz options, with no price difference. No base unit_amount shows up in the payload because each color variant specifies its own price.
Create a payment link with taxes and shipping
Create a payment link for a coffee mug priced at $12.00 USD with tax and shipping calculations. Thetaxes and shipping arrays specify type: PREFERENCE and value: PROFILE to apply the merchant’s preconfigured tax and shipping settings from their PayPal account. Merchants must configure these tax and shipping settings in their PayPal account for this feature to work.
List payment links (GET)
Retrieve a paginated list of all payment links created by the merchant. This endpoint supports filtering and pagination through query parameters, including filtering by link status and tags.
Endpoint: GET /v1/checkout/payment-resources
Request
The following sample request includes these key details:- Sends a
GETrequest to list payment links you created. - Uses the
page_sizeparameter to limit results. For example, settingpage_size=2returns two payment links per page. - Includes an OAuth 2.0 Bearer token for authentication.
- Headers set to
Accept: application/jsonandContent-Type: application/json. - Uses a
page_tokenfrom the response to retrieve additional pages.
Response
The following sample response includes these key details:- Returns a resources array with two payment links.
- The first payment link is for a
Wireless Mouse, priced at $29.99 USD. This link is active, set toBUY_NOW, and is reusable. - The second payment link is for a Wireless Keyboard, priced at $99.99 USD. It has the same status, type, and reusability settings as the first link.
- Each resource includes a shareable
payment_linkURL, metadata such as ID, product name, price, status, type, and creation timestamp, and a links array with HATEOAS actions to retrieve, update, edit, delete, or access the payment link. - The response also includes a top-level links array for navigation, with a self link referencing the current request and a next link with a
page_tokenfor retrieving additional results.
Get payment link details (GET)
Get the details of a specific payment link by its unique ID. This endpoint returns all available metadata, including payment status, links, reusable type, and line item details for the requested payment link.
Endpoint: GET /v1/checkout/payment-resources/{id}
Request
The following sample request includes these key details:- Includes the complete details for a specific payment link identified by the resource ID
PLB-X7MNK9P2QR8Tusing aGETrequest. - Uses an OAuth 2.0 Bearer token in the Authorization header to authenticate the request.
- Sets the
AcceptandContent-Typeheaders toapplication/jsonfor proper formatting.
Response
The following response contains the complete details for a single fixed-price payment link. The API returns status code200 OK and content type application/json.
The following sample response includes these key details:
- Returns the full details of payment link
PLB-X7MNK9P2QR8T. - The payment link is active, set to
BUY_NOW, and configured for multiple uses. - Shows a product called Wireless Mouse, priced at $29.99 USD
- The link was created on
2025-11-29T13:13:25.832592Zwith integration modeLINK. - After payment, customers are redirected to
https://merchant.example.com/thank-youthat is specified byreturn_url. - Includes a shareable payment link URL at
https://www.paypal.com/ncp/payment/PLB-X7MNK9P2QR8T. - Provides a links array with HATEOAS actions: retrieve the link details (
self), update the link (replace), delete the link (delete), and access the customer-facing payment page (payment_link).
Update payment link (PUT)
Update a specific payment link by its unique identifier. This endpoint helps you replace the product and checkout details for a fixed price payment link with new configuration data.
Endpoint: PUT /v1/checkout/payment-resources/{id}
Request
The following sample request includes these key details:- Sends a
PUTrequest to update the payment link with IDPLB-X7MNK9P2QR8T. - Uses an OAuth 2.0 Bearer token in the Authorization header for authentication.
- Includes the
AcceptandContent-Typeheaders set toapplication/json. - Sends the updated link configuration in the request body, replacing the existing product information entirely.
- Maintains the same payment link ID and URL while applying the new settings.
Note: The API currently only usesPUTcalls instead ofPATCHcalls.
Response
The following response contains the confirmation details of an updated payment link. The API returns HTTP status204 No Content or, in some cases, a confirmation response body with the content type application/json.
The following sample response includes these key details:
- Confirms that the updated payment link
PLB-X7MNK9P2QR8Thas been successfully applied. - Returns the payment link with
ACTIVEstatus, maintaining the same ID and payment link URL. - Preserves the original creation time.
Delete payment link (DELETE)
Delete a specific payment link by its unique identifier. This endpoint permanently removes a payment link associated with the specified ID.
Endpoint: DELETE /v1/checkout/payment-resources/{id}
Request
The following sample request includes these key details:- Sends a
DELETErequest to permanently remove the payment link with IDPLB-X7MNK9P2QR8T. - Uses an OAuth 2.0 Bearer token in the Authorization header for authentication.
- Includes the
AcceptandContent-Typeheaders set toapplication/json.
Response
The API returns HTTP status204 No Content with the content type application/json, indicating that the payment link was deleted. No response body is returned.
Test
- Create a sandbox account through the PayPal Developer Portal.
- Use your sandbox environment for all development and testing. All endpoints are duplicated for the sandbox (
api-m.sandbox.paypal.com) and live environments. See Card testing to simulate transactions in the sandbox. - To test live behavior, create a low-value payment link, complete a test purchase, and verify the transaction in the Activity section of your PayPal account. Refund the test transaction after verification.