Lock Bill - m3ter Documentation
Lock Bill
cURL
curl --request PUT \
--url https://api.m3ter.com/organizations/{orgId}/bills/{id}/lock \
--header 'Authorization: Bearer <token>'
Python
import requests
url = "https://api.m3ter.com/organizations/{orgId}/bills/{id}/lock"
headers = {"Authorization": "Bearer <token>"}
response = requests.put(url, headers=headers)
print(response.text)
JavaScript (Fetch)
const options = {method: 'PUT', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.m3ter.com/organizations/{orgId}/bills/{id}/lock', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
PHP
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.m3ter.com/organizations/{orgId}/bills/{id}/lock",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
?>
Go
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.m3ter.com/organizations/{orgId}/bills/{id}/lock"
req, _ := http.NewRequest("PUT", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}
Unirest (Java)
HttpResponse<String> response = Unirest.put("https://api.m3ter.com/organizations/{orgId}/bills/{id}/lock")
.header("Authorization", "Bearer <token>")
.asString();
Ruby
require 'uri'
require 'net/http'
url = URI("https://api.m3ter.com/organizations/{orgId}/bills/{id}/lock")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body
Response Codes
Sample Response
{
"id": "<string>",
"version": 123,
"accountId": "<string>",
"accountCode": "<string>",
"startDate": "2023-12-25",
"endDate": "2023-12-25",
"startDateTimeUTC": "2023-11-07T05:31:56Z",
"endDateTimeUTC": "2023-11-07T05:31:56Z",
"billDate": "2023-12-25",
"dueDate": "2023-12-25",
"billFrequencyInterval": 123,
"timezone": "UTC",
"currency": "<string>",
"locked": true,
"createdDate": "2023-11-07T05:31:56Z",
"billJobId": "<string>",
"currencyConversions": [
{
"from": "EUR",
"to": "USD",
"multiplier": 1.12
}
],
"lastCalculatedDate": "2023-11-07T05:31:56Z",
"lineItems": [
{
"description": "<string>",
"quantity": 123,
"units": 123,
"unit": "<string>",
"subtotal": 123,
"currency": "<string>",
"conversionRate": 123,
"convertedSubtotal": 123,
"averageUnitPrice": 123,
"id": "<string>",
"productId": "<string>",
"productName": "<string>",
"productCode": "<string>",
"accountingProductId": "<string>",
"accountingProductName": "<string>",
"accountingProductCode": "<string>",
"aggregationId": "<string>",
"compoundAggregationId": "<string>",
"counterId": "<string>",
"chargeId": "<string>",
"segment": {},
"group": {},
"meterId": "<string>",
"planId": "<string>",
"planGroupId": "<string>",
"commitmentId": "<string>",
"balanceId": "<string>",
"creditTypeId": "<string>",
"pricingId": "<string>",
"childAccountId": "<string>",
"childAccountCode": "<string>",
"usagePerPricingBand": [
{
"pricingBandId": "<string>",
"lowerLimit": 123,
"fixedPrice": 123,
"unitSubtotal": 123,
"unitPrice": 123,
"bandUnits": 123,
"bandQuantity": 123,
"bandSubtotal": 123,
"creditTypeId": "<string>",
"convertedBandSubtotal": 123
}
],
"servicePeriodStartDate": "2023-11-07T05:31:56Z",
"servicePeriodEndDate": "2023-11-07T05:31:56Z",
"referencedBillId": "<string>",
"referencedLineItemId": "<string>",
"reasonId": "<string>",
"contractId": "<string>",
"sequenceNumber": 123,
"additional": {},
"grantDrawdowns": [
{
"balanceId": "<string>",
"quantity": 123,
"units": 123,
"currencyAmount": 123
}
],
"balanceDrawdowns": [
{
"balanceId": "<string>",
"units": 123,
"balanceAmount": 123,
"lineItemAmount": 123,
"billAmount": 123
}
],
"commitmentDrawdowns": [
{
"commitmentId": "<string>",
"units": 123,
"commitmentAmount": 123,
"lineItemAmount": 123,
"billAmount": 123
}
],
"creditCoverage": [
{
"lineItemId": "<string>",
"units": 123,
"lineItemAmount": 123,
"creditAmount": 123,
"billAmount": 123
}
]
}
],
"purchaseOrderNumber": "<string>",
"externalInvoiceReference": "<string>",
"externalInvoiceDate": "2023-12-25",
"jsonStatementGenerated": true,
"csvStatementGenerated": true,
"statementStale": true,
"billTotal": 123,
"totalDebits": 123,
"totalCredits": 123,
"sequentialInvoiceNumber": "<string>",
"dtCreated": "2023-11-07T05:31:56Z",
"dtLastModified": "2023-11-07T05:31:56Z",
"createdBy": "<string>",
"lastModifiedBy": "<string>",
"dtApproved": "2023-11-07T05:31:56Z",
"approvedBy": "<string>",
"dtLocked": "2023-11-07T05:31:56Z",
"lockedBy": "<string>"
}
Error Response
{
"message": "<string>"
}
{
"message": "<string>"
}
Authorizations
- Authorization:
string (header, required)
m3ter supports machine to machine authentication using the clientCredentials OAuth2 flow.
Path Parameters
- orgId: string (required) - The unique identifier (UUID) of your Organization.
- id: string (required) - The unique identifier (UUID) of the Bill to lock.