Use REST API to Apply and Release Holds

Use the applyHold operation and the releaseHold operation on the Sales Orders for Order Hub REST API to apply and release holds on sales orders and fulfillment lines.

Guidelines

You can apply and release a hold on:

  • A draft or submitted sales order
  • One or more sales orders or fulfillment lines in a single request
  • The sales order entity
  • The fulfilment line entity

You can release a hold that you applied on the order header or fulfilment line through some other channel, such as through the View Order page or a fulfilment view in the Order Management work area, or a header hold that you applied through a SOAP service.

Note

  • You can use REST API to apply or release a hold on one or more sales orders or on one or more fulfillment lines.
  • You can't use REST API to apply a hold when you create a sales order. The order must already be in draft or submitted status.
  • If you apply a hold on an order line through a SOAP service, then you can't use REST API to release it.

For details, go to REST API for Oracle Supply Chain Management Cloud, then expand Order Management > Sales Orders for Order Hub > Holds.

For more, see Guidelines for Setting Up Holds on Sales Orders.

Try It

  1. Go to the Setup and Maintenance work area, then click Tasks > Search.
  2. Search for, then open the Manage Profile Options task.
  3. On the Manage Profile Options page, click Actions > New.
  4. On the Create Profile Option page, set the values, then click Save and Close.
    Attribute Value
    Profile Option Code FOM_NEW_HOLDS_PROCESSING
    Profile Display Name FOM_NEW_HOLDS_PROCESSING
    Application Order Management
    Module Order Management
    SQL Validation
    select MEANING , LOOKUP_CODE from 
    FND_LOOKUPS where LOOKUP_TYPE='YES_NO'

    Make sure you set LOOKUP_TYPE to 'YES_NO'. Don't set it to any other value.

  5. In the Profile Option Levels area, make sure the Site level is enabled.
  6. Go to the task.
    • Offering: Order Management
    • Functional Area: Orders
    • Task: Manage Administrator Profile Values
  7. Search for the value.
    Attribute Value
    Profile Option Code FOM_NEW_HOLDS_PROCESSING
  8. In the search results, set the value.
    Profile Level Value
    Site Yes
  9. Add the hold request to your REST API payload.

Examples

Here's an example request payload that applies the DOO_SHIP_ALL hold on the order header for source order AASHIP190404.

{
  "processRequestOfflineAfter":"240",
  "holdRequests": [
    {
      "HoldCode":"DOO_SHIP_ALL",
      "HoldComments":"Order On Hold",
      "SourceTransactionId":"AASHIP190404",
      "SourceTransactionSystem":"GPR"
    }
  ]
}

Here's the REST API response from that hold request.

"result"
  {
    "RequestStatus":"SUCCESS",
    "SourceTransactionSystem":"GPR"
    "SourceTransactionId":"AASHIP190404",
    "OrderNumber":"531258",
    "SourceTransactionLineId": null,
    "FulfillLineId": null,
    "HoldCode":"DOO_SHIP_ALL"
  }
]

Here's an example request payload that releases the DOO_SHIP_ALL hold on the order header for source order AASHIP190404.

{
  "processRequestOfflineAfter": 240,
  "holdRequests": [
     {
      "SourceTransactionSystem" : "GPR",
      "SourceTransactionId": "AASHIP190404",
      "HoldCode": "DOO_SHIP_ALL",
      "HoldReleaseComments": "Order released from hold",
      "HoldReleaseReasonCode": "QAREL"
    }
  ]
}

Here's the response.

{
    "result": [
        {
            "RequestStatus": "SUCCESS",
            "SourceTransactionSystem": "GPR",
            "SourceTransactionId": "AASHIP190404",
            "OrderNumber": "531257",
            "SourceTransactionLineId": null,
            "FulfillLineId": null,
            "HoldCode": "DOO_SHIP_ALL"
        }
    ]
}

SourceTransactionLineId Attribute

Use the SourceTransactionLineId attribute to identify the line.

  • To apply a hold on the order header, include a value for SourceTransactionId but not for SourceTransactionLineId and FulfillLineId. Order Management will apply the hold on the header and all order lines in the sales order.
  • To apply or release a hold on the fulfillment line, you must include a value for FulfillLineId in the order line entity. You can also use SourceTransactionLineId in the order line entity to apply or release a hold on all fulfillment lines for the order line.
  • REST API will apply the hold only on the fulfilment lines that reference SourceTransactionLineId.
  • If you use SourceTransactionLineId, then REST API will apply the hold only on fulfillment lines that are part of the order line entity, and won't apply a hold on the order line entity.

Process Your Requests in the Background

You can include the ProcessRequestOfflineAfter attribute in your REST API request to specify the number of seconds to wait before sending control back to your calling application, and then run the request in the background.

  • REST API will process the request immediately regardless of how you set ProcessRequestOfflineAfter.
  • You will need to query the sales order to monitor the request's progress.

Here are the values that you can use.

ProcessRequestOfflineAfter Value What REST API Does
0 (zero), or any value that's less than -1 (negative 1). Process the request immediately in the background.
-1 (negative 1). Time out after 5 minutes, then continue to process the request in the background.
Any value that's 1 to 240. Time out after the number of seconds that you specify, then continue to process the request in the background.
Any value that's more than 240. Time out after 240 seconds, then continue to process the request in the background.

Timeout

If your REST API request to apply or release a hold times out for some reason after 240 seconds, then you might encounter a message that's similar to:

Order management is processing your request to apply or release a hold on the sales order. Query for order {ORDER_NO} to monitor your request.

if the request times out, then Order Management will continue to process it in the background and will send this message in the REST response. If you encounter this message, then use REST API to query the sales order again to determine whether the request was successful. If it isn't successful, wait a few minutes, then try again.