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.comfor sandbox orhttps://api.paypal.comfor 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 aPOST request to get an OAuth 2.0 bearer token.
access_token that you pass in the Authorization header for subsequent calls.
2. Create a payment link
Send aPOST request with the minimal required product details.
3. Use the payment_link URL
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.
4. Verify the link
Open thepayment_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:- Get an OAuth access token for your PayPal Business account.
- Create a payment resource by calling
POST /v1/checkout/payment-resources. - Share the returned
payment_linkURL with customers. - 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 typeapplication/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 status200 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 status204 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 status204 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.