Create PayPal Pay Link
POST/api/sales-orders/:salesOrderId/paypal-payment-links
Creates a PayPal pay link for a sales order and, optionally, emails it to the customer.
Authentication: Requires Bearer token with permission to manage sales order payments.
An order has at most one active pay link: creating a new one cancels the previous active link.
Body fields:
amount(number, required) — at least 0.01 and no more than the order's amount due.integration_instance_id(integer, required) — the connected PayPal account to collect into.expires_in_days(integer, optional, 1–365, default 30).email_customer(boolean, optional) — email the new link using the editable "PayPal Payment Request" email template.recipient_email(string, optional) — address to email; defaults to the order's customer email.
The link is always created. If it cannot be emailed (no address, or the template is turned off), email_error explains why and emailed_to is null.
Returns 409 when PayPal is not available on this account and 422 when the PayPal account is not connected or the amount is invalid.
This endpoint currently requires session authentication; Personal Access Token scope support is in progress.
Request
Responses
- 201
- 401
- 403
- 404
- 422
- 429
Created
Response Headers
Unauthenticated — the bearer token is missing, revoked, expired, or malformed. Never retry automatically; fix the credential. See the Errors guide.
Forbidden — the token lacks a required scope, the endpoint is not available to API tokens, or the user behind the token lacks the permission. A human must adjust the token scopes or user permissions; do not retry.
Not found — no record with the given identifier (or the route does not exist). Verify the ID before retrying.
Unprocessable Content
Response Headers
Rate limited — platform limit is 1,000 requests/min; individual tokens may carry lower limits. Honor the Retry-After header before retrying. See the Rate Limits guide.