diller-loyalty / php-sdk
Diller API 的 PHP SDK
v0.1.27
2024-08-13 19:40 UTC
Requires
- php: >=8.0
- ext-curl: *
- ext-json: *
- ext-mbstring: *
- guzzlehttp/guzzle: >=7.5.0
Requires (Dev)
- fakerphp/faker: v1.21.0
- phpunit/phpunit: ^9.6.3
- squizlabs/php_codesniffer: ~2.6
- vlucas/phpdotenv: v5.5.0
README
官方 Diller 零售商 API(beta 版本)
最后更新时间:2024-08-12T18:08:52
此 PHP 包由 Swagger Codegen 项目自动生成
- API 版本:v2.0
- 构建包:io.swagger.codegen.v3.generators.php.PhpClientCodegen
需求
PHP 8.1 及以上,Guzzle 7.5 及以上
安装与使用
Composer
要通过 Composer 安装绑定,请将以下内容添加到 composer.json
{
"require": {
"diller-loyalty/php-sdk": "*@dev"
}
}
然后运行 composer install
手动安装
下载文件并包含 autoload.php
require_once('/path/to/DillerAPI/vendor/autoload.php');
测试
要运行单元测试
composer install
./vendor/bin/phpunit
入门
请按照 安装过程 进行,然后运行以下命令
<?php require_once(__DIR__ . '/vendor/autoload.php'); // Configure OAuth2 access token for authorization: OAuth2 $config = DillerAPI\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); $apiInstance = new DillerAPI\Api{{classname}}( // 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 ); $storeId = "storeId_example"; // string | $memberId = "memberId_example"; // string | $couponCode = "couponCode_example"; // string | $body = new \DillerAPI\Model\CouponCancelReservationRequest(); // \DillerAPI\Model\CouponCancelReservationRequest | try { $result = $apiInstance->cancelCouponReservation($storeId, $memberId, $couponCode, $body); print_r($result); } catch (Exception $e) { echo 'Exception when calling CouponsApi->cancelCouponReservation: ', $e->getMessage(), PHP_EOL; } // Configure OAuth2 access token for authorization: OAuth2 $config = DillerAPI\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); $apiInstance = new DillerAPI\Api{{classname}}( // 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 ); $storeId = "storeId_example"; // string | $memberId = "memberId_example"; // string | try { $result = $apiInstance->getMemberCoupons($storeId, $memberId); print_r($result); } catch (Exception $e) { echo 'Exception when calling CouponsApi->getMemberCoupons: ', $e->getMessage(), PHP_EOL; } // Configure OAuth2 access token for authorization: OAuth2 $config = DillerAPI\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); $apiInstance = new DillerAPI\Api{{classname}}( // 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 ); $storeId = "storeId_example"; // string | The store Id $alsoInactive = true; // bool | When true, it also return coupons that are not currently valid. try { $result = $apiInstance->getStoreCoupons($storeId, $alsoInactive); print_r($result); } catch (Exception $e) { echo 'Exception when calling CouponsApi->getStoreCoupons: ', $e->getMessage(), PHP_EOL; } // Configure OAuth2 access token for authorization: OAuth2 $config = DillerAPI\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); $apiInstance = new DillerAPI\Api{{classname}}( // 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 ); $storeId = "storeId_example"; // string | The storeId $memberId = "memberId_example"; // string | The memberId $couponCode = "couponCode_example"; // string | The coupon code $body = new \DillerAPI\Model\CouponReservationRequest(); // \DillerAPI\Model\CouponReservationRequest | Details of the coupon reservation request try { $result = $apiInstance->reserveCoupon($storeId, $memberId, $couponCode, $body); print_r($result); } catch (Exception $e) { echo 'Exception when calling CouponsApi->reserveCoupon: ', $e->getMessage(), PHP_EOL; } // Configure OAuth2 access token for authorization: OAuth2 $config = DillerAPI\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); $apiInstance = new DillerAPI\Api{{classname}}( // 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 ); $storeId = "storeId_example"; // string | The store id $memberId = "memberId_example"; // string | The member id $couponCode = "couponCode_example"; // string | The coupon code try { $result = $apiInstance->validateCoupon($storeId, $memberId, $couponCode); print_r($result); } catch (Exception $e) { echo 'Exception when calling CouponsApi->validateCoupon: ', $e->getMessage(), PHP_EOL; } // Configure OAuth2 access token for authorization: OAuth2 $config = DillerAPI\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); $apiInstance = new DillerAPI\Api{{classname}}( // 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 ); $storeId = "storeId_example"; // string | The store Id $memberId = "memberId_example"; // string | The member Id try { $result = $apiInstance->getInvitedFriends($storeId, $memberId); print_r($result); } catch (Exception $e) { echo 'Exception when calling InvitationsApi->getInvitedFriends: ', $e->getMessage(), PHP_EOL; } // Configure OAuth2 access token for authorization: OAuth2 $config = DillerAPI\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); $apiInstance = new DillerAPI\Api{{classname}}( // 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 ); $storeId = "storeId_example"; // string | The store Id $memberId = "memberId_example"; // string | The member Id $invitationToken = "invitationToken_example"; // string | The invitation token try { $result = $apiInstance->getReferrals($storeId, $memberId, $invitationToken); print_r($result); } catch (Exception $e) { echo 'Exception when calling InvitationsApi->getReferrals: ', $e->getMessage(), PHP_EOL; } // Configure OAuth2 access token for authorization: OAuth2 $config = DillerAPI\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); $apiInstance = new DillerAPI\Api{{classname}}( // 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 ); $storeId = "storeId_example"; // string | The store id $memberId = "memberId_example"; // string | The member id try { $result = $apiInstance->deleteMember($storeId, $memberId); print_r($result); } catch (Exception $e) { echo 'Exception when calling MembersApi->deleteMember: ', $e->getMessage(), PHP_EOL; } // Configure OAuth2 access token for authorization: OAuth2 $config = DillerAPI\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); $apiInstance = new DillerAPI\Api{{classname}}( // 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 ); $storeId = "storeId_example"; // string | $body = new \DillerAPI\Model\EnrollMemberRequest(); // \DillerAPI\Model\EnrollMemberRequest | try { $result = $apiInstance->enrollMember($storeId, $body); print_r($result); } catch (Exception $e) { echo 'Exception when calling MembersApi->enrollMember: ', $e->getMessage(), PHP_EOL; } // Configure OAuth2 access token for authorization: OAuth2 $config = DillerAPI\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); $apiInstance = new DillerAPI\Api{{classname}}( // 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 ); $storeId = "storeId_example"; // string | The Store id $memberId = "memberId_example"; // string | The member id try { $result = $apiInstance->getDependents($storeId, $memberId); print_r($result); } catch (Exception $e) { echo 'Exception when calling MembersApi->getDependents: ', $e->getMessage(), PHP_EOL; } // Configure OAuth2 access token for authorization: OAuth2 $config = DillerAPI\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); $apiInstance = new DillerAPI\Api{{classname}}( // 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 ); $storeId = "storeId_example"; // string | The member's store id $email = "email_example"; // string | Email Address of the member $phone = "phone_example"; // string | The phone number can be entered in international format, starting with either \"00\" or \"+\". If the phone number is entered in national format, it will be assumed that the number belongs to the same country as the store $identifierValue = "identifierValue_example"; // string | The extra identifier of a member defined at the store level. $activationToken = "activationToken_example"; // string | The token value for when a member signed up via POS or any other source, that requires an activation step. try { $result = $apiInstance->getMemberByFilter($storeId, $email, $phone, $identifierValue, $activationToken); print_r($result); } catch (Exception $e) { echo 'Exception when calling MembersApi->getMemberByFilter: ', $e->getMessage(), PHP_EOL; } // Configure OAuth2 access token for authorization: OAuth2 $config = DillerAPI\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); $apiInstance = new DillerAPI\Api{{classname}}( // 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 ); $storeId = "storeId_example"; // string | The id of the store $memberId = "memberId_example"; // string | The member Id try { $result = $apiInstance->getMemberById($storeId, $memberId); print_r($result); } catch (Exception $e) { echo 'Exception when calling MembersApi->getMemberById: ', $e->getMessage(), PHP_EOL; } // Configure OAuth2 access token for authorization: OAuth2 $config = DillerAPI\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); $apiInstance = new DillerAPI\Api{{classname}}( // 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 ); $storeId = "storeId_example"; // string | $memberId = "memberId_example"; // string | The id of the member try { $result = $apiInstance->getWidgetProfile($storeId, $memberId); print_r($result); } catch (Exception $e) { echo 'Exception when calling MembersApi->getWidgetProfile: ', $e->getMessage(), PHP_EOL; } // Configure OAuth2 access token for authorization: OAuth2 $config = DillerAPI\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); $apiInstance = new DillerAPI\Api{{classname}}( // 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 ); $storeId = "storeId_example"; // string | The store Id $memberId = "memberId_example"; // string | The member Id try { $result = $apiInstance->loginOTP($storeId, $memberId); print_r($result); } catch (Exception $e) { echo 'Exception when calling MembersApi->loginOTP: ', $e->getMessage(), PHP_EOL; } // Configure OAuth2 access token for authorization: OAuth2 $config = DillerAPI\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); $apiInstance = new DillerAPI\Api{{classname}}( // 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 ); $storeId = "storeId_example"; // string | The store Id $memberId = "memberId_example"; // string | The member Id $body = new \DillerAPI\Model\LoginOtpVerificationRequest(); // \DillerAPI\Model\LoginOtpVerificationRequest | Otp code generated previously using the endpoint /login-otp try { $result = $apiInstance->loginOtpVerification($storeId, $memberId, $body); print_r($result); } catch (Exception $e) { echo 'Exception when calling MembersApi->loginOtpVerification: ', $e->getMessage(), PHP_EOL; } // Configure OAuth2 access token for authorization: OAuth2 $config = DillerAPI\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); $apiInstance = new DillerAPI\Api{{classname}}( // 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 ); $storeId = "storeId_example"; // string | The store id $body = new \DillerAPI\Model\RegisterMemberRequest(); // \DillerAPI\Model\RegisterMemberRequest | try { $result = $apiInstance->registerMember($storeId, $body); print_r($result); } catch (Exception $e) { echo 'Exception when calling MembersApi->registerMember: ', $e->getMessage(), PHP_EOL; } // Configure OAuth2 access token for authorization: OAuth2 $config = DillerAPI\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); $apiInstance = new DillerAPI\Api{{classname}}( // 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 ); $storeId = "storeId_example"; // string | The store Id $memberId = "memberId_example"; // string | The member Id $body = new \DillerAPI\Model\Phone(); // \DillerAPI\Model\Phone | The new phone number using the international format try { $result = $apiInstance->resetPhone($storeId, $memberId, $body); print_r($result); } catch (Exception $e) { echo 'Exception when calling MembersApi->resetPhone: ', $e->getMessage(), PHP_EOL; } // Configure OAuth2 access token for authorization: OAuth2 $config = DillerAPI\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); $apiInstance = new DillerAPI\Api{{classname}}( // 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 ); $storeId = "storeId_example"; // string | The store Id $memberId = "memberId_example"; // string | The member Id $body = new \DillerAPI\Model\ResetPhoneVerificationRequest(); // \DillerAPI\Model\ResetPhoneVerificationRequest | The new phone number using the international format try { $result = $apiInstance->resetPhoneVerification($storeId, $memberId, $body); print_r($result); } catch (Exception $e) { echo 'Exception when calling MembersApi->resetPhoneVerification: ', $e->getMessage(), PHP_EOL; } // Configure OAuth2 access token for authorization: OAuth2 $config = DillerAPI\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); $apiInstance = new DillerAPI\Api{{classname}}( // 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 ); $storeId = "storeId_example"; // string | The Store Id $memberId = "memberId_example"; // string | The Member Id $body = array(new \DillerAPI\Model\Dependent()); // \DillerAPI\Model\Dependent[] | A collection of dependents try { $apiInstance->updateDependents($storeId, $memberId, $body); } catch (Exception $e) { echo 'Exception when calling MembersApi->updateDependents: ', $e->getMessage(), PHP_EOL; } // Configure OAuth2 access token for authorization: OAuth2 $config = DillerAPI\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); $apiInstance = new DillerAPI\Api{{classname}}( // 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 ); $storeId = "storeId_example"; // string | The store id $memberId = "memberId_example"; // string | The member id $body = new \DillerAPI\Model\UpdateMemberRequest(); // \DillerAPI\Model\UpdateMemberRequest | try { $result = $apiInstance->updateMember($storeId, $memberId, $body); print_r($result); } catch (Exception $e) { echo 'Exception when calling MembersApi->updateMember: ', $e->getMessage(), PHP_EOL; } // Configure OAuth2 access token for authorization: OAuth2 $config = DillerAPI\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); $apiInstance = new DillerAPI\Api{{classname}}( // 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 ); $storeId = "storeId_example"; // string | The store id try { $result = $apiInstance->getStoreMembershipLevel($storeId); print_r($result); } catch (Exception $e) { echo 'Exception when calling MembershipLevelApi->getStoreMembershipLevel: ', $e->getMessage(), PHP_EOL; } // Configure OAuth2 access token for authorization: OAuth2 $config = DillerAPI\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); $apiInstance = new DillerAPI\Api{{classname}}( // 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 ); $storeId = "storeId_example"; // string | The unique identifier of the store. $body = array(new \DillerAPI\Model\AddNonEligibleProductRequest()); // \DillerAPI\Model\AddNonEligibleProductRequest[] | The list of non-eligible products to add. try { $result = $apiInstance->addBatchNonEligibleProducts($storeId, $body); print_r($result); } catch (Exception $e) { echo 'Exception when calling NonEligibleProductsApi->addBatchNonEligibleProducts: ', $e->getMessage(), PHP_EOL; } // Configure OAuth2 access token for authorization: OAuth2 $config = DillerAPI\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); $apiInstance = new DillerAPI\Api{{classname}}( // 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 ); $storeId = "storeId_example"; // string | The unique identifier of the store. $nonEligibleProductId = 56; // int | The identifier of the non-eligible product to be deleted. try { $result = $apiInstance->deleteNonEligibleProduct($storeId, $nonEligibleProductId); print_r($result); } catch (Exception $e) { echo 'Exception when calling NonEligibleProductsApi->deleteNonEligibleProduct: ', $e->getMessage(), PHP_EOL; } // Configure OAuth2 access token for authorization: OAuth2 $config = DillerAPI\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); $apiInstance = new DillerAPI\Api{{classname}}( // 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 ); $storeId = "storeId_example"; // string | The unique identifier of the store. $offset = 56; // int | The starting index of the paginated data (must be greater than or equal to 0). $limit = 56; // int | The number of records per page (must be between 1 and 100). try { $result = $apiInstance->getNonEligibleProducts($storeId, $offset, $limit); print_r($result); } catch (Exception $e) { echo 'Exception when calling NonEligibleProductsApi->getNonEligibleProducts: ', $e->getMessage(), PHP_EOL; } // Configure OAuth2 access token for authorization: OAuth2 $config = DillerAPI\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); $apiInstance = new DillerAPI\Api{{classname}}( // 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 ); $storeId = "storeId_example"; // string | The unique identifier of the store. $body = array(new \DillerAPI\Model\UpdateNonEligibleProductRequest()); // \DillerAPI\Model\UpdateNonEligibleProductRequest[] | The list of non-eligible products to update. try { $result = $apiInstance->updateBatchNonEligibleProducts($storeId, $body); print_r($result); } catch (Exception $e) { echo 'Exception when calling NonEligibleProductsApi->updateBatchNonEligibleProducts: ', $e->getMessage(), PHP_EOL; } // Configure OAuth2 access token for authorization: OAuth2 $config = DillerAPI\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); $apiInstance = new DillerAPI\Api{{classname}}( // 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 ); $storeId = "storeId_example"; // string | $memberId = "memberId_example"; // string | $stampId = 56; // int | $body = new \DillerAPI\Model\CouponCancelReservationRequest(); // \DillerAPI\Model\CouponCancelReservationRequest | try { $result = $apiInstance->cancelStampReservation($storeId, $memberId, $stampId, $body); print_r($result); } catch (Exception $e) { echo 'Exception when calling StampCardsApi->cancelStampReservation: ', $e->getMessage(), PHP_EOL; } // Configure OAuth2 access token for authorization: OAuth2 $config = DillerAPI\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); $apiInstance = new DillerAPI\Api{{classname}}( // 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 ); $storeId = "storeId_example"; // string | The store id $memberId = "memberId_example"; // string | try { $result = $apiInstance->getMemberStampCards($storeId, $memberId); print_r($result); } catch (Exception $e) { echo 'Exception when calling StampCardsApi->getMemberStampCards: ', $e->getMessage(), PHP_EOL; } // Configure OAuth2 access token for authorization: OAuth2 $config = DillerAPI\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); $apiInstance = new DillerAPI\Api{{classname}}( // 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 ); $storeId = "storeId_example"; // string | The store id $alsoInactive = true; // bool | When true, it also return stamp cards that are not currently valid. try { $result = $apiInstance->getStoreStamps($storeId, $alsoInactive); print_r($result); } catch (Exception $e) { echo 'Exception when calling StampCardsApi->getStoreStamps: ', $e->getMessage(), PHP_EOL; } // Configure OAuth2 access token for authorization: OAuth2 $config = DillerAPI\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); $apiInstance = new DillerAPI\Api{{classname}}( // 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 ); $storeId = "storeId_example"; // string | The storeId $memberId = "memberId_example"; // string | The memberId $stampId = 56; // int | The stam id $body = new \DillerAPI\Model\StampReservationRequest(); // \DillerAPI\Model\StampReservationRequest | Details of the coupon reservation request try { $result = $apiInstance->reserveStamp($storeId, $memberId, $stampId, $body); print_r($result); } catch (Exception $e) { echo 'Exception when calling StampCardsApi->reserveStamp: ', $e->getMessage(), PHP_EOL; } // Configure OAuth2 access token for authorization: OAuth2 $config = DillerAPI\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); $apiInstance = new DillerAPI\Api{{classname}}( // 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 ); $storeId = "storeId_example"; // string | The store id $body = new \DillerAPI\Model\CreateDepartmentRequest(); // \DillerAPI\Model\CreateDepartmentRequest | try { $result = $apiInstance->createDepartment($storeId, $body); print_r($result); } catch (Exception $e) { echo 'Exception when calling StoresApi->createDepartment: ', $e->getMessage(), PHP_EOL; } // Configure OAuth2 access token for authorization: OAuth2 $config = DillerAPI\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); $apiInstance = new DillerAPI\Api{{classname}}( // 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 ); $storeId = "storeId_example"; // string | The id of the store try { $result = $apiInstance->get($storeId); print_r($result); } catch (Exception $e) { echo 'Exception when calling StoresApi->get: ', $e->getMessage(), PHP_EOL; } // Configure OAuth2 access token for authorization: OAuth2 $config = DillerAPI\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); $apiInstance = new DillerAPI\Api{{classname}}( // 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 ); try { $result = $apiInstance->getAll(); print_r($result); } catch (Exception $e) { echo 'Exception when calling StoresApi->getAll: ', $e->getMessage(), PHP_EOL; } // Configure OAuth2 access token for authorization: OAuth2 $config = DillerAPI\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); $apiInstance = new DillerAPI\Api{{classname}}( // 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 ); $storeId = "storeId_example"; // string | The store id try { $result = $apiInstance->getDepartments($storeId); print_r($result); } catch (Exception $e) { echo 'Exception when calling StoresApi->getDepartments: ', $e->getMessage(), PHP_EOL; } // Configure OAuth2 access token for authorization: OAuth2 $config = DillerAPI\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); $apiInstance = new DillerAPI\Api{{classname}}( // 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 ); $storeId = "storeId_example"; // string | The Id of the store try { $result = $apiInstance->getSegments($storeId); print_r($result); } catch (Exception $e) { echo 'Exception when calling StoresApi->getSegments: ', $e->getMessage(), PHP_EOL; } // Configure OAuth2 access token for authorization: OAuth2 $config = DillerAPI\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); $apiInstance = new DillerAPI\Api{{classname}}( // 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 ); $storeId = "storeId_example"; // string | $externalTransactionId = "externalTransactionId_example"; // string | The store's transaction unique identifier. Eg. Order-1234 $body = new \DillerAPI\Model\CancelationReason(); // \DillerAPI\Model\CancelationReason | try { $result = $apiInstance->cancelTransaction($storeId, $externalTransactionId, $body); print_r($result); } catch (Exception $e) { echo 'Exception when calling TransactionsApi->cancelTransaction: ', $e->getMessage(), PHP_EOL; } // Configure OAuth2 access token for authorization: OAuth2 $config = DillerAPI\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); $apiInstance = new DillerAPI\Api{{classname}}( // 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 ); $storeId = "storeId_example"; // string | Store Id $memberId = "memberId_example"; // string | Member Id $transactionId = "transactionId_example"; // string | The original transaction Id that is being refunded $body = new \DillerAPI\Model\CreateRefundTransactionRequest(); // \DillerAPI\Model\CreateRefundTransactionRequest | CreateRefundTransactionRequest object try { $result = $apiInstance->createRefundTransaction($storeId, $memberId, $transactionId, $body); print_r($result); } catch (Exception $e) { echo 'Exception when calling TransactionsApi->createRefundTransaction: ', $e->getMessage(), PHP_EOL; } // Configure OAuth2 access token for authorization: OAuth2 $config = DillerAPI\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); $apiInstance = new DillerAPI\Api{{classname}}( // 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 ); $storeId = "storeId_example"; // string | Store Id $memberId = "memberId_example"; // string | Member Id $body = new \DillerAPI\Model\CreateTransactionRequest(); // \DillerAPI\Model\CreateTransactionRequest | CreateTransactionRequest object try { $result = $apiInstance->createTransaction($storeId, $memberId, $body); print_r($result); } catch (Exception $e) { echo 'Exception when calling TransactionsApi->createTransaction: ', $e->getMessage(), PHP_EOL; } ?>
API 端点文档
所有 URI 都相对于 /
模型文档
- ActionResponse
- AddNonEligibleBatchError
- AddNonEligibleProductRequest
- Address
- ApiError
- CancelationReason
- Consent
- CouponCancelReservationRequest
- CouponDiscountType
- CouponReservationRequest
- CouponTarget
- CouponType
- CreateDepartmentRequest
- CreateRefundTransactionRequest
- CreateTransactionRequest
- Dependent
- EnrollMemberRequest
- ExternalCouponIdentifier
- Gender
- GlobalProductIdentifier
- GtinType
- InvitedFriendResponse
- LoginOtpVerificationRequest
- MemberAdditionalInfo
- MemberConsent
- MemberCouponResponse
- MemberIdentifier
- MemberMembershipDetail
- MemberProfileWidgetResponse
- MemberResponse
- MemberSegmentResponse
- MemberStampCard
- NonEligibleProductResponse
- NonEligibleProductResponsePaginatedDataResponse
- Origin
- PaymentDetails
- Phone
- PointsSystem
- ProductCategory
- ProductDetail
- RefundDetailRequest
- RegisterMemberRequest
- ResetPhoneVerificationRequest
- SegmentOption
- SegmentType
- SegmentValue
- StampCard
- StampReservationRequest
- StoreCouponResponse
- StoreDepartmentResponse
- StoreMembershipLevelResponse
- StoreResponse
- StoreSegmentResponse
- StoreStampCardResponse
- TransactionDetailRequest
- UpdateBatchStatus
- UpdateMemberRequest
- UpdateNonEligibleProductRequest
授权文档
OAuth2
- 类型: OAuth
- 流程: application
- 授权 URL:
- 作用域:
- ****: