# Retrieve Rateplan

This endpoint allows you to retrieve all rateplan, active rateplan and deactivated rateplan list.

***

### <mark style="color:yellow;">Endpoint</mark>

<mark style="color:green;background-color:green;">**`POST`**</mark>&#x20;

<div align="left"><figure><img src="https://958347541-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FM9bn2UcBkeqtqixkl5eF%2Fuploads%2FpsybX0n39kUB8Z8WOk4X%2FSandbox%20image.png?alt=media&#x26;token=4ae73d0f-0d1a-4d73-a4e2-673dbc081d6a" alt="" width="56"><figcaption></figcaption></figure></div>

{% code overflow="wrap" %}
```url
https://connect-sandbox.su-api.com/SUAPI/jservice/bdc/rateplan/retrieve
```
{% endcode %}

#### <mark style="color:yellow;">Header</mark>

```xml
-app-id: YOUR_APP_ID
Authorization: YOUR_API_KEY
Content-Type:application/json
```

<table><thead><tr><th width="185">Header</th><th width="85">Type</th><th width="101">Required</th><th>Description</th></tr></thead><tbody><tr><td><code>app-id</code></td><td>string</td><td>Yes</td><td>Your application ID. Required for authentication.</td></tr><tr><td><code>Authorization</code></td><td>string</td><td>Yes</td><td>Your API key. for authorization. Required for authentication.</td></tr><tr><td><code>Content-Type</code></td><td>string</td><td>Yes</td><td>Must be set to <code>application/json</code>.</td></tr></tbody></table>

***

#### <mark style="color:yellow;">Attributes</mark>

`hotel_id` <mark style="color:orange;">**string (Required)**</mark>

The unique property ID as assigned by the provider upon creation of the property.

***

`channel_hotel_id` <mark style="color:orange;">**string (Required)**</mark>

The unique id for the hotel on the specific channel.

***

`status`  <mark style="color:orange;">**string**</mark> <mark style="color:orange;"></mark><mark style="color:orange;">(</mark><mark style="color:orange;">**Required**</mark><mark style="color:orange;">)</mark>

Specifies the status of the rate plans you want to retrieve.&#x20;

{% hint style="info" %}
* status = 1, retrieve all rateplans (activate and deactived both)
* status = 3, retrieve all active rate plans
* status = 6, retrieve all deactivated rateplans
{% endhint %}

***

## <mark style="color:yellow;">**Sample Requests**</mark>

```json
{
  "Hotel_id": "new1",
  "channel_hotel_id": "12915674",
  "status": "6"
}
```

## <mark style="color:yellow;">Response</mark>

#### <mark style="color:green;">**Sample Success Response 1**</mark>

{% code overflow="wrap" %}
```json
{
  "Status": "Success",
  "Data": [],
  "Message": "Rateplan details Set Successfully",
  "Ruid": "UmFuZG9tSVYkc2RlIyh9YSPNt5WoaZhm5rf7WoiC3q/2sF8DwOzVLR7IgWwjDUz/2EBrgCiM9fbE526V0QhvPmjDzbl+cAuz"
}
```
{% endcode %}

#### <mark style="color:yellow;">Success Response Body Elements</mark>

`Status` <mark style="color:orange;">**string**</mark>

Indicates the result of the API call.&#x20;

{% hint style="info" %}
Will be `"Success"` for successful operations.
{% endhint %}

***

`Message` <mark style="color:orange;">**string**</mark>

A message receives within the response body. This will generally be an empty string if no additional information is needed.

***

`Ruid` <mark style="color:orange;">**string**</mark>&#x20;

Specifies the unique request ID.&#x20;

{% hint style="info" %}
You can share this ID with Booking.com customer support when you run into an issue. This can help in understanding what went wrong.
{% endhint %}

***

`Data` <mark style="color:orange;">**array**</mark>

An array of charge data, each item containing details about charge types, categories, and other associated information (for example, tax types, legacy codes).

***

#### <mark style="color:red;">Errors</mark>

<mark style="color:red;">**Sample Error Response 1**</mark>

```json
{
  "Errors": [
    {
      "Code": "400",
      "ShortText": "HotelCode: Invalid HotelCode ('NT711')"
    }
  ],
  "Status": "Fail",
  "Ruid": ""
}
```

<mark style="color:red;">**Sample Error Response 2**</mark>

```json
{
  "Errors": [
    {
      "Code": "573",
      "ShortText": "channel-mapping not found for this property!"
    }
  ],
  "Status": "Fail",
  "Ruid": ""
}
```

***

<mark style="color:yellow;">**Error Response Body Elements**</mark>

`Status` <mark style="color:orange;">**string**</mark>

Indicates the result of the API call, which will be always `"Fail"` in case of an error response.

***

`Error` <mark style="color:orange;">**array**</mark>

Array that contains details about any errors that occurred during the API call. Each object in the `Errors` array contains the following properties:

`Code` <mark style="color:orange;">**string**</mark>

Specific error code that helps identify the type of error.

{% hint style="info" %}
For example: `"400"` indicates a bad request.
{% endhint %}

`ShortText` <mark style="color:orange;">**string**</mark>

A short description of the error.

***

`Message` <mark style="color:orange;">**string**</mark>

A message providing more information about the error.

***

`Ruid` <mark style="color:orange;">**string**</mark>&#x20;

Specifies the unique request ID.&#x20;

{% hint style="info" %}
You can share this ID with Booking.com customer support when you run into an issue. This can help in understanding what went wrong.

In the case where a **RUID** (Request Unique Identifier) is provided by Booking.com, it will be displayed in the response. If no RUID is received, the field will be left blank.
{% endhint %}
