> ## Documentation Index
> Fetch the complete documentation index at: https://kb.paymentsmojo.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Reading a payment response

> The fields in a payment's answer, and how to handle each result.

Every sale, authorization, refund and void answers with the card processor's result. These are the fields to act on
(names as in [JSON](https://kb.paymentsmojo.com/api/formats.md); XML uses the same names with a capital first letter).

| Field | What it is |
| - | - |
| `respStat` | The result: see below. Always check it first. |
| `respCode` | The processor's code for the result: see [Decline and response codes](https://kb.paymentsmojo.com/api/decline-codes.md). |
| `respText` | The processor's words for it, such as `Approval` or `Insufficient funds`. Fine to show staff; for customers, use your own wording. |
| `respProc` | Which processor answered. Codes mean different things on different processors, so read `respCode` with it. `PPS` means the gateway itself answered, before the processor. |
| `authCode` | The issuer's approval code, for the receipt. |
| `retRef` | The processor's reference: keep it. It ties the payment to its capture, void, refund and deposit. |
| `amount` | The amount authorized. |
| `avsResp` | The address (ZIP) check: see [Address and CVV checks](https://kb.paymentsmojo.com/api/avs-cvv.md). |
| `cvvResp` | The security code check: see [Address and CVV checks](https://kb.paymentsmojo.com/api/avs-cvv.md). |
| `respMessage` | Only with `respStat` `E`: why the gateway couldn't complete the request. |

### The card brands' advice on a decline

On a decline, some processors (Rapid Connect and North) also pass on what the card brand advises. Each field is left out
when there's nothing to say.

| Field | What it is |
| - | - |
| `declineCategory`, `declineCategoryText` | Visa's advice on retrying: `1` the issuer will never approve this card (don't retry), `2` it can't approve now (retry later), `3` something in the details was wrong (fix it, then retry). |
| `merchAdviceCode`, `merchAdviceText` | Mastercard's advice, mostly for recurring payments. For example: `01` new account information available, `02` retry after 3 days, `03` account closed, `21` stop recurring payments for this merchant, `24`–`30` retry after 1 hour to 10 days. |
| `assocRespCode`, `assocRespText` | The card brand's own response code and words, behind the processor's `respCode`. |

## The result: respStat

| `respStat` | Means | What to do |
| - | - | - |
| `A` | Approved | Complete the sale; print `authCode` on the receipt. |
| `B` | Try again | A temporary problem (a network or issuer timeout). Retry once after a few seconds. If you aren't sure the first attempt failed, look the order up with `Inquire` first. |
| `C` | Declined | The issuer or the processor said no. `respCode` and `respText` say why: see [Decline and response codes](https://kb.paymentsmojo.com/api/decline-codes.md). Usually, ask for another payment method. |
| `E` | Not completed | The POS Gateway stopped before or after the processor, for example a key or setup problem, or a partial approval it voided. `respMessage` says why: see [Errors](https://kb.paymentsmojo.com/api/errors.md). |

> [!WARNING]
>
> Never retry an unclear result blindly. If the answer was lost or the result isn't `A` or `C`, look the payment up with
> `Inquire` by its order id: the payment may have gone through, and sending it again would charge the customer twice.

## After the sale: setlStat

`Capture` and `Inquire` also say where the payment is on its way to the merchant's bank, in `setlStat`.

| `setlStat` | Means |
| - | - |
| `Authorized` | Approved, not yet captured. |
| `Queued for Capture` | Captured; it goes in the next settlement batch. |
| `Accepted` | Settled and accepted for funding. |
| `Voided` | Voided: nothing will be charged. |
| `Declined` | The authorization was declined. |
| `Zero Amount` | A \$0 card check: nothing to capture. |
| `Amount under review` | Settled, held for review because of its amount; usually decided the next day. |
| `Rejected`, `Format error`, `Token Decrypt` | Not funded. Contact Mojo Payments with the order id. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.