> ## 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.

# Commands and results

> How the POS runs the CLI, and the result file it reads.

## Running an action

```bash theme={null}
mojo.exe "-a=<Action>" "-f=<result file>" "-c=<request>"
```

| Switch | Meaning |
| - | - |
| `-a=` | The action, spelled exactly (they're case-sensitive), e.g. `AuthorizeXml`. |
| `-f=` | The result file to write. A full path, or a name placed in `Directory` ([Settings](/cli/settings)). |
| `-c=` | The request: the API's XML request for the action, including the register's key in `CardPointeUsername` and `CardPointePassword`. |
| `-d` | Also write a diagnostic log for this run. |

Quote each switch as a whole, as above. The CLI exits with code `0` once the result file is written, whatever the
result: always read the file.

## Actions

`AuthorizeXml`, `ManualAuthorizeXml`, `VoidXml`, `RefundXml`, `CaptureXml`, `InquireXml`, `Signature`, `Test` and
`Version`. Each is the [API action](/api/actions) of the same name. Card-not-present payments (`Authorize`) go through
the API directly.

### Example: a sale

```bash theme={null}
mojo.exe "-a=AuthorizeXml" "-f=sale-1042.txt" "-c=<ReadCardRequest><MerchantId>496100000000</MerchantId><Hsn>…</Hsn><Amount>5.00</Amount><OrderId>R1-1042</OrderId><CardPointeUsername>pgk_…</CardPointeUsername><CardPointePassword>pgs_…</CardPointePassword></ReadCardRequest>"
```

## The result file

The answer, as XML with one element per line:

```xml theme={null}
<AuthCardResponse>
<RespStat>A</RespStat>
<RetRef>277127012209</RetRef>
<Amount>5.00</Amount>
<AuthCode>PPS112</AuthCode>
</AuthCardResponse>
```

When the answer isn't a result (a customer cancelling, or a failure), the file holds the message:

```xml theme={null}
<Error>
<Message>Operation cancelled by customer</Message>
</Error>
```

`RespStat` is `A` approved, `C` declined, `E` error (see [Formats](/api/formats) and [Errors](/api/errors)).

## Lost answers

If a sale's answer doesn't come back (a network drop), the CLI looks the sale up by its `OrderId` and writes the
approved result if it went through. Send a unique `OrderId` with every sale so this can work.

## Interactive mode

Run `mojo.exe` with no `-a=` to type actions at a prompt, which is useful for testing. `mojo --help` lists the actions and
`mojo --version` prints the version.


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