> For the complete documentation index, see [llms.txt](https://apis.rightrev.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://apis.rightrev.com/rightrev-rest-api/policy-sets/configuration/revenue-policies/identify-customer-contract.md).

# Identify Customer Contract

## Get Orders Group Policy

> Retrieves \*\*Orders Group\*\* policy created in the RightRev system.<br>

```json
{"openapi":"3.1.0","info":{"title":"RightRev API(s)","version":"1.0.0"},"servers":[{"description":"RightRev APP Server","url":"https://{realm}.{env}.rightrev.cloud/","variables":{"env":{"default":"{env}"},"realm":{"default":"{realm}"}}},{"description":"RightRev Auth Server","url":"https://authn.{env}.rightrev.cloud/auth/realms/{realm}/protocol/openid-connect/","variables":{"env":{"default":"{env}"},"realm":{"default":"{realm}"}}}],"security":[],"paths":{"/apis/policy-sets/v1/policy/orders-group":{"get":{"description":"Retrieves **Orders Group** policy created in the RightRev system.\n","responses":{"200":{"description":"Get Orders Group Policy","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"compliance_id":{"type":"string","description":"A system-generated compliance ID to retrieve orders group."},"compliance_name":{"type":"string","description":"Name of the policy fetched by the system."},"compliance_spec":{"type":"array","items":{"type":"object","properties":{"can_delete":{"type":"boolean","description":"A boolean field indicating whether the orders group policy can be deleted or not. If set to True, the user is allowed to delete the orders group policy; if False, deletion is not permitted."},"created_at":{"type":"integer","description":"Timestamp of the policy created by the user. This is a unix Epoch timestamp format."},"created_by":{"type":"string","description":"ID of the user who created the policy."},"groupings":{"type":"array","items":{"type":"object","properties":{"fields":{"type":"array","items":{"type":"string"},"description":"Displays the list of field values selected by the user to set orders group policy."}}},"description":"A process where transaction lines are automatically grouped into revenue contracts (RCs) based on the defined orders group policy."},"is_user_defined":{"type":"boolean","description":"A boolean field indicating whether the orders group policy is defined by the user or not. If set to True, the user is allowed to define the orders group policy; if False, defining the orders group policy is not permitted."},"name":{"type":"string","description":"Displays the orders group policy name generated by the system."},"updated_at":{"type":"integer","description":"Timestamp of the policy updated by the user. This is a unix Epoch timestamp format."},"updated_by":{"type":"string","description":"ID of the user who updated the policy."}}},"description":"Defines the specific rules and standards where a system must process adhering to the compliant."},"created_by":{"type":"string","description":"ID of the user who created the policy."},"created_on":{"type":"integer","description":"Timestamp of the policy created by the user. This is a unix Epoch timestamp format."},"last_modified_by":{"type":"string","description":"ID of the user last modified by."},"last_modified_on":{"type":"integer","description":"Timestamp of the policy last modified on."},"policy_type":{"type":"string","description":"Represents the type of policy."},"status":{"type":"string","description":"Represents the status of the policy."},"unique_key":{"type":"string","description":"Represents the unique name of the orders group."},"version_id":{"type":"string","description":"Represents the latest version of the policy."}}}}}}}},"tags":["Policy Sets"],"summary":"Get Orders Group Policy","operationId":"get_orders_group_policy_apis_policy_sets_v1_policy_orders_group_get"}}}}
```

## Post Orders Group Policy

> Create a new \*\*Order Group\*\* policy in the RightRev system.\
> \- Users must select at least one identifier and maximum of five identifiers to create a order group policy.<br>

```json
{"openapi":"3.1.0","info":{"title":"RightRev API(s)","version":"1.0.0"},"servers":[{"description":"RightRev APP Server","url":"https://{realm}.{env}.rightrev.cloud/","variables":{"env":{"default":"{env}"},"realm":{"default":"{realm}"}}},{"description":"RightRev Auth Server","url":"https://authn.{env}.rightrev.cloud/auth/realms/{realm}/protocol/openid-connect/","variables":{"env":{"default":"{env}"},"realm":{"default":"{realm}"}}}],"security":[],"paths":{"/apis/policy-sets/v1/policy/orders-group":{"post":{"description":"Create a new **Order Group** policy in the RightRev system.\n- Users must select at least one identifier and maximum of five identifiers to create a order group policy.\n","responses":{"200":{"description":"Set Orders Group Policy","content":{"application/json":{"schema":{"type":"object","properties":{"compliance_details":{"type":"array","items":{"type":"object","properties":{"error":{"type":"array","description":"Displays information about problems that occurred while handling the request. Commonly used to report validation errors, missing or invalid parameters, or other issues related to API processing."},"message":{"type":"string","description":"Displays the outcome of the action. It is commonly used to provide success confirmations, error details, or other informational responses from the API after the operation is executed."},"unique_key":{"type":"string","description":"Unique identifier generated by the system."}},"required":["error","message","unique_key"]},"description":"A list of compliance-related entries, each providing detailed information about the outcome of a specific compliance check. This includes messages, associated errors, and a system-generated unique identifier for tracking."},"compliance_id":{"type":"string","description":"Provide compliance id to create order group policy pertaining to that compliance id."},"error":{"type":"array","description":"Displays information about problems that occurred while handling the request. Commonly used to report validation errors, missing or invalid parameters, or other issues related to API processing."}},"required":["compliance_details","compliance_id","error"]}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"compliance_spec":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"Name of the policy fetched by the system."},"groupings":{"type":"array","items":{"type":"object","properties":{"fields":{"type":"array","items":{"type":"string"},"description":"List of field values to be selected by the user to set order group policy."}},"required":["fields"]},"description":"A process where transaction lines are automatically grouped into revenue contracts (RCs) based on the defined order group policy."}},"required":["groupings","name"]},"description":"Defines the specific rules and standards where a system must process adhering to the compliant."},"format_type":{"type":"string","description":"JSON format."},"compliance_name":{"type":"string","description":"Provide compliance name to create an order group policy pertaining to that compliance name."},"unique_key":{"type":"string","description":"Name of the order group policy."}},"required":["compliance_name","compliance_spec","format_type","unique_key"]}}},"required":true},"tags":["Policy Sets"],"summary":"Post Orders Group Policy","operationId":"post_orders_group_policy_apis_policy_sets_v1_policy_orders_group_post"}}}}
```

## Patch Orders Group Policy

> Update the \*\*Orders Group\*\* policy in the RightRev system.<br>

```json
{"openapi":"3.1.0","info":{"title":"RightRev API(s)","version":"1.0.0"},"servers":[{"description":"RightRev APP Server","url":"https://{realm}.{env}.rightrev.cloud/","variables":{"env":{"default":"{env}"},"realm":{"default":"{realm}"}}},{"description":"RightRev Auth Server","url":"https://authn.{env}.rightrev.cloud/auth/realms/{realm}/protocol/openid-connect/","variables":{"env":{"default":"{env}"},"realm":{"default":"{realm}"}}}],"security":[],"paths":{"/apis/policy-sets/v1/policy/orders-group/{compliance_id}":{"patch":{"description":"Update the **Orders Group** policy in the RightRev system.\n","parameters":[{"name":"compliance_id","in":"path","required":true,"schema":{"type":"string","title":"Compliance Id"},"description":"User has to provide a compliance id to update orders group. This compliance id can be fetched from the response of the **Orders Group Policy - GET** API.\n"}],"responses":{"200":{"description":"Update Orders Group Policy","content":{"application/json":{"schema":{"type":"object","properties":{"compliance_details":{"type":"array","items":{"type":"object","properties":{"error":{"type":"array","description":"Displays information about problems that occurred while handling the request. Commonly used to report validation errors, missing or invalid parameters, or other issues related to API processing."},"message":{"type":"string","description":"Displays the outcome of the action. It is commonly used to provide success confirmations, error details, or other informational responses from the API after the operation is executed."},"unique_key":{"type":"string","description":"Represents the unique name of the orders group."}}},"description":"A list of compliance-related entries, each providing detailed information about the outcome of a specific compliance check. This includes messages, associated errors, and a system-generated unique identifier for tracking."},"compliance_id":{"type":"string","description":"A system-generated compliance ID to update orders group."},"error":{"type":"array","description":"Displays information about problems that occurred while handling the request. Commonly used to report validation errors, missing or invalid parameters, or other issues related to API processing."}}}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"compliance_spec":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"Name of the transaction grouping rule."},"groupings":{"type":"array","items":{"type":"object","properties":{"fields":{"type":"array","items":{"type":"string"},"description":"Name of the fields on which transactions are grouped."}},"required":["fields"]},"description":"Specification of grouping rule."}},"required":["groupings","name"]},"description":"Defines the specific rules and standards where a system must process adhering to the compliant."},"format_type":{"type":"string","description":"Format of the payload. For e.g. JSON."},"compliance_name":{"type":"string","description":"Name of the Policy."},"unique_key":{"type":"string","description":"Name of the grouping policy."}},"required":["compliance_name","compliance_spec","format_type","unique_key"]}}},"required":true},"tags":["Policy Sets"],"summary":"Patch Orders Group Policy","operationId":"patch_orders_group_policy_apis_policy_sets_v1_policy_orders_group__compliance_id__patch"}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://apis.rightrev.com/rightrev-rest-api/policy-sets/configuration/revenue-policies/identify-customer-contract.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
