### Schema: ANY
Source: https://demo.portaone.com:8444/doc/api/CustomerInterface.json
Schema definition for ANY
```markdown
## Schema: ANY
Schema definition for ANY
**Type:** object
```
--------------------------------
### POST /DiscountPlan/get_topup_option_info
Source: https://demo.portaone.com:8444/doc/api/CustomerInterface.json
The method is supported as read-only when the system is in standalone mode.
```markdown
### Request Body
**Content-Type:** application/json
- **params** (object)
- **i_vd_topup** (integer) (required): The unique ID of the bundle item top-up option. (example: 1)
### Responses
#### 200 - Successful response of the API method.
- **topup_option_info** (object)
- **i_vd_dg** (integer): The unique ID of the bundle item. (example: 1)
- **i_vd_topup** (integer): The unique ID of the bundle item top-up option. (example: 1)
- **topup_amount** (number): The amount of service units or money to top-up. (example: 0.99)
- **topup_expiry_time** (integer): The lifetime of the topped-up amount (in days). (example: 1)
- **topup_fee** (number): The amount of money charged to a customer/account for a top-up. (example: 0.99)
#### 500 - Failed response of the API method.
- **faultcode** (string): The error code.
- **faultstring** (string): Text description of the error.
### Example Usage
```bash
curl -X POST "https://{hostname}:{port}/rest/DiscountPlan/get_topup_option_info" \
-H "Content-Type: application/json" \
-d '{
"params": "value"
}'
```
```
--------------------------------
### POST /Account/activate_bundle
Source: https://demo.portaone.com:8444/doc/api/CustomerInterface.json
By default, a new bundle cycle starts instantly, unless "delay_activation_till" is set.
The method is not supported when the system is in standalone mode.
```markdown
### Request Body
**Content-Type:** application/json
- **params** (object)
- **automatic_renewal** (string (N|Y)): Allows you to specify, whether the bundle cycle should be auto-renewed periodically.
If set to 'Y', the system will attempt to renew the cycle on its last day. If this attempt fails (e.g., due to insufficient funds) and the bundle cycle expires, the system will make hourly attempts to renew the bundle cycle for a defined number of days after its expiration (the number of days is defined by the 'DiscountPlans.ExpiredBundleReactivationDays' option).
Possible values: 'Y' - auto-renewal is enabled; 'N' - auto-renewal is disabled.
Default value: used 'automatic_renewal' from the bundle that is assigned as 'prepaid bundle' to the account. (example: "Y") ("N"|"Y")
- **continued_from** (string (date-time)): Defines the look-back period for the new activation rating, determining how far it should go to roll over unused minutes.
Note: the required format is 'YYYY-MM-DD HH24:MI:SS'; this field can be used only in the admin and reseller realms. (example: "2000-01-01 08:00:00")
- **delay_activation_till** (string (date-time)): Enables scheduling a future bundle cycle activation. It can be used only if there has been at least one prior cycle activation for this bundle.
Note: the required format is 'YYYY-MM-DD HH24:MI:SS'; if the specified date is in the past, the current date and time will be used; this field can be used only in the admin and reseller realms. (example: "2000-01-01 08:00:00")
- **i_account** (integer) (required): The unique ID of the account. (example: 1)
- **i_vd_plan** (integer) (required): The unique ID of the volume discount plan that represents the bundle. (example: 1)
### Responses
#### 200 - Successful response of the API method.
- **success** (integer) (required): The result of the operation.
Possible values: 1 - the operation was successful.
Note: if the operation fails, the method will end with an error. (example: 1)
#### 500 - Failed response of the API method.
- **faultcode** (string): The error code.
- **faultstring** (string): Text description of the error.
### Example Usage
```bash
curl -X POST "https://{hostname}:{port}/rest/Account/activate_bundle" \
-H "Content-Type: application/json" \
-d '{
"params": "value"
}'
```
```
--------------------------------
### POST /Payment/get_payment_distribution_list
Source: https://demo.portaone.com:8444/doc/api/CustomerInterface.json
Example: a payment of $100 is applied as follows: $90 is applied to invoice #123, and the remaining $10 is unallocated to any invoice.
The method is supported as read-only when the system is in standalone mode.
```markdown
### Request Body
**Content-Type:** application/json
- **params** (object)
- **funds_source_type** (string (E-commerce payment|Internal funds increase|Manual payment|Unknown)): The funds source type allows filtering records based on the origin of the funds in the system.
Note: if provided, the value of the i_xdr field is ignored; records with the 'Internal funds increase'/'Unknown' source types are cumulative, i.e. a record with 'funds_source_type'='Unknown' for 'status'='applied_to_invoice' and 'i_invoice'=N represents the total amount of unknown funds applied to this invoice.
Possible values:
- 'E-commerce payment' - get records related to e-commerce payments;
- 'Manual payment' - get records related to manual payments;
- 'Internal funds increase' - get records related to internal funds increase totals (the system can increase the amount of customer's unallocated payments without an actual payment, e.g., when an invoice is issued with a negative amount_net or when a prepaid customer is created with an initial balance);
- 'Unknown' - get records related to unknown funds source totals (e.g., when a specific payment cannot be identified because the payment history was cleaned up or the payment was made before the MR119 system update). (example: "Unknown") ("E-commerce payment"|"Internal funds increase"|"Manual payment"|"Unknown")
- **get_total** (integer): Indicates whether to return the total number of history records found.
Possible values: 1 - yes, 0 - no. (example: 1)
- **i_account** (integer): The unique ID of the account to get payment history for.
Note: if provided, the value of the payment_owner field is ignored. (example: 1)
- **i_customer** (integer) (required): The unique ID of the customer to get payment history for. (example: 1)
- **i_xdr** (integer): The unique ID of the payment xDR.
Note: requires the payment_owner field to be specified. (example: 1)
- **limit** (integer): The number of rows to retrieve.
Mandatory for an API request with the offset property specified. (example: 50)
- **offset** (integer): The number of rows to skip at the beginning of the list.
Requires the limit property to be specified in the API request. (example: 1)
- **payment_owner** (string (Account|Customer)): The payments owner filter.
By default, the method returns records related to both the customer and their accounts.
Note: the system only tracks payments for credit accounts with individual credit limits, because in other cases (e.g., payments of debit accounts) the customer's unallocated payments value is not affected.
Possible values:
- 'Customer' - get only records related to customer payments;
- 'Account' - get only records related to payments of customer accounts. (example: "Customer") ("Account"|"Customer")
- **status** (string (applied_to_invoice|erased|refunded|refunded_to_cc|unallocated)): The record status filter enables retrieval of records for a specific status only.
Possible values:
- 'applied_to_invoice' - get records for the parts of payments applied to invoices;
- 'unallocated' - get records for the currently unallocated parts of payments;
- 'refunded' - get records for the parts of payments whose amounts were manually refunded;
- 'refunded_to_cc' - get records for the parts of payments whose amounts were refunded to the owner's credit card;
- 'erased' - get records for the parts of payments whose amounts were erased due to disabled invoicing. (example: "unallocated") ("applied_to_invoice"|"erased"|"refunded"|"refunded_to_cc"|"unallocated")
### Responses
#### 200 - Successful response of the API method.
- **payment_usage_history_record_list** (array (union)) (required)
Array items:
- **amount** (number) (required): The payment part amount in the customer's currency that corresponds to the status field. (example: 0.99)
- **bill_time** (string (date-time)): The date and time in the 'YYYY-MM-DD HH24:MI:SS' format (UTC timezone) when the payment was processed.
Note: this field is empty for records where the value of the funds_source_type field equals to 'Internal funds increase' or 'Unknown'. (example: "2000-01-01 08:00:00")
- **funds_source_type** (string) (required): The type of funds source.
Note: records with the 'Internal funds increase'/'Unknown' source types are cumulative, i.e. a record with 'funds_source_type'='Unknown' for 'status'='applied_to_invoice' and 'i_invoice'=N represents the total amount of unknown funds applied to this invoice.
Possible values:
- 'E-commerce payment' - the retrieved amount is associated with an e-commerce payment;
- 'Manual payment' - the retrieved amount is associated with a manual payment;
- 'Internal funds increase' - the retrieved amount is the total of internal operations (the system can increase the customer's unallocated payments amount without an actual payment, e.g., when an invoice is issued with a negative amount_net or when a prepaid customer is created with an initial balance);
- 'Unknown' - the retrieved amount is the total of payments that cannot be identified because the payment history was cleaned up or because they were made before the MR119 system update.
- **i_account** (integer): The unique ID of the account that made the payment.
Note: this field is empty for records the value of the payment_owner field equals to 'Customer'. (example: 1)
- **i_customer** (integer) (required): The unique ID of the customer. (example: 1)
- **i_invoice** (integer): The unique ID of the customer's invoice to which the payment part was applied.
Note: the value is only present for records where the value of the status field is 'applied_to_invoice'. (example: 1)
- **i_xdr** (integer): The unique ID of the payment xDR.
Note: this field is empty for records where the value of the funds_source_type field equals to 'Internal funds increase' or 'Unknown'. (example: 1)
- **payment_owner** (string) (required): The owner of the payment.
Note: the system only tracks payments for credit accounts with individual credit limits, because in other cases (e.g., payments of debit accounts) customer's unallocated payments value is not affected.
Possible values:
- 'Customer' - payment was made by customer;
- 'Account' - payment was made by one of customer's accounts.
- **status** (string) (required): The payment part status.
Possible values:
- 'applied_to_invoice' - the payment part was applied to an invoice (see i_invoice field);
- 'unallocated' - the payment part is currently unallocated;
- 'refunded' - the payment part was manually refunded;
- 'refunded_to_cc' - the payment part was refunded to the owner's credit card;
- 'erased' - the payment part was erased due to disabled invoicing.
- **total_payment_amount** (number): The total payment amount in customer's currency.
Note: this field is empty for records where the value of the funds_source_type field equals to 'Internal funds increase' or 'Unknown'. (example: 0.99)
- **total** (integer): The total number of history records found. (example: 1)
#### 500 - Failed response of the API method.
- **faultcode** (string): The error code.
- **faultstring** (string): Text description of the error.
### Example Usage
```bash
curl -X POST "https://{hostname}:{port}/rest/Payment/get_payment_distribution_list" \
-H "Content-Type: application/json" \
-d '{
"params": "value"
}'
```
```
--------------------------------
### POST /DiscountPlan/get_topup_option_list
Source: https://demo.portaone.com:8444/doc/api/CustomerInterface.json
The method is supported as read-only when the system is in standalone mode.
```markdown
### Request Body
**Content-Type:** application/json
- **params** (object)
- **i_vd_dg** (integer) (required): The unique ID of the bundle item. (example: 1)
- **topup_amount** (number): The amount of service units or money to top-up. (example: 0.99)
- **topup_expiry_time** (integer): The lifetime of the topped-up amount (in days). (example: 1)
- **topup_fee** (number): The amount of money charged to a customer/account for a top-up. (example: 0.99)
### Responses
#### 200 - Successful response of the API method.
- **topup_option_list** (array (union))
Array items:
- **i_vd_dg** (integer): The unique ID of the bundle item. (example: 1)
- **i_vd_topup** (integer): The unique ID of the bundle item top-up option. (example: 1)
- **topup_amount** (number): The amount of service units or money to top-up. (example: 0.99)
- **topup_expiry_time** (integer): The lifetime of the topped-up amount (in days). (example: 1)
- **topup_fee** (number): The amount of money charged to a customer/account for a top-up. (example: 0.99)
#### 500 - Failed response of the API method.
- **faultcode** (string): The error code.
- **faultstring** (string): Text description of the error.
### Example Usage
```bash
curl -X POST "https://{hostname}:{port}/rest/DiscountPlan/get_topup_option_list" \
-H "Content-Type: application/json" \
-d '{
"params": "value"
}'
```
```
--------------------------------
### POST /Session/login
Source: https://demo.portaone.com:8444/doc/api/CustomerInterface.json
The method is fully supported when the system is in standalone mode.
```markdown
### Request Body
**Content-Type:** application/json
- **params** (object)
- **ca_code** (string): The captcha code.
- **ca_token** (string): The captcha token.
- **enable_csrf_protection** (integer): The flag shows whether to permanently enable CSRF protection for the session.
Possible values: 0 - do not enable CSRF protection; 1 - enable CSRF protection. (example: 1)
- **i_env** (integer): The unique ID of the environment. (example: 1)
- **login** (string) (required): The user login for the PortaBilling web interface.
- **one_time_password** (string): The one-time password received by multi-factor authentication.
- **password** (string): The user password for the PortaBilling web interface.
- **token** (string): The API token of a user.
Note: Can be used instead of the password to set up a session.
### Responses
#### 200 - Successful response of the API method.
- **access_token** (string) (required): The access token of the user.
It can be supplied in the HTTP Authorization header using the Bearer schema for API request authorization.
The token provides access to PortaSIP, ESPF, and PortaBilling APIs and is valid until the value stated in its expires_at property.
- **csrf_token** (string): The CSRF token of the current session.
Note: can be obtained only with enabled CSRF protection.
- **expires_at** (string): The date and time in UTC when the access token becomes expired (YYYY-MM-DD HH24:MI:SS).
Note: deprecated, use the "expires_in" field instead.
- **expires_in** (integer): The lifetime of the access token, in seconds.
Note: Corresponds to the amount of time after which the provided access token will expire.
For example, the value "3600" denotes that the access token will expire in one hour from the time the response was generated. (example: 1)
- **mfa_attempts** (integer): The number of attempts left to verify multi-factor authentication. The session will be closed when this number is depleted. (example: 1)
- **mfa_enabled** (integer) (required): The availability of multi-factor authentication for the object.
Possible values: 1 - the use of MFA is enabled, 0 - MFA is disabled for the object. (example: 1)
- **mfa_verified** (integer): The status of multi-factor authentication for the session.
Verification is performed by a request to the AccessControl.verify_otp method before proceeding with the session.
Possible values: 0 - MFA verification is required, 1 - no additional MFA verification is required. Not present if MFA is disabled. (example: 1)
- **refresh_token** (string) (required): The refresh token of the user.
Note: can be used to update the access token (Session/refresh_access_token API method).
- **session_id** (string): The unique ID of the newly opened authenticated session.
#### 500 - Failed response of the API method.
- **faultcode** (string): The error code.
- **faultstring** (string): Text description of the error.
### Example Usage
```bash
curl -X POST "https://{hostname}:{port}/rest/Session/login" \
-H "Content-Type: application/json" \
-d '{
"params": {
"login": "my_user_login",
"password": "FuY+h)8:ya>EaFN5"
}
}'
```
```
--------------------------------
### POST /CodecConverter/get_file
Source: https://demo.portaone.com:8444/doc/api/CustomerInterface.json
Note: users with administrator rights can get any file. Other users can only get their own ringback tone files or file properties information (e.g. file name, ID, etc) using the 'audio_file' or 'ringback_tone' handler with the 'info_only' flag enabled; The 'handler' field is mandatory to properly process the request.
The method is supported as read-only when the system is in standalone mode.
```markdown
### Request Body
**Content-Type:** application/json
- **params** (object)
- **codec** (string (a_law|g723|g729|mp3|u_law|wav)): The codec name.
Note: supported values depend on the selected handler.
Possible values: "a_law", "u_law", "g729", "g723", "wav", "mp3".
Default value: "wav". (example: "wav") ("a_law"|"g723"|"g729"|"mp3"|"u_law"|"wav")
- **handler** (string (audio_file|dial_by_name|moh|response_message|ringback_tone)): The handler name.
Note: the field is used in conjunction with the id to find the file.
Possible values: audio_file, dial_by_name, moh, ringback_tone, response_message.
Default value: audio_file. (example: "ringback_tone") ("audio_file"|"dial_by_name"|"moh"|"response_message"|"ringback_tone")
- **id** (integer) (required): The unique identifier of the file. (example: 1)
- **info_only** (integer): The flag that shows whether to fetch only the information without attachment. (example: 1)
### Responses
#### 200 - Successful response of the API method.
- **error_message** (string): The error message for the error that occurred while adding the file.
- **i_owner** (integer): The identifier of the user who owns the file. (example: 1)
- **id** (integer): The unique identifier of the audio file. (example: 1)
- **name** (string): The file name.
- **owner_type** (integer): The identifier of the user type who owns the file.
Possible values: 1 - there is no owner (system file), 2 - the owner is an account entity, 3 - the owner is a customer entity, 4 - the owner is a user entity. (example: 1)
- **status** (string): The processing status of the file that is being added.
#### 500 - Failed response of the API method.
- **faultcode** (string): The error code.
- **faultstring** (string): Text description of the error.
### Example Usage
```bash
curl -X POST "https://{hostname}:{port}/rest/CodecConverter/get_file" \
-H "Content-Type: application/json" \
-d '{
"params": "value"
}'
```
```