Gestione dei negozi
Nota
La risorsa dello Store è disponibile solo per i partecipanti a beta chiusa. Per informazioni sulla partecipazione al programma closed-beta o open beta, contattare il proprio account manager.
Tutti gli elementi di programmazione e la documentazione dello Store sono soggetti a modifiche durante la versione beta.
Per creare un archivio, usare il modello archivi POST. Il corpo di POST è un oggetto StoreCreate . È necessario specificare i storeName
campi , storeDestinationUrl
e notificationEmail
. Gli altri campi sono facoltativi. È necessario aver verificato in precedenza e richiesto l'URL del sito Web.
Di seguito viene illustrata una richiesta di esempio che specifica solo i campi obbligatori.
curl -X POST -H "AuthenticationToken: <access token goes here>" -H "DeveloperToken: <developer token goes here>" -H "Content-Type: application/json" --data "{\"storeName\": \"Contoso Sports\",\"storeUrl\": \"https://contoso.com\",\"notificationEmail\": [\"someone@example.com\"]}" https://content.api.ads.microsoft.com/v9.1/bmc/stores
Se la richiesta ha esito positivo, il corpo della risposta contiene un oggetto Store . L'oggetto contiene i campi specificati nella richiesta più tutti i campi facoltativi che forniscono valori predefiniti. Il merchantId
campo contiene l'ID del nuovo archivio e il storeStatus
campo indica se l'archivio è approvato.
{
"merchantId": 123456,
"storeName": "Contoso Sports",
"storeUrl": "https://contoso.com/",
"notificationEmail": [
"someone@example.com"
],
"notificationLanguage": "en-US",
"isSslCheckout": true,
"isBlockAggregator": false,
"storeStatus": {
"status": "Approved"
}
}
Se lo stato è Non approvato, l'oggetto StoreStatus include il message
campo , che indica il motivo per cui l'archivio non è stato approvato. Nell'esempio seguente l'archivio non è stato approvato perché isSslCheckout
è false.
"storeStatus": {
"status": "Disapproved",
"message": "UnSecuredCheckOut"
}
Se la richiesta POST non riesce, il corpo della risposta è un oggetto ErrorResponse . Per un elenco dei possibili codici di errore, vedere Codici di errore.
{
"errors": [
{
"code": "DuplicateStoreNameErr",
"message": "Another store with the specified store name exists; store names must be unique with Microsoft Merchant Center."
},
{
"code": "NotificationLanguageNotSupportedErr",
"message": "The market that you specified in the notificationLanguage field is not valid."
}
]
}
Recupero di un elenco di negozi
Per ottenere un elenco di archivi a cui l'utente ha accesso, usare il modello GET Stores. Se si è un'agenzia, includere le CustomerId
intestazioni e CustomerAccountId
.
curl -H "AuthenticationToken: <access token goes here>" -H "DeveloperToken: <developer token goes here>" https://content.api.ads.microsoft.com/v9.1/bmc/stores
La risposta è un oggetto StoreCollection . Il stores
campo contiene una matrice di oggetti Store .
{
"stores": [
{
"merchantId": 12345,
"storeName": "Alpine Ski House",
"storeUrl": "https://alpineskihouse.com/",
"notificationEmail": [
"someone@alpineskihouse.com"],
"notificationLanguage": "de-De",
"isSslCheckout": true,
"isBlockAggregator": false,
"storeStatus": {
"status": "Approved"
}
},
. . .
{
"merchantId": 67890,
"storeName": "Fabrikam",
"storeUrl": "https://fabrikam.com/",
"notificationEmail": [
"someone@fabrikam.com"],
"notificationLanguage": "en-us",
"isSslCheckout": true,
"isBlockAggregator": false,
"storeStatus": {
"status": "Approved"
}
}
]
}
Recupero di un archivio specifico
Per ottenere un archivio specifico a cui l'utente ha accesso, usare il modello di archivio GET. Se si è un'agenzia, includere le CustomerId
intestazioni e CustomerAccountId
.
curl -H "AuthenticationToken: <access token goes here>" -H "DeveloperToken: <developer token goes here>" https://content.api.ads.microsoft.com/v9.1/bmc/stores/12345
La risposta è un oggetto Store .
{
"merchantId": 12345,
"storeName": "Alpine Ski House",
"storeUrl": "http://www.alpineskihouse.com",
"notificationEmail": [
"someone@alpineskihouse.com"],
"notificationLanguage": "de-DE",
"isSslCheckout": true,
"isBlockAggregator": false,
"storeStatus": {
"status": "Approved"
}
}