Update a transfer request for new commerce using Partner Center REST APIs
This article covers how to use the REST API in Partner Center to accept or cancel a transfer request for new commerce license-based or Azure plan items. The example includes REST syntax, headers, and REST responses.
Appropriate roles: Admin agent
Prerequisites
- Credentials as described in Partner Center authentication. This scenario supports authentication with both standalone App and App+User credentials.
- A customer ID (
customer-tenant-id
). If you don't know the customer's ID, you can look it up in Partner Center by selecting the Customers workspace, then the customer from the customer list, then Account. On the customer’s Account page, look for the Microsoft ID in the Customer Account Info section. The Microsoft ID is the same as the customer ID (customer-tenant-id
). - A transfer identifier for an existing transfer.
REST request
Request syntax
Method | Request URI |
---|---|
PATCH | {baseURL}/v1/customers/{customer-id}/transfers/{transfer-id} HTTP/1.1 |
URI parameter
Use the following path parameter to identify the customer and specify the transfer to be accepted.
Name | Type | Required | Description |
---|---|---|---|
customer-id | string | Yes | A GUID formatted customer-ID that identifies the customer |
transfer-id | string | Yes | A GUID formatted transfer-ID that identifies the transfer |
Request headers
For more information, see Partner Center REST headers.
Request example for cancel transfer
A transfer can only be canceled if it's in the pending state. Only the target partner that created the transfer can cancel it.
PATCH /v1/customers/a624f7f8-408b-49B0-9320-df79e56bed55/transfers/43fb1d3a-79fe-45a9-863e-9a4acf17b630 HTTP/1.1
Authorization: Bearer <token>
Accept: application/json
MS-CorrelationId: aaaa0000-bb11-2222-33cc-444444dddddd
MS-RequestId: 8389053b-731c-4261-9899-1583d7859153
X-Locale: en-US
Content-Type: application/json
Host: api.partnercenter.microsoft.com
Content-Length: 0
{
"id": "43fb1d3a-79fe-45a9-863e-9a4acf17b630",
"status": "Cancel",
"targetPartnerTenantId": "aaaabbbb-0000-cccc-1111-dddd2222eeee",
"sourcePartnerTenantId": "bbbbcccc-1111-dddd-2222-eeee3333fff",
"customerName": "ipdbtrans2"
}
Request example for accept transfer
Accepting a transfer includes line items. This table describes the TransferLineItem properties in the request body.
Property | Type | Required | Description |
---|---|---|---|
ID | string | No | A unique identifier for a transfer line item; applied upon successful creation of the transferEntity |
subscriptionID | string | Yes | The subscription identifier |
productType | string | Yes | The type to transfer should be OnlineServicesNCE for license-based subscriptions |
PATCH /v1/customers/a624f7f8-408b-49B0-9320-df79e56bed55/transfers/43fb1d3a-79fe-45a9-863e-9a4acf17b630 HTTP/1.1
Authorization: Bearer <token>
Accept: application/json
MS-CorrelationId: aaaa0000-bb11-2222-33cc-444444dddddd
MS-RequestId: 8389053b-731c-4261-9899-1583d7859153
X-Locale: en-US
Content-Type: application/json
Host: api.partnercenter.microsoft.com
Content-Length: 0
{
"id": "43fb1d3a-79fe-45a9-863e-9a4acf17b630",
"status": "Accept",
"transferType": 3,
"targetPartnerTenantId": "aaaabbbb-0000-cccc-1111-dddd2222eeee",
"sourcePartnerTenantId": "bbbbcccc-1111-dddd-2222-eeee3333fff",
"customerName": "ipdbtrans2",
"lineItems": [{
"id": 0,
"subscriptionId": "aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e",
"productType": "OnlineServicesNCE"
}]
}
REST response for transfer updates
If successful, this method returns the populated TransferSubmitResult resource in the response body.
Response success and error codes
Each response comes with an HTTP status code that indicates success or failure and more debugging information. Use a network trace tool to read this code, error type, and more parameters. For the full list, see Error Codes.
Response example for cancel transfer
HTTP/1.1 200 OK
Content-Length: 3389
Content-Type: application/json; charset=utf-8
MS-CorrelationId: aaaa0000-bb11-2222-33cc-444444dddddd
MS-RequestId: 8389053b-731c-4261-9899-1583d7859153
X-Locale: en-US
Date: Wed, 25 Mar 2020 19:13:06 GMT
{
"id": "43fb1d3a-79fe-45a9-863e-9a4acf17b630",
"status": "Cancel",
"transferType": 3,
"customerEmailId": "",
"createdTime": "2024-04-30T18:31:41.5133355Z",
"lastModifiedTime": "2024-04-30T18:31:41Z",
"expirationTime": "2024-05-31T00:00:00Z",
"customerName": "ipdbtrans2",
"customerTenantId": "a624f7f8-408b-49B0-9320-df79e56bed55",
"partnertenantid": "aaaabbbb-0000-cccc-1111-dddd2222eeee",
"sourcePartnerName": "Test_Test_IP4_AG",
"sourcePartnerTenantId": "aaaabbbb-0000-cccc-1111-dddd2222eeee",
"targetPartnerName": "Test_Test_DB_AG",
"targetPartnerTenantId": "aaaabbbb-0000-cccc-1111-dddd2222eeee",
"targetPartnerEmailId": "aaaabbbb-0000-cccc-1111-dddd2222eeee",
"transferDirection": 1,
"ignoreEligibilityCheck": false,
"lastModifiedUser": "7ffdaa28-3b1c-4a61-b580-e1aa6ecf833c",
"links": {
"self": {
"uri": "/customers/a624f7f8-408b-49B0-9320-df79e56bed55/transfers/43fb1d3a-79fe-45a9-863e-9a4acf17b630",
"method": "GET",
"headers": []
}
}
}
Response example for accept transfer
HTTP/1.1 200 OK
Content-Length: 3389
Content-Type: application/json; charset=utf-8
MS-CorrelationId: aaaa0000-bb11-2222-33cc-444444dddddd
MS-RequestId: 8389053b-731c-4261-9899-1583d7859153
X-Locale: en-US
Date: Wed, 25 Mar 2020 19:13:06 GMT
{
"id": "43fb1d3a-79fe-45a9-863e-9a4acf17b630",
"status": "InProgress",
"transferType": 3,
"customerEmailId": "",
"createdTime": "2024-04-30T18:31:41.5133355Z",
"lastModifiedTime": "2024-05-01T00:51:55Z",
"expirationTime": "2024-05-31T00:00:00Z",
"customerName": "ipdbtrans2",
"customerTenantId": "a624f7f8-408b-49B0-9320-df79e56bed55",
"partnertenantid": "aaaabbbb-0000-cccc-1111-dddd2222eeee",
"sourcePartnerName": "Test_Test_IP4_AG",
"sourcePartnerTenantId": "aaaabbbb-0000-cccc-1111-dddd2222eeee",
"targetPartnerName": "Test_Test_DB_AG",
"targetPartnerTenantId": "aaaabbbb-0000-cccc-1111-dddd2222eeee",
"targetPartnerEmailId": "aaaabbbb-0000-cccc-1111-dddd2222eeee",
"transferDirection": 2,
"ignoreEligibilityCheck": false,
"lastModifiedUser": "1671774b-679f-4543-a152-1f8b14006c0e",
"lineItems": [{
"id": 0,
"subscriptionId": "aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e",
"billingCycle": "unknown",
"quantity": 0,
"productType": 5,
"status": "InProgress"
}],
"links": {
"self": {
"uri": "/customers/a624f7f8-408b-49B0-9320-df79e56bed55/transfers/43fb1d3a-79fe-45a9-863e-9a4acf17b630",
"method": "GET",
"headers": []
}
}
}