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

# Cancel Requests

Canceling a request will immediately close the customer's executable order request within our system.

<Frame>
  <img className="block dark:hidden" height="200" width="200" src="https://mintcdn.com/pipevest/l6kPGYU9W55pgekc/images/ussd-request-cancel.png?fit=max&auto=format&n=l6kPGYU9W55pgekc&q=85&s=4beaee68bd6b35044b8393a5257fea4f" data-path="images/ussd-request-cancel.png" />

  <img className="hidden dark:block" height="200" width="200" src="https://mintcdn.com/pipevest/l6kPGYU9W55pgekc/images/ussd-request-cancel-dark.png?fit=max&auto=format&n=l6kPGYU9W55pgekc&q=85&s=cef9a4170ecdece6174105ca2e946f9d" data-path="images/ussd-request-cancel-dark.png" />
</Frame>

<Warning>
  It is **highly recommended** that you require the customer to input some sort
  of security key (i.e. pin, OTP, etc...) before making the request to
  cancel an order request.
</Warning>

### Canceling an order request

```bash theme={null}
  curl --request POST \
    --url https://api.staging.pipevest.com/v1/ussd/process
    ...
    --data 'sessionId=<session-id>'
    --data 'choice=1'
```

**Example Response**

```json theme={null}
{
    "message": "USSD request processed successfully",
    "data": {
        "sessionId": "ussd_2231df057f1f8f5269f0a268249ac104",
        "currentState": "CANCEL_REQUEST_CONFIRMATION",
        "menu": {
            "state": "CANCEL_REQUEST_CONFIRMATION",
            "text": "Confirm Order Cancellation:\n\nSELL: AAPL\nAmount: ZK281.51\n\nAre you sure you want to cancel this order?\n",
            "options": [
                {
                    "key": "1",
                    "label": "Yes, Cancel Order",
                    "nextState": "CANCEL_ORDER"
                },
                {
                    "key": "0",
                    "label": "No, Go Back",
                    "nextState": "PENDING_REQUEST_DETAILS"
                }
            ],
            "isEndState": false
        },
        "ussdText": "Confirm Order Cancellation:\n\nSELL: AAPL\nAmount: ZK281.51\n\nAre you sure you want to cancel this order?\n\n\n1. Yes, Cancel Order\n0. No, Go Back",
        "expiresAt": "2025-11-10T14:56:05.356Z"
    }
}
```

### Confirm request view example

<Card title="USSD Cancel Request View" icon="circle-xmark" href="https://www.figma.com/proto/xkSZwzsNTpYDNQiG0QGRlu/Zamtel-USSD-Flow?node-id=72-459&t=7ty9x1l3kywQhWlB-0&scaling=min-zoom&content-scaling=fixed&page-id=72%3A258&starting-point-node-id=108%3A69&show-proto-sidebar=1" horizontal>
  Check out an example of the ussd cancel request view
</Card>
