Attachments

Refund the payment an attach attempt took

Called by refunds-api. The attachment names the wallet that took the payment, the payment's id there, its amount and when it was paid. For Maya the payment is voided on the day it was paid (Philippine time) and refunded afterwards. Each reference_id reaches the wallet at most once: a repeat returns the first outcome. A refusal by the wallet, an error or no answer from it, is returned as status failed with a code in provider_error. A 4xx means nothing was reversed; any 5xx means the outcome is not final and the refund must stay pending. In test mode the wallet is not called.

post/v1/attachments/attach_attempt/{attach_attempt_id}/refunds

Request

  • Base URL
    https://ewallets-api.paymongo.com
  • URL
    https://ewallets-api.paymongo.com/v1/attachments/attach_attempt/{attach_attempt_id}/refunds
  • Auth
    HTTP bearer

Path parameters

attach_attempt_idstring required

Attach attempt id of the payment

Headers

PayMongo-Livemode'true' | 'false' required

Mode of the refund: true or false

Request body

amountinteger required
currency'PHP' required
metadataobject
reason'duplicate' | 'fraudulent' | 'others' | 'requested_by_customer' required
reference_idstring required

Example request

{
  "amount": 5000,
  "currency": "PHP",
  "reason": "requested_by_customer",
  "reference_id": "ref_xyz789"
}

Response

The wallet reversed the payment, the wallet refused, or a repeat of an earlier outcome

has_moreboolean

Example response

{
  "data": {
    "provider_error": "PY0123",
    "reference_id": "ref_xyz789",
    "status": "failed"
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.