PayFast Onsite Checkout API

Generate payment identifiers for embedded (onsite) checkout flows

GitHub OpenAPI
Business capability
Payment Initiation Management BC-1340.10

Operations 1

Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay

POST /onsite/process Generate an onsite payment identifier · Generate onsite payment identifier #
Ask an LLM
“How do I get a UUID to render the PayFast embedded checkout form?”
“Can I pre-fill the customer's name and email on the onsite checkout?”
Tell an agent
Generate an onsite payment identifier for {merchant_id} with amount {amount} and item {item_name}, signature {signature}.
Create an onsite payment for {amount} on {merchant_id} for {item_name}, returning a UUID for the embedded form.

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/payfast:payfast-onsite-checkout-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

payfast-onsite-checkout-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: PayFast Onsite Checkout API
  description: South African payment gateway providing REST APIs for online payment processing, subscription billing, tokenized recurring card payments, onsite checkout, and merchant refunds. Trusted by 80,000+ South African businesses and certified PCI-DSS Level 1.
  version: v1
  contact:
    name: PayFast Developer Support
    url: https://support.payfast.help
  license:
    name: Proprietary
    url: https://payfast.io
servers:
- url: https://api.payfast.co.za/v1
  description: Production API server
- url: https://sandbox.payfast.co.za/v1
  description: Sandbox / test server
security:
- merchantAuth: []
tags:
- name: Onsite Checkout
  description: Generate payment identifiers for embedded (onsite) checkout flows
paths:
  /onsite/process:
    post:
      operationId: generatePaymentIdentifier
      summary: Generate onsite payment identifier
      description: Generate a UUID payment identifier for the PayFast onsite (embedded) checkout integration. The UUID is then used client-side with the PayFast JS library to render the embedded payment form. Not available in sandbox mode.
      tags:
      - Onsite Checkout
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/OnsitePaymentRequest'
      responses:
        '200':
          description: Payment identifier generated successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  uuid:
                    type: string
                    description: Payment identifier UUID to pass to the PayFast JS library
                    example: 550e8400-e29b-41d4-a716-446655440000
        '400':
          $ref: '#/components/responses/BadRequest'
components:
  schemas:
    OnsitePaymentRequest:
      type: object
      required:
      - merchant_id
      - merchant_key
      - amount
      - item_name
      - signature
      properties:
        merchant_id:
          type: string
          description: PayFast merchant ID
          example: '10000100'
        merchant_key:
          type: string
          description: PayFast merchant key
          example: 46f0cd694581a
        return_url:
          type: string
          format: uri
          description: URL to redirect to after successful payment
          example: https://www.example.com/return
        cancel_url:
          type: string
          format: uri
          description: URL to redirect to if customer cancels
          example: https://www.example.com/cancel
        notify_url:
          type: string
          format: uri
          description: ITN notification URL (server-to-server webhook)
          example: https://www.example.com/notify
        name_first:
          type: string
          description: Customer first name
          example: Jane
        name_last:
          type: string
          description: Customer last name
          example: Smith
        email_address:
          type: string
          format: email
          description: Customer email address
          example: jane@example.com
        cell_number:
          type: string
          description: Customer cell number
          example: '+27821234567'
        m_payment_id:
          type: string
          description: Merchant payment reference ID
          example: order-1234
        amount:
          type: string
          description: Payment amount (ZAR, 2 decimal places)
          example: '99.00'
        item_name:
          type: string
          description: Item name
          maxLength: 100
          example: Premium subscription
        item_description:
          type: string
          description: Item description
          maxLength: 255
          example: Monthly premium plan
        currency:
          type: string
          description: Currency (default ZAR)
          default: ZAR
          example: ZAR
        payment_method:
          type: string
          description: Restrict payment to a specific method
          example: cc
        signature:
          type: string
          description: MD5 signature of sorted payment parameters
          example: ad3e6c84d5e5f374a3a0431bc5acbc90
    ErrorResponse:
      type: object
      properties:
        code:
          type: integer
          description: HTTP error code
          example: 400
        status:
          type: string
          description: Error status
          example: failed
        data:
          type: object
          properties:
            response:
              type: string
              description: Error message
              example: Required "token" parameter missing
  responses:
    BadRequest:
      description: Bad request — missing or invalid parameters
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    merchantAuth:
      type: apiKey
      in: header
      name: merchant-id
      description: 'PayFast API authentication uses an MD5 signature derived from the merchant ID, passphrase, timestamp, and request data. Required headers include merchant-id, version, timestamp, and signature.

        '