All URIs are relative to https://api.reepay.com
Method | HTTP request | Description |
---|---|---|
createCoupon | POST /v1/coupon | Create coupon |
deleteCoupon | DELETE /v1/coupon/{handle} | Delete coupon |
expireCoupon | POST /v1/coupon/{handle}/expire | Expire coupon |
getCoupon | GET /v1/coupon/{handle} | Get coupon |
getCoupons | GET /v1/coupon | Get list of coupons |
updateCoupon | PUT /v1/coupon/{handle} | Update coupon |
validateCode | GET /v1/coupon/code/validate | Validate coupon |
\Reepay\Model\Coupon createCoupon($body)
Create coupon
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: apiKey
Reepay\Configuration::getDefaultConfiguration()->setApiKey('X-Auth-Token', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Reepay\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Auth-Token', 'Bearer');
// Configure HTTP basic authorization: basicAuth
Reepay\Configuration::getDefaultConfiguration()->setUsername('YOUR_USERNAME');
Reepay\Configuration::getDefaultConfiguration()->setPassword('YOUR_PASSWORD');
$apiInstance = new Reepay\Api\CouponApi();
$body = new \Reepay\Model\CreateCoupon(); // \Reepay\Model\CreateCoupon |
try {
$result = $apiInstance->createCoupon($body);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling CouponApi->createCoupon: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
body | \Reepay\Model\CreateCoupon | [optional] |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
\Reepay\Model\Coupon deleteCoupon($handle)
Delete coupon
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: apiKey
Reepay\Configuration::getDefaultConfiguration()->setApiKey('X-Auth-Token', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Reepay\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Auth-Token', 'Bearer');
// Configure HTTP basic authorization: basicAuth
Reepay\Configuration::getDefaultConfiguration()->setUsername('YOUR_USERNAME');
Reepay\Configuration::getDefaultConfiguration()->setPassword('YOUR_PASSWORD');
$apiInstance = new Reepay\Api\CouponApi();
$handle = "handle_example"; // string | Coupon handle
try {
$result = $apiInstance->deleteCoupon($handle);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling CouponApi->deleteCoupon: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
handle | string | Coupon handle |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
\Reepay\Model\Coupon expireCoupon($handle)
Expire coupon
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: apiKey
Reepay\Configuration::getDefaultConfiguration()->setApiKey('X-Auth-Token', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Reepay\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Auth-Token', 'Bearer');
// Configure HTTP basic authorization: basicAuth
Reepay\Configuration::getDefaultConfiguration()->setUsername('YOUR_USERNAME');
Reepay\Configuration::getDefaultConfiguration()->setPassword('YOUR_PASSWORD');
$apiInstance = new Reepay\Api\CouponApi();
$handle = "handle_example"; // string | Coupon handle
try {
$result = $apiInstance->expireCoupon($handle);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling CouponApi->expireCoupon: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
handle | string | Coupon handle |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
\Reepay\Model\Coupon getCoupon($handle)
Get coupon
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: apiKey
Reepay\Configuration::getDefaultConfiguration()->setApiKey('X-Auth-Token', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Reepay\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Auth-Token', 'Bearer');
// Configure HTTP basic authorization: basicAuth
Reepay\Configuration::getDefaultConfiguration()->setUsername('YOUR_USERNAME');
Reepay\Configuration::getDefaultConfiguration()->setPassword('YOUR_PASSWORD');
$apiInstance = new Reepay\Api\CouponApi();
$handle = "handle_example"; // string | Coupon handle
try {
$result = $apiInstance->getCoupon($handle);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling CouponApi->getCoupon: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
handle | string | Coupon handle |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
\Reepay\Model\CouponSearch getCoupons($page, $size, $search, $sort)
Get list of coupons
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: apiKey
Reepay\Configuration::getDefaultConfiguration()->setApiKey('X-Auth-Token', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Reepay\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Auth-Token', 'Bearer');
// Configure HTTP basic authorization: basicAuth
Reepay\Configuration::getDefaultConfiguration()->setUsername('YOUR_USERNAME');
Reepay\Configuration::getDefaultConfiguration()->setPassword('YOUR_PASSWORD');
$apiInstance = new Reepay\Api\CouponApi();
$page = 1; // int | Page number to get
$size = 20; // int | Page size to use
$search = "search_example"; // string | Optional search expression
$sort = "sort_example"; // string | Optional sorting expression
try {
$result = $apiInstance->getCoupons($page, $size, $search, $sort);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling CouponApi->getCoupons: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
page | int | Page number to get | [default to 1] |
size | int | Page size to use | [default to 20] |
search | string | Optional search expression | |
sort | string | Optional sorting expression |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
\Reepay\Model\Coupon updateCoupon($handle, $body)
Update coupon
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: apiKey
Reepay\Configuration::getDefaultConfiguration()->setApiKey('X-Auth-Token', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Reepay\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Auth-Token', 'Bearer');
// Configure HTTP basic authorization: basicAuth
Reepay\Configuration::getDefaultConfiguration()->setUsername('YOUR_USERNAME');
Reepay\Configuration::getDefaultConfiguration()->setPassword('YOUR_PASSWORD');
$apiInstance = new Reepay\Api\CouponApi();
$handle = "handle_example"; // string | Coupon handle
$body = new \Reepay\Model\UpdateCoupon(); // \Reepay\Model\UpdateCoupon |
try {
$result = $apiInstance->updateCoupon($handle, $body);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling CouponApi->updateCoupon: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
handle | string | Coupon handle | |
body | \Reepay\Model\UpdateCoupon | [optional] |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
\Reepay\Model\Coupon validateCode($code, $plan, $customer)
Validate coupon
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: apiKey
Reepay\Configuration::getDefaultConfiguration()->setApiKey('X-Auth-Token', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Reepay\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Auth-Token', 'Bearer');
// Configure HTTP basic authorization: basicAuth
Reepay\Configuration::getDefaultConfiguration()->setUsername('YOUR_USERNAME');
Reepay\Configuration::getDefaultConfiguration()->setPassword('YOUR_PASSWORD');
$apiInstance = new Reepay\Api\CouponApi();
$code = "code_example"; // string | Coupon code
$plan = "plan_example"; // string | Optional plan to validate against
$customer = "customer_example"; // string | Optional customer to validate against
try {
$result = $apiInstance->validateCode($code, $plan, $customer);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling CouponApi->validateCode: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
code | string | Coupon code | |
plan | string | Optional plan to validate against | [optional] |
customer | string | Optional customer to validate against | [optional] |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]