PUT Create or update reservations for a number of location groups, locations, or both. If any of the location groups or locations provided in the request are invalid, nothing is processed.
PUT /organizations/{organizationId}/reservation-documents/{reservationId}
Operation ID: createReservations. Security: AmOAuth2 (sfcc.inventory.reservations.rw, sfcc_inventory_reservations_rw).
Creates or updates a reservation document for the specified organization and reservation ID.
Parameters
organizationId(path, OrganizationId, required) An identifier for the organization the request is being made byExample
f_ecom_zzxy_prdreservationId(path, string, required)
Maximum length: 36. Pattern: ^[0-9a-fA-F\-]{36}$. Example:12345-23456-3456-4567-5678.
Request body (required)
Media type: application/json. Schema: PlaceReservationRequest.
Example: placeReservationRequestBodyLocation Example request body for placing a reservation by location
{
"externalRefId": "7282822-9823-aaa",
"expirationSeconds": 300,
"allowPartialReservations": true,
"reservationTime": "2019-07-24T21:13:00Z",
"locations": [
{
"id": "warehouse5",
"reservations": [
{
"sku": "sku1234",
"quantity": 10
}
]
}
]
}
Example: placeReservationRequestBodyLocationAllOrNothing Example request body for placing a reservation by location with all or nothing reservations
{
"externalRefId": "7282822-9823-aaa",
"expirationSeconds": 300,
"allowPartialReservations": true,
"reservationTime": "2019-07-24T21:13:00Z",
"locations": [
{
"id": "warehouse5",
"reservations": [
{
"sku": "sku1234",
"quantity": 10
}
],
"allOrNothingReservations": [
{
"id": "a14s-4b1c-1a3cbd4",
"reservations": [
{
"sku": "sku1234",
"quantity": 10
}
]
}
]
}
]
}
Example: placeReservationRequestBodyGroups Example request body for placing a reservation by group
{
"externalRefId": "7282822-9823-aaa",
"expirationSeconds": 300,
"allowPartialReservations": true,
"reservationTime": "2019-07-24T21:13:00Z",
"groups": [
{
"id": "UnitedStates",
"reservations": [
{
"sku": "sku1234",
"quantity": 10
}
]
}
]
}
Example: placeReservationRequestBodyLocationAndGroup Example request body for placing a reservation by both location and group
{
"externalRefId": "7282822-9823-aaa",
"expirationSeconds": 300,
"allowPartialReservations": true,
"reservationTime": "2019-07-24T21:13:00Z",
"groups": [
{
"id": "UnitedStates",
"reservations": [
{
"sku": "sku1234",
"quantity": 10
}
]
}
],
"locations": [
{
"id": "warehouse5",
"reservations": [
{
"sku": "sku1234",
"quantity": 10
}
]
}
]
}
Example: placeReservationAgainstATFBody Example request body for placing a reservation against ATF
{
"externalRefId": "7282822-9823-aaa",
"expirationSeconds": 300,
"allowPartialReservations": true,
"fulfillOnly": true,
"reservationTime": "2019-07-24T21:13:00Z",
"locations": [
{
"id": "warehouse5",
"reservations": [
{
"sku": "sku1234",
"quantity": 10
}
]
}
]
}
Responses
- 200
Successfully received and processed the request. The consumer is responsible for validating the returned data to ensure that the specified quantity was reserved as requested.
Headers:
Location(string) URI used to retrieve the recorded reservation document.
Maximum length: 255. Example:/organizations/org123/reservation-documents/2345-23456-3456-4567-5678.X-RateLimit-Limit(string) The maximum number of requests permitted per minute.X-RateLimit-Remaining(string) The number of requests remaining in the current rate limit window.X-RateLimit-Reset(string) The time at which the current rate limit window resets in UTC epoch seconds.
Media type:
application/json. Schema:PlaceReservationResponseBody.Example reservationNonPartialSomeItemSuccessSomeFail: same as PUT /organizations/{organizationId}/reservation-documents/{reservationId} 200 response. Example response with some items succeeded and some failed for groups and locations
Example reservationNonPartialAllItemsFail: same as PUT /organizations/{organizationId}/reservation-documents/{reservationId} 200 response. Example response where all items failed for groups and locations
Example: reservationSuccessExample Example response with successful reservation for groups and locations
{ "reservationTime": "2019-07-24T21:13:00Z", "expirationTime": "2019-07-24T22:13:00Z", "success": true, "groups": [ { "id": "UnitedStates", "details": [ { "sku": "sku1234", "quantity": 10.1 } ] } ], "locations": [ { "id": "warehouse5", "details": [ { "sku": "sku1234", "quantity": 10.1 } ] } ] }Example: placeReservationResponseBody Example response with partial failure for groups and locations
{ "reservationTime": "2019-07-24T21:13:00Z", "expirationTime": "2019-07-24T22:13:00Z", "success": false, "groups": [ { "id": "UnitedStates", "errors": [ { "sku": "sku5678", "errorCode": "Unknown" } ], "details": [ { "sku": "sku1234", "quantity": 10 } ] } ], "locations": [ { "id": "warehouse5", "errors": [ { "sku": "sku5678", "errorCode": "Unknown" } ], "details": [ { "sku": "sku1234", "quantity": 10 } ] } ] }Example: reservationFail Example response with reservation failure due to insufficient quantity
{ "reservationTime": "2019-07-24T21:13:00Z", "expirationTime": "2019-07-24T22:13:00Z", "success": false, "groups": [ { "id": "UnitedStates", "errors": [ { "errorCode": "InsufficientQuantity", "sku": "sku1234" } ] } ], "locations": [ { "id": "warehouse5", "errors": [ { "sku": "sku1234", "errorCode": "InsufficientQuantity" } ] } ] }Example: reservationPartialQtySuccess Example response with partial quantity success for groups and locations
{ "reservationTime": "2019-07-24T21:13:00Z", "expirationTime": "2019-07-24T22:13:00Z", "success": false, "groups": [ { "id": "UnitedStates", "errors": [ { "sku": "sku1234", "errorCode": "InsufficientQuantity" } ], "details": [ { "sku": "sku1234", "quantity": 10.1 } ] } ], "locations": [ { "id": "warehouse5", "errors": [ { "sku": "sku1234", "errorCode": "InsufficientQuantity" } ], "details": [ { "sku": "sku1234", "quantity": 10.1 } ] } ] }Example: reservationPartialItemSuccess Example response with partial item success for groups and locations
{ "reservationTime": "2019-07-24T21:13:00Z", "expirationTime": "2019-07-24T22:13:00Z", "success": true, "groups": [ { "id": "UnitedStates", "errors": [ { "sku": "sku1234", "errorCode": "InsufficientQuantity" } ], "details": [ { "sku": "sku1234", "quantity": 10.1 } ] } ], "locations": [ { "id": "warehouse5", "errors": [ { "sku": "sku1234", "errorCode": "InsufficientQuantity" } ], "details": [ { "sku": "sku1234", "quantity": 10.1 } ] } ] }Example: reservationPartialNoItemSuccess Example response with no item success for groups and locations
{ "reservationTime": "2019-07-24T21:13:00Z", "expirationTime": "2019-07-24T21:18:00Z", "success": false, "groups": [ { "id": "Germany", "errors": [ { "sku": "sku1234", "errorCode": "InsufficientQuantity" }, { "sku": "sku5678", "errorCode": "InsufficientQuantity" } ] } ], "locations": [ { "id": "warehouse5", "errors": [ { "sku": "sku1234", "errorCode": "InsufficientQuantity" }, { "sku": "sku5678", "errorCode": "InsufficientQuantity" } ] } ] }Example: reservationNonPartialSomeItemSuccessSomeFail Example response with some items succeeded and some failed for groups and locations
Example: reservationNonPartialAllItemsFail Example response where all items failed for groups and locations
- 400
Invalid request.
Headers:
X-RateLimit-Limit(string) The maximum number of requests permitted per minute.X-RateLimit-Remaining(string) The number of requests remaining in the current rate limit window.X-RateLimit-Reset(string) The time at which the current rate limit window resets in UTC epoch seconds.
Media type:
application/problem+json. Schema:InvalidRequestLocOrGroupDoesNotExist.Example: locationGroupNotFound
{ "errorCode": "GroupDoesNotExist", "message": "No group exists with ID", "type": "about:blank" }Example: locationIdNotFound
{ "errorCode": "LocationDoesNotExist", "message": "No location exists with ID 'warehouse5'", "type": "about:blank" }Example: noLocationOrGroupsNotProvided
{ "errorCode": "InvalidRequest", "message": "No location or groups provided.", "type": "about:blank" } - 403
Organization not authorized.
Media type:
application/problem+json. Schema:InventoryResponseErrorSchema.Example: TenantNotProvisioned
{ "type": "about:blank", "errorCode": "TenantNotProvisioned", "message": "The client is not correctly configured to access the system." } - 409
A reservation with the specified ID is in an invalid state.
Headers:
X-RateLimit-Limit(string) The maximum number of requests permitted per minute.X-RateLimit-Remaining(string) The number of requests remaining in the current rate limit window.X-RateLimit-Reset(string) The time at which the current rate limit window resets in UTC epoch seconds.
Media type:
application/problem+json. Schema:ReservationInvalidState.Example: conflictExample Example conflict response
{ "errorCode": "ReservationInvalidState", "message": "Reservation is in a CLOSED state.", "type": "about:blank", "parameterName": "sku" } - 429
The user has sent too many requests in a given amount of time ("rate limiting")
Headers:
Retry-After(string)
Media type:
application/problem+json. Schema:object.title(string) A short, human-readable summary of the problem type. It will not change from occurrence to occurrence of the problem, except for purposes of localization.
Example:You do not have enough credit..type(string, required) A URI reference [RFC3986] that identifies the problem type. This specification encourages that, when dereferenced, it provide human-readable documentation for the problem type (e.g., using HTML [W3C.REC-html5-20141028]). When this member is not present, its value is assumed to be "about:blank". It accepts relative URIs; this means that they must be resolved relative to the document's base URI, as per [RFC3986], Section 5.
Example:https://example.com/probs/out-of-credit.detail(string) A human-readable explanation specific to this occurrence of the problem.
Example:Your current balance is 30, but that costs 50..instance(string) A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced. It accepts relative URIs; this means that they must be resolved relative to the document's base URI, as per [RFC3986], Section 5.
Example:/account/12345/msgs/abc.
Example
{ "type": "https://api.commercecloud.salesforce.com/documentation/error/v1/errors/too-many-requests", "title": "Too Many Requests", "detail": "You have performed too many requests in a short period of time." }