Endpoint summary
- Method & path:
POST /v1/aggregators/{{aggregator_id}}/payments - Authentication:
X-SFPY-AGGREGATOR-SECRET-KEY: {{secret_key}} - Idempotency: Provide a unique
request_idand reuse it when retrying the same intent.
| Field | Type | Required? | Notes |
|---|---|---|---|
request_id | string | Yes | UUID that enforces idempotency. |
amount | integer | Yes | Amount in paisa (PKR). |
aggregator_merchant_identifier | string | Yes | Token returned when you created the merchant. |
order_id | string | Yes | Merchant order reference. |
type | enum | Yes | RTP_NOW or RTP_LATER. |
expiry_in_minutes | integer | Required for RTP Now | Range 1-180 minutes. |
expiry_in_days | integer | Required for RTP Later | Range 1-40 days. |
debitor_iban | string | One of | Provide IBAN when you know the account. |
debitor_raast_id | string | One of | Provide Raast alias (for example, phone). |
debitor_vault_token | string | One of | Provide stored vault token. |
Validate the debtor’s IBAN or alias with the account validation utilities before creating the payment.
Example request
Status lifecycle
| Status | Description |
|---|---|
P_INITIATED | Safepay accepted the request and pushed it to Raast. |
P_RECEIVED | Customer approval pending. |
P_AUTHORIZED | Payment authorized and funds on hold. |
P_CAPTURED | Payment captured successfully. |
P_SETTLED | Funds transferred. Emit confirmation to the user. |
P_FAILED | Payment failed during processing. |
P_REJECTED | Customer declined or request rejected. |
P_CANCELLED | Payment was canceled before completion. |
P_REVERSED | Payment reversed after completion. |
P_PARTIALLY_REFUNDED | Payment partially refunded. |
P_REFUNDED | Payment fully refunded. |
Monitoring
- Poll
GET /v1/aggregators/{{aggregator_id}}/payments/{{payment_id}}for dashboards. - Subscribe to webhooks to receive final states.
- Use
request_idto deduplicate retries.
Key endpoints
| Endpoint | Purpose |
|---|---|
POST /v1/aggregators/{{aggregator_id}}/payments | Create RTP Now or RTP Later payments. |
GET /v1/aggregators/{{aggregator_id}}/payments | List payments with filters and pagination. |
GET /v1/aggregators/{{aggregator_id}}/payments/{{payment_id}} | Read a single payment. |