Skip to content
トレカクラウド
Esc
↑↓navigate↵open⌘Jpreview

Hold units in a batch

Up to 100 entries; requestId and inventoryItemId must each be unique. All new holds succeed or none do. Creation returns 201; replaying the same requestId and content returns 200. Reusing requestId for different content fails with idempotency_conflict. In addition to inventory:read, this needs its operation scope and the approving member’s inventory.write permission.

POST/inventory/holds/batch
Authorization
AuthorizationOAuth2 access token · headerrequired

Authorization code flow (PKCE S256 required). Send resource=https://api.toreca-cloud.com/partner/v1 with the authorization, token and refresh requests. Access tokens last 15 minutes; refresh tokens last 90 days and rotate on every refresh.

Scopes:inventory:readinventory:write
Request body
requiredapplication/json
holdsobject[]required
min items 1 · max items 100
Show properties
Array of object
requestIdstring<uuid>required
inventoryItemIdstring<uuid>required
purposestringrequired
Allowed:oripasale
destinationLabelstringrequired
min length 1 · max length 200
reasonstringrequired
min length 1 · max length 2000
externalRefstring
min length 1 · max length 200
expiresAtstring<date-time>
matches ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
Responses
200

Success

holdsobject[]required
Show properties
Array of object
requestIdstring<uuid>required
createdbooleanrequired
holdHoldrequired
Show properties
idstring<uuid>required
createdAtstring<date-time>required
updatedAtstring<date-time>required
orderNumberstringrequired
statusstringrequired
Allowed:reservedawaiting_shipmentshippedcancelled
versionintegerrequired
inventoryItemIdstring<uuid>required
purposestringrequired
Allowed:oripasale
destinationLabelstringrequired
externalRefstring | nullrequired
Show properties
One of:
string
string
null
null
expiresAtstring<date-time> | nullrequired
Show properties
One of:
string<date-time>
string<date-time>
null
null
trackingNumberstring | nullrequired
Show properties
One of:
string
string
null
null
saleobject | nullrequired
Show properties
One of:
object
amountMinorintegerrequired
currencystringrequired
sourcestringrequired
Allowed:enteredmarket
null
null
201

Created

holdsobject[]required
Show properties
Array of object
requestIdstring<uuid>required
createdbooleanrequired
holdHoldrequired
Show properties
idstring<uuid>required
createdAtstring<date-time>required
updatedAtstring<date-time>required
orderNumberstringrequired
statusstringrequired
Allowed:reservedawaiting_shipmentshippedcancelled
versionintegerrequired
inventoryItemIdstring<uuid>required
purposestringrequired
Allowed:oripasale
destinationLabelstringrequired
externalRefstring | nullrequired
Show properties
One of:
string
string
null
null
expiresAtstring<date-time> | nullrequired
Show properties
One of:
string<date-time>
string<date-time>
null
null
trackingNumberstring | nullrequired
Show properties
One of:
string
string
null
null
saleobject | nullrequired
Show properties
One of:
object
amountMinorintegerrequired
currencystringrequired
sourcestringrequired
Allowed:enteredmarket
null
null
400

invalid_request: a parameter is invalid.

errorstringrequired

The error code

scopestring

With insufficient_scope, the missing scope

requestIdstring<uuid>
inventoryItemIdsstring<uuid>[]
holdIdsstring<uuid>[]
commitmentIdsstring<uuid>[]
401

invalid_token: the token is missing, expired, or for another resource.

errorstringrequired

The error code

scopestring

With insufficient_scope, the missing scope

requestIdstring<uuid>
inventoryItemIdsstring<uuid>[]
holdIdsstring<uuid>[]
commitmentIdsstring<uuid>[]
403

One of insufficient_scope, connection_revoked, client_disabled or forbidden.

errorstringrequired

The error code

scopestring

With insufficient_scope, the missing scope

requestIdstring<uuid>
inventoryItemIdsstring<uuid>[]
holdIdsstring<uuid>[]
commitmentIdsstring<uuid>[]
409

Conflict, reused requestId or receipt not confirmed

errorstringrequired

The error code

scopestring

With insufficient_scope, the missing scope

requestIdstring<uuid>
inventoryItemIdsstring<uuid>[]
holdIdsstring<uuid>[]
commitmentIdsstring<uuid>[]
422

The state, target or value refuses the operation. Inspect error and affected IDs.

errorstringrequired

The error code

scopestring

With insufficient_scope, the missing scope

requestIdstring<uuid>
inventoryItemIdsstring<uuid>[]
holdIdsstring<uuid>[]
commitmentIdsstring<uuid>[]
Try it
Server
Authorization
Bodyapplication/json
Request
curl -X POST 'https://api.toreca-cloud.com/partner/v1/inventory/holds/batch' \
  -H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "holds": [
    {
      "requestId": "d385ab22-0f51-4b97-9ecd-b8ff3fd4fcb6",
      "inventoryItemId": "ef1bc09e-447a-46aa-a9d9-d86e3d490831",
      "purpose": "oripa",
      "destinationLabel": "string",
      "reason": "string",
      "externalRef": "string",
      "expiresAt": "2019-08-24T14:15:22Z"
    }
  ]
}'
Response
{
  "holds": [
    {
      "requestId": "d385ab22-0f51-4b97-9ecd-b8ff3fd4fcb6",
      "created": true,
      "hold": {
        "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
        "createdAt": "2019-08-24T14:15:22Z",
        "updatedAt": "2019-08-24T14:15:22Z",
        "orderNumber": "string",
        "status": "reserved",
        "version": 0,
        "inventoryItemId": "ef1bc09e-447a-46aa-a9d9-d86e3d490831",
        "purpose": "oripa",
        "destinationLabel": "string",
        "externalRef": "string",
        "expiresAt": "2019-08-24T14:15:22Z",
        "trackingNumber": "string",
        "sale": {
          "amountMinor": 0,
          "currency": "string",
          "source": "entered"
        }
      }
    }
  ]
}

Was this page helpful?