# Dynamic Monetization APIs
APIs to perform Dynamic Monetization activity.
Version: 1.0
## Servers
Dynamic Monetization API URL
```
https://{siteID}.flexnetoperations.{domainExtension}/dynamicmonetization/api
```
Variables:
- `siteID`: Site ID for your Dynamic Monetization instance.
Default: "siteID"
- `domainExtension`: Domain extension for your Dynamic Monetization instance.
Default: "com"
Dynamic Monetization API URL
```
https://{siteID}.flexnetoperations.{domainExtension}/dynamicmonetization/floating/api
```
Variables:
- `siteID`: Site ID for your Dynamic Monetization instance.
Default: "siteID"
- `domainExtension`: Domain extension for your Dynamic Monetization instance.
Default: "com"
## Security
### AdministrationAccess
A JWT token signed using a private key corresponding to a named producer admin public key.
May be used by a producer user for elevated API access.
Required claims:
- iss: The URI of the issuing server.
- nbf: The time this token is valid after, in seconds since the epoch.
- exp: The time this token is valid until, in seconds since the epoch.
- iat: The time this token was issued, in seconds since the epoch.
- cnf: A JSON object that contains public key identity information.
- kid: The ID of the public key that should be used to verify this JWT.
- kty: The key type, must be "ADMIN".
Example payload
```
{
"nbf": 1691663772,
"exp": 1699652520,
"iat": 1691663773,
"iss": "producer.org",
"cnf": {
"jwk" : {
"kid": "xyz-key-id",
"kty": "ADMIN"
}
}
}
```
Type: http
Scheme: bearer
Bearer Format: JWT
### ClientAccess
A JWT token signed using a private key corresponding to a named client public key.
May be used by a client, or customer user to access APIs.
Required claims:
- iss: The URI of the issuing server.
- nbf: The time this token is valid after, in seconds since the epoch.
- exp: The time this token is valid until, in seconds since the epoch.
- iat: The time this token was issued, in seconds since the epoch.
- aud: A list of instance IDs that this token will allow access to.
- cnf: A JSON object that contains public key identity information.
- kid: The ID of the public key that should be used to verify this JWT.
- kty: The key type, must be "CLIENT".
Example payload
```
{
"nbf": 1691663772,
"exp": 1699652520,
"iat": 1691663773,
"iss": "producer.org",
"aud":["47c173d4-a262-44ba-992c-63b0436fecc5"],
"cnf": {
"jwk" : {
"kid": "xyz-key-id",
"kty": "CLIENT"
}
}
}
```
Type: http
Scheme: bearer
Bearer Format: JWT
### bearerAuth
Type: http
Scheme: bearer
Bearer Format: JWT
## Download OpenAPI description
[Dynamic Monetization APIs](https://fnoapi-dynamicmonetization.redocly.app/_spec/apis/OpenAPISpec.yaml)
## Authorization
APIs to manage authorization keys.
### Save a producer administration key
- [PUT /v1.0/administration-keys](https://fnoapi-dynamicmonetization.redocly.app/apis/openapispec/authorization/producer-admin-key-upload.md): Adds or updates a public key which can be used by a producer user to make Dynamic Monetization API requests. Allow 10 minutes for the key to be available to authorize requests.
### Delete a producer administration key
- [DELETE /v1.0/administration-keys/{keyId}](https://fnoapi-dynamicmonetization.redocly.app/apis/openapispec/authorization/delete-producer-admin-key.md): Deletes a specified producer administration key. Pass the ID of the key that you want to delete as a path parameter. It may take up to 10 minutes for the key to be fully removed after calling the API.
### Save a client key
- [PUT /v1.0/client-keys](https://fnoapi-dynamicmonetization.redocly.app/apis/openapispec/authorization/client-key-upload.md): Adds or updates a public key which can be used by a client user to make Dynamic Monetization API requests. Allow 10 minutes for the key to be available to authorize requests.
### Delete a client key
- [DELETE /v1.0/client-keys/{keyId}](https://fnoapi-dynamicmonetization.redocly.app/apis/openapispec/authorization/delete-client-key.md): Deletes a specified client key. Pass the ID of the key that you want to delete as a path parameter. It may take up to 10 minutes for the key to be fully removed after calling the API.
### Get a list of public keys
- [GET /v1.0/public-keys](https://fnoapi-dynamicmonetization.redocly.app/apis/openapispec/authorization/get-public-keys.md): Gets a list of administration and client public keys.
## Instances
APIs to manage Dynamic Monetization instances, which host the line items belonging to customers.
### Get a list of instances
- [GET /v1.0/instances](https://fnoapi-dynamicmonetization.redocly.app/apis/openapispec/instances/listinstances.md): Returns information about instances owned by a producer's customer accounts.
Each customer account may have one or more instances, and each instance serves
exactly one customer account.
### Create an instance
- [POST /v1.0/instances](https://fnoapi-dynamicmonetization.redocly.app/apis/openapispec/instances/addinstance.md): Creates a new instance. Each customer account may have one or more instances,
and each instance serves exactly one customer account.
This method is intended for use if you do not use FlexNet Operations as your back office,
so that you can configure your upstream system (e.g. a CRM) to create instances for your accounts.
### Get instance by instance ID
- [GET /v1.0/instances/{instanceId}](https://fnoapi-dynamicmonetization.redocly.app/apis/openapispec/instances/getinstancebyid.md): Returns information about a specific instance. Pass the instance ID for which you require information as a path parameter.
## Line Items
APIs to manage line items mapped to an instance.
### Get a list of line items
- [GET /v1.0/instances/{instanceId}/line-items](https://fnoapi-dynamicmonetization.redocly.app/apis/openapispec/line-items/getactivationsforinstance.md): Returns a list of line items mapped to instances owned by a producer's customer accounts.
### Map a line item to an instance
- [PUT /v1.0/instances/{instanceId}/line-items](https://fnoapi-dynamicmonetization.redocly.app/apis/openapispec/line-items/addactivation.md): Maps a line item to an instance. The first time
this API is called, the payload details will be stored,
and reported in a GET line-item
request. If the line item is already mapped, then the details stored
will be entirely replaced.
This method is intended for use if you do not use FlexNet Operations as your back office,
so that you can configure your upstream system (e.g. a CRM or back office)
to create line items in Dynamic Monetization for your end customers.
(If you use FlexNet Operations as your back office, but use this method directly
to provision line items that do not exist in FlexNet Operations, then those line items
will not be reflected in FlexNet Operations.)
### Get a specific line item by ID
- [GET /v1.0/instances/{instanceId}/line-items/{lineItemId}](https://fnoapi-dynamicmonetization.redocly.app/apis/openapispec/line-items/getlineitembyid.md): Returns information about a specific line item. Pass the line item ID for which you require information as a path parameter.
### Delete a line item by its ID
- [DELETE /v1.0/instances/{instanceId}/line-items/{lineItemId}](https://fnoapi-dynamicmonetization.redocly.app/apis/openapispec/line-items/deletelineitem.md): Deletes a line item given its ID.
This method is intended for use if you do not use FlexNet Operations as your back office,
so that you can manage line items in Dynamic Monetization for your end customers.
(If you use FlexNet Operations as your back office, but use this method directly to remove
line items that exist in FlexNet Operations, then those line items' representation in
FlexNet Operations will not be affected.)
## Rules of Access
APIs to manage rules of access for Dynamic Monetization instances. Rules of access are used to control the way the counts of an elastic line item are used in an access request.
### Create a list of actions and allocations for a line item
- [POST /v1.0/instances/{instanceId}/line-items/{lineItemId}/actions](https://fnoapi-dynamicmonetization.redocly.app/apis/openapispec/rules-of-access/createactions.md): Creates an ordered list of actions to be taken when a condition is met.
### Delete all actions on a line item
- [DELETE /v1.0/instances/{instanceId}/line-items/{lineItemId}/actions](https://fnoapi-dynamicmonetization.redocly.app/apis/openapispec/rules-of-access/deleteactions.md): Deletes all actions on a line item.
### Get actions and allocations for a line item
- [GET /v1.0/instances/{instanceId}/line-items/{lineItemId}/actions](https://fnoapi-dynamicmonetization.redocly.app/apis/openapispec/rules-of-access/getactions.md): Returns a list of actions to be taken when condition is met.
### Modify actions for a line item
- [PUT /v1.0/instances/{instanceId}/line-items/{lineItemId}/actions](https://fnoapi-dynamicmonetization.redocly.app/apis/openapispec/rules-of-access/putactions.md): Modifies the list of actions for a line item. The existing actions can be re-ordered, modified or omitted, and new actions can be added to the list. If an action is omitted, it will be completely removed and the current counts for a related allocation will be lost; therefore, care should be taken when making any changes.
### Get all defined conditions
- [GET /v1.0/instances/{instanceId}/conditions](https://fnoapi-dynamicmonetization.redocly.app/apis/openapispec/rules-of-access/getconditionsofaccess.md): API to fetch conditions.
### Create conditions
- [POST /v1.0/instances/{instanceId}/conditions](https://fnoapi-dynamicmonetization.redocly.app/apis/openapispec/rules-of-access/postconditionsofaccess.md): API to create conditions.
### Update conditions
- [PATCH /v1.0/instances/{instanceId}/conditions](https://fnoapi-dynamicmonetization.redocly.app/apis/openapispec/rules-of-access/patchconditions.md): Update existing and add new conditions to an instance.
### Delete conditions
- [DELETE /v1.0/instances/{instanceId}/conditions](https://fnoapi-dynamicmonetization.redocly.app/apis/openapispec/rules-of-access/deleteconditionsofaccess.md): Delete all conditions configured on the instance.
### Delete a condition by ID
- [DELETE /v1.0/instances/{instanceId}/conditions/{conditionId}](https://fnoapi-dynamicmonetization.redocly.app/apis/openapispec/rules-of-access/deleteconditionbyid.md): API to delete a specific condition configured on the instance.
### Get all actions for all Elastic Access line items of the instance
- [GET /v1.0/instances/{instanceId}/line-items/actions](https://fnoapi-dynamicmonetization.redocly.app/apis/openapispec/rules-of-access/getlineitemactions.md): API to fetch all actions for all Elastic Access line items of the instance.
## Rate Tables
APIs to manage rate tables. Rate tables are used to define the price of items (how many tokens are charged per item).
### Get all rate tables
- [GET /v1.0/rate-tables](https://fnoapi-dynamicmonetization.redocly.app/apis/openapispec/rate-tables/getratetables.md): Gets all the rate tables created, whether the effective time of the rate table has been reached or not.
### Create a rate table
- [POST /v1.0/rate-tables](https://fnoapi-dynamicmonetization.redocly.app/apis/openapispec/rate-tables/postratetables.md): Creates a new rate table.
### Delete a rate table
- [DELETE /v1.0/rate-tables](https://fnoapi-dynamicmonetization.redocly.app/apis/openapispec/rate-tables/deleteratetables.md): Deletes a rate table that hasn't come into effect yet.
Note: Rate tables that are already in effect cannot be deleted.
## Sessions
APIs for elastic access within the context of a session.
### Request a new session
- [POST /v1.0/sessions](https://fnoapi-dynamicmonetization.redocly.app/apis/openapispec/sessions/createsession.md): Creates a new session for elastic access.
### Fetch IDLE and ACTIVE sessions
- [GET /v1.0/sessions](https://fnoapi-dynamicmonetization.redocly.app/apis/openapispec/sessions/getallsessionsforinstance.md): Returns up to 100 live sessions, sorted in descending order of creation time.
### Fetch session details
- [GET /v1.0/sessions/{sessionId}](https://fnoapi-dynamicmonetization.redocly.app/apis/openapispec/sessions/getsession.md): Returns session details for the specified session ID.
### Close a session
- [DELETE /v1.0/sessions/{sessionId}](https://fnoapi-dynamicmonetization.redocly.app/apis/openapispec/sessions/closesession.md): Closes a specified session for elastic access.
### Elastic access request in the context of a session
- [PUT /v1.0/sessions/{sessionId}](https://fnoapi-dynamicmonetization.redocly.app/apis/openapispec/sessions/putsessionaccessrequest.md): Makes an elastic access request in the context of a session.
### Send heartbeat
- [GET /v1.0/sessions/{sessionId}/heartbeat](https://fnoapi-dynamicmonetization.redocly.app/apis/openapispec/sessions/getheartbeat.md): Sends a heartbeat for a session to keep it active.
## Non-Session Access Request
APIs for elastic access without a session.
### Access request for elastic tokens
- [POST /v1.0/instances/{instanceId}/access-request](https://fnoapi-dynamicmonetization.redocly.app/apis/openapispec/non-session-access-request/postaccessrequest.md): API to request products, features or other items that will be charged for using elastic tokens.
## Configuration
APIs for managing configuration values that control how customers can access and consume line items.
Available values:
- timezone.tolerant
- Allows a line item to be used up to 12 hours before its start date (UTC) and up to 12 hours after its end date (UTC), therefore making it tolerant to all time zones.
- Supported values: true (enabled) and false (disabled).
- Default: false
### All configuration
- [GET /v1.0/configuration](https://fnoapi-dynamicmonetization.redocly.app/apis/openapispec/configuration/gettenantconfigurations.md): Returns all configured values. If a configuration has been modified, the response includes the date of modification and the token key ID that was used to change configuration.
### Update configuration
- [PATCH /v1.0/configuration](https://fnoapi-dynamicmonetization.redocly.app/apis/openapispec/configuration/patchtenantconfigurations.md): Update one or more configuration values.