Initiate a refund for a completed payment

POST /v2/rtp/{payId}/refund

Initiates a refund for an RTP payment that has already been accepted/executed. The path parameter is the payment identifier (payId), not the rtpId.


Request

HTTP Method: POST Endpoint:

/v2/rtp/{payId}/refund

Headers

Authorization: Bearer {access_token}
Content-Type: application/json

Path Parameters

Parameter
Type
Required
Description

payId

string (GUID)

Yes

Payment unique identifier.


Request Body Parameters

Parameter
Type
Required
Description

reason

string (500)

Yes

Reason for initiating refund.


Example Request

POST /v2/rtp/123e4567-e89b-12d3-a456-426614174000/refund HTTP/1.1
Host: api.maibmerchants.md
Authorization: Bearer {access_token}
Content-Type: application/json

{
  "reason": "Refund reason"
}

(curl)

curl -X POST "https://api.maibmerchants.md/v2/rtp/123e4567-e89b-12d3-a456-426614174000/refund" \
  -H "Authorization: Bearer {{access_token}}" \
  -H "Content-Type: application/json" \
  -d '{"reason":"Refund reason"}'

Response

Response Parameters

Field
Type
Description

result

object

Response result object.

result.payId

string (GUID)

Payment unique identifier.

result.status

string (enum)

Payment status. Possible value: Refunded.

ok

boolean

Request processing status (true on success).

errors

array

Present only if ok = false.

errors.errorCode

string

Error code.

errors.errorMessage

string

Error description.


Example Successful Response

{
  "result": {
    "payId": "123e4567-e89b-12d3-a456-426614174000",
    "status": "Refunded"
  },
  "ok": true
}

Notes & Best Practices

  • The path uses payId (payment) rather than the rtpId (request). Ensure you store both identifiers after a successful payment.

  • Provide a clear, auditable reason for the refund in your back-office systems.

  • Handle results idempotently on your side—if a refund is already Refunded, avoid duplicate state changes when reprocessing the same response. (Inference based on standard refund handling; spec defines the single Refunded status.)

Last updated