Skip to main content

PayPal

PayPal Instant Payment Notification (IPN) sends a message to an address in the profile of a business account every time a payment changes: completed, denied, refunded. IPN is the older PayPal mechanism, still supported, and the only one set in the profile without code. Pointed at the Flows address, it starts your flows — a thank-you after a payment, a note about a refund.

Written from PayPal documentation

This page is written from the public documentation of PayPal and has not been checked on a live account yet.

What you need​

  • A PayPal business account.
  • IPN that is not taken. The profile has one Notification URL. If your site or a shop module already uses IPN, replacing the address cuts the shop off — then take the "paid" event from the shop. A notify_url passed by a button or an API call overrides the profile, and such payments go to their own address, not to AlphaFlow.
  • The phone of the buyer usually is not in the message — the contact is found by email.

Step 1. Create a connection​

  1. Open Flows → Connections, press Connect a system and choose PayPal.
  2. Press Copy address. It looks like https://events.alphasms.net/hooks/<TOKEN> — keep it secret.

Step 2. Set up IPN in PayPal​

  1. Log in to your PayPal business account at www.paypal.com.
  2. Hover over your name and choose Account Settings.
  3. On the Notifications page press Update next to Instant payment notifications.
  4. Press Choose IPN Settings and paste the address from the cabinet into Notification URL.
  5. Choose Receive IPN messages (Enabled) and press Save.

Step 3. Send a test​

Send a test message from the IPN Simulator in the sandbox (developer.paypal.com), or make a real payment. IPN History in the profile shows the messages and sends one again. The event appears in Flows → Connections → Event journal within seconds, and the connection shows Recognised: PayPal.

Events​

PayPal payment_statusAlphaFlow eventProperties
Completedpayment_succeededorder_id, total, currency, item, txn_type
Denied, Failedpayment_failedorder_id, total, currency, item, txn_type
Refunded, Reversedrefund_issuedorder_id, total, currency, item, txn_type
  • order_id is the invoice of the seller, if passed; total is mc_gross, currency is mc_currency, item is item_name.
  • Every event also carries status, custom and last_name.
  • Pending, Canceled_Reversal, Processed and the other statuses start nothing.
  • The time of the event is the time AlphaFlow received it: PayPal writes the date in its own format.

The contact is found by the email of the payer (payer_email) — the reliable contact here. The phone (contact_phone) comes only if the seller turned on phone collection, so it is usually empty; the first name comes from first_name. An event without a phone reaches the buyer by SMS or Viber only if AlphaFlow already knows a contact with this email and a phone.

Payment events are not among the events of the ready-made templates (see Recommended events): create the flow From scratch and choose the event as its start.

Good to know​

  • PayPal repeats a message until it gets 200 — with a growing pause, for up to 4 days and no more than 15 times. A repeat has the same transaction and status and is not recorded twice.
  • IPN has no signature. PayPal suggests checking each message by sending it back (cmd=_notify-validate); AlphaFlow does not do this, so the protection is the secret in the address.
  • PayPal often sends names in the windows-1252 encoding: Cyrillic names may come garbled.
  • PayPal REST webhooks need a REST application and are not covered by this page.
  • The address always answers 200. Above the daily event limit the event is refused in AlphaFlow with quota_exceeded and shown in the journal; IPN in PayPal stays on.

PayPal documentation​