Skip to content
Developer preview: the API may change before general availability. Request access

Update a location

PATCH
/locations/{location_id}
curl --request PATCH \
--url https://sandbox.partners.loops.sa/v1/locations/loc_2Xf9K \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Loops-Merchant-Id: mer_7Hq2Lw8Z' \
--data '{ "external_ref": "BR-01", "name": { "en": "example", "ar": "example" }, "phone": "example", "email": "hello@example.com", "address": { "line1": "King Fahd Road", "district": "Al Olaya", "city": "Riyadh", "postal_code": "12214", "country": "SA", "latitude": 24.7136, "longitude": 46.6753 }, "opening_hours": { "sunday": [ { "opens": "12:00", "closes": "02:00" } ], "monday": [ { "opens": "12:00", "closes": "02:00" } ], "tuesday": [ { "opens": "12:00", "closes": "02:00" } ], "wednesday": [ { "opens": "12:00", "closes": "02:00" } ], "thursday": [ { "opens": "12:00", "closes": "02:00" } ], "friday": [ { "opens": "12:00", "closes": "02:00" } ], "saturday": [ { "opens": "12:00", "closes": "02:00" } ] } }'

Send only the fields to change. opening_hours replaces the whole weekly schedule. A location can’t move to another brand.

location_id
required
string

The location ID (loc_…).

Loops-Merchant-Id
string

The merchant you are acting for (mer_…). Required for platform applications; optional for direct integrations, which have a single merchant.

Media typeapplication/json
object
external_ref

Your own ID for this object, from your system. Unique within its type for the merchant (for menu items, within the brand). Letters, digits, -, _, . and :.

string
>= 1 characters <= 64 characters /^[A-Za-z0-9._:-]+$/
name

Text in English and Arabic. Delivery apps in Saudi Arabia show both, so both are required.

object
en
required
string
>= 1 characters <= 120 characters
ar
required
string
>= 1 characters <= 120 characters
phone
string
email
string | null format: email
address
object
line1
required
string
district
string | null
city
required
string
postal_code
string | null
country
string
default: SA
latitude
required

Where drivers pick up orders.

number
longitude
required
number
opening_hours

Weekly hours in the location’s time zone. Each day lists one or more time ranges; an empty list means closed that day.

object
sunday
required
Array<object>
object
opens
required
string
/^([01][0-9]|2[0-3]):[0-5][0-9]$/
closes
required

A time earlier than opens means the next day, e.g. 18:00–02:00.

string
/^([01][0-9]|2[0-3]):[0-5][0-9]$/
monday
required
Array<object>
object
opens
required
string
/^([01][0-9]|2[0-3]):[0-5][0-9]$/
closes
required

A time earlier than opens means the next day, e.g. 18:00–02:00.

string
/^([01][0-9]|2[0-3]):[0-5][0-9]$/
tuesday
required
Array<object>
object
opens
required
string
/^([01][0-9]|2[0-3]):[0-5][0-9]$/
closes
required

A time earlier than opens means the next day, e.g. 18:00–02:00.

string
/^([01][0-9]|2[0-3]):[0-5][0-9]$/
wednesday
required
Array<object>
object
opens
required
string
/^([01][0-9]|2[0-3]):[0-5][0-9]$/
closes
required

A time earlier than opens means the next day, e.g. 18:00–02:00.

string
/^([01][0-9]|2[0-3]):[0-5][0-9]$/
thursday
required
Array<object>
object
opens
required
string
/^([01][0-9]|2[0-3]):[0-5][0-9]$/
closes
required

A time earlier than opens means the next day, e.g. 18:00–02:00.

string
/^([01][0-9]|2[0-3]):[0-5][0-9]$/
friday
required
Array<object>
object
opens
required
string
/^([01][0-9]|2[0-3]):[0-5][0-9]$/
closes
required

A time earlier than opens means the next day, e.g. 18:00–02:00.

string
/^([01][0-9]|2[0-3]):[0-5][0-9]$/
saturday
required
Array<object>
object
opens
required
string
/^([01][0-9]|2[0-3]):[0-5][0-9]$/
closes
required

A time earlier than opens means the next day, e.g. 18:00–02:00.

string
/^([01][0-9]|2[0-3]):[0-5][0-9]$/

The updated location.

Media typeapplication/json
object
id
required
string
merchant_id
required
string
brand_id
required
string
external_ref
string | null
name
required

Text in English and Arabic.

object
en
string | null
ar
string | null
phone
string | null
email
string | null
address
object
line1
required
string
district
string | null
city
required
string
postal_code
string | null
country
string
default: SA
latitude
required

Where drivers pick up orders.

number
longitude
required
number
timezone
required
string
opening_hours

Weekly hours in the location’s time zone. Each day lists one or more time ranges; an empty list means closed that day.

object
sunday
required
Array<object>
object
opens
required
string
/^([01][0-9]|2[0-3]):[0-5][0-9]$/
closes
required

A time earlier than opens means the next day, e.g. 18:00–02:00.

string
/^([01][0-9]|2[0-3]):[0-5][0-9]$/
monday
required
Array<object>
object
opens
required
string
/^([01][0-9]|2[0-3]):[0-5][0-9]$/
closes
required

A time earlier than opens means the next day, e.g. 18:00–02:00.

string
/^([01][0-9]|2[0-3]):[0-5][0-9]$/
tuesday
required
Array<object>
object
opens
required
string
/^([01][0-9]|2[0-3]):[0-5][0-9]$/
closes
required

A time earlier than opens means the next day, e.g. 18:00–02:00.

string
/^([01][0-9]|2[0-3]):[0-5][0-9]$/
wednesday
required
Array<object>
object
opens
required
string
/^([01][0-9]|2[0-3]):[0-5][0-9]$/
closes
required

A time earlier than opens means the next day, e.g. 18:00–02:00.

string
/^([01][0-9]|2[0-3]):[0-5][0-9]$/
thursday
required
Array<object>
object
opens
required
string
/^([01][0-9]|2[0-3]):[0-5][0-9]$/
closes
required

A time earlier than opens means the next day, e.g. 18:00–02:00.

string
/^([01][0-9]|2[0-3]):[0-5][0-9]$/
friday
required
Array<object>
object
opens
required
string
/^([01][0-9]|2[0-3]):[0-5][0-9]$/
closes
required

A time earlier than opens means the next day, e.g. 18:00–02:00.

string
/^([01][0-9]|2[0-3]):[0-5][0-9]$/
saturday
required
Array<object>
object
opens
required
string
/^([01][0-9]|2[0-3]):[0-5][0-9]$/
closes
required

A time earlier than opens means the next day, e.g. 18:00–02:00.

string
/^([01][0-9]|2[0-3]):[0-5][0-9]$/
created_at
required
string format: date-time
updated_at
required
string format: date-time
Example
{
"id": "loc_2Xf9K",
"brand_id": "brd_9Lk3Vb",
"external_ref": "BR-01",
"address": {
"line1": "King Fahd Road",
"district": "Al Olaya",
"city": "Riyadh",
"postal_code": "12214",
"country": "SA",
"latitude": 24.7136,
"longitude": 46.6753
},
"timezone": "Asia/Riyadh",
"opening_hours": {
"sunday": [
{
"opens": "12:00",
"closes": "02:00"
}
],
"monday": [
{
"opens": "12:00",
"closes": "02:00"
}
],
"tuesday": [
{
"opens": "12:00",
"closes": "02:00"
}
],
"wednesday": [
{
"opens": "12:00",
"closes": "02:00"
}
],
"thursday": [
{
"opens": "12:00",
"closes": "02:00"
}
],
"friday": [
{
"opens": "12:00",
"closes": "02:00"
}
],
"saturday": [
{
"opens": "12:00",
"closes": "02:00"
}
]
}
}

The request is invalid. errors lists each problem.

Media typeapplication/problem+json

RFC 9457 Problem Details with a stable code.

object
type
required
string format: uri
title
required
string
status
required
integer
code
required

Stable machine-readable error code. Switch on this, not on title.

string
Allowed values: invalid_request invalid_file merchant_required unauthorized insufficient_scope scope_not_granted connection_not_active application_suspended not_found merchant_not_found merchant_exists external_ref_conflict business_profile_locked idempotency_key_reused rate_limited upstream_unavailable
detail
string
request_id
required
string
existing_id

For external_ref_conflict, the ID of the object that already uses the reference.

string
errors

Field errors, for invalid_request.

Array<object>
object
field
string
message
string
Example
{
"type": "https://docs.partners.loops.sa/errors/external_ref_conflict",
"title": "External reference already used",
"status": 409,
"code": "invalid_request",
"detail": "A location with external_ref BR-01 already exists.",
"request_id": "req_01J9X7P2QK",
"existing_id": "loc_2Xf9K",
"errors": [
{
"field": "products[3].price",
"message": "Required unless the product has variants."
}
]
}

The access token is missing, expired or invalid.

Media typeapplication/problem+json

RFC 9457 Problem Details with a stable code.

object
type
required
string format: uri
title
required
string
status
required
integer
code
required

Stable machine-readable error code. Switch on this, not on title.

string
Allowed values: invalid_request invalid_file merchant_required unauthorized insufficient_scope scope_not_granted connection_not_active application_suspended not_found merchant_not_found merchant_exists external_ref_conflict business_profile_locked idempotency_key_reused rate_limited upstream_unavailable
detail
string
request_id
required
string
existing_id

For external_ref_conflict, the ID of the object that already uses the reference.

string
errors

Field errors, for invalid_request.

Array<object>
object
field
string
message
string
Example
{
"type": "https://docs.partners.loops.sa/errors/external_ref_conflict",
"title": "External reference already used",
"status": 409,
"code": "invalid_request",
"detail": "A location with external_ref BR-01 already exists.",
"request_id": "req_01J9X7P2QK",
"existing_id": "loc_2Xf9K",
"errors": [
{
"field": "products[3].price",
"message": "Required unless the product has variants."
}
]
}

Not allowed: the scope isn’t approved or granted, the connection is not active, or your application is suspended. See code.

Media typeapplication/problem+json

RFC 9457 Problem Details with a stable code.

object
type
required
string format: uri
title
required
string
status
required
integer
code
required

Stable machine-readable error code. Switch on this, not on title.

string
Allowed values: invalid_request invalid_file merchant_required unauthorized insufficient_scope scope_not_granted connection_not_active application_suspended not_found merchant_not_found merchant_exists external_ref_conflict business_profile_locked idempotency_key_reused rate_limited upstream_unavailable
detail
string
request_id
required
string
existing_id

For external_ref_conflict, the ID of the object that already uses the reference.

string
errors

Field errors, for invalid_request.

Array<object>
object
field
string
message
string
Example
{
"type": "https://docs.partners.loops.sa/errors/external_ref_conflict",
"title": "External reference already used",
"status": 409,
"code": "invalid_request",
"detail": "A location with external_ref BR-01 already exists.",
"request_id": "req_01J9X7P2QK",
"existing_id": "loc_2Xf9K",
"errors": [
{
"field": "products[3].price",
"message": "Required unless the product has variants."
}
]
}

Not found, or not accessible with this connection.

Media typeapplication/problem+json

RFC 9457 Problem Details with a stable code.

object
type
required
string format: uri
title
required
string
status
required
integer
code
required

Stable machine-readable error code. Switch on this, not on title.

string
Allowed values: invalid_request invalid_file merchant_required unauthorized insufficient_scope scope_not_granted connection_not_active application_suspended not_found merchant_not_found merchant_exists external_ref_conflict business_profile_locked idempotency_key_reused rate_limited upstream_unavailable
detail
string
request_id
required
string
existing_id

For external_ref_conflict, the ID of the object that already uses the reference.

string
errors

Field errors, for invalid_request.

Array<object>
object
field
string
message
string
Example
{
"type": "https://docs.partners.loops.sa/errors/external_ref_conflict",
"title": "External reference already used",
"status": 409,
"code": "invalid_request",
"detail": "A location with external_ref BR-01 already exists.",
"request_id": "req_01J9X7P2QK",
"existing_id": "loc_2Xf9K",
"errors": [
{
"field": "products[3].price",
"message": "Required unless the product has variants."
}
]
}

The request conflicts with the current state, for example an external_ref already in use, or a business profile that is in review. See code.

Media typeapplication/problem+json

RFC 9457 Problem Details with a stable code.

object
type
required
string format: uri
title
required
string
status
required
integer
code
required

Stable machine-readable error code. Switch on this, not on title.

string
Allowed values: invalid_request invalid_file merchant_required unauthorized insufficient_scope scope_not_granted connection_not_active application_suspended not_found merchant_not_found merchant_exists external_ref_conflict business_profile_locked idempotency_key_reused rate_limited upstream_unavailable
detail
string
request_id
required
string
existing_id

For external_ref_conflict, the ID of the object that already uses the reference.

string
errors

Field errors, for invalid_request.

Array<object>
object
field
string
message
string
Example
{
"type": "https://docs.partners.loops.sa/errors/external_ref_conflict",
"title": "External reference already used",
"status": 409,
"code": "invalid_request",
"detail": "A location with external_ref BR-01 already exists.",
"request_id": "req_01J9X7P2QK",
"existing_id": "loc_2Xf9K",
"errors": [
{
"field": "products[3].price",
"message": "Required unless the product has variants."
}
]
}