Merchant API Documentation (Mastercard MIGS)
Overview
The Merchant API provides secure access to process payments, issue refunds, and check transaction statuses using Mastercard’s MIGS gateway. This API enables seamless integration for merchants to accept payments through Mastercard and other supported card networks.
Base URL
Test Environment: https://migs.mastercard.com
Production Environment: https://secure.mastercard.com
Authentication
All API requests require API Key Authentication using the following headers:
Headers:
Authorization: Bearer {your_api_key}
Content-Type: application/json
Endpoints
1. Process Payment
Endpoint: /api/v1/payments
Method: POST
Description: Processes a payment transaction for a merchant account.
Request Example:
{
"merchant_id": "123456789",
"amount": 100.00,
"currency": "USD",
"card_number": "4111111111111111",
"expiry_month": "12",
"expiry_year": "2025",
"cvv": "123",
"customer_email": "customer@example.com",
"order_id": "ORD12345"
}
Response Example:
{
"status": "success",
"transaction_id": "txn_987654321",
"approval_code": "A123BC",
"message": "Transaction approved"
}
2. Refund Payment
Endpoint: /api/v1/refunds
Method: POST
Description: Issues a refund for a previously completed transaction.
Request Example:
{
"merchant_id": "123456789",
"transaction_id": "txn_987654321",
"amount": 50.00,
"currency": "USD",
"reason": "Customer request"
}
Response Example:
{
"status": "success",
"refund_id": "refund_654321",
"message": "Refund processed successfully"
}
3. Transaction Inquiry
Endpoint: /api/v1/transactions/{transaction_id}
Method: GET
Description: Retrieves the status and details of a specific transaction.
Request Example:
GET /api/v1/transactions/txn_987654321
Response Example:
{
"transaction_id": "txn_987654321",
"status": "approved",
"amount": 100.00,
"currency": "USD",
"payment_method": "Mastercard",
"timestamp": "2025-02-28T12:34:56Z"
}
4. Retrieve Merchant Balance
Endpoint: /api/v1/merchant/balance
Method: GET
Description: Retrieves the current available balance of the merchant account.
Response Example:
{
"merchant_id": "123456789",
"balance": 5000.00,
"currency": "USD"
}
Error Codes
Code | Message | Description |
---|---|---|
400 | Invalid request | Missing or incorrect parameters |
401 | Unauthorized | Invalid API key |
404 | Transaction not found | No matching record |
500 | Internal server error | Unexpected system issue |
Security & Compliance
PCI-DSS Compliant: All transactions are securely processed following PCI security standards.
Tokenization: Card details are never stored; tokenized references are used instead.
3D Secure Support: Available for additional fraud protection.
Support
For any integration issues, please contact API Support at merchantsupport@rcpsecure.net
This API documentation ensures a secure and efficient payment processing experience for merchants using Mastercard’s MIGS.