Set up and use webhooks

PayPal APIs use webhooks for event notification. A webhook is an HTTP callback that receives notification messages for events. For information, see set up webhooks.

Create order

To create an order:

POST https://api.sandbox.paypal.com/v1/checkout/orders

In addition to the standard Accept, Content-Type, PayPal-Request-Id, and Authorization headers, include the PayPal-Partner-Attribution-Id header with a unique build notation (BN) code. If you do not have a BN code, contact your PayPal account manager. For more information, see HTTP request headers.

To define an order, include the URLs to which to redirect the customer after he or she approves or cancels the order, the order details, and the payment fees. For details, see the Orders API reference.

Pay for order

In addition to the standard Accept, Content-Type, PayPal-Request-Id, and Authorization headers, include the PayPal-Client-Metadata-Id and PayPal-Partner-Attribution-Id headers.

In the URL, specify the ID that the create order call returns.

In the JSON request body, set the disbursement_mode parameter to DELAYED. PayPal holds the money until you call /v1/payments/referenced-payouts-items to disburse funds. For example, you can distribute funds automatically after an order ships.

Note: To learn more about delayed disbursement, see Managing risk for Connected or Managed integrations.

Additional checkout experience options

Shortcut

Shortcut is an optimized checkout experience that enables you to skip collecting your customer's shipping address, email address, and telephone number on your checkout page — the information is pre-filled based on PayPal data.

Disburse funds

Note: You must disburse funds only if you choose delayed disbursement.

PayPal disburses the funds to the partner and seller.

Pass these parameters in the request body:

Parameter

Description

reference_id

The transaction ID for the payout. The pay for order call generates a webhook, which returns the transaction ID.