License Keys
Get License Key
Get a license key.
Scopes: customer_portal:read customer_portal:write
GET
/
v1
/
customer-portal
/
license-keys
/
{id}
Go (SDK)
package main
import(
"context"
macropaygo "github.com/web3group/macropay-go-main"
"os"
"github.com/web3group/macropay-go-main/models/operations"
"log"
)
func main() {
ctx := context.Background()
s := macropaygo.New()
res, err := s.CustomerPortal.LicenseKeys.Get(ctx, operations.CustomerPortalLicenseKeysGetSecurity{
CustomerSession: os.Getenv("MACROPAY_CUSTOMER_SESSION"),
}, "<value>")
if err != nil {
log.Fatal(err)
}
if res.LicenseKeyWithActivations != nil {
// handle response
}
}import macropay_sdk
from macropay_sdk import Macropay
with Macropay() as macropay:
res = macropay.customer_portal.license_keys.get(security=macropay_sdk.CustomerPortalLicenseKeysGetSecurity(
customer_session="<YOUR_BEARER_TOKEN_HERE>",
), id="<value>")
# Handle response
print(res)import { Macropay } from "@macropayments/sdk";
const macropay = new Macropay();
async function run() {
const result = await macropay.customerPortal.licenseKeys.get({
customerSession: process.env["MACROPAY_CUSTOMER_SESSION"] ?? "",
}, {
id: "<value>",
});
console.log(result);
}
run();declare(strict_types=1);
require 'vendor/autoload.php';
use Macropay;
use Macropay\Models\Operations;
$sdk = Macropay\Macropay::builder()->build();
$requestSecurity = new Operations\CustomerPortalLicenseKeysGetSecurity(
customerSession: '<YOUR_BEARER_TOKEN_HERE>',
);
$response = $sdk->customerPortal->licenseKeys->get(
security: $requestSecurity,
id: '<value>'
);
if ($response->licenseKeyWithActivations !== null) {
// handle response
}curl --request GET \
--url https://api.macropay.ai/v1/customer-portal/license-keys/{id} \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.macropay.ai/v1/customer-portal/license-keys/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));HttpResponse<String> response = Unirest.get("https://api.macropay.ai/v1/customer-portal/license-keys/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.macropay.ai/v1/customer-portal/license-keys/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"modified_at": "2023-11-07T05:31:56Z",
"organization_id": "<string>",
"customer_id": "<string>",
"customer": {
"id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"modified_at": "2023-11-07T05:31:56Z",
"metadata": {},
"external_id": "usr_1337",
"email": "<string>",
"email_verified": true,
"name": "John Doe",
"billing_address": {
"line1": "<string>",
"line2": "<string>",
"postal_code": "<string>",
"city": "<string>",
"state": "<string>"
},
"tax_id": {
"[0]": "<string>"
},
"organization_id": "<string>",
"deleted_at": "2023-11-07T05:31:56Z",
"avatar_url": "<string>",
"type": "individual"
},
"benefit_id": "<string>",
"key": "<string>",
"display_key": "<string>",
"limit_activations": 123,
"usage": 123,
"limit_usage": 123,
"validations": 123,
"last_validated_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z",
"activations": [
{
"id": "<string>",
"license_key_id": "<string>",
"label": "<string>",
"meta": {},
"created_at": "2023-11-07T05:31:56Z",
"modified_at": "2023-11-07T05:31:56Z"
}
]
}{
"error": "<string>",
"detail": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
customer_sessionmember_session
Customer session tokens are specific tokens that are used to authenticate customers on your organization. You can create those sessions programmatically using the Create Customer Session endpoint.
Path Parameters
Response
Successful Response
The ID of the object.
Creation timestamp of the object.
Last modification timestamp of the object.
Show child attributes
Show child attributes
The benefit ID.
Available options:
granted, revoked, disabled Show child attributes
Show child attributes
⌘I
Go (SDK)
package main
import(
"context"
macropaygo "github.com/web3group/macropay-go-main"
"os"
"github.com/web3group/macropay-go-main/models/operations"
"log"
)
func main() {
ctx := context.Background()
s := macropaygo.New()
res, err := s.CustomerPortal.LicenseKeys.Get(ctx, operations.CustomerPortalLicenseKeysGetSecurity{
CustomerSession: os.Getenv("MACROPAY_CUSTOMER_SESSION"),
}, "<value>")
if err != nil {
log.Fatal(err)
}
if res.LicenseKeyWithActivations != nil {
// handle response
}
}import macropay_sdk
from macropay_sdk import Macropay
with Macropay() as macropay:
res = macropay.customer_portal.license_keys.get(security=macropay_sdk.CustomerPortalLicenseKeysGetSecurity(
customer_session="<YOUR_BEARER_TOKEN_HERE>",
), id="<value>")
# Handle response
print(res)import { Macropay } from "@macropayments/sdk";
const macropay = new Macropay();
async function run() {
const result = await macropay.customerPortal.licenseKeys.get({
customerSession: process.env["MACROPAY_CUSTOMER_SESSION"] ?? "",
}, {
id: "<value>",
});
console.log(result);
}
run();declare(strict_types=1);
require 'vendor/autoload.php';
use Macropay;
use Macropay\Models\Operations;
$sdk = Macropay\Macropay::builder()->build();
$requestSecurity = new Operations\CustomerPortalLicenseKeysGetSecurity(
customerSession: '<YOUR_BEARER_TOKEN_HERE>',
);
$response = $sdk->customerPortal->licenseKeys->get(
security: $requestSecurity,
id: '<value>'
);
if ($response->licenseKeyWithActivations !== null) {
// handle response
}curl --request GET \
--url https://api.macropay.ai/v1/customer-portal/license-keys/{id} \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.macropay.ai/v1/customer-portal/license-keys/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));HttpResponse<String> response = Unirest.get("https://api.macropay.ai/v1/customer-portal/license-keys/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.macropay.ai/v1/customer-portal/license-keys/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"modified_at": "2023-11-07T05:31:56Z",
"organization_id": "<string>",
"customer_id": "<string>",
"customer": {
"id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"modified_at": "2023-11-07T05:31:56Z",
"metadata": {},
"external_id": "usr_1337",
"email": "<string>",
"email_verified": true,
"name": "John Doe",
"billing_address": {
"line1": "<string>",
"line2": "<string>",
"postal_code": "<string>",
"city": "<string>",
"state": "<string>"
},
"tax_id": {
"[0]": "<string>"
},
"organization_id": "<string>",
"deleted_at": "2023-11-07T05:31:56Z",
"avatar_url": "<string>",
"type": "individual"
},
"benefit_id": "<string>",
"key": "<string>",
"display_key": "<string>",
"limit_activations": 123,
"usage": 123,
"limit_usage": 123,
"validations": 123,
"last_validated_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z",
"activations": [
{
"id": "<string>",
"license_key_id": "<string>",
"label": "<string>",
"meta": {},
"created_at": "2023-11-07T05:31:56Z",
"modified_at": "2023-11-07T05:31:56Z"
}
]
}{
"error": "<string>",
"detail": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}