Payflex Connector
Connector name: Payflex
Payment method type:
za_payflex_ewallet(Payflex Buy Now, Pay Later (BNPL) for South Africa. Category ewallet, flow type ewallet. The shopper is redirected to Payflex, picks an installment plan and completes the payment there. Refundable: yes. Cancelable: no. Expirable: yes (max 3600 seconds).)Gateway name: payflex (gateway name 'Payflex', gc_type 'payflex', runs in the payments connector service)
Supported countries and currencies: South Africa (ZA), ZAR
Minimum amount is ZAR 10.00. No maximum is set in Rapyd; Payflex decides the limit per shopper based on credit history.
Payments expire after 3600 seconds (60 minutes) of inactivity (payment_method_type_maximum_expiration_seconds = 3600).
Payflex checkout page is hosted by Payflex (redirect). The merchant receives a redirect_url and sends the shopper there.
The final payment status arrives asynchronously: Payflex calls a Rapyd webhook, and the connector re-reads the order from Payflex (GET order) before updating the payment. The webhook payload status itself is never trusted.
Refunds are synchronous: the connector creates the refund at Payflex and immediately looks it up, so the refund status is final in the API response.
Sub-merchant support: Rapyd sends aggregateMerchantId to Payflex on every create-order call. The value comes from the gateway submid configuration (sub_merchant_id, fallback rapyd_sub_merchant_id). It is not a merchant API field. Payflex never echoes it back in responses.
Rapyd uses one set of Payflex OAuth2 client credentials per environment (central configuration). Individual merchants are identified to Payflex through aggregateMerchantId.
In the Sandbox environment the PMT is linked to the Rapyd simulator gateway (rapyd_gw), not to Payflex UAT. Sandbox tests do not reach Payflex.
API request | Endpoint | Unique capabilities | Limitations |
|---|---|---|---|
Create payment |
| Redirect BNPL flow. Response has status ACT and a Payflex redirect_url. Payment becomes CLO when Payflex reports Approved (via webhook + order lookup). No payment_method.fields are needed. Customer name, email and phone are mandatory and are passed to Payflex for its credit and OTP checks. aggregateMerchantId (sub-merchant) is added automatically from submid configuration. | ZAR only, with a minimum of ZAR 10.00; payments cannot be canceled through the API. |
Create refund |
| Full and partial refunds. Synchronous: the connector creates the refund at Payflex and then looks it up; the refund is Completed only when Payflex returns status 'Completed'. Payflex error codes (for example MRM007 Refund not allowed) are passed back as the refund failure code and reason. | Completed payments only; total refunds cannot exceed the order amount. |
Header parameters: Standard Rapyd headers. No connector-specific headers.
Supported workflows
Redirect ewallet (BNPL) payment: create payment, redirect the shopper to redirect_url, receive the final status by Rapyd webhook.
Refund (full or partial) of a completed payment with
POST /v1/refunds.Retrieve payment (
GET /v1/payments/{payment}) returns the status Rapyd has stored. The connector does not call Payflex for this (no gateway retrieve/polling).Unique workflow - asynchronous status by Payflex webhook: Payflex posts to the Rapyd callback URL; the connector re-fetches the order (GET order) and maps Approved -> CLO, Declined/Abandoned -> ERR, Created/Initiated -> stays ACT. A payment already CLO is not changed again.
Create Payment - Body parameters
Note
This table has many columns. Use the horizontal scroll bar below the table to move across and view all of the columns.
Field name | Parent field | Data type | Required or optional | Default value | Accepted values (enum) | Constraints | Description | Example | Provided by |
|---|---|---|---|---|---|---|---|---|---|
| - | number | Required | - | Decimal, 2 places | Minimum 10.00 ZAR. No Rapyd maximum (Payflex decides per shopper). | Payment amount in ZAR. | 250.00 | Merchant |
| - | string | Required | - | ZAR | ISO 4217 | Payment currency. | ZAR | Merchant |
| - | object | Required | - | - | - | Payment method object. | {"type": " | Merchant |
|
| string | Required | - |
| - | Payment method type. |
| Merchant |
|
| object | Optional | {} | Empty object | No fields are defined for this PMT (required_fields = []). | Payment-method-specific fields. None for Payflex. | {} | Merchant |
| - | object | Required | - | - | Must contain name, email and phone_number. | Shopper details used by Payflex for identity, credit and OTP checks. | {"name": "Thabo Nkosi", "email": "thabo@example.com", "phone_number": "27821234567"} | Merchant |
|
| string | Required | - | Letters and spaces | Regex ^[a-zA-ZÀ-ÿ ]{1,100}$ | Shopper full name. | Thabo Nkosi | Merchant |
|
| string | Required | - | - | Regex (?=.{4,100}$)[a-zA-Z0-9À-ÿ._%+-]+@[a-zA-Z0-9À-ÿ.-]+[.][a-zA-ZÀ-ÿ]{2,}$ | Shopper email. | thabo@example.com | Merchant |
|
| string | Required | - | Digits only | Production and Sandbox regex ^[0-9]{1,15}$ (no plus sign). | Shopper mobile number. Payflex uses it for OTP. | 27821234567 | Merchant |
| - | string | Required | - | URL | HTTPS required in production. No localhost. | Where the shopper returns after approving the Payflex payment. | https://merchant.example/return | Merchant |
| - | string | Required | - | URL | HTTPS required in production. No localhost. | Where the shopper returns if they cancel or are declined. | https://merchant.example/cancel | Merchant |
| - | string | Optional | - | - | - | Merchant's own order reference. | MERCH-REF-0001 | Merchant |
| - | string | Optional | - | - | - | Payment description. | Order 1234 | Merchant |
| - | number | Optional | Now + 3600 seconds | Unix timestamp (seconds) | PMT maximum expiration is 3600 seconds. | When the payment expires if the shopper does not complete it. | 1780398761 | Merchant |
| - | object | Optional | - | - | - | Merchant-defined key/value data. | {"order": "1234"} | Merchant |
Create Payment - Response parameters
Note
This table has many columns. Use the horizontal scroll bar below the table to move across and view all of the columns.
Field name | Parent field | Data type | Values (enum) | Description | Example | Provided by |
|---|---|---|---|---|---|---|
|
| string | payment_... | Rapyd payment ID. Also sent to Payflex as merchantReference and used for reconciliation. | payment_77465d3aeaa6eb6dedf34d4552a76fdd | Rapyd |
|
| string | ACT, CLO, ERR, EXP | Payment status. ACT on creation; CLO when Payflex approves; ERR when Payflex declines, the shopper abandons, or order creation fails; EXP after 60 minutes. | ACT | Rapyd |
|
| string | URL | Payflex checkout page. Send the shopper here. | https://checkout.payflex.co.za/embedded/v2?orderId=22ba200f-8d69-496a-97ec-d0a1a0dd038c | Gateway |
|
| number | - | Amount paid. 0 while ACT; equals original_amount once CLO. | 0 | Rapyd |
|
| number | - | Requested amount. | 250 | Carried over |
|
| string | ZAR | Currency. | ZAR | Carried over |
|
| string | ZA | Country of the payment method. | ZA | Rapyd |
|
| string | - | Echo of the merchant reference. | MERCH-REF-0001 | Carried over |
|
| string |
| Payment method type. |
| Rapyd |
|
| string | ewallet | PMT category. | ewallet | Rapyd |
|
| string | pending_confirmation, not_applicable | What the merchant should do next. pending_confirmation means redirect the shopper. | pending_confirmation | Rapyd |
|
| array | - | Shopper instructions from the PMT configuration. | [{"name": "instructions", "steps": [{"step1": "You will be redirected to the Payflex login page to complete your payment.", "step2": "Once in the Payflex environment, select your preferred payment plan and complete your payment."}]}] | Rapyd |
|
| string | - | Echo. | https://merchant.example/return | Carried over |
|
| string | - | Echo. | https://merchant.example/cancel | Carried over |
|
| number | - | Expiry time (Unix seconds). | 1780398761 | Rapyd |
|
| boolean | true, false | true once the payment is CLO. | false | Rapyd |
|
| string | Payflex error code, for example CRM005, VALIDATION_ERROR, UNAUTHORISED | Failure code when order creation fails at Payflex. | - | Gateway |
|
| string | - | Failure message from Payflex. | - | Gateway |
|
| object | - | Not used by this connector (always empty). | {} | Rapyd |
|
| string | cus_... | Rapyd customer created from the inline customer. | cus_8c94d097e831e530763f2e5b3462e568 | Rapyd |
Create Refund - Body parameters
Note
This table has many columns. Use the horizontal scroll bar below the table to move across and view all of the columns.
Field name | Parent field | Data type | Required or optional | Default value | Accepted values (enum) | Constraints | Description | Example | Provided by |
|---|---|---|---|---|---|---|---|---|---|
| - | string | Required | - | payment_... | Payment must be CLO. | ID of the Payflex payment to refund. | payment_77465d3aeaa6eb6dedf34d4552a76fdd | Merchant |
| - | number | Optional | Full remaining amount | Decimal | Cannot exceed the remaining refundable amount. | Refund amount. Partial refunds are supported. | 100.00 | Merchant |
| - | string | Optional | Payment currency | ZAR | Must match the payment currency. | Refund currency. | ZAR | Merchant |
| - | string | Optional | - | - | - | Merchant's own refund reference. | REFUND-0001 | Merchant |
| - | string | Optional | - | - | - | Reason for the refund. | Customer returned item | Merchant |
| - | object | Optional | - | - | - | Merchant-defined data. | {} | Merchant |
Create Refund - Response parameters
Note
This table has many columns. Use the horizontal scroll bar below the table to move across and view all of the columns.
Field name | Parent field | Data type | Values (enum) | Description | Example | Provided by |
|---|---|---|---|---|---|---|
|
| string | refund_... | Rapyd refund ID. Sent to Payflex as merchantRefundReference. | refund_5a1b2c3d4e5f60718293a4b5c6d7e8f9 | Rapyd |
|
| string | Completed, Error | Final refund status. Completed only when the Payflex refund lookup returns 'Completed'. | Completed | Rapyd |
|
| number | - | Refunded amount as returned by Payflex. | 100 | Gateway |
|
| string | payment_... | Original payment ID. | payment_77465d3aeaa6eb6dedf34d4552a76fdd | Carried over |
|
| string | ZAR | Refund currency. | ZAR | Carried over |
|
| string | - | Why the refund failed. Either the Payflex error message, or 'Refund lookup returned unexpected status: <status>'. | - | Gateway |
|
| string | - | Echo of the merchant refund reference. | REFUND-0001 | Carried over |
|
| string |
| PMT of the refunded payment. |
| Rapyd |
|
| number | - | Creation time (Unix seconds). | 1780400000 | Rapyd |
This section shows how PayU Africa (Magellan API) fields, values and behavior relate to the Rapyd fields in the field mapping tables.
Migration notes
PayU Africa equivalent: payment method code PAYFLEX (AdditionalInformation.supportedPaymentMethods = PAYFLEX). PayU Africa merchants are mapped from PAYFLEX to
za_payflex_ewallet.Unique workflow - PayU Africa merchants: setTransaction with supportedPaymentMethods=PAYFLEX becomes a Rapyd hosted checkout (
POST /v1/checkoutwith payment_method_types_include ['za_payflex_ewallet']); doTransaction PAYMENT with PAYFLEX becomesPOST /v1/payments; doTransaction CREDIT becomesPOST /v1/refunds. The Rapyd result is sent to the merchant's notificationUrl as a PayU-style IPN.
Field mapping (Rapyd field to original PayU field)
Create Payment - Body parameters
Rapyd field name | Original PayU field |
|---|---|
|
|
|
|
|
|
|
|
| None (new in Rapyd) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| None (new in Rapyd) |
| None (new in Rapyd) |
Accepted values mapping
Field name | Original PayU value | Rapyd value |
|---|---|---|
| PAYFLEX |
|
| Basket.amountInCents = 25000 | 250.00 |
Create Payment - Response parameters
Rapyd field name | Original PayU field |
|---|---|
|
|
|
|
| redirect url |
|
|
|
|
|
|
| - |
|
|
| - |
| None (new in Rapyd) |
| None (new in Rapyd) |
| None (new in Rapyd) |
|
|
|
|
| None (new in Rapyd) |
|
|
|
|
|
|
| None (new in Rapyd) |
| None (new in Rapyd) |
Accepted values mapping
Field name | Original PayU value | Rapyd value |
|---|---|---|
| successful=true, resultCode 00 (doTransaction) | ACT or CLO |
| successful=false, resultCode 05, pointOfFailure ACQUIRER | ERR |
| successful=false, resultCode P015, pointOfFailure PAYU | CAN |
| successful=false, resultCode 994, pointOfFailure PAYU | EXP |
| any other or missing status -> resultCode P046 | other |
Create Refund - Body parameters
Rapyd field name | Original PayU field |
|---|---|
|
|
| Credit block amount (core field |
|
|
|
|
| None (new in Rapyd) |
| None (new in Rapyd) |
Accepted values mapping
Field name | Original PayU value | Rapyd value |
|---|---|---|
| doTransaction TransactionType = CREDIT | POST /v1/refunds |
Create Refund - Response parameters
Rapyd field name | Original PayU field |
|---|---|
|
|
|
|
| Credit amount / |
|
|
|
|
|
|
|
|
| - |
| None (new in Rapyd) |
Accepted values mapping
Field name | Original PayU value | Rapyd value |
|---|---|---|
| successful=true, resultCode 00 | Completed (or Pending) |
| successful=false, resultCode P046, pointOfFailure PAYU | Error / any other |
| N/A - Payflex refund lookup status 'Completed' | Completed (CLO) |
Create payment (POST /v1/payments)
Request
curl -X POST 'https://sandboxapi.rapyd.net/v1/payments' \ -H 'access_key: <your_access_key>' \ -H 'Content-Type: application/json' \ -H 'idempotency: <unique_idempotency_key>' \ -H 'salt: <random_salt>' \ -H 'signature: <calculated_signature>' \ -H 'timestamp: <unix_timestamp>' \ --data-raw '{ "amount": 250.0, "currency": "ZAR", "payment_method": { "type": "za_payflex_ewallet", "fields": {} }, "customer": { "name": "Thabo Nkosi", "email": "thabo@example.com", "phone_number": "27821234567" }, "complete_payment_url": "https://merchant.example/return", "error_payment_url": "https://merchant.example/cancel", "merchant_reference_id": "MERCH-REF-0001", "description": "Order 1234" }'
Response
{ "status": { "error_code": "", "status": "SUCCESS", "message": "", "response_code": "", "operation_id": "71825e7b-b292-4415-bd08-4514d7780e06" }, "data": { "id": "payment_77465d3aeaa6eb6dedf34d4552a76fdd", "amount": 0, "original_amount": 250, "is_partial": false, "currency_code": "ZAR", "country_code": "ZA", "status": "ACT", "description": "Order 1234", "merchant_reference_id": "MERCH-REF-0001", "customer_token": "cus_8c94d097e831e530763f2e5b3462e568", "payment_method": "other_a7a94f0a5fe13d5381a5752310fc4c98", "payment_method_data": { "id": "other_a7a94f0a5fe13d5381a5752310fc4c98", "type": "za_payflex_ewallet", "category": "ewallet", "metadata": {}, "next_action": "not_applicable" }, "expiration": 1780398761, "captured": true, "refunded": false, "refunded_amount": 0, "redirect_url": "https://checkout.payflex.co.za/embedded/v2?orderId=22ba200f-8d69-496a-97ec-d0a1a0dd038c", "complete_payment_url": "https://merchant.example/return", "error_payment_url": "https://merchant.example/cancel", "created_at": 1780395160, "metadata": {}, "failure_code": "", "failure_message": "", "paid": false, "paid_at": 0, "visual_codes": {}, "textual_codes": {}, "instructions": [ { "name": "instructions", "steps": [ { "step1": "You will be redirected to the Payflex login page to complete your payment.", "step2": "Once in the Payflex environment, select your preferred payment plan and complete your payment." } ] } ], "ewallet_id": "ewallet_ba37d302e173e089078bf8cbadf68cc8", "payment_method_options": {}, "payment_method_type": "za_payflex_ewallet", "payment_method_type_category": "ewallet", "initiation_type": "customer_present", "next_action": "pending_confirmation", "error_code": "" } }
Create refund (POST /v1/refunds)
Request
curl -X POST 'https://sandboxapi.rapyd.net/v1/refunds' \ -H 'access_key: <your_access_key>' \ -H 'Content-Type: application/json' \ -H 'idempotency: <unique_idempotency_key>' \ -H 'salt: <random_salt>' \ -H 'signature: <calculated_signature>' \ -H 'timestamp: <unix_timestamp>' \ --data-raw '{ "payment": "payment_77465d3aeaa6eb6dedf34d4552a76fdd", "amount": 100.0, "currency": "ZAR", "merchant_reference_id": "REFUND-0001", "reason": "Customer returned item" }'
Response
{ "status": { "error_code": "", "status": "SUCCESS", "message": "", "response_code": "", "operation_id": "0c3a5d0e-5f1e-4c47-9a0b-1f2e3d4c5b6a" }, "data": { "id": "refund_5a1b2c3d4e5f60718293a4b5c6d7e8f9", "amount": 100, "payment": "payment_77465d3aeaa6eb6dedf34d4552a76fdd", "currency": "ZAR", "failure_reason": "", "metadata": {}, "reason": "Customer returned item", "status": "Completed", "receipt_number": 0, "created_at": 1780400000, "merchant_reference_id": "REFUND-0001", "payment_created_at": 1780395160, "payment_method_type": "za_payflex_ewallet", "ewallets": [ { "ewallet": "ewallet_ba37d302e173e089078bf8cbadf68cc8", "amount": 100 } ], "proportional_refund": true } }