Managing Availability
The Rappi API enables you to configure the availability of your menu items and your stores, by using the items
resource.
The following sections guide you through the process of configuring these options for your integration.
Item Availability
Configure the availability of your menu items and disable them when they are out of stock, to prevent incoming orders that contain unavailable products.
The Rappi API enables you to configure availability by:
- Item SKU: This is the SKU you provided for the item to the Rappi when uploading to the menu.
- Item ID: This is the identifier that Rappi provided you when uploading to the menu.
Consulting the Availability by SKU
Use the POST availability/items/status
endpoint to query the availability of your items by item SKU.
To check the availability of your items by Item SKU:
Make a POST
request to the following URL, and add a JSON
to the body of the request with the following objects.
URL: https://{COUNTRY_DOMAIN}/api/v2/restaurants-integrations-public-api/availability/items/status
{COUNTRY_DOMAIN}
: This is your Rappi Country Domain. See the list of Country Domains.
This is an example of the JSON
in the body of the request:
{ "store_id": "900144512", "item_ids": ["7713", "2668", "3395", "5685"] }
Note
The values from this JSON
are not real data. Ensure to replace them with your data when making API requests.
This is an example JSON
of the response:
[ { "item_id": 2136411305, "item_type": "PRODUCT", "stock_out_state": "AVAILABLE" }, { "item_id": 2136411307, "item_type": "PRODUCT", "stock_out_state": "AVAILABLE" }, { "item_id": 2136411304, "item_type": "PRODUCT", "stock_out_state": "AVAILABLE" }, { "item_id": 2136411306, "item_type": "PRODUCT", "stock_out_state": "AVAILABLE" } ]
Consulting the Availability by Rappi ID
Use the POST availability/items/rappi/status
endpoint to query the availability of your items by item SKU.
To check the availability of your items by Item SKU:
Make a POST
request to the following URL, and add a JSON
to the body of the request with the following objects.
URL: https://{COUNTRY_DOMAIN}/api/v2/restaurants-integrations-public-api/availability/items/rappi/status
{COUNTRY_DOMAIN}
: This is your Rappi Country Domain. See the list of Country Domains.
This is an example of the JSON
in the body of the request:
{ "store_id": "900144512", "item_ids": ["2136411304"] }
Note
The values in this JSON
are not actual data. Be sure to replace them with your data when making API requests.
This is an example JSON
of the response:
[ { "item_id": 2136411304, "item_type": "PRODUCT", "stock_out_state": "AVAILABLE" } ]
Setting Availability by SKU
Use the PUT availability/stores/items
endpoint to configure the availability of your items by Item SKU.
To configure the availability of your items by Item SKU:
Make a PUT
request to the following URL, and add a JSON
to the body of the request with the following objects.
URL: https://{COUNTRY_DOMAIN}/api/v2/restaurants-integrations-public-api/token
{COUNTRY_DOMAIN}
: This is your Rappi Country Domain. See the list of Country Domains.
This is an example of the JSON
in the body of the request:
[ { "store_integration_id": "999", "items": { "turn_on": ["1111", "2222", "3333"], "turn_off": ["5555"] } } ]
Note
The values from this JSON
object are not real data. Ensure to replace them with your own data when making API requests. You can add more items to the turn_on
and turn_off
JSON
objects separated by a comma. If you only want to turn on or turn off items in your request, remove the other object from your JSON
accordingly.
The system retrieves a JSON
response with the confirmation message Items successfully updated.
Setting Availability by Rappi ID
Use the PUT availability/stores/items/rappi
endpoint to configure the availability of your items by Item ID.
To configure the availability of your items by Item ID:
Make a PUT
request to the following URL, and add a JSON
to the body of the request with the following objects.
URL: https://{COUNTRY_DOMAIN}/api/v2/restaurants-integrations-public-api/availability/stores/items/rappi
{COUNTRY_DOMAIN}
: This is your Rappi Country Domain. See the list of Country Domains.
This is an example of the JSON
in the body of the request:
[ { "store_integration_id": "999", "items": { "turn_on": [1111, 2222, 3333], "turn_off": [5555] } } ]
Note
The values from this JSON
are not real data. Ensure to replace them with your data when making API requests. You can add more items to the turn_on
and turn_off
JSON
objects separated by a comma. If you only want to turn on or turn off items in your request, remove the other object from your JSON
accordingly.
The system returns a JSON
response with the confirmation status message "Items successfully updated".
Store status
Use the POST availability/stores
endpoint to check the availability of your stores.
To check the availability of your stores:
Make a POST
request to the following URL and add a JSON
to the request body with the following structure.
URL: https://{COUNTRY_DOMAIN}/api/v2/restaurants-integrations-public-api/availability/stores
{COUNTRY_DOMAIN}
: This is your Rappi Country Domain. See the list of Country Domains.
This is an example of the JSON
in the body of the request:
[900105433]
Note
- The values in this
JSON
are not actual data. Be sure to replace them with your data when making API requests. - You can add more stores in the
JSON
separated by a comma. - You can query up to 100 stores in your
JSON
.
This is an example of the JSON
response:
{ "900105433": false }
Health Check
This is a procedure that run every minute to check the status of each store associated to a webhook. When a store is not available it will be turned off until it is available again
Important
This procedure will only be available for those stores that are using the NEW_ORDER webhook and are subscribed to PING
Behaviour
A POST
will be sent to the url configurated in the webhook with the following format:
{ "store_id": 999 }
Where store_id represents the id of the store configurated on your side (external id)
The response should have the following format:
{ "status": "OK", "description": "Tienda prendida" }
- status: this field is required, if the value is null or different to OK it will be considered as unavailable store.
- description: this field is optional.
HOW DOES PING WORK?
OBJECTIVE
Detect when a store loses connectivity and turn it off when a ping change from positive to negative occurs, in order to prevent future cancellations due to said lack of connectivity in the store to accept the take. This Ping must be implemented for each store and not on a central server.
FUNCTION
The monitor receives a notification every time a store goes from being pinged positive to negative. Realizing this, he immediately sends himself to turn off the shop in question.
- When a webhook is configured, the ping is sent every 3 minutes, in case of not having a webhook and using Order Pulling, it will be evaluated every 3 minutes.
- Depending on the number of negative pings configured, a Negative Ping incident is generated.
- The time range configured for grace time will be 1 minute.
- The maximum number of attempts allowed for non-response for a shop is currently set to 2 for all allies.
- Only after validating the intermittence time, the connectivity loss or recovery incident is generated according to its definition.
Important
If you do not use webhooks, the evaluation every 3 minutes is done on the last time you downloaded orders, the grace time to determine if it is a negative ping is 1 minute
Important
There are stores that have split hours during the day, therefore, this schedule must be taken into account for the generation of the ping
Important
It is important to clarify that it does NOT apply to stores that have 24-hour hours
PING RULES
These are the following rules that we take into account
PING NEGATIVE
This rule creates a Lost Connectivity incident, this incident is Status: Open awaiting a Positive Ping.
PING POSITIVE
In this rule, an alert is triggered that looks for the Lost Connectivity incident Status: Open to change it to Status: Closed.
Store Availability (asynchronous)
Use the PUT availability/stores
endpoint to configure the availability of your stores.
Important
This is an asynchronous method so the operation's result will not come in the response. Using this approach you can receive the updated store status through the STORE_CONNECTIVITY webhook. See Store Connectivity
If an instant response is needed the synchronous endpoint should be use. See Store Availability (synchronous)
To configure the availability of your stores:
Make a PUT
request to the following URL, and add a JSON
to the body of the request with the following objects.
URL: https://{COUNTRY_DOMAIN}/api/v2/restaurants-integrations-public-api/availability/stores
{COUNTRY_DOMAIN}
: This is your Rappi Country Domain. See the list of Country Domains.
This is an example of the JSON
in the body of the request:
{ "turn_on": ["2222"], "turn_off": ["333", "444"] }
Note
- The values from this
JSON
are not real data. Ensure to replace them with your data when making API requests. - You can add more items to the
turn_on
andturn_off
JSON
objects separated by a comma. - If you only want to turn on or turn off items in your request, remove the other object from your
JSON
accordingly.
The system retrieves a JSON
response with the confirmation message "Stores successfully updated".
Store Availability massive (asynchronous)
Use the PUT availability/stores/enable/massive
endpoint to configure the availability of your stores.
Important
This is an asynchronous method so the operation's result will not come in the response. Using this approach you can receive the updated store status through the STORE_CONNECTIVITY webhook. See Store Connectivity
It is possible that a store cannot be turn on/off because it is suspended or not published in the Rappi app
To configure the availability of your stores:
Make a PUT
request to the following URL, and add a JSON
to the body of the request with the following objects.
URL: https://{COUNTRY_DOMAIN}/api/v2/restaurants-integrations-public-api/availability/stores/enable/massive
{COUNTRY_DOMAIN}
: This is your Rappi Country Domain. See the list of Country Domains.
This is an example of the JSON
in the body of the request:
{ "stores": [ { "store_id": "12312", "is_enabled": true }, { "store_id": "12312", "is_enabled": false } ] }
Store Availability (synchronous)
Use the PUT availability/stores/enable
endpoint to configure the availability of your stores.
Important
This is a synchronous method so the operation's result will come in the response.
Keep in mind that the max amount of stores is 300. If you need to send more stores use the async method. See Store Availability (asynchronous)
It is possible that a store cannot be turn on/off because it is suspended or not published in the Rappi app
To configure the availability of your stores:
Make a PUT
request to the following URL, and add a JSON
to the body of the request with the following objects.
URL: https://{COUNTRY_DOMAIN}/api/v2/restaurants-integrations-public-api/availability/stores/enable
{COUNTRY_DOMAIN}
: This is your Rappi Country Domain. See the list of Country Domains.
This is an example of the JSON
in the body of the request:
{ "stores": [ { "store_id": "12312", "is_enabled": true }, { "store_id": "12312", "is_enabled": false } ] }
This is an example of the response:
{ "results": [ { "store_id": 90774, "is_enabled": false, "operation_result": false, "operation_result_type": "suspended", "suspended_reason": "suspended due cancelled orders", "suspended_at": "2022-04-11T20:23:00.00Z", "suspended_time": 60 } ] }