All URIs are relative to https://api.getlago.com/api/v1, except if the operation defines another base path.
Method | HTTP request | Description |
---|---|---|
createCustomer() | POST /customers | Create a customer |
deleteAppliedCoupon() | DELETE /customers/{customer_external_id}/applied_coupons/{applied_coupon_id} | Delete customer's appplied coupon |
destroyCustomer() | DELETE /customers/{external_id} | Delete a customer |
findAllCustomers() | GET /customers | Find customers |
findCustomer() | GET /customers/{external_id} | Find customer by external ID |
findCustomerCurrentUsage() | GET /customers/{customer_external_id}/current_usage | Find customer current usage |
getCustomerPortalUrl() | GET /customers/{customer_external_id}/portal_url | Get customer portal URL |
createCustomer($customer_input): \OpenAPI\Client\Model\Customer
Create a customer
Create a new customer
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure Bearer authorization: bearerAuth
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new OpenAPI\Client\Api\CustomersApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$customer_input = new \OpenAPI\Client\Model\CustomerInput(); // \OpenAPI\Client\Model\CustomerInput | Customer payload
try {
$result = $apiInstance->createCustomer($customer_input);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling CustomersApi->createCustomer: ', $e->getMessage(), PHP_EOL;
}
Name | Type | Description | Notes |
---|---|---|---|
customer_input | \OpenAPI\Client\Model\CustomerInput | Customer payload |
\OpenAPI\Client\Model\Customer
- Content-Type:
application/json
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
deleteAppliedCoupon($customer_external_id, $applied_coupon_id): \OpenAPI\Client\Model\AppliedCoupon
Delete customer's appplied coupon
Delete customer's appplied coupon
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure Bearer authorization: bearerAuth
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new OpenAPI\Client\Api\CustomersApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$customer_external_id = 12345; // string | External ID of the existing customer
$applied_coupon_id = 54321; // string | Applied Coupon Lago ID
try {
$result = $apiInstance->deleteAppliedCoupon($customer_external_id, $applied_coupon_id);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling CustomersApi->deleteAppliedCoupon: ', $e->getMessage(), PHP_EOL;
}
Name | Type | Description | Notes |
---|---|---|---|
customer_external_id | string | External ID of the existing customer | |
applied_coupon_id | string | Applied Coupon Lago ID |
\OpenAPI\Client\Model\AppliedCoupon
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
destroyCustomer($external_id): \OpenAPI\Client\Model\Customer
Delete a customer
Return the deleted customer
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure Bearer authorization: bearerAuth
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new OpenAPI\Client\Api\CustomersApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$external_id = 12345; // string | External ID of the existing customer
try {
$result = $apiInstance->destroyCustomer($external_id);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling CustomersApi->destroyCustomer: ', $e->getMessage(), PHP_EOL;
}
Name | Type | Description | Notes |
---|---|---|---|
external_id | string | External ID of the existing customer |
\OpenAPI\Client\Model\Customer
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
findAllCustomers($page, $per_page): \OpenAPI\Client\Model\CustomersPaginated
Find customers
Find all customers in certain organisation
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure Bearer authorization: bearerAuth
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new OpenAPI\Client\Api\CustomersApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$page = 2; // int | Number of page
$per_page = 20; // int | Number of records per page
try {
$result = $apiInstance->findAllCustomers($page, $per_page);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling CustomersApi->findAllCustomers: ', $e->getMessage(), PHP_EOL;
}
Name | Type | Description | Notes |
---|---|---|---|
page | int | Number of page | [optional] |
per_page | int | Number of records per page | [optional] |
\OpenAPI\Client\Model\CustomersPaginated
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
findCustomer($external_id): \OpenAPI\Client\Model\Customer
Find customer by external ID
Return a single customer
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure Bearer authorization: bearerAuth
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new OpenAPI\Client\Api\CustomersApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$external_id = 12345; // string | External ID of the existing customer
try {
$result = $apiInstance->findCustomer($external_id);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling CustomersApi->findCustomer: ', $e->getMessage(), PHP_EOL;
}
Name | Type | Description | Notes |
---|---|---|---|
external_id | string | External ID of the existing customer |
\OpenAPI\Client\Model\Customer
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
findCustomerCurrentUsage($customer_external_id, $external_subscription_id): \OpenAPI\Client\Model\CustomerUsage
Find customer current usage
Return a customer current usage
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure Bearer authorization: bearerAuth
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new OpenAPI\Client\Api\CustomersApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$customer_external_id = 12345; // string | External ID of the existing customer
$external_subscription_id = 54321; // string | External subscription ID
try {
$result = $apiInstance->findCustomerCurrentUsage($customer_external_id, $external_subscription_id);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling CustomersApi->findCustomerCurrentUsage: ', $e->getMessage(), PHP_EOL;
}
Name | Type | Description | Notes |
---|---|---|---|
customer_external_id | string | External ID of the existing customer | |
external_subscription_id | string | External subscription ID |
\OpenAPI\Client\Model\CustomerUsage
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
getCustomerPortalUrl($customer_external_id): \OpenAPI\Client\Model\GetCustomerPortalUrl200Response
Get customer portal URL
Get customer portal URL
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure Bearer authorization: bearerAuth
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new OpenAPI\Client\Api\CustomersApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$customer_external_id = 12345; // string | External ID of the existing customer
try {
$result = $apiInstance->getCustomerPortalUrl($customer_external_id);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling CustomersApi->getCustomerPortalUrl: ', $e->getMessage(), PHP_EOL;
}
Name | Type | Description | Notes |
---|---|---|---|
customer_external_id | string | External ID of the existing customer |
\OpenAPI\Client\Model\GetCustomerPortalUrl200Response
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]