Подписки
В этом разделе
В этом разделе приведены примеры для:
- Получение всех подписок
- Получение подписки
- Обновление понятного имени
- Обновите идентификатор партнера советника
- Добавление приостановки
- Удаление приостановки
- Источники
- Цели
Примеры
Get all subscriptions
Вы можете просмотреть все подписки, которые принадлежат клиенту.
Пример запроса
GET https : //api.cp.microsoft.com/d51a0512-02a2-4363-8184-ef4b470568db/subscriptions?recipient_customer_id=5f0c5985-e502-439d-be26-efdee6212c6f HTTP/1.1
Accept : application / json
api - version : 2015 - 03 - 31
Authorization : Bearer < SA_Token >
x - ms - correlation - id : 78c452f2 - fc2f - 4c77 - 89c8 - c5d55df23142
x - ms - tracking - id : 983005f4 - 672f - 4acf - ad81 - 07d19550d7da
Пример ответа
HTTP / 1.1 200 OK
api - version : 2015 - 03 - 31
Cache - Control : no - cache
Date : Sat, 21 Mar 2015 04 : 13 : 26 GMT
Pragma : no - cache
Server : Microsoft - IIS / 7.5
Strict - Transport - Security : max - age = 15724800;
includeSubDomains
X - AspNet - Version : 4.0.30319
x - ms - correlation - id : 78c452f2 - fc2f - 4c77 - 89c8 - c5d55df23142
x - ms - session - id : 211c537e - e665 - 4596 - a95a - c520a298b473
X - Server : BLUOS3OMSORDW02
{
"object_type" : "Subscriptions",
"contract_version" : "1.1",
"items" : [{
"id" : "997c9748-fbfe-4000-80b6-040041cfca30",
"order_id" : "9806c28c-634c-4bfd-a016-519ee25cb778",
"creation_date" : "2015-03-21T00:00:00Z",
"effective_start_date" : "2015-03-21T00:00:00Z",
"commitment_end_date" : "2016-04-09T00:00:00Z",
"quantity" : 815,
"state" : "Active",
"etag" : "eyJpZCI6Ijk5N2M5NzQ4LWZiZmUtNDAwMC04MGI2LTA0MDA0MWNmY2EzMCIsInZlcnNpb24iOjF9",
"suspension_reasons" : [],
"offer_uri" : "/3c95518e-8c37-41e3-9627-0ca339200f53/offers/195416C1-3447-423A-B37B-EE59A99A19C4",
"object_type" : "Subscription",
"contract_version" : "1.1",
"links" : {
"self" : {
"href" : "/d51a0512-02a2-4363-8184-ef4b470568db/Subscriptions/997c9748-fbfe-4000-80b6-040041cfca30?recipient_customer_id=5f0c5985-e502-439d-be26-efdee6212c6f",
"method" : "GET"
},
"order" : {
"href" : "/d51a0512-02a2-4363-8184-ef4b470568db/Orders/9806c28c-634c-4bfd-a016-519ee25cb778?recipient_customer_id=5f0c5985-e502-439d-be26-efdee6212c6f",
"method" : "GET"
},
"offer" : {
"href" : "/3c95518e-8c37-41e3-9627-0ca339200f53/offers/195416C1-3447-423A-B37B-EE59A99A19C4",
"method" : "GET"
},
"update_friendly_name" : {
"href" : "/d51a0512-02a2-4363-8184-ef4b470568db/Subscriptions/997c9748-fbfe-4000-80b6-040041cfca30/update-friendly-name?recipient_customer_id=5f0c5985-e502-439d-be26-efdee6212c6f",
"method" : "POST"
},
"transition_sources" : {
"href" : "/d51a0512-02a2-4363-8184-ef4b470568db/Subscriptions/997c9748-fbfe-4000-80b6-040041cfca30/sources?recipient_customer_id=5f0c5985-e502-439d-be26-efdee6212c6f",
"method" : "GET"
},
"transition_targets" : {
"href" : "/d51a0512-02a2-4363-8184-ef4b470568db/Subscriptions/997c9748-fbfe-4000-80b6-040041cfca30/targets?recipient_customer_id=5f0c5985-e502-439d-be26-efdee6212c6f",
"method" : "GET"
},
"add_suspension" : {
"href" : "/d51a0512-02a2-4363-8184-ef4b470568db/Subscriptions/997c9748-fbfe-4000-80b6-040041cfca30/add-suspension?recipient_customer_id=5f0c5985-e502-439d-be26-efdee6212c6f",
"method" : "POST"
},
"remove_suspension" : {
"href" : "/d51a0512-02a2-4363-8184-ef4b470568db/Subscriptions/997c9748-fbfe-4000-80b6-040041cfca30/remove-suspension?recipient_customer_id=5f0c5985-e502-439d-be26-efdee6212c6f",
"method" : "POST"
},
"update_advisor_partner_id" : {
"href" : "/d51a0512-02a2-4363-8184-ef4b470568db/Subscriptions/997c9748-fbfe-4000-80b6-040041cfca30/update-advisor-partner-id?recipient_customer_id=5f0c5985-e502-439d-be26-efdee6212c6f",
"method" : "POST"
},
"entitlement" : {
"href" : "/5f0c5985-e502-439d-be26-efdee6212c6f/Entitlements/997c9748-fbfe-4000-80b6-040041cfca30",
"method" : "GET"
}
}
}, {
"id" : "86b70f6d-8c96-4b7d-93ac-38ce27172761",
"order_id" : "9806c28c-634c-4bfd-a016-519ee25cb778",
"creation_date" : "2015-03-21T00:00:00Z",
"effective_start_date" : "2015-03-21T00:00:00Z",
"commitment_end_date" : "2016-04-09T00:00:00Z",
"quantity" : 729,
"state" : "Active",
"etag" : "eyJpZCI6Ijg2YjcwZjZkLThjOTYtNGI3ZC05M2FjLTM4Y2UyNzE3Mjc2MSIsInZlcnNpb24iOjF9",
"suspension_reasons" : [],
"offer_uri" : "/3c95518e-8c37-41e3-9627-0ca339200f53/offers/ACA0C06C-890D-4ABB-83CF-BC519A2565E5",
"object_type" : "Subscription",
"contract_version" : "1.1",
"links" : {
"self" : {
"href" : "/d51a0512-02a2-4363-8184-ef4b470568db/Subscriptions/86b70f6d-8c96-4b7d-93ac-38ce27172761?recipient_customer_id=5f0c5985-e502-439d-be26-efdee6212c6f",
"method" : "GET"
},
"order" : {
"href" : "/d51a0512-02a2-4363-8184-ef4b470568db/Orders/9806c28c-634c-4bfd-a016-519ee25cb778?recipient_customer_id=5f0c5985-e502-439d-be26-efdee6212c6f",
"method" : "GET"
},
"offer" : {
"href" : "/3c95518e-8c37-41e3-9627-0ca339200f53/offers/ACA0C06C-890D-4ABB-83CF-BC519A2565E5",
"method" : "GET"
},
"update_friendly_name" : {
"href" : "/d51a0512-02a2-4363-8184-ef4b470568db/Subscriptions/86b70f6d-8c96-4b7d-93ac-38ce27172761/update-friendly-name?recipient_customer_id=5f0c5985-e502-439d-be26-efdee6212c6f",
"method" : "POST"
},
"transition_sources" : {
"href" : "/d51a0512-02a2-4363-8184-ef4b470568db/Subscriptions/86b70f6d-8c96-4b7d-93ac-38ce27172761/sources?recipient_customer_id=5f0c5985-e502-439d-be26-efdee6212c6f",
"method" : "GET"
},
"transition_targets" : {
"href" : "/d51a0512-02a2-4363-8184-ef4b470568db/Subscriptions/86b70f6d-8c96-4b7d-93ac-38ce27172761/targets?recipient_customer_id=5f0c5985-e502-439d-be26-efdee6212c6f",
"method" : "GET"
},
"add_suspension" : {
"href" : "/d51a0512-02a2-4363-8184-ef4b470568db/Subscriptions/86b70f6d-8c96-4b7d-93ac-38ce27172761/add-suspension?recipient_customer_id=5f0c5985-e502-439d-be26-efdee6212c6f",
"method" : "POST"
},
"remove_suspension" : {
"href" : "/d51a0512-02a2-4363-8184-ef4b470568db/Subscriptions/86b70f6d-8c96-4b7d-93ac-38ce27172761/remove-suspension?recipient_customer_id=5f0c5985-e502-439d-be26-efdee6212c6f",
"method" : "POST"
},
"update_advisor_partner_id" : {
"href" : "/d51a0512-02a2-4363-8184-ef4b470568db/Subscriptions/86b70f6d-8c96-4b7d-93ac-38ce27172761/update-advisor-partner-id?recipient_customer_id=5f0c5985-e502-439d-be26-efdee6212c6f",
"method" : "POST"
},
"entitlement" : {
"href" : "/5f0c5985-e502-439d-be26-efdee6212c6f/Entitlements/86b70f6d-8c96-4b7d-93ac-38ce27172761",
"method" : "GET"
}
}
}
],
"total_count" : 2,
"links" : {
"self" : {
"href" : "/d51a0512-02a2-4363-8184-ef4b470568db/subscriptions?recipient_customer_id=5f0c5985-e502-439d-be26-efdee6212c6f",
"method" : "GET"
}
}
}
Get a subscription
Получает конкретную подписку, которой предоставлен идентификатор подписки.
Пример запроса
GET https : //api.cp.microsoft.com/d51a0512-02a2-4363-8184-ef4b470568db/subscriptions/997c9748-fbfe-4000-80b6-040041cfca30 HTTP/1.1
Accept : application / json
api - version : 2015 - 03 - 31
Authorization : Bearer < SA_Token >
x - ms - correlation - id : 35bc4c7d - ca9d - 4cd5 - 9dfc - 2b881c4cc669
x - ms - tracking - id : 8ad7f03e - f187 - 42b7 - 9be9 - 70326a778acb
Пример ответа
HTTP / 1.1 200 OK
api - version : 2015 - 03 - 31
Cache - Control : no - cache
Date : Sat, 21 Mar 2015 04 : 13 : 37 GMT
Pragma : no - cache
Server : Microsoft - IIS / 7.5
Strict - Transport - Security : max - age = 15724800;
includeSubDomains
X - AspNet - Version : 4.0.30319
x - ms - correlation - id : 35bc4c7d - ca9d - 4cd5 - 9dfc - 2b881c4cc669
x - ms - session - id : 319e9926 - e4e2 - 4907 - 97a7 - 50866fc0dc60
X - Server : BLUOS3OMSORDW02
{
"id" : "997c9748-fbfe-4000-80b6-040041cfca30",
"order_id" : "9806c28c-634c-4bfd-a016-519ee25cb778",
"creation_date" : "2015-03-21T00:00:00Z",
"effective_start_date" : "2015-03-21T00:00:00Z",
"commitment_end_date" : "2016-04-09T00:00:00Z",
"quantity" : 815,
"state" : "Active",
"etag" : "eyJpZCI6Ijk5N2M5NzQ4LWZiZmUtNDAwMC04MGI2LTA0MDA0MWNmY2EzMCIsInZlcnNpb24iOjF9",
"suspension_reasons" : [],
"offer_uri" : "/3c95518e-8c37-41e3-9627-0ca339200f53/offers/195416C1-3447-423A-B37B-EE59A99A19C4",
"object_type" : "Subscription",
"contract_version" : "1.1",
"links" : {
"self" : {
"href" : "/d51a0512-02a2-4363-8184-ef4b470568db/Subscriptions/997c9748-fbfe-4000-80b6-040041cfca30?recipient_customer_id=5f0c5985-e502-439d-be26-efdee6212c6f",
"method" : "GET"
},
"order" : {
"href" : "/d51a0512-02a2-4363-8184-ef4b470568db/Orders/9806c28c-634c-4bfd-a016-519ee25cb778?recipient_customer_id=5f0c5985-e502-439d-be26-efdee6212c6f",
"method" : "GET"
},
"offer" : {
"href" : "/3c95518e-8c37-41e3-9627-0ca339200f53/offers/195416C1-3447-423A-B37B-EE59A99A19C4",
"method" : "GET"
},
"update_friendly_name" : {
"href" : "/d51a0512-02a2-4363-8184-ef4b470568db/Subscriptions/997c9748-fbfe-4000-80b6-040041cfca30/update-friendly-name?recipient_customer_id=5f0c5985-e502-439d-be26-efdee6212c6f",
"method" : "POST"
},
"transition_sources" : {
"href" : "/d51a0512-02a2-4363-8184-ef4b470568db/Subscriptions/997c9748-fbfe-4000-80b6-040041cfca30/sources?recipient_customer_id=5f0c5985-e502-439d-be26-efdee6212c6f",
"method" : "GET"
},
"transition_targets" : {
"href" : "/d51a0512-02a2-4363-8184-ef4b470568db/Subscriptions/997c9748-fbfe-4000-80b6-040041cfca30/targets?recipient_customer_id=5f0c5985-e502-439d-be26-efdee6212c6f",
"method" : "GET"
},
"add_suspension" : {
"href" : "/d51a0512-02a2-4363-8184-ef4b470568db/Subscriptions/997c9748-fbfe-4000-80b6-040041cfca30/add-suspension?recipient_customer_id=5f0c5985-e502-439d-be26-efdee6212c6f",
"method" : "POST"
},
"remove_suspension" : {
"href" : "/d51a0512-02a2-4363-8184-ef4b470568db/Subscriptions/997c9748-fbfe-4000-80b6-040041cfca30/remove-suspension?recipient_customer_id=5f0c5985-e502-439d-be26-efdee6212c6f",
"method" : "POST"
},
"update_advisor_partner_id" : {
"href" : "/d51a0512-02a2-4363-8184-ef4b470568db/Subscriptions/997c9748-fbfe-4000-80b6-040041cfca30/update-advisor-partner-id?recipient_customer_id=5f0c5985-e502-439d-be26-efdee6212c6f",
"method" : "POST"
},
"entitlement" : {
"href" : "/5f0c5985-e502-439d-be26-efdee6212c6f/Entitlements/997c9748-fbfe-4000-80b6-040041cfca30",
"method" : "GET"
}
}
}
Update friendly name
Обновляет понятное имя.
Пример запроса
POST https : //api.cp.microsoft.com/d51a0512-02a2-4363-8184-ef4b470568db/subscriptions/ef947115-efc7-4558-b2d0-75a72bf183db/update-friendly-name HTTP/1.1
Accept : application / json
api - version : 2015 - 03 - 31
Authorization : Bearer < SA_Token >
If - Match : "eyJpZCI6ImVmOTQ3MTE1LWVmYzctNDU1OC1iMmQwLTc1YTcyYmYxODNkYiIsInZlcnNpb24iOjN9"
x - ms - correlation - id : 98218fc3 - 6fa1 - 41a4 - aafa - 9b02257f9f63
x - ms - tracking - id : 38f1f9bd - e345 - 4bdd - ac76 - 753934690c73
{
"friendly_name" : "a1690eef-99d3-433a-80a9-d22e0700fd53"
}
Пример ответа
HTTP / 1.1 200 OK
api - version : 2015 - 03 - 31
Cache - Control : no - cache
Date : Sat, 21 Mar 2015 03 : 50 : 16 GMT
Pragma : no - cache
Server : Microsoft - IIS / 7.5
Strict - Transport - Security : max - age = 15724800;
includeSubDomains
X - AspNet - Version : 4.0.30319
x - ms - correlation - id : 98218fc3 - 6fa1 - 41a4 - aafa - 9b02257f9f63
x - ms - session - id : 593f75f6 - f8a0 - 4706 - b67e - 93a3eb129255
X - Server : BLUOS3OMSORDW01
{
"id" : "ef947115-efc7-4558-b2d0-75a72bf183db",
"order_id" : "843dc548-0564-4457-a4e4-ecc15a0e6b11",
"creation_date" : "2015-03-21T00:00:00Z",
"effective_start_date" : "2015-03-21T00:00:00Z",
"commitment_end_date" : "2016-04-09T00:00:00Z",
"quantity" : 875,
"state" : "Active",
"friendly_name" : "a1690eef-99d3-433a-80a9-d22e0700fd53",
"etag" : "eyJpZCI6ImVmOTQ3MTE1LWVmYzctNDU1OC1iMmQwLTc1YTcyYmYxODNkYiIsInZlcnNpb24iOjR9",
"suspension_reasons" : [],
"offer_uri" : "/3c95518e-8c37-41e3-9627-0ca339200f53/offers/195416C1-3447-423A-B37B-EE59A99A19C4",
"object_type" : "Subscription",
"contract_version" : "1.1",
"links" : {
"self" : {
"href" : "/d51a0512-02a2-4363-8184-ef4b470568db/Subscriptions/ef947115-efc7-4558-b2d0-75a72bf183db?recipient_customer_id=1bbbe60b-e174-4a4c-8e5a-ed9f09e02010",
"method" : "GET"
},
"order" : {
"href" : "/d51a0512-02a2-4363-8184-ef4b470568db/Orders/843dc548-0564-4457-a4e4-ecc15a0e6b11?recipient_customer_id=1bbbe60b-e174-4a4c-8e5a-ed9f09e02010",
"method" : "GET"
},
"offer" : {
"href" : "/3c95518e-8c37-41e3-9627-0ca339200f53/offers/195416C1-3447-423A-B37B-EE59A99A19C4",
"method" : "GET"
},
"update_friendly_name" : {
"href" : "/d51a0512-02a2-4363-8184-ef4b470568db/Subscriptions/ef947115-efc7-4558-b2d0-75a72bf183db/update-friendly-name?recipient_customer_id=1bbbe60b-e174-4a4c-8e5a-ed9f09e02010",
"method" : "POST"
},
"transition_sources" : {
"href" : "/d51a0512-02a2-4363-8184-ef4b470568db/Subscriptions/ef947115-efc7-4558-b2d0-75a72bf183db/sources?recipient_customer_id=1bbbe60b-e174-4a4c-8e5a-ed9f09e02010",
"method" : "GET"
},
"transition_targets" : {
"href" : "/d51a0512-02a2-4363-8184-ef4b470568db/Subscriptions/ef947115-efc7-4558-b2d0-75a72bf183db/targets?recipient_customer_id=1bbbe60b-e174-4a4c-8e5a-ed9f09e02010",
"method" : "GET"
},
"add_suspension" : {
"href" : "/d51a0512-02a2-4363-8184-ef4b470568db/Subscriptions/ef947115-efc7-4558-b2d0-75a72bf183db/add-suspension?recipient_customer_id=1bbbe60b-e174-4a4c-8e5a-ed9f09e02010",
"method" : "POST"
},
"remove_suspension" : {
"href" : "/d51a0512-02a2-4363-8184-ef4b470568db/Subscriptions/ef947115-efc7-4558-b2d0-75a72bf183db/remove-suspension?recipient_customer_id=1bbbe60b-e174-4a4c-8e5a-ed9f09e02010",
"method" : "POST"
},
"update_advisor_partner_id" : {
"href" : "/d51a0512-02a2-4363-8184-ef4b470568db/Subscriptions/ef947115-efc7-4558-b2d0-75a72bf183db/update-advisor-partner-id?recipient_customer_id=1bbbe60b-e174-4a4c-8e5a-ed9f09e02010",
"method" : "POST"
},
"entitlement" : {
"href" : "/1bbbe60b-e174-4a4c-8e5a-ed9f09e02010/Entitlements/ef947115-efc7-4558-b2d0-75a72bf183db",
"method" : "GET"
}
}
}
Update advisor partner ID
Когда торговый посредник 2-го уровня создает заказ в системах партнеров CSP, партнер CSP должен заполнить поле "идентификатор_партнера_советника" идентификатором MPN торгового посредника 2-го уровня, чтобы добавить его в подписку. Чтобы обновить идентификатор партнера советника, можете создать этот запрос.
Пример запроса
POST https : //api.cp.microsoft.com/d51a0512-02a2-4363-8184-ef4b470568db/subscriptions/ef947115-efc7-4558-b2d0-75a72bf183db/update-advisor-partner-id HTTP/1.1
Accept : application / json
api - version : 2015 - 03 - 31
Authorization : Bearer < SA_Token >
If - Match : "eyJpZCI6ImVmOTQ3MTE1LWVmYzctNDU1OC1iMmQwLTc1YTcyYmYxODNkYiIsInZlcnNpb24iOjR9"
x - ms - correlation - id : e1a4c86a - 367e-41c0 - 84fe - a3e303762a8e
x - ms - tracking - id : 1929c181 - a5ac - 497f - 97c8 - 868a0df9c6b2
{
"advisor_partner_id" : "4224837"
}
Пример ответа
HTTP / 1.1 200 OK
api - version : 2015 - 03 - 31
Cache - Control : no - cache
Date : Sat, 21 Mar 2015 03 : 50 : 17 GMT
Pragma : no - cache
Server : Microsoft - IIS / 7.5
Strict - Transport - Security : max - age = 15724800;
includeSubDomains
X - AspNet - Version : 4.0.30319
x - ms - correlation - id : e1a4c86a - 367e-41c0 - 84fe - a3e303762a8e
x - ms - session - id : 88e5bd09 - 153c - 4232 - 9bae - af7eca011fdf
X - Server : BLUOS3OMSORDW01
{
"id" : "ef947115-efc7-4558-b2d0-75a72bf183db",
"order_id" : "843dc548-0564-4457-a4e4-ecc15a0e6b11",
"creation_date" : "2015-03-21T00:00:00Z",
"effective_start_date" : "2015-03-21T00:00:00Z",
"commitment_end_date" : "2016-04-09T00:00:00Z",
"quantity" : 875,
"state" : "Active",
"friendly_name" : "a1690eef-99d3-433a-80a9-d22e0700fd53",
"etag" : "eyJpZCI6ImVmOTQ3MTE1LWVmYzctNDU1OC1iMmQwLTc1YTcyYmYxODNkYiIsInZlcnNpb24iOjV9",
"suspension_reasons" : [],
"advisor_partner_id" : "4224837",
"offer_uri" : "/3c95518e-8c37-41e3-9627-0ca339200f53/offers/195416C1-3447-423A-B37B-EE59A99A19C4",
"object_type" : "Subscription",
"contract_version" : "1.1",
"links" : {
"self" : {
"href" : "/d51a0512-02a2-4363-8184-ef4b470568db/Subscriptions/ef947115-efc7-4558-b2d0-75a72bf183db?recipient_customer_id=1bbbe60b-e174-4a4c-8e5a-ed9f09e02010",
"method" : "GET"
},
"order" : {
"href" : "/d51a0512-02a2-4363-8184-ef4b470568db/Orders/843dc548-0564-4457-a4e4-ecc15a0e6b11?recipient_customer_id=1bbbe60b-e174-4a4c-8e5a-ed9f09e02010",
"method" : "GET"
},
"offer" : {
"href" : "/3c95518e-8c37-41e3-9627-0ca339200f53/offers/195416C1-3447-423A-B37B-EE59A99A19C4",
"method" : "GET"
},
"update_friendly_name" : {
"href" : "/d51a0512-02a2-4363-8184-ef4b470568db/Subscriptions/ef947115-efc7-4558-b2d0-75a72bf183db/update-friendly-name?recipient_customer_id=1bbbe60b-e174-4a4c-8e5a-ed9f09e02010",
"method" : "POST"
},
"transition_sources" : {
"href" : "/d51a0512-02a2-4363-8184-ef4b470568db/Subscriptions/ef947115-efc7-4558-b2d0-75a72bf183db/sources?recipient_customer_id=1bbbe60b-e174-4a4c-8e5a-ed9f09e02010",
"method" : "GET"
},
"transition_targets" : {
"href" : "/d51a0512-02a2-4363-8184-ef4b470568db/Subscriptions/ef947115-efc7-4558-b2d0-75a72bf183db/targets?recipient_customer_id=1bbbe60b-e174-4a4c-8e5a-ed9f09e02010",
"method" : "GET"
},
"add_suspension" : {
"href" : "/d51a0512-02a2-4363-8184-ef4b470568db/Subscriptions/ef947115-efc7-4558-b2d0-75a72bf183db/add-suspension?recipient_customer_id=1bbbe60b-e174-4a4c-8e5a-ed9f09e02010",
"method" : "POST"
},
"remove_suspension" : {
"href" : "/d51a0512-02a2-4363-8184-ef4b470568db/Subscriptions/ef947115-efc7-4558-b2d0-75a72bf183db/remove-suspension?recipient_customer_id=1bbbe60b-e174-4a4c-8e5a-ed9f09e02010",
"method" : "POST"
},
"update_advisor_partner_id" : {
"href" : "/d51a0512-02a2-4363-8184-ef4b470568db/Subscriptions/ef947115-efc7-4558-b2d0-75a72bf183db/update-advisor-partner-id?recipient_customer_id=1bbbe60b-e174-4a4c-8e5a-ed9f09e02010",
"method" : "POST"
},
"entitlement" : {
"href" : "/1bbbe60b-e174-4a4c-8e5a-ed9f09e02010/Entitlements/ef947115-efc7-4558-b2d0-75a72bf183db",
"method" : "GET"
}
}
}
Add suspension
Торговые посредники могут добавлять только приостановку с ее причиной "Отмена_клиентом". Подписка не может быть в состоянии "Другое".
Пример запроса
POST https : //api.cp.microsoft.com/d51a0512-02a2-4363-8184-ef4b470568db/subscriptions/ef947115-efc7-4558-b2d0-75a72bf183db/add-suspension HTTP/1.1
Accept : application / json
api - version : 2015 - 03 - 31
Authorization : Bearer < SA_Token >
x - ms - correlation - id : 16c920f6 - 6143 - 4349 - b831 - bab26ed99414
x - ms - tracking - id : 8df36bbf - 77a5 - 4d93 - 98dd - 9b1d65eb6953
{
"suspension_reason" : "CustomerCancellation",
"suspension_reason_comment" : "Customer wanted to cancel"
}
Пример ответа
HTTP / 1.1 200 OK
api - version : 2015 - 03 - 31
Cache - Control : no - cache
Date : Sat, 21 Mar 2015 03 : 50 : 13 GMT
Pragma : no - cache
Server : Microsoft - IIS / 7.5
Strict - Transport - Security : max - age = 15724800;
includeSubDomains
X - AspNet - Version : 4.0.30319
x - ms - correlation - id : 16c920f6 - 6143 - 4349 - b831 - bab26ed99414
x - ms - session - id : d1d7556a - bd5c - 4616 - a6b1 - 8c1a3b1dfec9
X - Server : BLUOS3OMSORDW01
{
"id" : "ef947115-efc7-4558-b2d0-75a72bf183db",
"order_id" : "843dc548-0564-4457-a4e4-ecc15a0e6b11",
"creation_date" : "2015-03-21T00:00:00Z",
"effective_start_date" : "2015-03-21T00:00:00Z",
"commitment_end_date" : "2016-04-09T00:00:00Z",
"quantity" : 875,
"state" : "Suspended",
"etag" : "eyJpZCI6ImVmOTQ3MTE1LWVmYzctNDU1OC1iMmQwLTc1YTcyYmYxODNkYiIsInZlcnNpb24iOjJ9",
"suspension_reasons" : ["CustomerCancellation"],
"offer_uri" : "/3c95518e-8c37-41e3-9627-0ca339200f53/offers/195416C1-3447-423A-B37B-EE59A99A19C4",
"object_type" : "Subscription",
"contract_version" : "1.1",
"links" : {
"self" : {
"href" : "/d51a0512-02a2-4363-8184-ef4b470568db/Subscriptions/ef947115-efc7-4558-b2d0-75a72bf183db?recipient_customer_id=1bbbe60b-e174-4a4c-8e5a-ed9f09e02010",
"method" : "GET"
},
"order" : {
"href" : "/d51a0512-02a2-4363-8184-ef4b470568db/Orders/843dc548-0564-4457-a4e4-ecc15a0e6b11?recipient_customer_id=1bbbe60b-e174-4a4c-8e5a-ed9f09e02010",
"method" : "GET"
},
"offer" : {
"href" : "/3c95518e-8c37-41e3-9627-0ca339200f53/offers/195416C1-3447-423A-B37B-EE59A99A19C4",
"method" : "GET"
},
"update_friendly_name" : {
"href" : "/d51a0512-02a2-4363-8184-ef4b470568db/Subscriptions/ef947115-efc7-4558-b2d0-75a72bf183db/update-friendly-name?recipient_customer_id=1bbbe60b-e174-4a4c-8e5a-ed9f09e02010",
"method" : "POST"
},
"transition_sources" : {
"href" : "/d51a0512-02a2-4363-8184-ef4b470568db/Subscriptions/ef947115-efc7-4558-b2d0-75a72bf183db/sources?recipient_customer_id=1bbbe60b-e174-4a4c-8e5a-ed9f09e02010",
"method" : "GET"
},
"transition_targets" : {
"href" : "/d51a0512-02a2-4363-8184-ef4b470568db/Subscriptions/ef947115-efc7-4558-b2d0-75a72bf183db/targets?recipient_customer_id=1bbbe60b-e174-4a4c-8e5a-ed9f09e02010",
"method" : "GET"
},
"add_suspension" : {
"href" : "/d51a0512-02a2-4363-8184-ef4b470568db/Subscriptions/ef947115-efc7-4558-b2d0-75a72bf183db/add-suspension?recipient_customer_id=1bbbe60b-e174-4a4c-8e5a-ed9f09e02010",
"method" : "POST"
},
"remove_suspension" : {
"href" : "/d51a0512-02a2-4363-8184-ef4b470568db/Subscriptions/ef947115-efc7-4558-b2d0-75a72bf183db/remove-suspension?recipient_customer_id=1bbbe60b-e174-4a4c-8e5a-ed9f09e02010",
"method" : "POST"
},
"update_advisor_partner_id" : {
"href" : "/d51a0512-02a2-4363-8184-ef4b470568db/Subscriptions/ef947115-efc7-4558-b2d0-75a72bf183db/update-advisor-partner-id?recipient_customer_id=1bbbe60b-e174-4a4c-8e5a-ed9f09e02010",
"method" : "POST"
},
"entitlement" : {
"href" : "/1bbbe60b-e174-4a4c-8e5a-ed9f09e02010/Entitlements/ef947115-efc7-4558-b2d0-75a72bf183db",
"method" : "GET"
}
}
}
Remove suspension
Торговые посредники могут удалять только приостановку с ее причиной "Отмена_клиентом". Подписка должна находиться в "приостановленном" состоянии.
Пример запроса
POST https : //api.cp.microsoft.com/d51a0512-02a2-4363-8184-ef4b470568db/subscriptions/ef947115-efc7-4558-b2d0-75a72bf183db/remove-suspension HTTP/1.1
Accept : application / json
api - version : 2015 - 03 - 31
Authorization : Bearer < SA_Token >
x - ms - correlation - id : 37e76cfe - 3c4f - 4fd7 - 98fa - a4ee5987ac54
x - ms - tracking - id : 072878dd - 8f04 - 4b5a - 99f2 - 36b7acacd4be
{
"suspension_reason" : "CustomerCancellation"
}
Пример ответа
HTTP / 1.1 200 OK
api - version : 2015 - 03 - 31
Cache - Control : no - cache
Date : Sat, 21 Mar 2015 03 : 50 : 14 GMT
Pragma : no - cache
Server : Microsoft - IIS / 7.5
Strict - Transport - Security : max - age = 15724800;
includeSubDomains
X - AspNet - Version : 4.0.30319
x - ms - correlation - id : 37e76cfe - 3c4f - 4fd7 - 98fa - a4ee5987ac54
x - ms - session - id : 4699f980 - 12db - 4dea - b2e4 - e9c6e0fd2e98
X - Server : BLUOS3OMSORDW01
{
"id" : "ef947115-efc7-4558-b2d0-75a72bf183db",
"order_id" : "843dc548-0564-4457-a4e4-ecc15a0e6b11",
"creation_date" : "2015-03-21T00:00:00Z",
"effective_start_date" : "2015-03-21T00:00:00Z",
"commitment_end_date" : "2016-04-09T00:00:00Z",
"quantity" : 875,
"state" : "Active",
"etag" : "eyJpZCI6ImVmOTQ3MTE1LWVmYzctNDU1OC1iMmQwLTc1YTcyYmYxODNkYiIsInZlcnNpb24iOjN9",
"suspension_reasons" : [],
"offer_uri" : "/3c95518e-8c37-41e3-9627-0ca339200f53/offers/195416C1-3447-423A-B37B-EE59A99A19C4",
"object_type" : "Subscription",
"contract_version" : "1.1",
"links" : {
"self" : {
"href" : "/d51a0512-02a2-4363-8184-ef4b470568db/Subscriptions/ef947115-efc7-4558-b2d0-75a72bf183db?recipient_customer_id=1bbbe60b-e174-4a4c-8e5a-ed9f09e02010",
"method" : "GET"
},
"order" : {
"href" : "/d51a0512-02a2-4363-8184-ef4b470568db/Orders/843dc548-0564-4457-a4e4-ecc15a0e6b11?recipient_customer_id=1bbbe60b-e174-4a4c-8e5a-ed9f09e02010",
"method" : "GET"
},
"offer" : {
"href" : "/3c95518e-8c37-41e3-9627-0ca339200f53/offers/195416C1-3447-423A-B37B-EE59A99A19C4",
"method" : "GET"
},
"update_friendly_name" : {
"href" : "/d51a0512-02a2-4363-8184-ef4b470568db/Subscriptions/ef947115-efc7-4558-b2d0-75a72bf183db/update-friendly-name?recipient_customer_id=1bbbe60b-e174-4a4c-8e5a-ed9f09e02010",
"method" : "POST"
},
"transition_sources" : {
"href" : "/d51a0512-02a2-4363-8184-ef4b470568db/Subscriptions/ef947115-efc7-4558-b2d0-75a72bf183db/sources?recipient_customer_id=1bbbe60b-e174-4a4c-8e5a-ed9f09e02010",
"method" : "GET"
},
"transition_targets" : {
"href" : "/d51a0512-02a2-4363-8184-ef4b470568db/Subscriptions/ef947115-efc7-4558-b2d0-75a72bf183db/targets?recipient_customer_id=1bbbe60b-e174-4a4c-8e5a-ed9f09e02010",
"method" : "GET"
},
"add_suspension" : {
"href" : "/d51a0512-02a2-4363-8184-ef4b470568db/Subscriptions/ef947115-efc7-4558-b2d0-75a72bf183db/add-suspension?recipient_customer_id=1bbbe60b-e174-4a4c-8e5a-ed9f09e02010",
"method" : "POST"
},
"remove_suspension" : {
"href" : "/d51a0512-02a2-4363-8184-ef4b470568db/Subscriptions/ef947115-efc7-4558-b2d0-75a72bf183db/remove-suspension?recipient_customer_id=1bbbe60b-e174-4a4c-8e5a-ed9f09e02010",
"method" : "POST"
},
"update_advisor_partner_id" : {
"href" : "/d51a0512-02a2-4363-8184-ef4b470568db/Subscriptions/ef947115-efc7-4558-b2d0-75a72bf183db/update-advisor-partner-id?recipient_customer_id=1bbbe60b-e174-4a4c-8e5a-ed9f09e02010",
"method" : "POST"
},
"entitlement" : {
"href" : "/1bbbe60b-e174-4a4c-8e5a-ed9f09e02010/Entitlements/ef947115-efc7-4558-b2d0-75a72bf183db",
"method" : "GET"
}
}
}
Sources
Вы можете получить оригинальную или исходную подписку, с которой перешла текущая подписка.
Пример запроса
GET https : //api.cp.microsoft.com/d51a0512-02a2-4363-8184-ef4b470568db/Subscriptions/ef947115-efc7-4558-b2d0-75a72bf183db/sources HTTP/1.1
Accept : application / json
api - version : 2015 - 03 - 31
Authorization : Bearer < SA_Token >
x - ms - correlation - id : e1a4c86a - 367e-41c0 - 84fe - a3e303762a8e
x - ms - tracking - id : 1929c181 - a5ac - 497f - 97c8 - 868a0df9c6b2
Пример ответа
HTTP / 1.1 200 OK
api - version : 2015 - 03 - 31
Cache - Control : no - cache
Date : Sat, 21 Mar 2015 03 : 50 : 21 GMT
Pragma : no - cache
Server : Microsoft - IIS / 7.5
Strict - Transport - Security : max - age = 15724800;
includeSubDomains
X - AspNet - Version : 4.0.30319
x - ms - correlation - id : e1a4c86a - 367e-41c0 - 84fe - a3e303762a8e
x - ms - session - id : 2703c4a1 - 165a - 4c00 - a7ab - fd0f5ed0c48e
X - Server : BLUOS3OMSORDW01
{
"contract_version" : "1.1",
"items" : [],
"total_count" : 0,
"object_type" : "SubscriptionSources",
"links" : {
"self" : {
"href" : "/d51a0512-02a2-4363-8184-ef4b470568db/Subscriptions/ef947115-efc7-4558-b2d0-75a72bf183db/sources",
"method" : "GET"
}
}
}
Targets
Вы можете получить целевую подписку, с которой перешла текущая подписка.
Пример запроса
GET https : //api.cp.microsoft.com/d51a0512-02a2-4363-8184-ef4b470568db/Subscriptions/ef947115-efc7-4558-b2d0-75a72bf183db/targets HTTP/1.1
Accept : application / json
api - version : 2015 - 03 - 31
Authorization : Bearer < SA_Token >
x - ms - correlation - id : e1a4c86a - 367e-41c0 - 84fe - a3e303762a8e
x - ms - tracking - id : 1929c181 - a5ac - 497f - 97c8 - 868a0df9c6b2
Пример ответа
HTTP / 1.1 200 OK
api - version : 2015 - 03 - 31
Cache - Control : no - cache
Date : Sat, 21 Mar 2015 03 : 50 : 21 GMT
Pragma : no - cache
Server : Microsoft - IIS / 7.5
Strict - Transport - Security : max - age = 15724800;
includeSubDomains
X - AspNet - Version : 4.0.30319
x - ms - correlation - id : e1a4c86a - 367e-41c0 - 84fe - a3e303762a8e
x - ms - session - id : 6df17e78 - 617c - 4bfc - a7b8 - 3a02d9e0f76d
X - Server : BLUOS3OMSORDW01
{
"contract_version" : "1.1",
"items" : [],
"total_count" : 0,
"object_type" : "SubscriptionTargets",
"links" : {
"self" : {
"href" : "/d51a0512-02a2-4363-8184-ef4b470568db/Subscriptions/ef947115-efc7-4558-b2d0-75a72bf183db/targets",
"method" : "GET"
}
}
}