开放给外部商家创建优惠券模版
名称 | 类型 | 是否必须 | 示例值 | 更多限制 | 描述 |
---|---|---|---|---|---|
param_coupon_template_operate_request | CouponTemplateOperateRequest | 可选 | 请求 | ||
|
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
result | ApiResult | 结果 | |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 | TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret); AlibabaWdkCouponTemplateCreateRequest req = new AlibabaWdkCouponTemplateCreateRequest(); AlibabaWdkCouponTemplateCreateRequest.CouponTemplateOperateRequest obj1 = new AlibabaWdkCouponTemplateCreateRequest.CouponTemplateOperateRequest(); AlibabaWdkCouponTemplateCreateRequest.CouponTemplate obj2 = new AlibabaWdkCouponTemplateCreateRequest.CouponTemplate(); AlibabaWdkCouponTemplateCreateRequest.CouponTemplateApplyLimitConfig obj3 = new AlibabaWdkCouponTemplateCreateRequest.CouponTemplateApplyLimitConfig(); obj3.setApplyEndTime(StringUtils.parseDateTime( "2019-12-31 23:59:59" )); obj3.setCouponDailyLmt(1L); obj3.setCouponTotalLmt(1000L); obj3.setPersonalDailyLmt(1L); obj3.setPersonalLmt(1L); obj3.setApplyStartTime(StringUtils.parseDateTime( "2019-12-31 23:59:59" )); obj2.setApplyLimitConfig(obj3); AlibabaWdkCouponTemplateCreateRequest.CouponTemplateCommonConfig obj4 = new AlibabaWdkCouponTemplateCreateRequest.CouponTemplateCommonConfig(); obj4.setApplyChannels( "darunfa" ); obj4.setDescription( "全场8折" ); obj4.setStatus(1L); obj4.setTitle( "超市8折" ); obj4.setType(6L); obj4.setSendType( "anonymous" ); obj2.setCommonConfig(obj4); AlibabaWdkCouponTemplateCreateRequest.CouponTemplateConditionConfig obj5 = new AlibabaWdkCouponTemplateCreateRequest.CouponTemplateConditionConfig(); obj5.setAmount(100L); obj5.setAmountAt( false ); obj5.setCategories( "23123" ); obj5.setCount(1L); obj5.setCountAt( false ); obj5.setOnlyMemberSelf( false ); obj5.setRangeType(1L); obj5.setShopIds( "23123" ); obj5.setTerminals( "1" ); AlibabaWdkCouponTemplateCreateRequest.CouponTemplateUserCrowdConfig obj6 = new AlibabaWdkCouponTemplateCreateRequest.CouponTemplateUserCrowdConfig(); obj6.setMerchantCustomizeCrowdName( "DRFMem" ); obj6.setPlatformCrowdName( "HEMAX" ); obj5.setUserCrowdConfig(obj6); obj5.setMaxUseCountPerOrder(1L); obj5.setMaxEffectAmount(20L); obj5.setExcludeItemRules( "1" ); obj5.setMerchantCategories( "“111”,“222”" ); obj2.setConditionConfig(obj5); AlibabaWdkCouponTemplateCreateRequest.CouponTemplateDiscountConfig obj7 = new AlibabaWdkCouponTemplateCreateRequest.CouponTemplateDiscountConfig(); obj7.setDecrease( false ); obj7.setDecreaseMoney(100L); obj7.setDiscount( false ); obj7.setDiscountRate(10L); obj7.setFixPriceAmount(1000L); obj7.setFixPrice( false ); obj2.setDiscountConfig(obj7); obj2.setId(1L); AlibabaWdkCouponTemplateCreateRequest.CouponTemplateInvestmentConfig obj8 = new AlibabaWdkCouponTemplateCreateRequest.CouponTemplateInvestmentConfig(); List<AlibabaWdkCouponTemplateCreateRequest.InvestmentInfo> list10 = new ArrayList<AlibabaWdkCouponTemplateCreateRequest.InvestmentInfo>(); AlibabaWdkCouponTemplateCreateRequest.InvestmentInfo obj11 = new AlibabaWdkCouponTemplateCreateRequest.InvestmentInfo(); list10.add(obj11); obj11.setInvestor( "caoding" ); obj11.setInvestorRatio(2000L); obj8.setInvestmentInfoList(list10); obj2.setInvestmentConfig(obj8); AlibabaWdkCouponTemplateCreateRequest.CouponTemplateOptionConfig obj12 = new AlibabaWdkCouponTemplateCreateRequest.CouponTemplateOptionConfig(); obj12.setOutCouponTemplateId( "11111" ); obj12.setOutCouponType( "qwer" ); obj12.setContractInstanceId(100100331414L); obj12.setPurchaseId(1001L); obj2.setOptionConfig(obj12); AlibabaWdkCouponTemplateCreateRequest.CouponTemplateParticipateConfig obj13 = new AlibabaWdkCouponTemplateCreateRequest.CouponTemplateParticipateConfig(); List<AlibabaWdkCouponTemplateCreateRequest.LogicGroup> list15 = new ArrayList<AlibabaWdkCouponTemplateCreateRequest.LogicGroup>(); AlibabaWdkCouponTemplateCreateRequest.LogicGroup obj16 = new AlibabaWdkCouponTemplateCreateRequest.LogicGroup(); list15.add(obj16); obj16.setNumber(1L); obj16.setWdkGroupName( "换购" ); obj16.setLogicGroupType(1L); obj13.setParticipateList(list15); obj2.setParticipateConfig(obj13); obj2.setSourceId(1L); AlibabaWdkCouponTemplateCreateRequest.CouponTemplateTimeLimitConfig obj17 = new AlibabaWdkCouponTemplateCreateRequest.CouponTemplateTimeLimitConfig(); obj17.setEndValidTime(StringUtils.parseDateTime( "2019-12-31 23:59:59" )); obj17.setStartValidTime(StringUtils.parseDateTime( "2019-12-31 23:59:59" )); obj17.setValidTimeType(1L); obj17.setValidityPeriod(1000L); obj17.setValidityStartInterval(7200L); obj17.setValidityEndInterval(14400L); obj2.setTimeLimitConfig(obj17); obj2.setUuid( "113131212" ); AlibabaWdkCouponTemplateCreateRequest.CouponTemplateCompatibleConfig obj18 = new AlibabaWdkCouponTemplateCreateRequest.CouponTemplateCompatibleConfig(); obj18.setValidTillNight(1L); obj18.setApplicationType( "pointCoupon" ); obj2.setCompatibleConfig(obj18); obj2.setUniqueId( "100000001" ); obj1.setCouponTemplate(obj2); AlibabaWdkCouponTemplateCreateRequest.UserInfo obj19 = new AlibabaWdkCouponTemplateCreateRequest.UserInfo(); obj19.setSource( "1" ); obj19.setUserId(1L); obj19.setUserName( "1" ); obj1.setUserInfo(obj19); req.setParamCouponTemplateOperateRequest(obj1); AlibabaWdkCouponTemplateCreateResponse rsp = client.execute(req, sessionKey); System.out.println(rsp.getBody()); |
1 2 3 4 5 6 7 8 9 10 11 | < alibaba_wdk_coupon_template_create_response > < result > < err_code >参数异常</ err_code > < err_msg >参数异常</ err_msg > < model > < id >1</ id > < source_id >1</ source_id > </ model > < success >false</ success > </ result > </ alibaba_wdk_coupon_template_create_response > |
1 2 3 4 5 6 | < error_response > < code >50</ code > < msg >Remote service error</ msg > < sub_code >isv.invalid-parameter</ sub_code > < sub_msg >非法参数</ sub_msg > </ error_response > |
错误码 | 错误描述 | 解决方案 |
---|