다음 방법을 사용하여 구매자 계정 및 클라이언트의 혜택 게재를 시작, 일시중지, 다시 시작할 수 있습니다.
수동으로 특가 제공
기본적으로 확정된 거래는 양쪽에서 수락한 후 자동으로 게재 준비 상태가 됩니다.
보장 프로그래매틱 거래를 수동으로 게재 준비 상태로 설정하려면 기술계정 관리자에게 문의하세요. 기술 계정 관리자가 사용 설정한 후 buyers.finalizedDeals.setReadyToServe 메서드를 사용하여 최종 보장 프로그래매틱 거래가 게재 준비되었음을 수동으로 알립니다. 이 호출은 구성된 기간 동안 확정된 거래의 게재를 시작합니다.
실시간 입찰 API의 buyers.creatives 리소스를 사용하여 거래에 게재할 각 광고 소재에 대해 검토를 요청하는 것이 좋습니다. 광고 소재가 승인되면 광고 소재를 거래에 추가할 수 있습니다.
게재하려는 모든 광고 소재가 승인되고 거래에 추가된 후 buyers.finalizedDeals.setReadyToServe를 호출하여 거래에 대한 수신 입찰 요청에 응답할 준비가 되었음을 알립니다.
이 메서드는 이미 게재 중인 거래에는 영향을 미치지 않습니다.
다음 샘플은 setReadyToServe 메서드를 사용하여 혜택 제공을 수동으로 시작하는 방법을 보여줍니다.
REST
요청
POST https://authorizedbuyersmarketplace.googleapis.com/v1/buyers/12345678/finalizedDeals/1840860:setReadyToServe?alt=json Authorization: Bearer ACCESS_TOKEN Content-Type: application/json
응답
{
"name": "buyers/12345678/finalizedDeals/1840860",
"deal": {
"name": "buyers/12345678/proposals/MP8642048/deals/1840860",
"createTime": "2031-03-26T05:53:33.053Z",
"updateTime": "2031-03-28T05:54:33.442Z",
"displayName": "test-pg-deal-4",
"buyer": "buyers/12345678",
"publisherProfile": "buyers/12345678/publisherProfiles/PP12345",
"flightStartTime": "2032-03-31T16:00:00Z",
"flightEndTime": "2032-03-31T18:59:00Z",
"targeting": {
"inventorySizeTargeting": {
"targetedInventorySizes": [
{
"width": "200",
"height": "200",
"type": "PIXEL"
},
{
"width": "234",
"height": "60",
"type": "PIXEL"
},
{
"width": "240",
"height": "400",
"type": "PIXEL"
},
{
"width": "300",
"height": "250",
"type": "PIXEL"
},
{
"width": "300",
"height": "600",
"type": "PIXEL"
},
{
"width": "300",
"height": "1050",
"type": "PIXEL"
}
]
}
},
"creativeRequirements": {
"creativePreApprovalPolicy": "SELLER_PRE_APPROVAL_NOT_REQUIRED",
"creativeSafeFrameCompatibility": "COMPATIBLE",
"programmaticCreativeSource": "ADVERTISER",
"creativeFormat": "DISPLAY"
},
"deliveryControl": {
"deliveryRateType": "EVENLY"
},
"billedBuyer": "buyers/12345678",
"dealType": "PROGRAMMATIC_GUARANTEED",
"programmaticGuaranteedTerms": {
"guaranteedLooks": "1",
"fixedPrice": {
"type": "CPM",
"amount": {
"currencyCode": "USD",
"nanos": 10000000
}
},
"reservationType": "STANDARD"
},
"sellerTimeZone": {
"id": "Asia/Shanghai"
}
},
"dealServingStatus": "ENDED",
"dealPausingInfo": {
"pausingConsented": true
},
"rtbMetrics": {},
"readyToServe": true
}자바
/* * Copyright 2022 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.google.api.services.samples.authorizedbuyers.marketplace.v1.buyers.finalizedDeals; import com.google.api.services.authorizedbuyersmarketplace.v1.AuthorizedBuyersMarketplace; import com.google.api.services.authorizedbuyersmarketplace.v1.model.FinalizedDeal; import com.google.api.services.authorizedbuyersmarketplace.v1.model.SetReadyToServeRequest; import com.google.api.services.samples.authorizedbuyers.marketplace.v1.Utils; import java.io.IOException; import java.security.GeneralSecurityException; import net.sourceforge.argparse4j.ArgumentParsers; import net.sourceforge.argparse4j.inf.ArgumentParser; import net.sourceforge.argparse4j.inf.ArgumentParserException; import net.sourceforge.argparse4j.inf.Namespace; /** * This sample illustrates how to signal that the given finalized deal is ready to serve. * * <p>By default, deals are set ready to serve as soon as they're finalized. For programmatic * guaranteed deals, bidders can opt out of this feature by asking their account manager. This is * recommended for programmatic guaranteed deals in order to ensure that bidders have creatives * prepared to be used in placing bids once the deal is serving. Use finalizedDeals.addCreative to * associate creatives with a programmatic guaranteed deal. */ public class SetReadyToServeFinalizedDeals { public static void execute(AuthorizedBuyersMarketplace marketplaceClient, Namespace parsedArgs) { Long accountId = parsedArgs.getLong("account_id"); Long dealId = parsedArgs.getLong("deal_id"); String name = String.format("buyers/%d/finalizedDeals/%d", accountId, dealId); FinalizedDeal finalizedDeal = null; try { finalizedDeal = marketplaceClient .buyers() .finalizedDeals() .setReadyToServe(name, new SetReadyToServeRequest()) .execute(); } catch (IOException ex) { System.out.printf("Marketplace API returned error response:%n%s", ex); System.exit(1); } System.out.printf("Signaling that finalized deal with name \"%s\" is ready to serve:%n", name); Utils.printFinalizedDeal(finalizedDeal); } public static void main(String[] args) { ArgumentParser parser = ArgumentParsers.newFor("SetReadyToServeFinalizedDeals") .build() .defaultHelp(true) .description(("Signals that the given finalized deal is ready to serve.")); parser .addArgument("-a", "--account_id") .help( "The resource ID of the buyers resource under which the finalized was created. " + "This will be used to construct the parent used as a path parameter for the " + "finalizedDeals.setReadyToServe request.") .required(true) .type(Long.class); parser .addArgument("-d", "--deal_id") .help( "The resource ID of the buyers.finalizedDeals resource that you intend to signal is" + " ready to serve. This will be used to construct the name used as a path" + " parameter for the finalizedDeals.setReadyToServe request.") .required(true) .type(Long.class); Namespace parsedArgs = null; try { parsedArgs = parser.parseArgs(args); } catch (ArgumentParserException ex) { parser.handleError(ex); System.exit(1); } AuthorizedBuyersMarketplace client = null; try { client = Utils.getMarketplaceClient(); } catch (IOException ex) { System.out.printf("Unable to create Marketplace API service:%n%s", ex); System.out.println("Did you specify a valid path to a service account key file?"); System.exit(1); } catch (GeneralSecurityException ex) { System.out.printf("Unable to establish secure HttpTransport:%n%s", ex); System.exit(1); } execute(client, parsedArgs); } }
게재 일시중지
buyers.finalizedDeals.pause 메서드를 사용하여 최종화된 거래를 일시중지할 수 있습니다. 거래를 일시중지하면 해당 거래에 대한 입찰 요청을 받지 않습니다.
구매자는 비공개 입찰 거래를 일시중지할 수 없습니다.
다음 샘플은 pause 메서드를 사용하여 완료된 거래를 일시중지하는 방법을 보여줍니다.
REST
요청
POST https://authorizedbuyersmarketplace.googleapis.com/v1/buyers/12345678/finalizedDeals/1840860:pause?alt=json Authorization: Bearer ACCESS_TOKEN Content-Type: application/json
응답
{
"name": "buyers/12345678/finalizedDeals/1840860",
"deal": {
"name": "buyers/12345678/proposals/MP8642048/deals/1840860",
"createTime": "2031-03-26T05:53:33.053Z",
"updateTime": "2032-03-31T16:30:21.351Z",
"displayName": "test-pg-deal-4",
"buyer": "buyers/12345678",
"publisherProfile": "buyers/12345678/publisherProfiles/PP12345",
"flightStartTime": "2032-03-31T16:00:00Z",
"flightEndTime": "2032-03-31T18:59:00Z",
"targeting": {
"inventorySizeTargeting": {
"targetedInventorySizes": [
{
"width": "200",
"height": "200",
"type": "PIXEL"
},
{
"width": "234",
"height": "60",
"type": "PIXEL"
},
{
"width": "240",
"height": "400",
"type": "PIXEL"
},
{
"width": "300",
"height": "250",
"type": "PIXEL"
},
{
"width": "300",
"height": "600",
"type": "PIXEL"
},
{
"width": "300",
"height": "1050",
"type": "PIXEL"
}
]
}
},
"creativeRequirements": {
"creativePreApprovalPolicy": "SELLER_PRE_APPROVAL_NOT_REQUIRED",
"creativeSafeFrameCompatibility": "COMPATIBLE",
"programmaticCreativeSource": "ADVERTISER",
"creativeFormat": "DISPLAY"
},
"deliveryControl": {
"deliveryRateType": "EVENLY"
},
"billedBuyer": "buyers/12345678",
"dealType": "PROGRAMMATIC_GUARANTEED",
"programmaticGuaranteedTerms": {
"guaranteedLooks": "1",
"fixedPrice": {
"type": "CPM",
"amount": {
"currencyCode": "USD",
"nanos": 10000000
}
},
"reservationType": "STANDARD"
},
"sellerTimeZone": {
"id": "Asia/Shanghai"
}
},
"dealServingStatus": "ENDED",
"dealPausingInfo": {
"pausingConsented": true
},
"rtbMetrics": {},
"readyToServe": true
}자바
/* * Copyright 2022 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.google.api.services.samples.authorizedbuyers.marketplace.v1.buyers.finalizedDeals; import com.google.api.services.authorizedbuyersmarketplace.v1.AuthorizedBuyersMarketplace; import com.google.api.services.authorizedbuyersmarketplace.v1.model.FinalizedDeal; import com.google.api.services.authorizedbuyersmarketplace.v1.model.PauseFinalizedDealRequest; import com.google.api.services.samples.authorizedbuyers.marketplace.v1.Utils; import java.io.IOException; import java.security.GeneralSecurityException; import net.sourceforge.argparse4j.ArgumentParsers; import net.sourceforge.argparse4j.inf.ArgumentParser; import net.sourceforge.argparse4j.inf.ArgumentParserException; import net.sourceforge.argparse4j.inf.Namespace; /** * This sample illustrates how to pause serving of a finalized deal. * * <p>Note that only programmatic guaranteed deals can be paused by buyers at this time. */ public class PauseFinalizedDeals { public static void execute(AuthorizedBuyersMarketplace marketplaceClient, Namespace parsedArgs) { Long accountId = parsedArgs.getLong("account_id"); Long dealId = parsedArgs.getLong("deal_id"); String name = String.format("buyers/%d/finalizedDeals/%d", accountId, dealId); FinalizedDeal finalizedDeal = null; try { finalizedDeal = marketplaceClient .buyers() .finalizedDeals() .pause(name, new PauseFinalizedDealRequest()) .execute(); } catch (IOException ex) { System.out.printf("Marketplace API returned error response:%n%s", ex); System.exit(1); } System.out.printf( "Paused finalized deal with ID \"%d\" for buyer account ID \"%d\":%n", dealId, accountId); Utils.printFinalizedDeal(finalizedDeal); } public static void main(String[] args) { ArgumentParser parser = ArgumentParsers.newFor("PauseFinalizedDeals") .build() .defaultHelp(true) .description(("Pause a finalized deal for the given buyer account ID and deal ID.")); parser .addArgument("-a", "--account_id") .help( "The resource ID of the buyers resource under which the finalized was created. " + "This will be used to construct the parent used as a path parameter for the " + "finalizedDeals.pause request.") .required(true) .type(Long.class); parser .addArgument("-d", "--deal_id") .help( "The resource ID of the buyers.finalizedDeals resource that is being paused. This " + "will be used to construct the name used as a path parameter for the " + "finalizedDeals.pause request.") .required(true) .type(Long.class); Namespace parsedArgs = null; try { parsedArgs = parser.parseArgs(args); } catch (ArgumentParserException ex) { parser.handleError(ex); System.exit(1); } AuthorizedBuyersMarketplace client = null; try { client = Utils.getMarketplaceClient(); } catch (IOException ex) { System.out.printf("Unable to create Marketplace API service:%n%s", ex); System.out.println("Did you specify a valid path to a service account key file?"); System.exit(1); } catch (GeneralSecurityException ex) { System.out.printf("Unable to establish secure HttpTransport:%n%s", ex); System.exit(1); } execute(client, parsedArgs); } }
게재 재개
'buyers.finalizedDeals.resume' 메서드를 사용하여 일시중지한 확정 거래의 게재를 재개할 수 있습니다. 거래를 재개하면 엔드포인트에서 해당 거래에 대한 입찰 요청을 수신하기 시작합니다. 게시자가 일시중지한 거래의 게재를 재개하려고 해도 아무런 영향이 없습니다.
구매자는 일시중지된 비공개 입찰 거래를 다시 시작할 수 없습니다.
다음 샘플은 resume 메서드를 사용하여 종료된 거래를 재개하는 방법을 보여줍니다.
REST
요청
POST https://authorizedbuyersmarketplace.googleapis.com/v1/buyers/12345678/finalizedDeals/1840860:resume?alt=json Authorization: Bearer ACCESS_TOKEN Content-Type: application/json
응답
{
"name": "buyers/12345678/finalizedDeals/1840860",
"deal": {
"name": "buyers/12345678/proposals/MP8642048/deals/1840860",
"createTime": "2031-03-26T05:53:33.053Z",
"updateTime": "2032-03-31T16:35:12.413Z",
"displayName": "test-pg-deal-4",
"buyer": "buyers/12345678",
"publisherProfile": "buyers/12345678/publisherProfiles/PP12345",
"flightStartTime": "2032-03-31T16:00:00Z",
"flightEndTime": "2032-03-31T18:59:00Z",
"targeting": {
"inventorySizeTargeting": {
"targetedInventorySizes": [
{
"width": "200",
"height": "200",
"type": "PIXEL"
},
{
"width": "234",
"height": "60",
"type": "PIXEL"
},
{
"width": "240",
"height": "400",
"type": "PIXEL"
},
{
"width": "300",
"height": "250",
"type": "PIXEL"
},
{
"width": "300",
"height": "600",
"type": "PIXEL"
},
{
"width": "300",
"height": "1050",
"type": "PIXEL"
}
]
}
},
"creativeRequirements": {
"creativePreApprovalPolicy": "SELLER_PRE_APPROVAL_NOT_REQUIRED",
"creativeSafeFrameCompatibility": "COMPATIBLE",
"programmaticCreativeSource": "ADVERTISER",
"creativeFormat": "DISPLAY"
},
"deliveryControl": {
"deliveryRateType": "EVENLY"
},
"billedBuyer": "buyers/12345678",
"dealType": "PROGRAMMATIC_GUARANTEED",
"programmaticGuaranteedTerms": {
"guaranteedLooks": "1",
"fixedPrice": {
"type": "CPM",
"amount": {
"currencyCode": "USD",
"nanos": 10000000
}
},
"reservationType": "STANDARD"
},
"sellerTimeZone": {
"id": "Asia/Shanghai"
}
},
"dealServingStatus": "ENDED",
"dealPausingInfo": {
"pausingConsented": true
},
"rtbMetrics": {},
"readyToServe": true
}자바
/* * Copyright 2022 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.google.api.services.samples.authorizedbuyers.marketplace.v1.buyers.finalizedDeals; import com.google.api.services.authorizedbuyersmarketplace.v1.AuthorizedBuyersMarketplace; import com.google.api.services.authorizedbuyersmarketplace.v1.model.FinalizedDeal; import com.google.api.services.authorizedbuyersmarketplace.v1.model.ResumeFinalizedDealRequest; import com.google.api.services.samples.authorizedbuyers.marketplace.v1.Utils; import java.io.IOException; import java.security.GeneralSecurityException; import net.sourceforge.argparse4j.ArgumentParsers; import net.sourceforge.argparse4j.inf.ArgumentParser; import net.sourceforge.argparse4j.inf.ArgumentParserException; import net.sourceforge.argparse4j.inf.Namespace; /** * This sample illustrates how to resume serving of a finalized deal. * * <p>Note that only programmatic guaranteed deals can be resumed by buyers at this time. */ public class ResumeFinalizedDeals { public static void execute(AuthorizedBuyersMarketplace marketplaceClient, Namespace parsedArgs) { Long accountId = parsedArgs.getLong("account_id"); Long dealId = parsedArgs.getLong("deal_id"); String name = String.format("buyers/%d/finalizedDeals/%d", accountId, dealId); FinalizedDeal finalizedDeal = null; try { finalizedDeal = marketplaceClient .buyers() .finalizedDeals() .resume(name, new ResumeFinalizedDealRequest()) .execute(); } catch (IOException ex) { System.out.printf("Marketplace API returned error response:%n%s", ex); System.exit(1); } System.out.printf( "Resumed finalized deal with ID \"%s\" for buyer account ID \"%d\":%n", dealId, accountId); Utils.printFinalizedDeal(finalizedDeal); } public static void main(String[] args) { ArgumentParser parser = ArgumentParsers.newFor("ResumeFinalizedDeals") .build() .defaultHelp(true) .description(("Resume a finalized deal for the given buyer account ID and deal ID.")); parser .addArgument("-a", "--account_id") .help( "The resource ID of the buyers resource under which the finalized was created. " + "This will be used to construct the parent used as a path parameter for the " + "finalizedDeals.resume request.") .required(true) .type(Long.class); parser .addArgument("-d", "--deal_id") .help( "The resource ID of the buyers.finalizedDeals resource that is being resumed. This " + "will be used to construct the name used as a path parameter for the " + "finalizedDeals.resume request.") .required(true) .type(Long.class); Namespace parsedArgs = null; try { parsedArgs = parser.parseArgs(args); } catch (ArgumentParserException ex) { parser.handleError(ex); System.exit(1); } AuthorizedBuyersMarketplace client = null; try { client = Utils.getMarketplaceClient(); } catch (IOException ex) { System.out.printf("Unable to create Marketplace API service:%n%s", ex); System.out.println("Did you specify a valid path to a service account key file?"); System.exit(1); } catch (GeneralSecurityException ex) { System.out.printf("Unable to establish secure HttpTransport:%n%s", ex); System.exit(1); } execute(client, parsedArgs); } }