PayFast integration

SA payment gateway: transactions, refunds, subscriptions, credit card tokenization

Help CentreConnectors

Overview

PayFast is South Africa's largest payment gateway – cards, EFT, Instant EFT (SiD), MobiCred, Mukuru, Zapper, plus tokenized recurring billing. The Automize PayFast connector covers transaction lookups, refunds, subscriptions (recurring billing), tokenised charging, and connectivity testing.

  • Regions: South Africa only. Customers must have a ZA bank account or card issued for ZA processing.
  • Plans: Pay-per-transaction. Tiered fees by volume + transaction type. No monthly fees.

Setting up the connection

Auth type: Bearer Token.

  1. Sign in to my.payfast.com → Settings → Integration.
  2. Note your Merchant ID + Merchant Key (used for hashing) + the Passphrase.
  3. For the REST API specifically, generate an API key under Integration → API.
  4. In Automize, open Settings → Connectors → PayFast → Add connection. Paste credentials.

Find your credentials at https://my.payfast.com/eng/account/integration.


Rate limits

PayFast doesn't publish per-second limits. The connector retries 429 with backoff. For sustained high traffic talk to PayFast support.


Data model

Two product lines:

    One-off / hosted checkout (handled outside this connector – server-to-server form post)
    REST API ─┬─ Tokenized cards (charge stored cards programmatically)
              ├─ Subscriptions (recurring billing tokens)
              └─ Transactions (lookup + refund)

Tokens come from initial checkout flow with 'subscription_type=1'. Once
you have a token, you can charge or manage via the REST API.

Available operations

8 operations available. Click any row to jump to its detail.

OperationCategoryWhat it does
Cancel subscriptionGeneralCancel a PayFast subscription.
Charge tokenized cardGeneralCharge a tokenized credit card via PayFast (adhoc payment).
Fetch subscriptionGeneralGet subscription/recurring billing details from PayFast.
Get transactionGeneralGet transaction details by ID from PayFast.
Pause subscriptionGeneralPause a PayFast subscription.
PingGeneralTest API connectivity to PayFast.
Refund transactionGeneralRefund a PayFast transaction (full or partial).
Unpause subscriptionGeneralResume a paused PayFast subscription.

Operations

Cancel subscription

Cancel a PayFast subscription.

ParameterRequiredTypeDescription
Subscription token tokenYestext

Tips

  • Cancels the recurring billing. Irreversible – start a new subscription if needed.

Charge tokenized card

Charge a tokenized credit card via PayFast (adhoc payment).

ParameterRequiredTypeDescription
Card token tokenYestext
Amount (cents) amountYesnumber
Item name item_nameYestext
Description item_descriptionNotext

Tips

  • token: from previous subscription_type=1 transaction.
  • amount in ZAR cents. item_name shown on the customer's statement.
  • Use for adhoc charges (one-off using saved card) – not for subscriptions.

Fetch subscription

Get subscription/recurring billing details from PayFast.

ParameterRequiredTypeDescription
Subscription token tokenYestext

Tips

  • token. Returns frequency, cycles, run_date, amount, status.

Get transaction

Get transaction details by ID from PayFast.

ParameterRequiredTypeDescription
Payment ID pf_payment_idYestext

Tips

  • pf_payment_id: the PayFast transaction ID (different from m_payment_id which is your reference).

Pause subscription

Pause a PayFast subscription.

ParameterRequiredTypeDescription
Subscription token tokenYestext

Tips

  • Pauses the recurring billing. Use Unpause to resume.

Ping

Test API connectivity to PayFast.

No input parameters.

Tips

  • Health check – verifies credentials + connectivity. Use during onboarding to validate setup.

Refund transaction

Refund a PayFast transaction (full or partial).

ParameterRequiredTypeDescription
Payment ID pf_payment_idYestext
Amount amountNonumber

Tips

  • pf_payment_id + optional amount (in cents) for partial refunds. Omit amount to refund in full.

Errors

  • transaction_not_refundable – Transaction not yet settled or already fully refunded.

Unpause subscription

Resume a paused PayFast subscription.

ParameterRequiredTypeDescription
Subscription token tokenYestext

Tips

  • Resumes a paused subscription. Next charge happens on the next scheduled run_date.

FAQ

Tokenized charge vs subscription – which?
Tokenized charge = one-off, customer-initiated. Subscription = recurring on a schedule. Both use saved-card tokens from the initial checkout.
Sandbox vs production?
PayFast Sandbox uses sandbox.payfast.co.za with test cards. Get sandbox credentials from your PayFast account → Integration → Sandbox. Create separate Automize connections per environment.
Webhooks (ITN) – how?
PayFast posts Instant Transaction Notifications (ITN) for events. Configure the ITN URL in PayFast UI to point at your Automize webhook ingest. This connector handles the API side; webhooks are configured separately.
Why does my Ping work but charge fail?
Ping only validates credentials. Charge can fail for other reasons – token expired, customer's card blocked, daily limit hit, MID restrictions. Look at the response's reason field.

Related connectors

See it working on your own data

Everything documented here ships with the platform – try the document tools free, or go live in 7 days.