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/d6bf25b7-e0a8-4f2d-a31b-97b55cfc774d/transfers/aa2bddb6-9cc8-4949-80fe-a37d5e0a13ba HTTP/1.1
Authorization: Bearer <token>
Accept: application/json
MS-CorrelationId: 4827b753-8541-428b-8c90-059b6b4851bd
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": "817512a1-0689-47a0-bcf2-b3f11ae1fc11",
    "sourcePartnerTenantId": "a94dcde1-ecd7-4ace-d3ef-ef73ba6b8ba5",
    "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/d6bf25b7-e0a8-4f2d-a31b-97b55cfc774d/transfers/aa2bddb6-9cc8-4949-80fe-a37d5e0a13ba HTTP/1.1
Authorization: Bearer <token>
Accept: application/json
MS-CorrelationId: 4827b753-8541-428b-8c90-059b6b4851bd
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": "817512a1-0689-47a0-bcf2-b3f11ae1fc11",
    "sourcePartnerTenantId": "a94dcde1-ecd7-4ace-d3ef-ef73ba6b8ba5",
    "customerName": "ipdbtrans2",
    "lineItems": [{
        "id": 0,
        "subscriptionId": "d0df8837-6db3-49d8-c2b3-1d94bc1ab42d",
        "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: 4827b753-8541-428b-8c90-059b6b4851bd
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-4900-9320-df79e56bed55",
    "partnertenantid": "817512a1-0689-47a0-bcf2-b3f11ae1fc11",
    "sourcePartnerName": "Test_Test_IP4_AG",
    "sourcePartnerTenantId": "a94dcde1-ecd7-4ace-d3ef-ef73ba6b8ba5",
    "targetPartnerName": "Test_Test_DB_AG",
    "targetPartnerTenantId": "817512a1-0689-47a0-bcf2-b3f11ae1fc11",
    "targetPartnerEmailId": "817512a1-0689-47a0-bcf2-b3f11ae1fc11",
    "transferDirection": 1,
    "ignoreEligibilityCheck": false,
    "lastModifiedUser": "7ffdaa28-3b1c-4a61-b580-e1aa6ecf833c",
    "links": {
        "self": {
            "uri": "/customers/a624f7f8-408b-4900-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: 4827b753-8541-428b-8c90-059b6b4851bd
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-4900-9320-df79e56bed55",
    "partnertenantid": "a94dcde1-ecd7-4ace-d3ef-ef73ba6b8ba5",
    "sourcePartnerName": "Test_Test_IP4_AG",
    "sourcePartnerTenantId": "a94dcde1-ecd7-4ace-d3ef-ef73ba6b8ba5",
    "targetPartnerName": "Test_Test_DB_AG",
    "targetPartnerTenantId": "817512a1-0689-47a0-bcf2-b3f11ae1fc11",
    "targetPartnerEmailId": "817512a1-0689-47a0-bcf2-b3f11ae1fc11",
    "transferDirection": 2,
    "ignoreEligibilityCheck": false,
    "lastModifiedUser": "1671774b-679f-4543-a152-1f8b14006c0e",
    "lineItems": [{
        "id": 0,
        "subscriptionId": "d0df8837-6db3-49d8-c2b3-1d94bc1ab42d",
        "billingCycle": "unknown",
        "quantity": 0,
        "productType": 5,
        "status": "InProgress"
    }],
    "links": {
        "self": {
            "uri": "/customers/a624f7f8-408b-4900-9320-df79e56bed55/transfers/43fb1d3a-79fe-45a9-863e-9a4acf17b630",
            "method": "GET",
            "headers": []
        }
    }
}