Skip to main content
Payments initiate a Request-to-Pay (RTP) against a customer’s bank account. Each payment belongs to an aggregator merchant and uses the Raast network to settle instantly once the customer approves.

Endpoint summary

  • Method & path: POST /v1/aggregators/{{aggregator_id}}/payments
  • Authentication: X-SFPY-AGGREGATOR-SECRET-KEY: {{secret_key}}
  • Idempotency: Provide a unique request_id and reuse it when retrying the same intent.
Validate the debtor’s IBAN or alias with the account validation utilities before creating the payment.

Example request

Status lifecycle

Cancelling a payment

Withdraw an unsettled RTP before the customer authorizes it. Cancellation targets a single payment and applies only while it is in P_INITIATED or P_RECEIVED; terminal payments (for example P_SETTLED, P_CAPTURED, P_REJECTED, or one already P_CANCELLED) cannot be cancelled.
  • Method & path: POST /v1/aggregators/{{aggregator_id}}/payments/{{payment_id}}/cancel
  • Authentication: X-SFPY-AGGREGATOR-SECRET-KEY: {{secret_key}}
  • Idempotency: Supply a fresh request_id for the cancellation — it must be distinct from the payment’s own request_id.
A 202 Accepted response means Safepay built and posted the cancellation (an ISO 20022 camt.055) to Raast. The final outcome is asynchronous — the response returns a cancellation record whose status starts at PAYMENT_CANCEL_CREATED and later resolves to PAYMENT_CANCEL_ACCEPTED or PAYMENT_CANCEL_REJECTED.
When the cancellation is accepted the payment reaches P_CANCELLED and emits the payment.voided webhook. Poll the payment or subscribe to webhooks for the final result — do not treat the 202 as a completed cancellation.

Charges breakdown

Every captured payment, including one that is later fully refunded, carries a breakdown of the fees and taxes deducted before the net amount is credited to the merchant. Read it with GET /v1/aggregators/{{aggregator_id}}/payments/{{payment_id}}/charges. The net amount is the gross amount minus every deduction:
Charges are recorded shortly after a payment reaches P_CAPTURED. Until then, and for payments that never complete, the endpoint returns 404. Refunded payments (P_REFUNDED) keep returning the charges of the original payment.
cURL
Response

Monitoring

  • Poll GET /v1/aggregators/{{aggregator_id}}/payments/{{payment_id}} for dashboards.
  • Call GET /v1/aggregators/{{aggregator_id}}/payments/{{payment_id}}/charges to show the fee and tax breakdown alongside a captured or refunded payment.
  • Subscribe to webhooks to receive final states.
  • Use request_id to deduplicate retries.

Key endpoints

See also