반응형
1편
2편
3편
맨날 블로그 글을 써야지 써야지 하다가 오늘 드디어 쓴다 .... !
스마트스토어 API중 이번엔 상품등록이다 !
headers = {
'Authorization': "Bearer "+ self.token,
'content-type': "application/json"
}
헤더는 위와 같다.
우리가 전에 만든 self.token을 이번에도 사용한다.
import http.client
conn = http.client.HTTPSConnection("api.commerce.naver.com")
payload = "{\"originProduct\":{\"statusType\":\"WAIT\",\"saleType\":\"NEW\",\"leafCategoryId\":\"string\",\"name\":\"string\",\"detailContent\":\"string\",\"images\":{\"representativeImage\":{\"url\":\"string\"},\"optionalImages\":[{\"url\":\"string\"}]},\"saleStartDate\":\"2024-07-24T11:56:17Z\",\"saleEndDate\":\"2024-07-24T11:56:17Z\",\"salePrice\":0,\"stockQuantity\":0,\"deliveryInfo\":{\"deliveryType\":\"DELIVERY\",\"deliveryAttributeType\":\"NORMAL\",\"deliveryCompany\":\"string\",\"outboundLocationId\":\"string\",\"deliveryBundleGroupUsable\":true,\"deliveryBundleGroupId\":0,\"quickServiceAreas\":[\"SEOUL\"],\"visitAddressId\":0,\"deliveryFee\":{\"deliveryFeeType\":\"FREE\",\"baseFee\":0,\"freeConditionalAmount\":0,\"repeatQuantity\":0,\"secondBaseQuantity\":0,\"secondExtraFee\":0,\"thirdBaseQuantity\":0,\"thirdExtraFee\":0,\"deliveryFeePayType\":\"COLLECT\",\"deliveryFeeByArea\":{\"deliveryAreaType\":\"AREA_2\",\"area2extraFee\":0,\"area3extraFee\":0},\"differentialFeeByArea\":\"string\"},\"claimDeliveryInfo\":{\"returnDeliveryCompanyPriorityType\":\"PRIMARY\",\"returnDeliveryFee\":0,\"exchangeDeliveryFee\":0,\"shippingAddressId\":0,\"returnAddressId\":0,\"freeReturnInsuranceYn\":true},\"installationFee\":true,\"expectedDeliveryPeriodType\":\"ETC\",\"expectedDeliveryPeriodDirectInput\":\"string\",\"todayStockQuantity\":0,\"customProductAfterOrderYn\":true,\"hopeDeliveryGroupId\":0,\"businessCustomsClearanceSaleYn\":true},\"productLogistics\":[{\"logisticsCompanyId\":\"string\",\"logisticsCenterId\":\"string\"}],\"detailAttribute\":{\"naverShoppingSearchInfo\":{\"modelId\":0,\"modelName\":\"string\",\"manufacturerName\":\"string\",\"brandId\":0,\"brandName\":\"string\"},\"afterServiceInfo\":{\"afterServiceTelephoneNumber\":\"string\",\"afterServiceGuideContent\":\"string\"},\"purchaseQuantityInfo\":{\"minPurchaseQuantity\":0,\"maxPurchaseQuantityPerId\":0,\"maxPurchaseQuantityPerOrder\":0},\"originAreaInfo\":{\"originAreaCode\":\"string\",\"importer\":\"string\",\"content\":\"string\",\"plural\":true},\"sellerCodeInfo\":{\"sellerManagementCode\":\"string\",\"sellerBarcode\":\"string\",\"sellerCustomCode1\":\"string\",\"sellerCustomCode2\":\"string\"},\"optionInfo\":{\"simpleOptionSortType\":\"CREATE\",\"optionSimple\":[{\"id\":0,\"groupName\":\"string\",\"name\":\"string\",\"usable\":true}],\"optionCustom\":[{\"id\":0,\"groupName\":\"string\",\"name\":\"string\",\"usable\":true}],\"optionCombinationSortType\":\"CREATE\",\"optionCombinationGroupNames\":{\"optionGroupName1\":\"string\",\"optionGroupName2\":\"string\",\"optionGroupName3\":\"string\",\"optionGroupName4\":\"string\"},\"optionCombinations\":[{\"id\":0,\"optionName1\":\"string\",\"optionName2\":\"string\",\"optionName3\":\"string\",\"optionName4\":\"string\",\"stockQuantity\":0,\"price\":0,\"sellerManagerCode\":\"string\",\"usable\":true}],\"standardOptionGroups\":[{\"groupName\":\"string\",\"standardOptionAttributes\":[{\"attributeId\":0,\"attributeValueId\":0,\"attributeValueName\":\"string\",\"imageUrls\":[\"string\"]}]}],\"optionStandards\":[{\"id\":0,\"optionName1\":\"string\",\"optionName2\":\"string\",\"stockQuantity\":0,\"sellerManagerCode\":\"string\",\"usable\":true}],\"useStockManagement\":true,\"optionDeliveryAttributes\":[\"string\"]},\"supplementProductInfo\":{\"sortType\":\"CREATE\",\"supplementProducts\":[{\"id\":0,\"groupName\":\"string\",\"name\":\"string\",\"price\":0,\"stockQuantity\":0,\"sellerManagementCode\":\"string\",\"usable\":true}]},\"purchaseReviewInfo\":{\"purchaseReviewExposure\":true,\"reviewUnExposeReason\":\"string\"},\"isbnInfo\":{\"isbn13\":\"string\",\"issn\":\"string\",\"independentPublicationYn\":true},\"bookInfo\":{\"publishDay\":\"string\",\"publisher\":{\"code\":\"string\",\"text\":\"string\"},\"authors\":[{\"code\":\"string\",\"text\":\"string\"}],\"illustrators\":[{\"code\":\"string\",\"text\":\"string\"}],\"translators\":[{\"code\":\"string\",\"text\":\"string\"}]},\"eventPhraseCont\":\"string\",\"manufactureDate\":\"2024-07-24\",\"releaseDate\":\"2024-07-24\",\"validDate\":\"2024-07-24\",\"taxType\":\"TAX\",\"productCertificationInfos\":[{\"certificationInfoId\":0,\"certificationKindType\":\"KC_CERTIFICATION\",\"name\":\"string\",\"certificationNumber\":\"string\",\"certificationMark\":true,\"companyName\":\"string\",\"certificationDate\":\"2024-07-24\"}],\"certificationTargetExcludeContent\":{\"childCertifiedProductExclusionYn\":true,\"kcExemptionType\":\"OVERSEAS\",\"kcCertifiedProductExclusionYn\":\"FALSE\",\"greenCertifiedProductExclusionYn\":true},\"sellerCommentContent\":\"string\",\"sellerCommentUsable\":true,\"minorPurchasable\":true,\"ecoupon\":{\"periodType\":\"FIXED\",\"validStartDate\":\"2024-07-24\",\"validEndDate\":\"2024-07-24\",\"periodDays\":0,\"publicInformationContents\":\"string\",\"contactInformationContents\":\"string\",\"usePlaceType\":\"PLACE\",\"usePlaceContents\":\"string\",\"restrictCart\":true,\"siteName\":\"string\"},\"productInfoProvidedNotice\":{\"productInfoProvidedNoticeType\":\"WEAR\",\"wear\":{\"returnCostReason\":\"string\",\"noRefundReason\":\"string\",\"qualityAssuranceStandard\":\"string\",\"compensationProcedure\":\"string\",\"troubleShootingContents\":\"string\",\"material\":\"string\",\"color\":\"string\",\"size\":\"string\",\"manufacturer\":\"string\",\"caution\":\"string\",\"packDate\":\"string\",\"packDateText\":\"string\",\"warrantyPolicy\":\"string\",\"afterServiceDirector\":\"string\"},\"shoes\":{\"returnCostReason\":\"string\",\"noRefundReason\":\"string\",\"qualityAssuranceStandard\":\"string\",\"compensationProcedure\":\"string\",\"troubleShootingContents\":\"string\",\"material\":\"string\",\"color\":\"string\",\"size\":\"string\",\"height\":\"string\",\"manufacturer\":\"string\",\"caution\":\"string\",\"warrantyPolicy\":\"string\",\"afterServiceDirector\":\"string\"},\"bag\":{\"returnCostReason\":\"string\",\"noRefundReason\":\"string\",\"qualityAssuranceStandard\":\"string\",\"compensationProcedure\":\"string\",\"troubleShootingContents\":\"string\",\"type\":\"string\",\"material\":\"string\",\"color\":\"string\",\"size\":\"string\",\"manufacturer\":\"string\",\"caution\":\"string\",\"warrantyPolicy\":\"string\",\"afterServiceDirector\":\"string\"},\"fashionItems\":{\"returnCostReason\":\"string\",\"noRefundReason\":\"string\",\"qualityAssuranceStandard\":\"string\",\"compensationProcedure\":\"string\",\"troubleShootingContents\":\"string\",\"type\":\"string\",\"material\":\"string\",\"size\":\"string\",\"manufacturer\":\"string\",\"caution\":\"string\",\"warrantyPolicy\":\"string\",\"afterServiceDirector\":\"string\"},\"sleepingGear\":{\"returnCostReason\":\"string\",\"noRefundReason\":\"string\",\"qualityAssuranceStandard\":\"string\",\"compensationProcedure\":\"string\",\"troubleShootingContents\":\"string\",\"material\":\"string\",\"color\":\"string\",\"size\":\"string\",\"components\":\"string\",\"manufacturer\":\"string\",\"caution\":\"string\",\"warrantyPolicy\":\"string\",\"afterServiceDirector\":\"string\"},\"furniture\":{\"returnCostReason\":\"string\",\"noRefundReason\":\"string\",\"qualityAssuranceStandard\":\"string\",\"compensationProcedure\":\"string\",\"troubleShootingContents\":\"string\",\"itemName\":\"string\",\"certificationType\":\"string\",\"color\":\"string\",\"components\":\"string\",\"material\":\"string\",\"manufacturer\":\"string\",\"importer\":\"string\",\"producer\":\"string\",\"size\":\"string\",\"installedCharge\":\"string\",\"warrantyPolicy\":\"string\",\"refurb\":\"string\",\"afterServiceDirector\":\"string\"},\"imageAppliances\":{\"returnCostReason\":\"string\",\"noRefundReason\":\"string\",\"qualityAssuranceStandard\":\"string\",\"compensationProcedure\":\"string\",\"troubleShootingContents\":\"string\",\"itemName\":\"string\",\"modelName\":\"string\",\"certificationType\":\"string\",\"ratedVoltage\":\"string\",\"powerConsumption\":\"string\",\"energyEfficiencyRating\":\"string\",\"releaseDate\":\"string\",\"releaseDateText\":\"string\",\"manufacturer\":\"string\",\"size\":\"string\",\"additionalCost\":\"string\",\"displaySpecification\":\"string\",\"warrantyPolicy\":\"string\",\"afterServiceDirector\":\"string\"},\"homeAppliances\":{\"returnCostReason\":\"string\",\"noRefundReason\":\"string\",\"qualityAssuranceStandard\":\"string\",\"compensationProcedure\":\"string\",\"troubleShootingContents\":\"string\",\"itemName\":\"string\",\"modelName\":\"string\",\"certificationType\":\"string\",\"ratedVoltage\":\"string\",\"powerConsumption\":\"string\",\"energyEfficiencyRating\":\"string\",\"releaseDate\":\"string\",\"releaseDateText\":\"string\",\"manufacturer\":\"string\",\"size\":\"string\",\"additionalCost\":\"string\",\"warrantyPolicy\":\"string\",\"afterServiceDirector\":\"string\"},\"seasonAppliances\":{\"returnCostReason\":\"string\",\"noRefundReason\":\"string\",\"qualityAssuranceStandard\":\"string\",\"compensationProcedure\":\"string\",\"troubleShootingContents\":\"string\",\"itemName\":\"string\",\"modelName\":\"string\",\"certificationType\":\"string\",\"ratedVoltage\":\"string\",\"powerConsumption\":\"string\",\"energyEfficiencyRating\":\"string\",\"releaseDate\":{\"year\":0,\"month\":\"JANUARY\",\"monthValue\":0,\"leapYear\":true},\"releaseDateText\":\"string\",\"manufacturer\":\"string\",\"size\":\"string\",\"area\":\"string\",\"installedCharge\":\"string\",\"warrantyPolicy\":\"string\",\"afterServiceDirector\":\"string\"},\"officeAppliances\":{\"returnCostReason\":\"string\",\"noRefundReason\":\"string\",\"qualityAssuranceStandard\":\"string\",\"compensationProcedure\":\"string\",\"troubleShootingContents\":\"string\",\"itemName\":\"string\",\"modelName\":\"string\",\"certificationType\":\"string\",\"ratedVoltage\":\"string\",\"powerConsumption\":\"string\",\"energyEfficiencyRating\":\"string\",\"releaseDate\":{\"year\":0,\"month\":\"JANUARY\",\"monthValue\":0,\"leapYear\":true},\"releaseDateText\":\"string\",\"manufacturer\":\"string\",\"size\":\"string\",\"weight\":\"string\",\"specification\":\"string\",\"warrantyPolicy\":\"string\",\"afterServiceDirector\":\"string\"},\"opticsAppliances\":{\"returnCostReason\":\"string\",\"noRefundReason\":\"string\",\"qualityAssuranceStandard\":\"string\",\"compensationProcedure\":\"string\",\"troubleShootingContents\":\"string\",\"itemName\":\"string\",\"modelName\":\"string\",\"certificationType\":\"string\",\"releaseDate\":\"string\",\"releaseDateText\":\"string\",\"manufacturer\":\"string\",\"size\":\"string\",\"weight\":\"string\",\"specification\":\"string\",\"warrantyPolicy\":\"string\",\"afterServiceDirector\":\"string\"},\"microElectronics\":{\"returnCostReason\":\"string\",\"noRefundReason\":\"string\",\"qualityAssuranceStandard\":\"string\",\"compensationProcedure\":\"string\",\"troubleShootingContents\":\"string\",\"itemName\":\"string\",\"modelName\":\"string\",\"certificationType\":\"string\",\"ratedVoltage\":\"string\",\"powerConsumption\":\"string\",\"releaseDate\":\"string\",\"releaseDateText\":\"string\",\"manufacturer\":\"string\",\"size\":\"string\",\"weight\":\"string\",\"specification\":\"string\",\"warrantyPolicy\":\"string\",\"afterServiceDirector\":\"string\"},\"navigation\":{\"returnCostReason\":\"string\",\"noRefundReason\":\"string\",\"qualityAssuranceStandard\":\"string\",\"compensationProcedure\":\"string\",\"troubleShootingContents\":\"string\",\"itemName\":\"string\",\"modelName\":\"string\",\"certificationType\":\"string\",\"ratedVoltage\":\"string\",\"powerConsumption\":\"string\",\"releaseDate\":\"string\",\"releaseDateText\":\"string\",\"manufacturer\":\"string\",\"size\":\"string\",\"weight\":\"string\",\"specification\":\"string\",\"updateCost\":\"string\",\"freeCostPeriod\":\"string\",\"warrantyPolicy\":\"string\",\"afterServiceDirector\":\"string\"},\"carArticles\":{\"returnCostReason\":\"string\",\"noRefundReason\":\"string\",\"qualityAssuranceStandard\":\"string\",\"compensationProcedure\":\"string\",\"troubleShootingContents\":\"string\",\"itemName\":\"string\",\"modelName\":\"string\",\"releaseDate\":\"string\",\"releaseDateText\":\"string\",\"certificationType\":\"string\",\"caution\":\"string\",\"manufacturer\":\"string\",\"size\":\"string\",\"applyModel\":\"string\",\"warrantyPolicy\":\"string\",\"roadWorthyCertification\":\"string\",\"afterServiceDirector\":\"string\"},\"medicalAppliances\":{\"returnCostReason\":\"string\",\"noRefundReason\":\"string\",\"qualityAssuranceStandard\":\"string\",\"compensationProcedure\":\"string\",\"troubleShootingContents\":\"string\",\"itemName\":\"string\",\"modelName\":\"string\",\"licenceNo\":\"string\",\"advertisingCertificationType\":\"string\",\"ratedVoltage\":\"string\",\"powerConsumption\":\"string\",\"releaseDate\":\"string\",\"releaseDateText\":\"string\",\"manufacturer\":\"string\",\"purpose\":\"string\",\"usage\":\"string\",\"caution\":\"string\",\"warrantyPolicy\":\"string\",\"afterServiceDirector\":\"string\"},\"kitchenUtensils\":{\"returnCostReason\":\"string\",\"noRefundReason\":\"string\",\"qualityAssuranceStandard\":\"string\",\"compensationProcedure\":\"string\",\"troubleShootingContents\":\"string\",\"itemName\":\"string\",\"modelName\":\"string\",\"material\":\"string\",\"component\":\"string\",\"size\":\"string\",\"releaseDate\":\"string\",\"releaseDateText\":\"string\",\"manufacturer\":\"string\",\"producer\":\"string\",\"importDeclaration\":true,\"warrantyPolicy\":\"string\",\"afterServiceDirector\":\"string\"},\"cosmetic\":{\"returnCostReason\":\"string\",\"noRefundReason\":\"string\",\"qualityAssuranceStandard\":\"string\",\"compensationProcedure\":\"string\",\"troubleShootingContents\":\"string\",\"capacity\":\"string\",\"specification\":\"string\",\"expirationDate\":\"string\",\"expirationDateText\":\"string\",\"usage\":\"string\",\"manufacturer\":\"string\",\"producer\":\"string\",\"distributor\":\"string\",\"customizedDistributor\":\"string\",\"mainIngredient\":\"string\",\"certificationType\":\"string\",\"caution\":\"string\",\"warrantyPolicy\":\"string\",\"customerServicePhoneNumber\":\"string\"},\"jewellery\":{\"returnCostReason\":\"string\",\"noRefundReason\":\"string\",\"qualityAssuranceStandard\":\"string\",\"compensationProcedure\":\"string\",\"troubleShootingContents\":\"string\",\"material\":\"string\",\"purity\":\"string\",\"bandMaterial\":\"string\",\"weight\":\"string\",\"manufacturer\":\"string\",\"producer\":\"string\",\"size\":\"string\",\"caution\":\"string\",\"specification\":\"string\",\"provideWarranty\":\"string\",\"warrantyPolicy\":\"string\",\"afterServiceDirector\":\"string\"},\"food\":{\"returnCostReason\":\"string\",\"noRefundReason\":\"string\",\"qualityAssuranceStandard\":\"string\",\"compensationProcedure\":\"string\",\"troubleShootingContents\":\"string\",\"foodItem\":\"string\",\"weight\":\"string\",\"amount\":\"string\",\"size\":\"string\",\"packDate\":\"2024-07-24\",\"packDateText\":\"string\",\"expirationDate\":\"2024-07-24\",\"expirationDateText\":\"string\",\"consumptionDate\":\"2024-07-24\",\"consumptionDateText\":\"string\",\"producer\":\"string\",\"relevantLawContent\":\"string\",\"productComposition\":\"string\",\"keep\":\"string\",\"adCaution\":\"string\",\"customerServicePhoneNumber\":\"string\"},\"generalFood\":{\"returnCostReason\":\"string\",\"noRefundReason\":\"string\",\"qualityAssuranceStandard\":\"string\",\"compensationProcedure\":\"string\",\"troubleShootingContents\":\"string\",\"productName\":\"string\",\"foodType\":\"string\",\"producer\":\"string\",\"location\":\"string\",\"packDate\":\"2024-07-24\",\"packDateText\":\"string\",\"expirationDate\":\"2024-07-24\",\"expirationDateText\":\"string\",\"consumptionDate\":\"2024-07-24\",\"consumptionDateText\":\"string\",\"weight\":\"string\",\"amount\":\"string\",\"ingredients\":\"string\",\"nutritionFacts\":\"string\",\"geneticallyModified\":true,\"consumerSafetyCaution\":\"string\",\"importDeclarationCheck\":true,\"customerServicePhoneNumber\":\"string\"},\"dietFood\":{\"returnCostReason\":\"string\",\"noRefundReason\":\"string\",\"qualityAssuranceStandard\":\"string\",\"compensationProcedure\":\"string\",\"troubleShootingContents\":\"string\",\"productName\":\"string\",\"producer\":\"string\",\"location\":\"string\",\"expirationDate\":\"2024-07-24\",\"expirationDateText\":\"string\",\"consumptionDate\":\"2024-07-24\",\"consumptionDateText\":\"string\",\"storageMethod\":\"string\",\"weight\":\"string\",\"amount\":\"string\",\"ingredients\":\"string\",\"nutritionFacts\":\"string\",\"specification\":\"string\",\"cautionAndSideEffect\":\"string\",\"nonMedicinalUsesMessage\":\"string\",\"geneticallyModified\":true,\"importDeclarationCheck\":true,\"consumerSafetyCaution\":\"string\",\"customerServicePhoneNumber\":\"string\"},\"kids\":{\"returnCostReason\":\"string\",\"noRefundReason\":\"string\",\"qualityAssuranceStandard\":\"string\",\"compensationProcedure\":\"string\",\"troubleShootingContents\":\"string\",\"itemName\":\"string\",\"modelName\":\"string\",\"certificationType\":\"string\",\"size\":\"string\",\"weight\":\"string\",\"color\":\"string\",\"material\":\"string\",\"recommendedAge\":\"string\",\"releaseDate\":\"string\",\"releaseDateText\":\"string\",\"manufacturer\":\"string\",\"caution\":\"string\",\"warrantyPolicy\":\"string\",\"afterServiceDirector\":\"string\",\"numberLimit\":\"string\"},\"musicalInstrument\":{\"returnCostReason\":\"string\",\"noRefundReason\":\"string\",\"qualityAssuranceStandard\":\"string\",\"compensationProcedure\":\"string\",\"troubleShootingContents\":\"string\",\"itemName\":\"string\",\"modelName\":\"string\",\"size\":\"string\",\"color\":\"string\",\"material\":\"string\",\"components\":\"string\",\"releaseDate\":\"string\",\"releaseDateText\":\"string\",\"manufacturer\":\"string\",\"detailContent\":\"string\",\"warrantyPolicy\":\"string\",\"afterServiceDirector\":\"string\"},\"sportsEquipment\":{\"returnCostReason\":\"string\",\"noRefundReason\":\"string\",\"qualityAssuranceStandard\":\"string\",\"compensationProcedure\":\"string\",\"troubleShootingContents\":\"string\",\"itemName\":\"string\",\"modelName\":\"string\",\"certificationType\":\"string\",\"size\":\"string\",\"weight\":\"string\",\"color\":\"string\",\"material\":\"string\",\"components\":\"string\",\"releaseDate\":{\"year\":0,\"month\":\"JANUARY\",\"monthValue\":0,\"leapYear\":true},\"releaseDateText\":\"string\",\"manufacturer\":\"string\",\"detailContent\":\"string\",\"warrantyPolicy\":\"string\",\"afterServiceDirector\":\"string\"},\"books\":{\"returnCostReason\":\"string\",\"noRefundReason\":\"string\",\"qualityAssuranceStandard\":\"string\",\"compensationProcedure\":\"string\",\"troubleShootingContents\":\"string\",\"title\":\"string\",\"author\":\"string\",\"publisher\":\"string\",\"size\":\"string\",\"pages\":\"string\",\"components\":\"string\",\"publishDate\":\"2024-07-24\",\"publishDateText\":\"string\",\"description\":\"string\"},\"rentalEtc\":{\"returnCostReason\":\"string\",\"noRefundReason\":\"string\",\"qualityAssuranceStandard\":\"string\",\"compensationProcedure\":\"string\",\"troubleShootingContents\":\"string\",\"itemName\":\"string\",\"modelName\":\"string\",\"ownershipTransferCondition\":\"string\",\"payingForLossOrDamage\":\"string\",\"refundPolicyForCancel\":\"string\",\"customerServicePhoneNumber\":\"string\"},\"digitalContents\":{\"returnCostReason\":\"string\",\"noRefundReason\":\"string\",\"qualityAssuranceStandard\":\"string\",\"compensationProcedure\":\"string\",\"troubleShootingContents\":\"string\",\"producer\":\"string\",\"termsOfUse\":\"string\",\"usePeriod\":\"string\",\"medium\":\"string\",\"requirement\":\"string\",\"cancelationPolicy\":\"string\",\"customerServicePhoneNumber\":\"string\"},\"giftCard\":{\"returnCostReason\":\"string\",\"noRefundReason\":\"string\",\"qualityAssuranceStandard\":\"string\",\"compensationProcedure\":\"string\",\"troubleShootingContents\":\"string\",\"issuer\":\"string\",\"periodStartDate\":\"2024-07-24\",\"periodEndDate\":\"2024-07-24\",\"periodDays\":0,\"termsOfUse\":\"string\",\"useStorePlace\":\"string\",\"useStoreAddressId\":0,\"useStoreUrl\":\"string\",\"refundPolicy\":\"string\",\"customerServicePhoneNumber\":\"string\"},\"mobileCoupon\":{\"returnCostReason\":\"string\",\"noRefundReason\":\"string\",\"qualityAssuranceStandard\":\"string\",\"compensationProcedure\":\"string\",\"troubleShootingContents\":\"string\",\"issuer\":\"string\",\"usableCondition\":\"string\",\"usableStore\":\"string\",\"cancelationPolicy\":\"string\",\"customerServicePhoneNumber\":\"string\"},\"movieShow\":{\"returnCostReason\":\"string\",\"noRefundReason\":\"string\",\"qualityAssuranceStandard\":\"string\",\"compensationProcedure\":\"string\",\"troubleShootingContents\":\"string\",\"sponsor\":\"string\",\"actor\":\"string\",\"rating\":\"string\",\"showTime\":\"string\",\"showPlace\":\"string\",\"cancelationCondition\":\"string\",\"cancelationPolicy\":\"string\",\"customerServicePhoneNumber\":\"string\"},\"etcService\":{\"returnCostReason\":\"string\",\"noRefundReason\":\"string\",\"qualityAssuranceStandard\":\"string\",\"compensationProcedure\":\"string\",\"troubleShootingContents\":\"string\",\"serviceProvider\":\"string\",\"certificateDetails\":\"string\",\"usableCondition\":\"string\",\"cancelationStandard\":\"string\",\"cancelationPolicy\":\"string\",\"customerServicePhoneNumber\":\"string\"},\"biochemistry\":{\"returnCostReason\":\"string\",\"noRefundReason\":\"string\",\"qualityAssuranceStandard\":\"string\",\"compensationProcedure\":\"string\",\"troubleShootingContents\":\"string\",\"productName\":\"string\",\"dosageForm\":\"string\",\"packDate\":\"string\",\"packDateText\":\"string\",\"expirationDate\":\"string\",\"expirationDateText\":\"string\",\"weight\":\"string\",\"effect\":\"string\",\"importer\":\"string\",\"producer\":\"string\",\"manufacturer\":\"string\",\"childProtection\":\"string\",\"chemicals\":\"string\",\"caution\":\"string\",\"safeCriterionNo\":\"string\",\"customerServicePhoneNumber\":\"string\"},\"biocidal\":{\"returnCostReason\":\"string\",\"noRefundReason\":\"string\",\"qualityAssuranceStandard\":\"string\",\"compensationProcedure\":\"string\",\"troubleShootingContents\":\"string\",\"productName\":\"string\",\"weight\":\"string\",\"effect\":\"string\",\"rangeOfUse\":\"string\",\"importer\":\"string\",\"producer\":\"string\",\"manufacturer\":\"string\",\"childProtection\":\"string\",\"harmfulChemicalSubstance\":\"string\",\"maleficence\":\"string\",\"caution\":\"string\",\"approvalNumber\":\"string\",\"customerServicePhoneNumber\":\"string\",\"expirationDate\":\"2024-07-24\",\"expirationDateText\":\"string\"},\"cellPhone\":{\"returnCostReason\":\"string\",\"noRefundReason\":\"string\",\"qualityAssuranceStandard\":\"string\",\"compensationProcedure\":\"string\",\"troubleShootingContents\":\"string\",\"itemName\":\"string\",\"modelName\":\"string\",\"certificationType\":\"string\",\"releaseDate\":\"string\",\"releaseDateText\":\"string\",\"manufacturer\":\"string\",\"importer\":\"string\",\"producer\":\"string\",\"size\":\"string\",\"weight\":\"string\",\"telecomType\":\"string\",\"joinProcess\":\"string\",\"extraBurden\":\"string\",\"specification\":\"string\",\"warrantyPolicy\":\"string\",\"afterServiceDirector\":\"string\"},\"etc\":{\"returnCostReason\":\"string\",\"noRefundReason\":\"string\",\"qualityAssuranceStandard\":\"string\",\"compensationProcedure\":\"string\",\"troubleShootingContents\":\"string\",\"itemName\":\"string\",\"modelName\":\"string\",\"certificateDetails\":\"string\",\"manufacturer\":\"string\",\"afterServiceDirector\":\"string\",\"customerServicePhoneNumber\":\"string\"}},\"productAttributes\":[{\"attributeSeq\":0,\"attributeValueSeq\":0,\"attributeRealValue\":\"string\",\"attributeRealValueUnitCode\":\"string\"}],\"cultureCostIncomeDeductionYn\":true,\"customProductYn\":true,\"itselfProductionProductYn\":true,\"brandCertificationYn\":true,\"seoInfo\":{\"pageTitle\":\"string\",\"metaDescription\":\"string\",\"sellerTags\":[{\"code\":0,\"text\":\"string\"}]}},\"customerBenefit\":{\"immediateDiscountPolicy\":{\"discountMethod\":{\"value\":1,\"unitType\":\"PERCENT\",\"startDate\":\"2024-07-24T11:56:18Z\",\"endDate\":\"2024-07-24T11:56:18Z\"},\"mobileDiscountMethod\":{\"value\":1,\"unitType\":\"PERCENT\",\"startDate\":\"2024-07-24T11:56:18Z\",\"endDate\":\"2024-07-24T11:56:18Z\"}},\"purchasePointPolicy\":{\"value\":0,\"unitType\":\"PERCENT\",\"startDate\":\"2024-07-24\",\"endDate\":\"2024-07-24\"},\"reviewPointPolicy\":{\"textReviewPoint\":0,\"photoVideoReviewPoint\":0,\"afterUseTextReviewPoint\":0,\"afterUsePhotoVideoReviewPoint\":0,\"storeMemberReviewPoint\":0,\"startDate\":\"2024-07-24\",\"endDate\":\"2024-07-24\"},\"freeInterestPolicy\":{\"value\":0,\"startDate\":\"2024-07-24\",\"endDate\":\"2024-07-24\"},\"giftPolicy\":{\"presentContent\":\"string\"},\"multiPurchaseDiscountPolicy\":{\"discountMethod\":{\"value\":1,\"unitType\":\"PERCENT\",\"startDate\":\"2024-07-24\",\"endDate\":\"2024-07-24\"},\"orderValue\":0,\"orderValueUnitType\":\"PERCENT\"},\"reservedDiscountPolicy\":{\"discountMethod\":{\"value\":1,\"unitType\":\"PERCENT\",\"startDate\":\"2024-07-24T11:56:18Z\",\"endDate\":\"2024-07-24T11:56:18Z\"}}}},\"smartstoreChannelProduct\":{\"channelProductName\":\"string\",\"bbsSeq\":0,\"storeKeepExclusiveProduct\":true,\"naverShoppingRegistration\":true,\"channelProductDisplayStatusType\":\"WAIT\"},\"windowChannelProduct\":{\"channelProductName\":\"string\",\"bbsSeq\":0,\"storeKeepExclusiveProduct\":true,\"naverShoppingRegistration\":true,\"channelNo\":0,\"best\":true}}"
conn.request("POST", "/external/v2/products", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
커머스 API의 예제를 가져와보자.
다른건 특별한건 없다. 다만, payload부분을 드래그 해보지도 않았는데, 벌써 귀찮음이 발생한다.
{
originProduct: {
statusType: WAIT,
saleType: NEW,
leafCategoryId: string,
name: string,
detailContent: string,
images: {
representativeImage: {
url: string
},
optionalImages: [{
url: string
}]
},
saleStartDate: 2024 - 07 - 24 T11: 56: 17 Z,
saleEndDate: 2024 - 07 - 24 T11: 56: 17 Z,
salePrice: 0,
stockQuantity: 0,
deliveryInfo: {
deliveryType: DELIVERY,
deliveryAttributeType: NORMAL,
deliveryCompany: string,
outboundLocationId: string,
deliveryBundleGroupUsable: true,
deliveryBundleGroupId: 0,
quickServiceAreas: [SEOUL],
visitAddressId: 0,
deliveryFee: {
deliveryFeeType: FREE,
baseFee: 0,
freeConditionalAmount: 0,
repeatQuantity: 0,
secondBaseQuantity: 0,
secondExtraFee: 0,
thirdBaseQuantity: 0,
thirdExtraFee: 0,
deliveryFeePayType: COLLECT,
deliveryFeeByArea: {
deliveryAreaType: AREA_2,
area2extraFee: 0,
area3extraFee: 0
},
differentialFeeByArea: string
},
claimDeliveryInfo: {
returnDeliveryCompanyPriorityType: PRIMARY,
returnDeliveryFee: 0,
exchangeDeliveryFee: 0,
shippingAddressId: 0,
returnAddressId: 0,
freeReturnInsuranceYn: true
},
installationFee: true,
expectedDeliveryPeriodType: ETC,
expectedDeliveryPeriodDirectInput: string,
todayStockQuantity: 0,
customProductAfterOrderYn: true,
hopeDeliveryGroupId: 0,
businessCustomsClearanceSaleYn: true
},
productLogistics: [{
logisticsCompanyId: string,
logisticsCenterId: string
}],
detailAttribute: {
naverShoppingSearchInfo: {
modelId: 0,
modelName: string,
manufacturerName: string,
brandId: 0,
brandName: string
},
afterServiceInfo: {
afterServiceTelephoneNumber: string,
afterServiceGuideContent: string
},
purchaseQuantityInfo: {
minPurchaseQuantity: 0,
maxPurchaseQuantityPerId: 0,
maxPurchaseQuantityPerOrder: 0
},
originAreaInfo: {
originAreaCode: string,
importer: string,
content: string,
plural: true
},
sellerCodeInfo: {
sellerManagementCode: string,
sellerBarcode: string,
sellerCustomCode1: string,
sellerCustomCode2: string
},
optionInfo: {
simpleOptionSortType: CREATE,
optionSimple: [{
id: 0,
groupName: string,
name: string,
usable: true
}],
optionCustom: [{
id: 0,
groupName: string,
name: string,
usable: true
}],
optionCombinationSortType: CREATE,
optionCombinationGroupNames: {
optionGroupName1: string,
optionGroupName2: string,
optionGroupName3: string,
optionGroupName4: string
},
optionCombinations: [{
id: 0,
optionName1: string,
optionName2: string,
optionName3: string,
optionName4: string,
stockQuantity: 0,
price: 0,
sellerManagerCode: string,
usable: true
}],
standardOptionGroups: [{
groupName: string,
standardOptionAttributes: [{
attributeId: 0,
attributeValueId: 0,
attributeValueName: string,
imageUrls: [string]
}]
}],
optionStandards: [{
id: 0,
optionName1: string,
optionName2: string,
stockQuantity: 0,
sellerManagerCode: string,
usable: true
}],
useStockManagement: true,
optionDeliveryAttributes: [string]
},
supplementProductInfo: {
sortType: CREATE,
supplementProducts: [{
id: 0,
groupName: string,
name: string,
price: 0,
stockQuantity: 0,
sellerManagementCode: string,
usable: true
}]
},
purchaseReviewInfo: {
purchaseReviewExposure: true,
reviewUnExposeReason: string
},
isbnInfo: {
isbn13: string,
issn: string,
independentPublicationYn: true
},
bookInfo: {
publishDay: string,
publisher: {
code: string,
text: string
},
authors: [{
code: string,
text: string
}],
illustrators: [{
code: string,
text: string
}],
translators: [{
code: string,
text: string
}]
},
eventPhraseCont: string,
manufactureDate: 2024 - 07 - 24,
releaseDate: 2024 - 07 - 24,
validDate: 2024 - 07 - 24,
taxType: TAX,
productCertificationInfos: [{
certificationInfoId: 0,
certificationKindType: KC_CERTIFICATION,
name: string,
certificationNumber: string,
certificationMark: true,
companyName: string,
certificationDate: 2024 - 07 - 24
}],
certificationTargetExcludeContent: {
childCertifiedProductExclusionYn: true,
kcExemptionType: OVERSEAS,
kcCertifiedProductExclusionYn: FALSE,
greenCertifiedProductExclusionYn: true
},
sellerCommentContent: string,
sellerCommentUsable: true,
minorPurchasable: true,
ecoupon: {
periodType: FIXED,
validStartDate: 2024 - 07 - 24,
validEndDate: 2024 - 07 - 24,
periodDays: 0,
publicInformationContents: string,
contactInformationContents: string,
usePlaceType: PLACE,
usePlaceContents: string,
restrictCart: true,
siteName: string
},
productInfoProvidedNotice: {
productInfoProvidedNoticeType: WEAR,
wear: {
returnCostReason: string,
noRefundReason: string,
qualityAssuranceStandard: string,
compensationProcedure: string,
troubleShootingContents: string,
material: string,
color: string,
size: string,
manufacturer: string,
caution: string,
packDate: string,
packDateText: string,
warrantyPolicy: string,
afterServiceDirector: string
},
shoes: {
returnCostReason: string,
noRefundReason: string,
qualityAssuranceStandard: string,
compensationProcedure: string,
troubleShootingContents: string,
material: string,
color: string,
size: string,
height: string,
manufacturer: string,
caution: string,
warrantyPolicy: string,
afterServiceDirector: string
},
bag: {
returnCostReason: string,
noRefundReason: string,
qualityAssuranceStandard: string,
compensationProcedure: string,
troubleShootingContents: string,
type: string,
material: string,
color: string,
size: string,
manufacturer: string,
caution: string,
warrantyPolicy: string,
afterServiceDirector: string
},
fashionItems: {
returnCostReason: string,
noRefundReason: string,
qualityAssuranceStandard: string,
compensationProcedure: string,
troubleShootingContents: string,
type: string,
material: string,
size: string,
manufacturer: string,
caution: string,
warrantyPolicy: string,
afterServiceDirector: string
},
sleepingGear: {
returnCostReason: string,
noRefundReason: string,
qualityAssuranceStandard: string,
compensationProcedure: string,
troubleShootingContents: string,
material: string,
color: string,
size: string,
components: string,
manufacturer: string,
caution: string,
warrantyPolicy: string,
afterServiceDirector: string
},
furniture: {
returnCostReason: string,
noRefundReason: string,
qualityAssuranceStandard: string,
compensationProcedure: string,
troubleShootingContents: string,
itemName: string,
certificationType: string,
color: string,
components: string,
material: string,
manufacturer: string,
importer: string,
producer: string,
size: string,
installedCharge: string,
warrantyPolicy: string,
refurb: string,
afterServiceDirector: string
},
imageAppliances: {
returnCostReason: string,
noRefundReason: string,
qualityAssuranceStandard: string,
compensationProcedure: string,
troubleShootingContents: string,
itemName: string,
modelName: string,
certificationType: string,
ratedVoltage: string,
powerConsumption: string,
energyEfficiencyRating: string,
releaseDate: string,
releaseDateText: string,
manufacturer: string,
size: string,
additionalCost: string,
displaySpecification: string,
warrantyPolicy: string,
afterServiceDirector: string
},
homeAppliances: {
returnCostReason: string,
noRefundReason: string,
qualityAssuranceStandard: string,
compensationProcedure: string,
troubleShootingContents: string,
itemName: string,
modelName: string,
certificationType: string,
ratedVoltage: string,
powerConsumption: string,
energyEfficiencyRating: string,
releaseDate: string,
releaseDateText: string,
manufacturer: string,
size: string,
additionalCost: string,
warrantyPolicy: string,
afterServiceDirector: string
},
seasonAppliances: {
returnCostReason: string,
noRefundReason: string,
qualityAssuranceStandard: string,
compensationProcedure: string,
troubleShootingContents: string,
itemName: string,
modelName: string,
certificationType: string,
ratedVoltage: string,
powerConsumption: string,
energyEfficiencyRating: string,
releaseDate: {
year: 0,
month: JANUARY,
monthValue: 0,
leapYear: true
},
releaseDateText: string,
manufacturer: string,
size: string,
area: string,
installedCharge: string,
warrantyPolicy: string,
afterServiceDirector: string
},
officeAppliances: {
returnCostReason: string,
noRefundReason: string,
qualityAssuranceStandard: string,
compensationProcedure: string,
troubleShootingContents: string,
itemName: string,
modelName: string,
certificationType: string,
ratedVoltage: string,
powerConsumption: string,
energyEfficiencyRating: string,
releaseDate: {
year: 0,
month: JANUARY,
monthValue: 0,
leapYear: true
},
releaseDateText: string,
manufacturer: string,
size: string,
weight: string,
specification: string,
warrantyPolicy: string,
afterServiceDirector: string
},
opticsAppliances: {
returnCostReason: string,
noRefundReason: string,
qualityAssuranceStandard: string,
compensationProcedure: string,
troubleShootingContents: string,
itemName: string,
modelName: string,
certificationType: string,
releaseDate: string,
releaseDateText: string,
manufacturer: string,
size: string,
weight: string,
specification: string,
warrantyPolicy: string,
afterServiceDirector: string
},
microElectronics: {
returnCostReason: string,
noRefundReason: string,
qualityAssuranceStandard: string,
compensationProcedure: string,
troubleShootingContents: string,
itemName: string,
modelName: string,
certificationType: string,
ratedVoltage: string,
powerConsumption: string,
releaseDate: string,
releaseDateText: string,
manufacturer: string,
size: string,
weight: string,
specification: string,
warrantyPolicy: string,
afterServiceDirector: string
},
navigation: {
returnCostReason: string,
noRefundReason: string,
qualityAssuranceStandard: string,
compensationProcedure: string,
troubleShootingContents: string,
itemName: string,
modelName: string,
certificationType: string,
ratedVoltage: string,
powerConsumption: string,
releaseDate: string,
releaseDateText: string,
manufacturer: string,
size: string,
weight: string,
specification: string,
updateCost: string,
freeCostPeriod: string,
warrantyPolicy: string,
afterServiceDirector: string
},
carArticles: {
returnCostReason: string,
noRefundReason: string,
qualityAssuranceStandard: string,
compensationProcedure: string,
troubleShootingContents: string,
itemName: string,
modelName: string,
releaseDate: string,
releaseDateText: string,
certificationType: string,
caution: string,
manufacturer: string,
size: string,
applyModel: string,
warrantyPolicy: string,
roadWorthyCertification: string,
afterServiceDirector: string
},
medicalAppliances: {
returnCostReason: string,
noRefundReason: string,
qualityAssuranceStandard: string,
compensationProcedure: string,
troubleShootingContents: string,
itemName: string,
modelName: string,
licenceNo: string,
advertisingCertificationType: string,
ratedVoltage: string,
powerConsumption: string,
releaseDate: string,
releaseDateText: string,
manufacturer: string,
purpose: string,
usage: string,
caution: string,
warrantyPolicy: string,
afterServiceDirector: string
},
kitchenUtensils: {
returnCostReason: string,
noRefundReason: string,
qualityAssuranceStandard: string,
compensationProcedure: string,
troubleShootingContents: string,
itemName: string,
modelName: string,
material: string,
component: string,
size: string,
releaseDate: string,
releaseDateText: string,
manufacturer: string,
producer: string,
importDeclaration: true,
warrantyPolicy: string,
afterServiceDirector: string
},
cosmetic: {
returnCostReason: string,
noRefundReason: string,
qualityAssuranceStandard: string,
compensationProcedure: string,
troubleShootingContents: string,
capacity: string,
specification: string,
expirationDate: string,
expirationDateText: string,
usage: string,
manufacturer: string,
producer: string,
distributor: string,
customizedDistributor: string,
mainIngredient: string,
certificationType: string,
caution: string,
warrantyPolicy: string,
customerServicePhoneNumber: string
},
jewellery: {
returnCostReason: string,
noRefundReason: string,
qualityAssuranceStandard: string,
compensationProcedure: string,
troubleShootingContents: string,
material: string,
purity: string,
bandMaterial: string,
weight: string,
manufacturer: string,
producer: string,
size: string,
caution: string,
specification: string,
provideWarranty: string,
warrantyPolicy: string,
afterServiceDirector: string
},
food: {
returnCostReason: string,
noRefundReason: string,
qualityAssuranceStandard: string,
compensationProcedure: string,
troubleShootingContents: string,
foodItem: string,
weight: string,
amount: string,
size: string,
packDate: 2024 - 07 - 24,
packDateText: string,
expirationDate: 2024 - 07 - 24,
expirationDateText: string,
consumptionDate: 2024 - 07 - 24,
consumptionDateText: string,
producer: string,
relevantLawContent: string,
productComposition: string,
keep: string,
adCaution: string,
customerServicePhoneNumber: string
},
generalFood: {
returnCostReason: string,
noRefundReason: string,
qualityAssuranceStandard: string,
compensationProcedure: string,
troubleShootingContents: string,
productName: string,
foodType: string,
producer: string,
location: string,
packDate: 2024 - 07 - 24,
packDateText: string,
expirationDate: 2024 - 07 - 24,
expirationDateText: string,
consumptionDate: 2024 - 07 - 24,
consumptionDateText: string,
weight: string,
amount: string,
ingredients: string,
nutritionFacts: string,
geneticallyModified: true,
consumerSafetyCaution: string,
importDeclarationCheck: true,
customerServicePhoneNumber: string
},
dietFood: {
returnCostReason: string,
noRefundReason: string,
qualityAssuranceStandard: string,
compensationProcedure: string,
troubleShootingContents: string,
productName: string,
producer: string,
location: string,
expirationDate: 2024 - 07 - 24,
expirationDateText: string,
consumptionDate: 2024 - 07 - 24,
consumptionDateText: string,
storageMethod: string,
weight: string,
amount: string,
ingredients: string,
nutritionFacts: string,
specification: string,
cautionAndSideEffect: string,
nonMedicinalUsesMessage: string,
geneticallyModified: true,
importDeclarationCheck: true,
consumerSafetyCaution: string,
customerServicePhoneNumber: string
},
kids: {
returnCostReason: string,
noRefundReason: string,
qualityAssuranceStandard: string,
compensationProcedure: string,
troubleShootingContents: string,
itemName: string,
modelName: string,
certificationType: string,
size: string,
weight: string,
color: string,
material: string,
recommendedAge: string,
releaseDate: string,
releaseDateText: string,
manufacturer: string,
caution: string,
warrantyPolicy: string,
afterServiceDirector: string,
numberLimit: string
},
musicalInstrument: {
returnCostReason: string,
noRefundReason: string,
qualityAssuranceStandard: string,
compensationProcedure: string,
troubleShootingContents: string,
itemName: string,
modelName: string,
size: string,
color: string,
material: string,
components: string,
releaseDate: string,
releaseDateText: string,
manufacturer: string,
detailContent: string,
warrantyPolicy: string,
afterServiceDirector: string
},
sportsEquipment: {
returnCostReason: string,
noRefundReason: string,
qualityAssuranceStandard: string,
compensationProcedure: string,
troubleShootingContents: string,
itemName: string,
modelName: string,
certificationType: string,
size: string,
weight: string,
color: string,
material: string,
components: string,
releaseDate: {
year: 0,
month: JANUARY,
monthValue: 0,
leapYear: true
},
releaseDateText: string,
manufacturer: string,
detailContent: string,
warrantyPolicy: string,
afterServiceDirector: string
},
books: {
returnCostReason: string,
noRefundReason: string,
qualityAssuranceStandard: string,
compensationProcedure: string,
troubleShootingContents: string,
title: string,
author: string,
publisher: string,
size: string,
pages: string,
components: string,
publishDate: 2024 - 07 - 24,
publishDateText: string,
description: string
},
rentalEtc: {
returnCostReason: string,
noRefundReason: string,
qualityAssuranceStandard: string,
compensationProcedure: string,
troubleShootingContents: string,
itemName: string,
modelName: string,
ownershipTransferCondition: string,
payingForLossOrDamage: string,
refundPolicyForCancel: string,
customerServicePhoneNumber: string
},
digitalContents: {
returnCostReason: string,
noRefundReason: string,
qualityAssuranceStandard: string,
compensationProcedure: string,
troubleShootingContents: string,
producer: string,
termsOfUse: string,
usePeriod: string,
medium: string,
requirement: string,
cancelationPolicy: string,
customerServicePhoneNumber: string
},
giftCard: {
returnCostReason: string,
noRefundReason: string,
qualityAssuranceStandard: string,
compensationProcedure: string,
troubleShootingContents: string,
issuer: string,
periodStartDate: 2024 - 07 - 24,
periodEndDate: 2024 - 07 - 24,
periodDays: 0,
termsOfUse: string,
useStorePlace: string,
useStoreAddressId: 0,
useStoreUrl: string,
refundPolicy: string,
customerServicePhoneNumber: string
},
mobileCoupon: {
returnCostReason: string,
noRefundReason: string,
qualityAssuranceStandard: string,
compensationProcedure: string,
troubleShootingContents: string,
issuer: string,
usableCondition: string,
usableStore: string,
cancelationPolicy: string,
customerServicePhoneNumber: string
},
movieShow: {
returnCostReason: string,
noRefundReason: string,
qualityAssuranceStandard: string,
compensationProcedure: string,
troubleShootingContents: string,
sponsor: string,
actor: string,
rating: string,
showTime: string,
showPlace: string,
cancelationCondition: string,
cancelationPolicy: string,
customerServicePhoneNumber: string
},
etcService: {
returnCostReason: string,
noRefundReason: string,
qualityAssuranceStandard: string,
compensationProcedure: string,
troubleShootingContents: string,
serviceProvider: string,
certificateDetails: string,
usableCondition: string,
cancelationStandard: string,
cancelationPolicy: string,
customerServicePhoneNumber: string
},
biochemistry: {
returnCostReason: string,
noRefundReason: string,
qualityAssuranceStandard: string,
compensationProcedure: string,
troubleShootingContents: string,
productName: string,
dosageForm: string,
packDate: string,
packDateText: string,
expirationDate: string,
expirationDateText: string,
weight: string,
effect: string,
importer: string,
producer: string,
manufacturer: string,
childProtection: string,
chemicals: string,
caution: string,
safeCriterionNo: string,
customerServicePhoneNumber: string
},
biocidal: {
returnCostReason: string,
noRefundReason: string,
qualityAssuranceStandard: string,
compensationProcedure: string,
troubleShootingContents: string,
productName: string,
weight: string,
effect: string,
rangeOfUse: string,
importer: string,
producer: string,
manufacturer: string,
childProtection: string,
harmfulChemicalSubstance: string,
maleficence: string,
caution: string,
approvalNumber: string,
customerServicePhoneNumber: string,
expirationDate: 2024 - 07 - 24,
expirationDateText: string
},
cellPhone: {
returnCostReason: string,
noRefundReason: string,
qualityAssuranceStandard: string,
compensationProcedure: string,
troubleShootingContents: string,
itemName: string,
modelName: string,
certificationType: string,
releaseDate: string,
releaseDateText: string,
manufacturer: string,
importer: string,
producer: string,
size: string,
weight: string,
telecomType: string,
joinProcess: string,
extraBurden: string,
specification: string,
warrantyPolicy: string,
afterServiceDirector: string
},
etc: {
returnCostReason: string,
noRefundReason: string,
qualityAssuranceStandard: string,
compensationProcedure: string,
troubleShootingContents: string,
itemName: string,
modelName: string,
certificateDetails: string,
manufacturer: string,
afterServiceDirector: string,
customerServicePhoneNumber: string
}
},
productAttributes: [{
attributeSeq: 0,
attributeValueSeq: 0,
attributeRealValue: string,
attributeRealValueUnitCode: string
}],
cultureCostIncomeDeductionYn: true,
customProductYn: true,
itselfProductionProductYn: true,
brandCertificationYn: true,
seoInfo: {
pageTitle: string,
metaDescription: string,
sellerTags: [{
code: 0,
text: string
}]
}
},
customerBenefit: {
immediateDiscountPolicy: {
discountMethod: {
value: 1,
unitType: PERCENT,
startDate: 2024 - 07 - 24 T11: 56: 18 Z,
endDate: 2024 - 07 - 24 T11: 56: 18 Z
},
mobileDiscountMethod: {
value: 1,
unitType: PERCENT,
startDate: 2024 - 07 - 24 T11: 56: 18 Z,
endDate: 2024 - 07 - 24 T11: 56: 18 Z
}
},
purchasePointPolicy: {
value: 0,
unitType: PERCENT,
startDate: 2024 - 07 - 24,
endDate: 2024 - 07 - 24
},
reviewPointPolicy: {
textReviewPoint: 0,
photoVideoReviewPoint: 0,
afterUseTextReviewPoint: 0,
afterUsePhotoVideoReviewPoint: 0,
storeMemberReviewPoint: 0,
startDate: 2024 - 07 - 24,
endDate: 2024 - 07 - 24
},
freeInterestPolicy: {
value: 0,
startDate: 2024 - 07 - 24,
endDate: 2024 - 07 - 24
},
giftPolicy: {
presentContent: string
},
multiPurchaseDiscountPolicy: {
discountMethod: {
value: 1,
unitType: PERCENT,
startDate: 2024 - 07 - 24,
endDate: 2024 - 07 - 24
},
orderValue: 0,
orderValueUnitType: PERCENT
},
reservedDiscountPolicy: {
discountMethod: {
value: 1,
unitType: PERCENT,
startDate: 2024 - 07 - 24 T11: 56: 18 Z,
endDate: 2024 - 07 - 24 T11: 56: 18 Z
}
}
}
},
smartstoreChannelProduct: {
channelProductName: string,
bbsSeq: 0,
storeKeepExclusiveProduct: true,
naverShoppingRegistration: true,
channelProductDisplayStatusType: WAIT
},
windowChannelProduct: {
channelProductName: string,
bbsSeq: 0,
storeKeepExclusiveProduct: true,
naverShoppingRegistration: true,
channelNo: 0,
best: true
}
}
하 ㅠㅠㅠㅠㅠ 길다 길어.
일단 모든값을 다 넣을 필요는 없다.
홈페이지에서 확인해보면, 필수인 값만 넣으면 되고, 또 필요한 값만 넣으면 된다.
payload = {
"originProduct": {
"statusType":"SALE",
"saleType":"NEW",
"leafCategoryId":CategoryId,
"name": Name,
"detailContent": Detail,
"images":{
"representativeImage":{"url":ImgURL}},
"salePrice": Price,
"stockQuantity":stockQuantity,
"deliveryInfo":{
"deliveryType":"DELIVERY",
"deliveryAttributeType":"NORMAL",
"deliveryCompany":"CH1",
"deliveryBundleGroupUsable":False,
"deliveryFee":{
"deliveryFeeType":deliveryFeeType,
"baseFee":baseFee,
"deliveryFeePayType":"PREPAID",
"deliveryFeeByArea":{
"deliveryAreaType":"AREA_3",
"area2extraFee":3000,
"area3extraFee":5000},
"differentialFeeByArea":"상세정보참조"},
"claimDeliveryInfo":{
"returnDeliveryCompanyPriorityType":"PRIMARY",
"returnDeliveryFee":returnDeliveryFee,
"exchangeDeliveryFee":returnDeliveryFee,
"shippingAddressId":returnAddressId,
"returnAddressId":returnAddressId,
"freeReturnInsuranceYn":False},
"installationFee":False},
"detailAttribute":{
"naverShoppingSearchInfo":{
"modelName":"상세정보참조",
"manufacturerName":"상세정보참조",
"brandName":"상세정보참조"},
"afterServiceInfo":{
"afterServiceTelephoneNumber":AS_Phone,
"afterServiceGuideContent":AS_Content},
"originAreaInfo":{
"originAreaCode":"04",
"content":"기타"},
"sellerCodeInfo":{
"sellerManagementCode":Usercode},
"optionInfo":{
"simpleOptionSortType":"CREATE",
"optionSimple":[],
"optionCustom":[],
"optionCombinationSortType":"CREATE",
"optionCombinationGroupNames":Option_group,
"optionCombinations":Options},
"useStockManagement":False,
"taxType":"TAX",
"certificationTargetExcludeContent":{
"childCertifiedProductExclusionYn":True,
"kcCertifiedProductExclusionYn":"TRUE"},
"minorPurchasable":True,
"productInfoProvidedNotice":{
"productInfoProvidedNoticeType":"ETC",
"etc":{
"returnCostReason":"0",
"noRefundReason":"0",
"qualityAssuranceStandard":"0",
"compensationProcedure":"0",
"troubleShootingContents":"0",
"itemName":"상세설명 참조",
"modelName":"상세설명 참조",
"certificateDetails":"상세설명 참조",
"manufacturer":"상세설명 참조",
"afterServiceDirector":"상세설명 참조"}},
"productAttributes":productAttributes},
"customerBenefit":{
"immediateDiscountPolicy":{
"discountMethod":{
"value":1,
"unitType":"PERCENT"},
"mobileDiscountMethod":{
"value":1,
"unitType":"PERCENT"}},
"purchasePointPolicy":{
"value":1,
"unitType":"PERCENT"},
"reviewPointPolicy":{
"textReviewPoint":30,
"photoVideoReviewPoint":30,
"afterUseTextReviewPoint":30,
"afterUsePhotoVideoReviewPoint":30,
"storeMemberReviewPoint":30},
"freeInterestPolicy":{"value":3},
"giftPolicy":{"presentContent":"사은품"},
"multiPurchaseDiscountPolicy":{
"discountMethod":{
"value":1,
"unitType":"PERCENT"},
"orderValue":100,
"orderValueUnitType":"COUNT"}}},
"smartstoreChannelProduct":{
"channelProductName":Name,
"naverShoppingRegistration":True,
"channelProductDisplayStatusType":"ON"}}
내가 미리 제작하고 사용하는건 위와 같은 payload를 사용한다.
사실 이대로 그냥
conn.request("POST", "/external/v2/products", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
하면 될꺼같지만,
우리는 여러 값들을 또 구해와야 한다 ^^ ~
1. 로컬이미지를 API 사용해서 네이버URL로 반환 받아 와야한다.
(사실 그냥 인터넷 이미지 url을 해도 되긴 한다. 근데 그냥 그러면 안될거같다.)
2. 카테고리 ID를 가져와야한다.
3. 등록하려는 스토어의 반품/교환 주소지 ID를 가져와야한다.
4. 등록하려는 상품의 옵션이 있으면 옵션을 또 형식에 맞게 변환해줘야 한다 .......................
5. 등록하려는 상품 카테고리에 속성값이 있는지 확인하고 ..... 그걸 또 거기에 맞는 속성값으로 형식을 변환해줘야한다 ......
위 5개는 다음에 해보자.
반응형
'프로그램 개발일지' 카테고리의 다른 글
[Python] 네이버 카페 API 없이 requests 하기 - 1 댓글편 (1) | 2024.07.29 |
---|---|
[Python] tkinter 테마 적용하기 - ttkbootstrap (0) | 2024.07.27 |
[Python] 스마트 스토어 API 활용 네이버 커머스 API 3편 (1) | 2024.07.08 |
[Python] 스마트 스토어 API 활용 네이버 커머스 API 2편 (0) | 2024.06.27 |
[ADB] adb 한글 전송이 안 될때 / 한글 입력이 안 될때 (0) | 2024.06.18 |