import macropay_sdk
from macropay_sdk import Macropay
with Macropay() as macropay:
res = macropay.customer_portal.customers.get(security=macropay_sdk.CustomerPortalCustomersGetSecurity(
customer_session="<YOUR_BEARER_TOKEN_HERE>",
))
# Handle response
print(res)
import { Macropay } from "@macropayai/sdk";
const macropay = new Macropay();
async function run() {
const result = await macropay.customerPortal.customers.get({
customerSession: process.env["MACROPAY_CUSTOMER_SESSION"] ?? "",
});
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\CustomerPortalCustomersGetSecurity(
customerSession: '<YOUR_BEARER_TOKEN_HERE>',
);
$response = $sdk->customerPortal->customers->get(
security: $requestSecurity
);
if ($response->customerPortalCustomer !== null) {
// handle response
}
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.
import macropay_sdk
from macropay_sdk import Macropay
with Macropay() as macropay:
res = macropay.customer_portal.customers.get(security=macropay_sdk.CustomerPortalCustomersGetSecurity(
customer_session="<YOUR_BEARER_TOKEN_HERE>",
))
# Handle response
print(res)
import { Macropay } from "@macropayai/sdk";
const macropay = new Macropay();
async function run() {
const result = await macropay.customerPortal.customers.get({
customerSession: process.env["MACROPAY_CUSTOMER_SESSION"] ?? "",
});
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\CustomerPortalCustomersGetSecurity(
customerSession: '<YOUR_BEARER_TOKEN_HERE>',
);
$response = $sdk->customerPortal->customers->get(
security: $requestSecurity
);
if ($response->customerPortalCustomer !== null) {
// handle response
}