---
schema_version: "1"
id: b4252ccf2de1c3b52a8f5624b8e787528dfedde749ced455f3ba58461a26721a
title: Invoke the Repricing API
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/ind/264-0-0/comms_invoke_the_repricing_api.md
canonical_url: https://help.salesforce.com/s/articleView?id=ind.comms_invoke_the_repricing_api.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 791716100685a6af3972ecc9e42ca2ea49cf1b315dc07a0e6359b6a76aaacc92
description: You can use the Repricing API to reprice all lines or to reprice specific items for orders, quotes, and opportunities.
products:
  - Communications
  - Media
  - Energy and Utilities
release: "264"
---
# Invoke the Repricing API

You can use the Repricing API to reprice all lines or to reprice specific items for orders, quotes, and opportunities.

- To reprice all the line items for a particular Order, Quote, or Opportunity, replace the ID with the appropriate Order, Quote, or Opportunity ID whose line items need to be repriced. This is highly recommended for bulk repricing.
    
    ```
    List<Order/Quote/Opportunity> a = [SELECT Id FROM Order/Quote/Opportunity];
    Map<String, Object> repricingInput = new Map<String, Object>{'objectList' => a};
    Map<String, Object> repricingOutput = new Map<String, Object>();
    Map<String, Object> repricingOptions = new Map<String, Object>();
    vlocity_cmt.VOIInvoker voi = vlocity_cmt.VOIInvoker.getInstance();
    voi.invoke('Repricing', 'repriceLineItems', repricingInput, repricingOutput, repricingOptions);
    ```
- To reprice OrderItems, QuoteLineItems, or OpportunityLineItems, replace the following query with a more suitable query based on the requirements, for example, reprice all lineItems created after 1/1/2019.
    
    ```
    List<OrderItem/OpportunityLineItem/QuoteLineItem> a = [SELECT Id,RootItemId__c From OrderItem/OpportunityLineItem/QuoteLineItem];
    Map<String,Object> repricingInput = new Map<String,Object>{'objectList' => codea};
    repricingInput.put('repriceProvidedLineItemsOnly', false);
    // mark it true to reprice only provided itemId, else the whole bundle associated with this ItemId needs to get repriced
    Map<String,Object> repricingOutput = new Map<String,Object>(); 
    Map<String,Object>; repricingOptions = new Map<String,Object>(); 
    vlocity_cmt.VOIInvoker voi = vlocity_cmt.VOIInvoker.getInstance(); 
    voi.invoke('Repricing', 'repriceLineItems', repricingInput, repricingOutput, repricingOptions);
    ```
- To reprice assets, replace the query for assets with a more suitable query based on the requirements, for example, reprice all assets created after 1/1/2019:
    
    ```
    List<Asset> a = [SELECT Id,RootItemId__c From Asset]; 
    Map<String,Object> repricingInput = new Map<String,Object>{'objectList' =>; a}; 
    repricingInput.put('repriceProvidedLineItemsOnly', false);
    // mark it true to reprice only provided itemId, else the whole bundle associated with this ItemId needs to get repriced
    Map<String,Object> repricingOutput = new Map<String,Object>(); 
    Map<String,Object> repricingOptions = new Map<String,Object>(); 
    vlocity_cmt.VOIInvoker voi = vlocity_cmt.VOIInvoker.getInstance(); 
    voi.invoke('Repricing', 'repriceLineItems', repricingInput, repricingOutput, repricingOptions);
    ```
- To reprice a particular account, replace the ID with the appropriate account ID whose assets need to be repriced. This is highly recommended for bulk repricing.
    
    ```
    List<Account> a = [SELECT Id FROM Account WHERE Id = '0011I00000DBYUK'];
    Map<String, Object> repricingInput = new Map<String, Object>{'objectList' => a};
    Map<String, Object> repricingOutput = new Map<String, Object>();
    Map<String, Object> repricingOptions = new Map <String, Object>();
    vlocity_cmt.VOIInvoker voi = vlocity_cmt.VOIInvoker.getInstance();
    voi.invoke('Repricing', 'repriceLineItems', repricingInput, repricingOutput, repricingOptions);
    ```
- To reprice a particular account, Order, Quote, or Opportunity using filters:
    
    ```
    Map<String, Object> input = new Map<String, Object>();
    //here by can be Order/Account/Opportunity/Quote 
    input.put('repriceBy', 'Order'); 
    //here objectId can be orderId,AcountId,OpptyId,QuoteId 
    input.put('objectId', '8011I000000dHQo'); 
    //rootItemIds are nothing but root line items or asset Id of the root in a bundle present in Order/Account/Opportunity/Quote input.put('rootLineItemIds', new List<Id>{'8021I000001s5saQAA'});
    input.put('repriceProvidedLineItemsOnly', false); 
    RepricingBatchProcessor repricingBatchJob = new RepricingBatchProcessor(input); 
    ID batchprocessid = Database.executeBatch(repricingBatchJob,1);
    ```
    
    This is the preferred way of repricing lineItems to avoid hitting SOQL limits. Use less than 10 rootItemIds at a time.