# Force Update Screen

## **Force Update App API**

The Force Update App API is a country-specific endpoint that enables the e-commerce platform to determine the latest version of the mobile application installed on a user's device and check if an update is required for a specific country. This API is crucial for ensuring that users in a particular country are always using the latest version of the app, which may contain important bug fixes, performance improvements, and new features.

<figure><img src="https://3686328336-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fd1Iq7THDAagTQzeC9rTN%2Fuploads%2F3ymjsnywIY2u0IfuONHn%2Fimage.png?alt=media&#x26;token=bd3af49d-d0c0-4632-8518-394c937b3b63" alt=""><figcaption><p><strong>App Update screen</strong></p></figcaption></figure>

### **Endpoint**

* `{{baseurl}}/api/v1/app/version`

### **Method**

* **GET**

### **Authorization**&#x20;

The API requires a valid bearer token in the request header for authentication. Users must include their token in the "Authorization" header to access their account and view the list of order returns

### **Response Format**&#x20;

The API responds with a JSON object containing information about the latest version of the app, including the version code and whether an update is required.

Example Response:

```json
{
    "success": true,
    "data": {
        "ios_min_version": 4,
        "ios_max_version": 13,
        "ios_version_title": "iOS Version1",
        "ios_version_description": "iOS Version Description",
        "android_min_version": 1,
        "android_max_version": 8,
        "android_version_title": "Android Version 5",
        "android_version_description": "update for new update"
    },
    "message": "Success",
    "status_code": 200
}
```

### **How it works**

#### Understanding the API Response

The API response includes the minimum and maximum versions for both Android and iOS platforms. If the user's app version is below the minimum version, a forced update is required. If the app version is between the minimum and maximum versions, an optional update is suggested.

### **Features**

* The Force Update App API is tailored to check for app updates specific to the user's country, ensuring localized and relevant updates.
* It allows the platform to notify users in a particular country if an update is necessary and provide them with a link to download the latest version from the app store.
* The API also provides a flag to show a pop-up on the home screen when the app version is between the minimum required version and the maximum supported version.

### **Usage**

* The API is called when the user launches the mobile app to check if a new version is available for their country.
* If a new version is available and it is marked as a force update, the API will prompt the user to update the app before continuing to use it.
* If the app version is between the minimum and maximum supported versions, the API will trigger a pop-up on the home screen to notify the user about the update.
