Taking a payment with PayPal is three moments, and a step for each:

  • PayPal · Create an order — An order the customer approves in PayPal, to capture after. It gives an approval link for the customer.
  • PayPal · Capture an order — Takes the money for an order the customer approved. It is marked Moves money — see Steps that move money.
  • PayPal · Get an order — An order's status and amount. Use it to see whether the customer has approved.

Who can do this

Workspace Admins and Editors, on every plan. Viewers see the step's settings but cannot change them.

Before you start

A PayPal connection — see Connect PayPal. Use a Sandbox one while you build.

Steps

Create an order:

  1. Select +. In the step picker, open Apps, select PayPal, then Create an order.
  2. In Connection, choose your PayPal connection.
  3. In Amount, the amount in the currency's main unit — 49.00.
  4. In Currency, leave $ US dollar or choose another.
  5. Optional: Reference — your own reference — and Description.
  6. Leave Idempotency key as {{ run.id }}. A retried step then makes one order, not two.
  7. Select Run this step. Send the customer the approveUrl.

Capture an order:

  1. In the step picker, under PayPal, select Capture an order. The settings open with Moves money and This step takes the customer's money.
  2. In Connection, choose your PayPal connection. Read the line under it: Live key — real money. or Test mode — Test key — no real money moves.
  3. In Order, the order's id — {{ steps.create_an_order.id }}, or from your own records.
  4. Leave Idempotency key as {{ run.id }} — A retry of this step sends the same key, so the service pays once. Run again, Test run and Run this step start a new run with a new key, and pay again. Bizomate adds the step's id, and the item's position, to it.
  5. Select Test run. On a Live connection, Bizomate asks first — This workflow captures money with a live PayPal key. A test run pays for real. — with Capture for real and Cancel.

Get an order:

  1. In the step picker, under PayPal, select Get an order.
  2. Choose the Connection, and in Order give the order's id.
  3. Select Run this step.

Output

All three give the order:

Field What it is
id PayPal's id for the order.
status CREATED, APPROVED once the customer approves, COMPLETED once captured.
approveUrl The link where the customer approves the payment.
payerEmail The customer's PayPal email, once they have approved.
amount, amountCurrency, amountText 49.00, USD, $ 49.00.

Capture an order also gives:

Field What it is
captureId The capture's id. Refund a capture needs it.
captureStatus COMPLETED, or PENDING while PayPal holds it.
amount, amountCurrency, amountText What was captured.

Good to know

  • Capture only after approval. PayPal refuses to capture an order the customer has not approved. Use the trigger Payment captured — or Get an order — to follow it.
  • A retried step captures once. Every try in the same run sends PayPal the same PayPal-Request-Id, and PayPal answers a repeat with the first capture.
  • Run again, Test run and Run this step capture again — each is a new run, with a new key.
  • Runs once per item. For several orders in one run, give each its own key — {{ run.id }}-{{ $json.id }} — or PayPal answers every item with the first one's result.

If something goes wrong

What you see Why What to do
Order is empty when the step ran — … / Amount is empty when the step ran — … The value it reads came out empty. Check the value it reads.
PayPal refused: … on a capture, saying the payer has not approved The customer has not approved the order. Wait until Get an order shows APPROVED, then capture.
PayPal refused: … PayPal would not do it, in its own words — already captured, an order from the other environment. Use Get an order to check it.
PayPal refused: Client Authentication failed. Check the connection's details on Connections. The app's secret was changed. Reconnect with the new secret.