Retrieve Contract by contract_id
curl --request GET \
--url http://127.0.0.1:8080/v1/c/contract/{contract_id} \
--header 'wb-key: <api-key>'import requests
url = "http://127.0.0.1:8080/v1/c/contract/{contract_id}"
headers = {"wb-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'wb-key': '<api-key>'}};
fetch('http://127.0.0.1:8080/v1/c/contract/{contract_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8080",
CURLOPT_URL => "http://127.0.0.1:8080/v1/c/contract/{contract_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"wb-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "http://127.0.0.1:8080/v1/c/contract/{contract_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("wb-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("http://127.0.0.1:8080/v1/c/contract/{contract_id}")
.header("wb-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("http://127.0.0.1:8080/v1/c/contract/{contract_id}")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["wb-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"billing_information": {
"current_period": {
"end": "2023-11-07T05:31:56Z",
"start": "2023-11-07T05:31:56Z"
},
"current_period_idx": 123
},
"contract_summary": {
"amount": "<string>",
"billing_information": {
"current_period": {
"end": "2023-11-07T05:31:56Z",
"start": "2023-11-07T05:31:56Z"
},
"current_period_idx": 123
},
"configuration": {
"automatic_payment": true,
"invoice_trigger": "immediate"
},
"cost_estimates": {
"custom_cycle_charges": {
"periodic_daily": {
"cycle_start_charges": "<string>",
"extra_cycle_end_charges": "<string>",
"minimum_usage": "<string>"
},
"periodic_monthly": {
"cycle_start_charges": "<string>",
"extra_cycle_end_charges": "<string>",
"minimum_usage": "<string>"
},
"periodic_quarterly": {
"cycle_start_charges": "<string>",
"extra_cycle_end_charges": "<string>",
"minimum_usage": "<string>"
},
"periodic_weekly": {
"cycle_start_charges": "<string>",
"extra_cycle_end_charges": "<string>",
"minimum_usage": "<string>"
},
"periodic_yearly": {
"cycle_start_charges": "<string>",
"extra_cycle_end_charges": "<string>",
"minimum_usage": "<string>"
}
},
"on_demand_price": {
"cycle_start_charges": "<string>",
"extra_cycle_end_charges": "<string>",
"minimum_usage": "<string>"
},
"one_time_price": {
"cycle_start_charges": "<string>",
"extra_cycle_end_charges": "<string>",
"minimum_usage": "<string>"
},
"recurring_price": {
"cycle_start_charges": "<string>",
"extra_cycle_end_charges": "<string>",
"minimum_usage": "<string>"
}
},
"customer": "<string>",
"customer_id": "Cust_c40bea18-c0c9-44b1-bd0c-43f5283e1670",
"cycle_start_offset": 1,
"free_cycles": 1,
"id": "Cust_c40bea18-c0c9-44b1-bd0c-43f5283e1670",
"plan": "<string>",
"plan_id": "Cust_c40bea18-c0c9-44b1-bd0c-43f5283e1670",
"plan_internal_name": "<string>",
"activation": "2023-11-07T05:31:56Z",
"created": "2023-11-07T05:31:56Z",
"expiration": "2023-11-07T05:31:56Z",
"free_trial_end": "2023-11-07T05:31:56Z",
"next_cycle_start": "2023-11-07T05:31:56Z",
"plan_external_name": "<string>",
"pricing_id": "Cust_c40bea18-c0c9-44b1-bd0c-43f5283e1670"
},
"plan": {
"features": [
{
"id": "Cust_c40bea18-c0c9-44b1-bd0c-43f5283e1670",
"name": "<string>",
"slug": "<string>",
"original_feature_id": "Cust_c40bea18-c0c9-44b1-bd0c-43f5283e1670",
"price": {
"amount": "<string>",
"strategy_details": {
"pricing_strategy": "flat"
},
"free_cycles": 1,
"tax_code": "<string>",
"total_charge_estimate": {
"subtotal": "<string>",
"total": "<string>"
}
}
}
],
"free_trial_days": 1,
"id": "Cust_c40bea18-c0c9-44b1-bd0c-43f5283e1670",
"internal_name": "<string>",
"name": "<string>",
"slug": "<string>",
"description": "<string>",
"external_name": "<string>",
"original_plan_id": "Cust_c40bea18-c0c9-44b1-bd0c-43f5283e1670",
"price": {
"amount": "<string>",
"strategy_details": {
"pricing_strategy": "flat"
},
"free_cycles": 1,
"tax_code": "<string>",
"total_charge_estimate": {
"subtotal": "<string>",
"total": "<string>"
}
}
},
"discount": {
"amount": "<string>",
"contract_id": "Cust_c40bea18-c0c9-44b1-bd0c-43f5283e1670",
"duration": 123,
"id": "Cust_c40bea18-c0c9-44b1-bd0c-43f5283e1670",
"name": "<string>",
"slug": "<string>",
"original_discount_id": "Cust_c40bea18-c0c9-44b1-bd0c-43f5283e1670"
}
}Contract
Retrieve Contract Details
GET
/
v1
/
c
/
contract
/
{contract_id}
Retrieve Contract by contract_id
curl --request GET \
--url http://127.0.0.1:8080/v1/c/contract/{contract_id} \
--header 'wb-key: <api-key>'import requests
url = "http://127.0.0.1:8080/v1/c/contract/{contract_id}"
headers = {"wb-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'wb-key': '<api-key>'}};
fetch('http://127.0.0.1:8080/v1/c/contract/{contract_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8080",
CURLOPT_URL => "http://127.0.0.1:8080/v1/c/contract/{contract_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"wb-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "http://127.0.0.1:8080/v1/c/contract/{contract_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("wb-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("http://127.0.0.1:8080/v1/c/contract/{contract_id}")
.header("wb-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("http://127.0.0.1:8080/v1/c/contract/{contract_id}")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["wb-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"billing_information": {
"current_period": {
"end": "2023-11-07T05:31:56Z",
"start": "2023-11-07T05:31:56Z"
},
"current_period_idx": 123
},
"contract_summary": {
"amount": "<string>",
"billing_information": {
"current_period": {
"end": "2023-11-07T05:31:56Z",
"start": "2023-11-07T05:31:56Z"
},
"current_period_idx": 123
},
"configuration": {
"automatic_payment": true,
"invoice_trigger": "immediate"
},
"cost_estimates": {
"custom_cycle_charges": {
"periodic_daily": {
"cycle_start_charges": "<string>",
"extra_cycle_end_charges": "<string>",
"minimum_usage": "<string>"
},
"periodic_monthly": {
"cycle_start_charges": "<string>",
"extra_cycle_end_charges": "<string>",
"minimum_usage": "<string>"
},
"periodic_quarterly": {
"cycle_start_charges": "<string>",
"extra_cycle_end_charges": "<string>",
"minimum_usage": "<string>"
},
"periodic_weekly": {
"cycle_start_charges": "<string>",
"extra_cycle_end_charges": "<string>",
"minimum_usage": "<string>"
},
"periodic_yearly": {
"cycle_start_charges": "<string>",
"extra_cycle_end_charges": "<string>",
"minimum_usage": "<string>"
}
},
"on_demand_price": {
"cycle_start_charges": "<string>",
"extra_cycle_end_charges": "<string>",
"minimum_usage": "<string>"
},
"one_time_price": {
"cycle_start_charges": "<string>",
"extra_cycle_end_charges": "<string>",
"minimum_usage": "<string>"
},
"recurring_price": {
"cycle_start_charges": "<string>",
"extra_cycle_end_charges": "<string>",
"minimum_usage": "<string>"
}
},
"customer": "<string>",
"customer_id": "Cust_c40bea18-c0c9-44b1-bd0c-43f5283e1670",
"cycle_start_offset": 1,
"free_cycles": 1,
"id": "Cust_c40bea18-c0c9-44b1-bd0c-43f5283e1670",
"plan": "<string>",
"plan_id": "Cust_c40bea18-c0c9-44b1-bd0c-43f5283e1670",
"plan_internal_name": "<string>",
"activation": "2023-11-07T05:31:56Z",
"created": "2023-11-07T05:31:56Z",
"expiration": "2023-11-07T05:31:56Z",
"free_trial_end": "2023-11-07T05:31:56Z",
"next_cycle_start": "2023-11-07T05:31:56Z",
"plan_external_name": "<string>",
"pricing_id": "Cust_c40bea18-c0c9-44b1-bd0c-43f5283e1670"
},
"plan": {
"features": [
{
"id": "Cust_c40bea18-c0c9-44b1-bd0c-43f5283e1670",
"name": "<string>",
"slug": "<string>",
"original_feature_id": "Cust_c40bea18-c0c9-44b1-bd0c-43f5283e1670",
"price": {
"amount": "<string>",
"strategy_details": {
"pricing_strategy": "flat"
},
"free_cycles": 1,
"tax_code": "<string>",
"total_charge_estimate": {
"subtotal": "<string>",
"total": "<string>"
}
}
}
],
"free_trial_days": 1,
"id": "Cust_c40bea18-c0c9-44b1-bd0c-43f5283e1670",
"internal_name": "<string>",
"name": "<string>",
"slug": "<string>",
"description": "<string>",
"external_name": "<string>",
"original_plan_id": "Cust_c40bea18-c0c9-44b1-bd0c-43f5283e1670",
"price": {
"amount": "<string>",
"strategy_details": {
"pricing_strategy": "flat"
},
"free_cycles": 1,
"tax_code": "<string>",
"total_charge_estimate": {
"subtotal": "<string>",
"total": "<string>"
}
}
},
"discount": {
"amount": "<string>",
"contract_id": "Cust_c40bea18-c0c9-44b1-bd0c-43f5283e1670",
"duration": 123,
"id": "Cust_c40bea18-c0c9-44b1-bd0c-43f5283e1670",
"name": "<string>",
"slug": "<string>",
"original_discount_id": "Cust_c40bea18-c0c9-44b1-bd0c-43f5283e1670"
}
}Authorizations
api-keywb_user_cookie
Path Parameters
Id of the Contract
Response
200 - application/json
Contract Details
Contract with additional information
Detailed information about the current billing period
Show child attributes
Show child attributes
Contract Summary
Show child attributes
Show child attributes
Same as Plan, but attached to a Contract
Show child attributes
Show child attributes
Discount attached to a Contract
Show child attributes
Show child attributes
⌘I