apiV2CouponCheckCodeCreateWithHttpInfo method
Future<Response>
apiV2CouponCheckCodeCreateWithHttpInfo(
- CouponCodeCheck couponCodeCheck, {
- String? code,
View used to receive coupon id by its code. If a coupon already used by a customer view returns 400 error
Note: This method returns the HTTP Response.
Parameters:
-
CouponCodeCheck couponCodeCheck (required):
-
String code:
Implementation
Future<Response> apiV2CouponCheckCodeCreateWithHttpInfo(CouponCodeCheck couponCodeCheck, { String? code, }) async {
// ignore: prefer_const_declarations
final path = r'/api/v2/coupon/check-code/';
// ignore: prefer_final_locals
Object? postBody = couponCodeCheck;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
if (code != null) {
queryParams.addAll(_queryParams('', 'code', code));
}
const contentTypes = <String>['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'];
return apiClient.invokeAPI(
path,
'POST',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}