All URIs are relative to https://api.getlago.com/api/v1, except if the operation defines another base path.
Method | HTTP request | Description |
---|---|---|
applyCoupon() | POST /applied_coupons | Apply a coupon to a customer |
createCoupon() | POST /coupons | Create a new coupon |
destroyCoupon() | DELETE /coupons/{code} | Delete a coupon |
findAllAppliedCoupons() | GET /applied_coupons | Find Applied Coupons |
findAllCoupons() | GET /coupons | Find Coupons |
findCoupon() | GET /coupons/{code} | Find coupon by code |
updateCoupon() | PUT /coupons/{code} | Update an existing coupon |
applyCoupon($applied_coupon_input): \OpenAPI\Client\Model\AppliedCoupon
Apply a coupon to a customer
Apply a coupon to a 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\CouponsApi(
// 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
);
$applied_coupon_input = new \OpenAPI\Client\Model\AppliedCouponInput(); // \OpenAPI\Client\Model\AppliedCouponInput | Apply coupon payload
try {
$result = $apiInstance->applyCoupon($applied_coupon_input);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling CouponsApi->applyCoupon: ', $e->getMessage(), PHP_EOL;
}
Name | Type | Description | Notes |
---|---|---|---|
applied_coupon_input | \OpenAPI\Client\Model\AppliedCouponInput | Apply coupon payload |
\OpenAPI\Client\Model\AppliedCoupon
- Content-Type:
application/json
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
createCoupon($coupon_input): \OpenAPI\Client\Model\Coupon
Create a new coupon
Create a new 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\CouponsApi(
// 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
);
$coupon_input = new \OpenAPI\Client\Model\CouponInput(); // \OpenAPI\Client\Model\CouponInput | Coupon payload
try {
$result = $apiInstance->createCoupon($coupon_input);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling CouponsApi->createCoupon: ', $e->getMessage(), PHP_EOL;
}
Name | Type | Description | Notes |
---|---|---|---|
coupon_input | \OpenAPI\Client\Model\CouponInput | Coupon payload |
- Content-Type:
application/json
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
destroyCoupon($code): \OpenAPI\Client\Model\Coupon
Delete a coupon
Delete a 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\CouponsApi(
// 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
);
$code = example_code; // string | Code of the existing coupon
try {
$result = $apiInstance->destroyCoupon($code);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling CouponsApi->destroyCoupon: ', $e->getMessage(), PHP_EOL;
}
Name | Type | Description | Notes |
---|---|---|---|
code | string | Code of the existing coupon |
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
findAllAppliedCoupons($page, $per_page, $status, $external_customer_id): \OpenAPI\Client\Model\AppliedCouponsPaginated
Find Applied Coupons
Find all applied coupons
<?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\CouponsApi(
// 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
$status = 'status_example'; // string | Applied coupon status
$external_customer_id = 12345; // string | External customer ID
try {
$result = $apiInstance->findAllAppliedCoupons($page, $per_page, $status, $external_customer_id);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling CouponsApi->findAllAppliedCoupons: ', $e->getMessage(), PHP_EOL;
}
Name | Type | Description | Notes |
---|---|---|---|
page | int | Number of page | [optional] |
per_page | int | Number of records per page | [optional] |
status | string | Applied coupon status | [optional] |
external_customer_id | string | External customer ID | [optional] |
\OpenAPI\Client\Model\AppliedCouponsPaginated
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
findAllCoupons($page, $per_page): \OpenAPI\Client\Model\CouponsPaginated
Find Coupons
Find all coupons 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\CouponsApi(
// 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->findAllCoupons($page, $per_page);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling CouponsApi->findAllCoupons: ', $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\CouponsPaginated
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
findCoupon($code): \OpenAPI\Client\Model\Coupon
Find coupon by code
Return a single 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\CouponsApi(
// 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
);
$code = example_code; // string | Code of the existing coupon
try {
$result = $apiInstance->findCoupon($code);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling CouponsApi->findCoupon: ', $e->getMessage(), PHP_EOL;
}
Name | Type | Description | Notes |
---|---|---|---|
code | string | Code of the existing coupon |
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
updateCoupon($code, $coupon_input): \OpenAPI\Client\Model\Coupon
Update an existing coupon
Update an existing coupon by code
<?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\CouponsApi(
// 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
);
$code = example_code; // string | Code of the existing coupon
$coupon_input = new \OpenAPI\Client\Model\CouponInput(); // \OpenAPI\Client\Model\CouponInput | Update an existing coupon
try {
$result = $apiInstance->updateCoupon($code, $coupon_input);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling CouponsApi->updateCoupon: ', $e->getMessage(), PHP_EOL;
}
Name | Type | Description | Notes |
---|---|---|---|
code | string | Code of the existing coupon | |
coupon_input | \OpenAPI\Client\Model\CouponInput | Update an existing coupon |
- Content-Type:
application/json
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]