# Switch Account Mode

Switch the merchant's account mode between SANDBOX and PRODUCTION.

* **Endpoint**: `POST {{base-url}}/merchant/account-mode`
* **Headers**:

  ```json
  {
    "X-Access-Token": "{{access-token}}",
    "X-Refresh-Token": "{{refresh-token}}"
  }
  ```
* **Body**:

  ```json
  {
    "mode": "PRODUCTION"
  }
  ```
* **Response**:
  * **200 OK**: (Successful switch)
  * **400 Bad Request**:

    ```json
    {
      "status": false,
      "message": "Kindly complete your account verification/setup before switching account mode."
    }
    ```
* **Sample Code (Dart)**:

  ```dart
  var headers = {
    'X-Access-Token': '{{access-token}}',
    'X-Refresh-Token': '{{refresh-token}}'
  };
  var request = http.Request('POST', Uri.parse('{{base-url}}/merchant/account-mode'));
  request.body = '''{
    "mode": "SANDBOX"
  }''';
  request.headers.addAll(headers);
  http.StreamedResponse response = await request.send();
  if (response.statusCode == 200) {
    print(await response.stream.bytesToString());
  } else {
    print(response.reasonPhrase);
  }
  ```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developer.providusbank.com/xpress-wallet-api/merchant/switch-account-mode.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
