MPGS Card - NG Connector
Connector name: MPGS Card - NG
Payment method type:
ng_mpgsvisa_card(Visa in Nigeria - Visa card payments in NGN processed through MPGS (category card, flow card).);ng_mpgsmastercard_card(Mastercard in Nigeria - Mastercard card payments in NGN processed through MPGS (category card, flow card).)Gateway name: MPGS (Mastercard Payment Gateway Services) - Rapyd gateway mpgs_ng
Supported countries and currencies: Nigeria (NG), NGN
Gateway: Mastercard Payment Gateway Services (MPGS) REST API v100, direct server-to-server card API (PUT .../merchant/{merchantId}/order/{orderId}/transaction/{transactionId}). No hosted checkout or redirect from MPGS itself.
Rapyd acts as the aggregator on MPGS. Every PAY, AUTHORIZE and VERIFY sends sub-merchant details (order.subMerchant) to MPGS.
Note
Card payments are processed as standard e-commerce payments, including when initiation_type is moto. Rapyd performs the 3DS authentication, and 3DS data cannot be supplied by the merchant. Merchant-initiated payments are currently limited: the original_payment reference is not used by the connector at present.
API request | Endpoint | Unique capabilities | Limitations |
|---|---|---|---|
Create payment (card) |
| capture=true sends MPGS PAY (payment closes immediately, status CLO). capture=false sends AUTHORIZE (status ACT, capture later). amount 0 with capture=false sends VERIFY (card check). Rapyd 3DS result (CAVV/ECI/3DS2 data) is forwarded to MPGS. Stored credentials: initiation_type customer_present/recurring/installment/unscheduled maps to MPGS CIT/MIT agreement fields. Acquirer response code and message are returned as failure_code / failure_message on declines. | NGN only. |
Capture payment |
| Full or partial capture of an AUTHORIZE (MPGS CAPTURE on the same order). The connector checks the amount does not exceed the remaining authorized amount. Sends order.expectedNumberOfCaptures (default 1 from the payment options). | Only one capture per authorization. |
Cancel payment (void) |
| Voids an open authorization (MPGS VOID with targetTransactionId = original transaction). Payment status becomes CAN. | Only for authorized, not yet captured payments. |
Create refund |
| Full and partial refunds (MPGS REFUND on the original order). Approved = refund closed; PENDING/SUBMITTED/UNKNOWN = refund pending; declines return the acquirer code/message. | Refund status is not updated after creation. |
Retrieve payment |
| The connector implements getPayment / pollingUpdate using MPGS Retrieve Transaction (GET) and re-syncs the status. Polling also voids an authorization that is past Rapyd's expiration time. | Polling is scheduler-driven, not merchant-triggered. |
Header parameters: Standard Rapyd headers. No connector-specific headers.
Supported workflows
Card payments: direct card, capture true/false, 3DS via Rapyd.
Authorize then capture, partial capture, void and refund on the same card payment.
Zero-amount card verification (amount 0, capture=false) sent to MPGS as VERIFY.
Stored credentials: a customer-initiated first payment can store the card agreement (save_payment_method).
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 amount in major units. 0 allowed only with capture=false (card verification). | Payment amount. | 15000.00 | Merchant |
| - | string | Required | - | NGN | - | ISO 4217 currency code. | NGN | Merchant |
| - | object | Required | - | - | - | Card payment method object. | {...} | Merchant |
|
| string | Required | - |
| - | Payment method type. |
| Merchant |
|
| string | Required | - | - | - | Card number (PAN). | 5123450000000008 | Merchant |
|
| string | Required | - | 01-12 | - | Card expiry month. | 01 | Merchant |
|
| string | Required | - | - | Two digits | Card expiry year. | 39 | Merchant |
|
| string | Required | - | - | - | Card security code. | 100 | Merchant |
|
| string | Required | - | - | - | Cardholder name. | Test Cardholder | Merchant |
| - | boolean | Optional | true | true, false | - | true = authorize and capture now (MPGS PAY). false = authorize only (MPGS AUTHORIZE), capture later. | true | Merchant |
|
| boolean | Optional | - | true, false | - | Ask for 3DS authentication. | true | Merchant |
| - | string | Optional | - | customer_present, installment, recurring, unscheduled | - | How the payment was initiated (stored credentials). | customer_present | Merchant |
| - | boolean | Optional | false | - | - | Keep the card agreement for later merchant-initiated payments. | false | Merchant |
| - | string | Conditional | - | - | - | Reference to the payment that first stored the card. Not used by the connector at present. | payment_0f0e0d0c0b0a09080706050403020100 | Merchant |
| - | string | Conditional | - | - | - | Where the customer returns after Rapyd 3DS. | https://merchant.example.com/success | Merchant |
| - | string | Conditional | - | - | - | Where the customer returns if 3DS fails. | https://merchant.example.com/error | Merchant |
| - | string | Optional | - | - | - | Merchant's own order reference. | ORDER-2026-000123 | Merchant |
| - | string | Optional | - | - | - | Payment description. | 2 x Widget + shipping | Merchant |
| - | string | Optional | - | - | - | Merchant name on the card statement. | MYSHOP | Merchant |
|
| object | Optional | - | - | - | Sub-merchant details for aggregator transactions. | {"trading_name":"MYSHOP",...} | Merchant |
|
| object | Optional | - | - | - | Recurring agreement settings for a customer-initiated first payment. | {"agreement_expiry":"2027-12-31","amount_variability":"FIXED","number_of_payments":12} | 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 | - | Rapyd payment id. Also used as the MPGS order id. | payment_1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d | Rapyd |
| - | string | ACT, CLO, ERR, CAN | Payment status. | CLO | Gateway |
| - | string | - | Reason code on failure. | 05 | Gateway |
| - | string | - | Readable failure reason. | Do not honour | Gateway |
| - | string | - | 3DS challenge URL. | https://sandboxcheckout.rapyd.net/3ds-payment?token=payment_... | Rapyd |
| - | boolean | - | Whether the payment is captured. | true | Rapyd |
|
| string | pass, fail, unavailable | 3DS result. | pass | Rapyd |
|
| string | - | Masked card details. | 0008 | Rapyd |
| - | number | - | Amount requested / captured. | 15000.00 | Rapyd |
| - | string | - | Echo of the merchant reference. | ORDER-2026-000123 | Carried over |
| - | string |
| Payment method type used. |
| Carried over |
| - | string | - | MPGS order id stored as the payment gateway token. | payment_1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d | Gateway |
Capture 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 |
|---|---|---|---|---|---|---|---|---|---|
|
| string | Required | - | - | - | Id of the authorized payment. | payment_1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d | Merchant |
| - | number | Optional | Full authorized amount | - | Greater than 0 and not more than the remaining authorized amount | Amount to capture. | 10000.00 | Merchant |
|
| integer | Optional | 1 | - | Integer >= 1, invalid values become 1 | Planned number of captures. | 1 | Merchant |
Capture 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 | CLO, ACT, ERR | CLO when MPGS result is SUCCESS (full or partial). ACT if MPGS is pending. ERR on failure. | CLO | Gateway |
| - | boolean / number | - | Captured flag and amount. | 10000.00 | Gateway |
| - | string | - | Failure reason. | DECLINED | Gateway |
Cancel 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 |
|---|---|---|---|---|---|---|---|---|---|
|
| string | Required | - | - | - | ID of the authorized payment to void. | payment_1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d | Merchant |
Cancel 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 | CAN, ACT, ERR | CAN when MPGS approves the void; ACT if pending; ERR on failure. | CAN | Gateway |
| - | string | - | Failure reason. | INVALID_REQUEST | Gateway |
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 | - | - | - | Id of the captured payment. | payment_1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d | Merchant |
| - | number | Optional | Full captured amount | - | - | Refund amount; partial allowed. | 10000.00 | Merchant |
| - | string | Optional | - | - | - | Merchant refund reference. | REFUND-000123 | Merchant |
| - | string | Optional | - | - | - | Refund reason. | Customer request | 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 | - | Rapyd refund id. | refund_1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d | Rapyd |
| - | string | Completed, Pending, Error | Refund status. | Completed | Gateway |
| - | number / string | - | Refund amount, currency and payment ID. | 10000.00 | Carried over |
Retrieve Payment - Path 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 | - | - | - | Rapyd payment id. | payment_1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d | Merchant |
Retrieve 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 | ACT, CLO, ERR, CAN | Current payment status. | CLO | Gateway |
This section shows how PayU Africa (Magellan API) fields, values and behavior relate to the Rapyd fields in the field mapping tables.
Field mapping (Rapyd field to original PayU field)
Create Payment - Body parameters
Rapyd field name | Original PayU field |
|---|---|
| CREDITCARD: |
| CREDITCARD: |
| CREDITCARD: |
| CREDITCARD (no field: The payment method type is resolved from the instrument CREDITCARD, the merchant processor country |
| CREDITCARD: |
| CREDITCARD: |
| CREDITCARD: |
| CREDITCARD: |
| CREDITCARD: |
| CREDITCARD: |
| CREDITCARD: |
| CREDITCARD: |
| CREDITCARD: |
| CREDITCARD: |
| CREDITCARD: |
| CREDITCARD: |
| CREDITCARD: |
| CREDITCARD: |
| - |
| - |
| - |
Accepted values mapping
Field name | Original PayU value | Rapyd value |
|---|---|---|
| TransactionType=PAYMENT | capture=true |
| TransactionType=RESERVE | capture=false |
| AdditionalInformation.secure3d=true | payment_method_options.3d_required=true |
| Basket.amountInCents=15000 | amount=150.00 |
| Creditcard.cardExpiry=012039 | expiration_month=01, expiration_year=39 |
| Customfield cardEntryMode=cof_merchant_initiated_transaction | initiation_type=unscheduled |
| Customfield cardEntryMode=recurring_subsequent_transaction | initiation_type=recurring |
| cardEntryMode cof_consent_transaction / recurring_consent_transaction / cof_cardholder_initiated_transaction / absent | initiation_type=customer_present |
| CREDITCARD (merchant country ZA or NG + Visa or Mastercard BIN) |
|
| Creditcard.budgetPeriod=0 | None |
Create Payment - Response parameters
Rapyd field name | Original PayU field |
|---|---|
| CREDITCARD: |
| CREDITCARD: |
| CREDITCARD: |
| CREDITCARD: |
| CREDITCARD: |
| CREDITCARD: |
| - |
| CREDITCARD: |
| CREDITCARD: |
| CREDITCARD: |
| CREDITCARD ( |
| CREDITCARD: |
Accepted values mapping
Field name | Original PayU value | Rapyd value |
|---|---|---|
| successful=true, resultCode=00 (PAYMENT) | CLO |
| successful=true, resultCode=00 (RESERVE) | ACT |
| successful=false, resultCode from payu_africa_rapyd_error_code_mappings | ERR |
| successful=true, resultCode=P3DS + secure3D block | ACT + redirect_url (next_action 3d_verification) |
Capture Payment - Body parameters
Rapyd field name | Original PayU field |
|---|---|
| CREDITCARD: |
| CREDITCARD: |
| - |
Accepted values mapping
Field name | Original PayU value | Rapyd value |
|---|---|---|
| CREDITCARD TransactionType=FINALIZE |
|
Capture Payment - Response parameters
Rapyd field name | Original PayU field |
|---|---|
| CREDITCARD: |
| CREDITCARD: |
| CREDITCARD: |
Cancel Payment - Body parameters
Rapyd field name | Original PayU field |
|---|---|
| CREDITCARD: |
Accepted values mapping
Field name | Original PayU value | Rapyd value |
|---|---|---|
| CREDITCARD TransactionType=RESERVE_CANCEL |
|
Cancel Payment - Response parameters
Rapyd field name | Original PayU field |
|---|---|
| CREDITCARD: |
| CREDITCARD: |
Create Refund - Body parameters
Rapyd field name | Original PayU field |
|---|---|
|
|
| CREDIT: |
| CREDIT: |
| - |
Accepted values mapping
Field name | Original PayU value | Rapyd value |
|---|---|---|
| TransactionType=CREDIT | POST /v1/refunds |
Create Refund - Response parameters
Rapyd field name | Original PayU field |
|---|---|
| CREDIT: |
| CREDIT: |
| CREDIT: |
Accepted values mapping
Field name | Original PayU value | Rapyd value |
|---|---|---|
| successful=true, resultCode 00 | Completed or Pending |
| successful=false, PROCESSED_FAILURE code | Error / other |
Retrieve Payment - Path parameters
Rapyd field name | Original PayU field |
|---|---|
| getTransaction: |
Accepted values mapping
Field name | Original PayU value | Rapyd value |
|---|---|---|
| getTransaction |
|
Retrieve Payment - Response parameters
Rapyd field name | Original PayU field |
|---|---|
| getTransaction: |
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 '{ "amount": 15000.0, "currency": "NGN", "capture": true, "merchant_reference_id": "ORDER-2026-000123", "description": "2 x Widget + shipping", "statement_descriptor": "MYSHOP", "complete_payment_url": "https://merchant.example.com/success", "error_payment_url": "https://merchant.example.com/error", "payment_method": { "type": "ng_mpgsmastercard_card", "fields": { "number": "5123450000000008", "expiration_month": "01", "expiration_year": "39", "cvv": "100", "name": "Test Cardholder" } }, "payment_method_options": { "3d_required": true } }'
Response
{ "status": { "error_code": "", "status": "SUCCESS", "message": "", "response_code": "", "operation_id": "11111111-2222-3333-4444-555555555555" }, "data": { "id": "payment_1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d", "amount": 15000.0, "original_amount": 15000.0, "currency_code": "NGN", "status": "CLO", "captured": true, "paid": true, "paid_at": 1790000000, "payment_method_type": "ng_mpgsmastercard_card", "payment_method_type_category": "card", "payment_method_data": { "type": "ng_mpgsmastercard_card", "name": "Test Cardholder", "last4": "0008", "acs_check": "pass", "cvv_check": "unchecked", "bin_details": { "type": null, "brand": null, "country": null, "bin_number": "512345" }, "expiration_year": "39", "expiration_month": "01", "fingerprint_token": "ocfp_..." }, "payment_method_options": { "3d_required": true }, "merchant_reference_id": "ORDER-2026-000123", "description": "2 x Widget + shipping", "statement_descriptor": "MYSHOP", "redirect_url": "", "complete_payment_url": "https://merchant.example.com/success", "error_payment_url": "https://merchant.example.com/error", "failure_code": "", "failure_message": "", "refunded": false, "refunded_amount": 0, "metadata": {} } }
Create payment - 3DS challenge pending (POST /v1/payments, response before 3DS is completed)
Request
// Same request as above (payment_method_options.3d_required=true) 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 '{ "amount": 15000.0, "currency": "NGN", "capture": true, "merchant_reference_id": "ORDER-2026-000123", "description": "2 x Widget + shipping", "statement_descriptor": "MYSHOP", "complete_payment_url": "https://merchant.example.com/success", "error_payment_url": "https://merchant.example.com/error", "payment_method": { "type": "ng_mpgsmastercard_card", "fields": { "number": "5123450000000008", "expiration_month": "01", "expiration_year": "39", "cvv": "100", "name": "Test Cardholder" } }, "payment_method_options": { "3d_required": true } }'
Response
{ "status": { "error_code": "", "status": "SUCCESS", "message": "", "response_code": "", "operation_id": "11111111-2222-3333-4444-555555555555" }, "data": { "id": "payment_1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d", "amount": 15000.0, "original_amount": 15000.0, "currency_code": "NGN", "status": "ACT", "captured": false, "paid": false, "paid_at": 0, "payment_method_type": "ng_mpgsmastercard_card", "payment_method_type_category": "card", "payment_method_data": { "type": "ng_mpgsmastercard_card", "name": "Test Cardholder", "last4": "0008", "acs_check": "unchecked", "cvv_check": "unchecked", "bin_details": { "type": null, "brand": null, "country": null, "bin_number": "512345" }, "expiration_year": "39", "expiration_month": "01", "fingerprint_token": "ocfp_..." }, "payment_method_options": { "3d_required": true }, "merchant_reference_id": "ORDER-2026-000123", "description": "2 x Widget + shipping", "statement_descriptor": "MYSHOP", "redirect_url": "https://sandboxcheckout.rapyd.net/3ds-payment?token=payment_1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d", "complete_payment_url": "https://merchant.example.com/success", "error_payment_url": "https://merchant.example.com/error", "failure_code": "", "failure_message": "", "refunded": false, "refunded_amount": 0, "metadata": {} } }
Create payment - declined by issuer (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 '{ "amount": 15000.0, "currency": "NGN", "capture": true, "merchant_reference_id": "ORDER-2026-000123", "description": "2 x Widget + shipping", "statement_descriptor": "MYSHOP", "complete_payment_url": "https://merchant.example.com/success", "error_payment_url": "https://merchant.example.com/error", "payment_method": { "type": "ng_mpgsmastercard_card", "fields": { "number": "5123450000000008", "expiration_month": "01", "expiration_year": "39", "cvv": "100", "name": "Test Cardholder" } }, "payment_method_options": { "3d_required": true } }'
Response
{ "status": { "error_code": "ERROR_CREATE_PAYMENT", "status": "ERROR", "message": "Do not honour", "response_code": "", "operation_id": "11111111-2222-3333-4444-555555555555" }, "data": { "id": "payment_1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d", "amount": 15000.0, "original_amount": 15000.0, "currency_code": "NGN", "status": "ERR", "captured": false, "paid": false, "paid_at": 0, "payment_method_type": "ng_mpgsmastercard_card", "payment_method_type_category": "card", "payment_method_data": { "type": "ng_mpgsmastercard_card", "name": "Test Cardholder", "last4": "0008", "acs_check": "pass", "cvv_check": "unchecked", "bin_details": { "type": null, "brand": null, "country": null, "bin_number": "512345" }, "expiration_year": "39", "expiration_month": "01", "fingerprint_token": "ocfp_..." }, "payment_method_options": { "3d_required": true }, "merchant_reference_id": "ORDER-2026-000123", "description": "2 x Widget + shipping", "statement_descriptor": "MYSHOP", "redirect_url": "", "complete_payment_url": "https://merchant.example.com/success", "error_payment_url": "https://merchant.example.com/error", "failure_code": "05", "failure_message": "Do not honour", "refunded": false, "refunded_amount": 0, "metadata": {} } }
Create payment - authorize only (POST /v1/payments, capture=false)
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 '{ "amount": 15000.0, "currency": "NGN", "capture": false, "merchant_reference_id": "ORDER-2026-000123", "description": "2 x Widget + shipping", "statement_descriptor": "MYSHOP", "complete_payment_url": "https://merchant.example.com/success", "error_payment_url": "https://merchant.example.com/error", "payment_method": { "type": "ng_mpgsmastercard_card", "fields": { "number": "5123450000000008", "expiration_month": "01", "expiration_year": "39", "cvv": "100", "name": "Test Cardholder" } }, "payment_method_options": { "3d_required": true } }'
Response
{ "status": { "error_code": "", "status": "SUCCESS", "message": "", "response_code": "", "operation_id": "11111111-2222-3333-4444-555555555555" }, "data": { "id": "payment_1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d", "amount": 15000.0, "original_amount": 15000.0, "currency_code": "NGN", "status": "ACT", "captured": false, "paid": false, "paid_at": 0, "payment_method_type": "ng_mpgsmastercard_card", "payment_method_type_category": "card", "payment_method_data": { "type": "ng_mpgsmastercard_card", "name": "Test Cardholder", "last4": "0008", "acs_check": "pass", "cvv_check": "unchecked", "bin_details": { "type": null, "brand": null, "country": null, "bin_number": "512345" }, "expiration_year": "39", "expiration_month": "01", "fingerprint_token": "ocfp_..." }, "payment_method_options": { "3d_required": true }, "merchant_reference_id": "ORDER-2026-000123", "description": "2 x Widget + shipping", "statement_descriptor": "MYSHOP", "redirect_url": "", "complete_payment_url": "https://merchant.example.com/success", "error_payment_url": "https://merchant.example.com/error", "failure_code": "", "failure_message": "", "refunded": false, "refunded_amount": 0, "metadata": {} } }
Capture payment (POST /v1/payments/{payment}/capture)
Request
curl -X POST 'https://sandboxapi.rapyd.net/v1/payments/payment_1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d/capture' \ -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 '{ "amount": 10000.0 }'
Response
{ "status": { "error_code": "", "status": "SUCCESS", "message": "", "response_code": "", "operation_id": "11111111-2222-3333-4444-555555555555" }, "data": { "id": "payment_1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d", "amount": 10000.0, "original_amount": 15000.0, "currency_code": "NGN", "status": "CLO", "captured": true, "paid": true, "paid_at": 1790000100, "payment_method_type": "ng_mpgsmastercard_card", "payment_method_type_category": "card", "payment_method_data": { "type": "ng_mpgsmastercard_card", "name": "Test Cardholder", "last4": "0008", "acs_check": "pass", "cvv_check": "unchecked", "bin_details": { "type": null, "brand": null, "country": null, "bin_number": "512345" }, "expiration_year": "39", "expiration_month": "01", "fingerprint_token": "ocfp_..." }, "payment_method_options": { "3d_required": true }, "merchant_reference_id": "ORDER-2026-000123", "description": "2 x Widget + shipping", "statement_descriptor": "MYSHOP", "redirect_url": "", "complete_payment_url": "https://merchant.example.com/success", "error_payment_url": "https://merchant.example.com/error", "failure_code": "", "failure_message": "", "refunded": false, "refunded_amount": 0, "metadata": {} } }
Cancel payment (DELETE /v1/payments/{payment})
Request
curl -X DELETE 'https://sandboxapi.rapyd.net/v1/payments/payment_1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d' \ -H 'access_key: <your_access_key>' \ -H 'Content-Type: application/json' \ -H 'salt: <random_salt>' \ -H 'signature: <calculated_signature>' \ -H 'timestamp: <unix_timestamp>'
Response
{ "status": { "error_code": "", "status": "SUCCESS", "message": "", "response_code": "", "operation_id": "11111111-2222-3333-4444-555555555555" }, "data": { "id": "payment_1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d", "amount": 15000.0, "original_amount": 15000.0, "currency_code": "NGN", "status": "CAN", "captured": false, "paid": false, "paid_at": 0, "payment_method_type": "ng_mpgsmastercard_card", "payment_method_type_category": "card", "payment_method_data": { "type": "ng_mpgsmastercard_card", "name": "Test Cardholder", "last4": "0008", "acs_check": "pass", "cvv_check": "unchecked", "bin_details": { "type": null, "brand": null, "country": null, "bin_number": "512345" }, "expiration_year": "39", "expiration_month": "01", "fingerprint_token": "ocfp_..." }, "payment_method_options": { "3d_required": true }, "merchant_reference_id": "ORDER-2026-000123", "description": "2 x Widget + shipping", "statement_descriptor": "MYSHOP", "redirect_url": "", "complete_payment_url": "https://merchant.example.com/success", "error_payment_url": "https://merchant.example.com/error", "failure_code": "", "failure_message": "", "refunded": false, "refunded_amount": 0, "metadata": {} } }
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 '{ "payment": "payment_1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d", "amount": 10000.0, "merchant_reference_id": "REFUND-000123", "reason": "Customer request" }'
Response
{ "status": { "error_code": "", "status": "SUCCESS", "message": "", "response_code": "", "operation_id": "11111111-2222-3333-4444-555555555555" }, "data": { "id": "refund_1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d", "amount": 10000.0, "payment": "payment_1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d", "currency": "NGN", "status": "Completed", "failure_reason": "", "merchant_reference_id": "REFUND-000123", "reason": "Customer request", "created_at": 1790000200, "payment_method_type": "ng_mpgsmastercard_card", "metadata": {} } }
Retrieve payment (GET /v1/payments/{payment})
Request
curl -X GET 'https://sandboxapi.rapyd.net/v1/payments/payment_1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d' \ -H 'access_key: <your_access_key>' \ -H 'Content-Type: application/json' \ -H 'salt: <random_salt>' \ -H 'signature: <calculated_signature>' \ -H 'timestamp: <unix_timestamp>'
Response
{ "status": { "error_code": "", "status": "SUCCESS", "message": "", "response_code": "", "operation_id": "11111111-2222-3333-4444-555555555555" }, "data": { "id": "payment_1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d", "amount": 15000.0, "original_amount": 15000.0, "currency_code": "NGN", "status": "CLO", "captured": true, "paid": true, "paid_at": 1790000000, "payment_method_type": "ng_mpgsmastercard_card", "payment_method_type_category": "card", "payment_method_data": { "type": "ng_mpgsmastercard_card", "name": "Test Cardholder", "last4": "0008", "acs_check": "pass", "cvv_check": "unchecked", "bin_details": { "type": null, "brand": null, "country": null, "bin_number": "512345" }, "expiration_year": "39", "expiration_month": "01", "fingerprint_token": "ocfp_..." }, "payment_method_options": { "3d_required": true }, "merchant_reference_id": "ORDER-2026-000123", "description": "2 x Widget + shipping", "statement_descriptor": "MYSHOP", "redirect_url": "", "complete_payment_url": "https://merchant.example.com/success", "error_payment_url": "https://merchant.example.com/error", "failure_code": "", "failure_message": "", "refunded": false, "refunded_amount": 0, "metadata": {} } }