Void a simulated card payment by its Payments id

Changed on

Voids a card payment a demo till took, named by its Payments id, while its order's shift is open and nothing of it was refunded: the order is refunded in full as by the till, and payment history records a void, so the payment reads Voided and counts in neither gross nor refunds. Refused with CONFLICT reversalIsRefund once the payment can only be refunded (its shift closed or part of it was refunded). A void the bank declined may be tried again while the shift is open and nothing was refunded, and reversal still reads void then. Refused with PRECONDITION_FAILED and refusal simulationOff before anything is read unless the business is a demo business with the payments flag on; NOT_FOUND for a payment no simulated approval recorded or one the caller may not refund, exactly as for a missing one; CONFLICT nothingToReverse for a payment with no standing card charge, otherPaymentsOnOrder when its order holds other payments; and, after the order's shift closed, the closed-shift gate of payments.refund. outcome is the sandbox bank's answer, approved by default: declined records the bank's refusal as a declined attempt and changes neither the payment's status nor the order. Returns the payment with the reversal it allows now. Needs order:refund. Refused with FORBIDDEN as paywallLocked when the caller is an Owner or Manager of a business the merchant Paywall locks: one with no verified subscription that has taken 5 orders while the Paywall's rollout reaches it, an order counting from its first saved line, whether or not it is paid or completed, until it is archived or cancelled before activation. Nothing is read or written; a verified subscription lifts the lock.

post/api/public/v1/payments/void

Request

  • Base URL
    https://app.fortuneos.ai
  • Auth
    none declared

Request body

object required
paymentId, string required
outcome, 'approved' | 'declined'

Response

OK

object required
id, string required
organizationId, string required
locationId, string required
venueName, string required
currency, 'AED' | 'USD' | 'MXN' | 'RUB' | 'AMD' | 'OMR' | 'JOD' | 'EUR' required
source, 'myfatoorah' | 'geidea' | 'points' | 'terminal' required
method, 'card' | 'points' required
principalCents, integer required
tipCents, integer required
refundedPrincipalCents, integer required
refundedTipCents, integer required
status, 'succeeded' | 'partiallyRefunded' | 'refunded' | 'needsVerification' | 'processing' | 'failed' | 'canceled' | 'voided' required

What the payment amounts to now. New values may be added; show an unknown status as-is rather than rejecting it.

failedPaymentAttempts, integer required
latestOperation, object nullable required
paymentAttempt, object nullable required
isFixture, boolean required
startedAt, string date-time required
lastUpdatedAt, string date-time required
reversal, 'void' | 'refund' nullable required

void while the payment's shift is open and nothing was returned, refund otherwise, null when it can't be taken back.

refundReason, 'partlyRefunded' | 'shiftClosed' nullable required

Why reversal is a refund rather than a void: partlyRefunded once part of the payment came back, shiftClosed otherwise. Null unless reversal is refund. May gain values; show an unknown one as shiftClosed.

reversalBlockedBy, 'otherPaymentsOnOrder' nullable required

Why reversal is null for a payment the till could otherwise take back: otherPaymentsOnOrder while its order holds other payments to refund. Null when reversal is set or the payment can't be taken back on the till at all. May gain values; show an unknown one as no reason.

Changes

    • info

      removed the voidDeclined enum value from the refundReason/anyOf[subschema #1] response property for the response status

    • info

      added the required property refundReason to the response with the status

    • info

      added the required property reversalBlockedBy to the response with the status