Payments

Process a refund for a payment.

Refunds settle the requested amount or the remaining refundable balance for the selected payment. If that payment is part of a shared Moyasar charge, set payment_is_part_of_related_set to true to distribute the refund across related payments in invoice order.

post/api/v2/payments/{payment_id}/refund

Request

  • Base URL
    https://stream-app-service.streampay.sa
  • Auth
    • HTTP bearer
    • or API key in header x-api-key

Path parameters

payment_idstring uuid required

Unique identifier (UUID) of the payment to refund

Request body

refund_reason'REQUESTED_BY_CUSTOMER' | 'DUPLICATE' | 'FRAUDULENT' | 'OTHER' required
refund_notestring nullable

Optional note explaining the refund reason

payment_is_part_of_related_setboolean

Set to true when this payment belongs to a related payment set and the refund should be applied across that set in order.

Response

Successful Response

idstring uuid

Unique identifier (UUID) of the payment

amountstring

Payment amount

currency'SAR' | 'USD' | 'EUR' | 'GBP' | 'AED' | 'BHD' | 'KWD' | 'OMR' | 'QAR'

ISO 4217 currency codes supported by Moyasar.

Includes all currencies supported by Moyasar payment gateway.

scheduled_onstring

Scheduled date and time for the payment

type'INITIAL' | 'INSTALLMENT' | 'SPLIT_PREPAID' | 'SPLIT_REMAINDER'
payment_method'MADA' | 'MASTERCARD' | 'VISA' | 'APPLE_PAY' | 'SAMSUNG_PAY' | 'AMEX' | 'CASH' | 'PGW_CARD_UNSPECIFIED' | 'BANK_TRANSFER' | 'CARD' | 'QURRAH' | 'BNPL'
current_status'PENDING' | 'PROCESSING' | 'FAILED_INITIATION' | 'SUCCEEDED' | 'FAILED' | 'CANCELED' | 'UNDER_REVIEW' | 'EXPIRED' | 'SETTLED' | 'REFUNDED' | 'PARTIALLY_REFUNDED'
payed_atstring date-time nullable

Date and time when the payment was completed

refunded_atstring date-time nullable

Date and time of the most recent refund

refund_reason'REQUESTED_BY_CUSTOMER' | 'DUPLICATE' | 'FRAUDULENT' | 'OTHER'
refund_notestring nullable

Note for the most recent refund if set

amount_refundedstring

Sum of all refund rows for this payment

latest_pgw_messagestring nullable

Latest payment gateway message for this payment

pos_transaction_idstring nullable

Transaction/network reference ID for card/POS payments

amount_in_smallest_unitinteger

Payment amount in smallest currency unit (e.g. halala for SAR).

Changes

    • warning

      added the new PAYMENT_REFUND_BEFORE_SUCCESS enum value to the / response property for the response status

    • warning

      added the new PAYMENT_REFUND_CONFLICT enum value to the / response property for the response status

    • warning

      added the new PAYMENT_REFUND_NOT_RECORDED enum value to the / response property for the response status

    • warning

      added the new INVOICE_CANCEL_CONFLICT enum value to the / response property for the response status

    • warning

      added the new INVOICE_REACTIVATION_BLOCKED enum value to the / response property for the response status

    • warning

      added the new INVOICE_REACTIVATION_CONFLICT enum value to the / response property for the response status