Skip to main content
Create and manage reusable Payment Links through a REST API so your systems can generate, update, and delete payment links programmatically. Payment links collect payments by sharing a URL with customers. You can send a payment link directly through text or email and embed it on your website. The Payment Links and Buttons API currently supports payment links only and does not return button code. This API is available in all countries where PayPal operates. See Countries and Currencies for a list of supported currencies.

Prerequisites

  • Set up a PayPal Business Account.
  • Navigate to the Apps and Credentials section on the PayPal Developer Dashboard and select Create App or select an existing one.
  • Confirm Payment Links & Buttons is enabled for the selected credentials.
  • Implement OAuth 2.0 to obtain an access token for each API call.
  • Use https://api-m.sandbox.paypal.com for sandbox or https://api.paypal.com for production. Payloads and steps are the same for both environments.

Quick start

Follow these steps to create your first payment link using the sandbox environment.

1. Get an access token

Send a POST request to get an OAuth 2.0 bearer token.
The response includes an access_token that you pass in the Authorization header for subsequent calls. Send a POST request with the minimal required product details.
The API returns HTTP status 201 Created, the payment resource id, and a payment_link URL. Share this URL with customers or embed it behind a button on your site. Open the payment_link URL in a browser, confirm the product name and price, and complete a test checkout using a sandbox buyer account. Use the payment_link value from the links array in the response.

How it works

The Payment Links and Buttons API exposes a simple lifecycle for Payment Links:
  1. Get an OAuth access token for your PayPal Business account.
  2. Create a payment resource by calling POST /v1/checkout/payment-resources.
  3. Share the returned payment_link URL with customers.
  4. Optionally list, retrieve, update, or delete existing payment resources as your catalog changes.

Endpoints

This section summarizes each endpoint. See the full API reference for the complete schema and additional examples.

Use cases

See how to create payment links that address common scenarios and requirements.

Create a payment link (POST /v1/checkout/payment-resources)

Create a payment link that points to a PayPal‑hosted checkout experience. Use this endpoint to generate shareable payment URLs for your products.

Request

Response

The response includes the payment resource ID, shareable payment link, product details, and configuration. The API returns HTTP status 201 Created with content type application/json.

List payment resources (GET /v1/checkout/payment-resources)

Retrieve a paginated list of all payment resources created by the merchant. This endpoint supports filtering through query parameters, such as status.

Request

Response

The response contains an array of payment resources and pagination links. The API returns HTTP status 200 OK with content type application/json.

Get payment resource details (GET /v1/checkout/payment-resources/{id})

Get the details of a specific payment resource by its unique ID. This endpoint returns all metadata, including payment status, link URL, reusable type, and line item details.

Request

Response

Update payment resource (PUT /v1/checkout/payment-resources/{id})

Replace the configuration of a specific payment resource with new product and checkout details.

Request

Response

The API returns HTTP status 204 No Content with no response body.

Delete payment resources (DELETE /v1/checkout/payment-resources/{id})

Permanently delete a payment resource by its unique ID.

Request

Response

The API returns HTTP status 204 No Content with no response body.

Error handling

For more information, see Common errors.

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.