|
| 1 | +--- |
| 2 | +title: Migrate from EA Marketplace Store Charge API |
| 3 | +titleSuffix: Microsoft Cost Management |
| 4 | +description: This article has information to help you migrate from the EA Marketplace Store Charge API. |
| 5 | +author: bandersmsft |
| 6 | +ms.author: banders |
| 7 | +ms.date: 01/31/2024 |
| 8 | +ms.topic: conceptual |
| 9 | +ms.service: cost-management-billing |
| 10 | +ms.subservice: cost-management |
| 11 | +ms.reviewer: maminn |
| 12 | +--- |
| 13 | + |
| 14 | +# Migrate from EA Marketplace Store Charge API |
| 15 | + |
| 16 | +EA customers who were previously using the Enterprise Reporting consumption.azure.com API to [get their marketplace store charges](/rest/api/billing/enterprise/billing-enterprise-api-marketplace-storecharge) need to migrate to a replacement Azure Resource Manager API. This article helps you migrate by using the following instructions. It also explains the contract differences between the old API and the new API. |
| 17 | + |
| 18 | +Endpoints to migrate off: |
| 19 | + |
| 20 | +|Endpoint|API Comments| |
| 21 | +|---|---| |
| 22 | +| `/v3/enrollments/{enrollmentNumber}/marketplacecharges` | • API method: GET <br><br> • Synchronous (non polling) <br><br> • Data format: JSON | |
| 23 | +| `/v3/enrollments/{enrollmentNumber}/billingPeriods/{billingPeriod}/marketplacecharges` | • API method: GET <br><br> • Synchronous (non polling) <br><br> • Data format: JSON | |
| 24 | +| `/v3/enrollments/{enrollmentNumber}/marketplacechargesbycustomdate?startTime=2017-01-01&endTime=2017-01-10` | • API method: GET <br><br> • Synchronous (non polling) <br><br> • Data format: JSON | |
| 25 | + |
| 26 | +## Assign permissions to an SPN to call the API |
| 27 | + |
| 28 | +Before calling the API, you need to configure a service principal with the correct permission. You use the service principal to call the API. For more information, see [Assign permissions to ACM APIs](cost-management-api-permissions.md). |
| 29 | + |
| 30 | +### Call the Marketplaces API |
| 31 | + |
| 32 | +Use the following request URIs when calling the new Marketplaces API. All Azure and Marketplace charges are merged into a single file that is available through the new solutions. You can identify which charges are *Azure* versus *Marketplace* charges by using the `PublisherType` field that is available in the new dataset. |
| 33 | + |
| 34 | +Your enrollment number should be used as the `billingAccountId`. |
| 35 | + |
| 36 | +#### Supported requests |
| 37 | + |
| 38 | +You can call the API using the following scopes: |
| 39 | + |
| 40 | +- Department: `/providers/Microsoft.Billing/departments/{departmentId}` |
| 41 | +- Enrollment: `/providers/Microsoft.Billing/billingAccounts/{billingAccountId}` |
| 42 | +- EnrollmentAccount: `/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}` |
| 43 | +- Management Group: `/providers/Microsoft.Management/managementGroups/{managementGroupId}` |
| 44 | +- Subscription: `/subscriptions/{subscriptionId}/` |
| 45 | + |
| 46 | +For subscription, billing account, department, enrollment account, and management group scopes you can also add a billing period to the scope using `/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}`. For example, to specify a billing period at the department scope, use `/providers/Microsoft.Billing/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}`. |
| 47 | + |
| 48 | +[List Marketplaces](/rest/api/consumption/marketplaces/list#marketplaceslistresult) |
| 49 | + |
| 50 | +```http |
| 51 | +GET https://management.azure.com/{scope}/providers/Microsoft.Consumption/marketplaces |
| 52 | +``` |
| 53 | + |
| 54 | +With optional parameters: |
| 55 | + |
| 56 | +```http |
| 57 | +https://management.azure.com/{scope}/providers/Microsoft.Consumption/marketplaces?$filter={$filter}&$top={$top}&$skiptoken={$skiptoken} |
| 58 | +``` |
| 59 | + |
| 60 | +#### Response body changes |
| 61 | + |
| 62 | +Old response: |
| 63 | + |
| 64 | + |
| 65 | +```json |
| 66 | +[ |
| 67 | + { |
| 68 | + "id": "id", |
| 69 | + "subscriptionGuid": "00000000-0000-0000-0000-000000000000", |
| 70 | + "subscriptionName": "subName", |
| 71 | + "meterId": "2core", |
| 72 | + "usageStartDate": "2015-09-17T00:00:00Z", |
| 73 | + "usageEndDate": "2015-09-17T23:59:59Z", |
| 74 | + "offerName": "Virtual LoadMaster™ (VLM) for Azure", |
| 75 | + "resourceGroup": "Res group", |
| 76 | + "instanceId": "id", |
| 77 | + "additionalInfo": "{\"ImageType\":null,\"ServiceType\":\"Medium\"}", |
| 78 | + "tags": "", |
| 79 | + "orderNumber": "order", |
| 80 | + "unitOfMeasure": "", |
| 81 | + "costCenter": "100", |
| 82 | + "accountId": 100, |
| 83 | + "accountName": "Account Name", |
| 84 | + "accountOwnerId": "[email protected]", |
| 85 | + "departmentId": 101, |
| 86 | + "departmentName": "Department 1", |
| 87 | + "publisherName": "Publisher 1", |
| 88 | + "planName": "Plan name", |
| 89 | + "consumedQuantity": 1.15, |
| 90 | + "resourceRate": 0.1, |
| 91 | + "extendedCost": 1.11, |
| 92 | + "isRecurringCharge": "False" |
| 93 | + }, |
| 94 | + ... |
| 95 | + ] |
| 96 | +``` |
| 97 | + |
| 98 | +New response: |
| 99 | + |
| 100 | +```json |
| 101 | + { |
| 102 | + "id": "/subscriptions/subid/providers/Microsoft.Billing/billingPeriods/201702/providers/Microsoft.Consumption/marketPlaces/marketplacesId1", |
| 103 | + "name": "marketplacesId1", |
| 104 | + "type": "Microsoft.Consumption/marketPlaces", |
| 105 | + "tags": { |
| 106 | + "env": "newcrp", |
| 107 | + "dev": "tools" |
| 108 | + }, |
| 109 | + "properties": { |
| 110 | + "accountName": "Account1", |
| 111 | + "additionalProperties": "additionalProperties", |
| 112 | + "costCenter": "Center1", |
| 113 | + "departmentName": "Department1", |
| 114 | + "billingPeriodId": "/subscriptions/subid/providers/Microsoft.Billing/billingPeriods/201702", |
| 115 | + "usageStart": "2017-02-13T00:00:00Z", |
| 116 | + "usageEnd": "2017-02-13T23:59:59Z", |
| 117 | + "instanceName": "shared1", |
| 118 | + "instanceId": "/subscriptions/subid/resourceGroups/Default-Web-eastasia/providers/Microsoft.Web/sites/shared1", |
| 119 | + "currency": "USD", |
| 120 | + "consumedQuantity": 0.00328, |
| 121 | + "pretaxCost": 0.67, |
| 122 | + "isEstimated": false, |
| 123 | + "meterId": "00000000-0000-0000-0000-000000000000", |
| 124 | + "offerName": "offer1", |
| 125 | + "resourceGroup": "TEST", |
| 126 | + "orderNumber": "00000000-0000-0000-0000-000000000000", |
| 127 | + "publisherName": "xyz", |
| 128 | + "planName": "plan2", |
| 129 | + "resourceRate": 0.24, |
| 130 | + "subscriptionGuid": "00000000-0000-0000-0000-000000000000", |
| 131 | + "subscriptionName": "azure subscription", |
| 132 | + "unitOfMeasure": "10 Hours", |
| 133 | + "isRecurringCharge": false |
| 134 | + } |
| 135 | + } |
| 136 | + |
| 137 | +``` |
| 138 | + |
| 139 | +## Next steps |
| 140 | + |
| 141 | +- Read the [Migrate from Azure Enterprise Reporting to Microsoft Cost Management APIs overview](migrate-ea-reporting-arm-apis-overview.md) article. |
0 commit comments