다음을 통해 공유


카트에서 고객 주문 확인

적용 대상: 파트너 센터 | 21Vianet에서 운영되는 파트너 센터 | Microsoft Cloud for US Government 파트너 센터

카트에서 고객의 주문을 검사 방법.

이 API는 idempotent입니다. 파트너는 하나의 카트 ID에 대해 CheckoutCart API를 여러 번 호출할 수 있습니다. 오류로 인해 주문이 실패하는 시나리오에서는 다시 호출하여 검사 다시 실행할 수 있습니다. 이전에 카트가 성공적으로 검사 동일한 카트에 대한 후속 검사 아웃 호출이 수행되면 API 응답은 초기 검사 아웃 후에 반환된 정보를 반복합니다.

참고 항목

카트는 초기 생성 후 7일 후에 만료됩니다.

필수 조건

  • 자격 증명(파트너 센터 인증에서 설명). 이 시나리오는 독립 실행형 앱 및 App+사용자 자격 증명을 모두 사용하여 인증을 지원합니다.

  • 고객 ID (customer-tenant-id). 고객의 ID를 모르는 경우 고객 작업 영역, 고객 목록에서 고객, 계정을 선택하여 파트너 센터에서 조회할 수 있습니다. 고객의 계정 페이지에서 고객 계정 정보 섹션에서 Microsoft ID습니다. Microsoft ID는 고객 ID(customer-tenant-id)와 동일합니다.

  • 기존 카트의 카트 ID입니다.

C#

고객의 주문을 검사 카트 및 고객 식별자를 사용하여 카트에 대한 참조를 가져옵니다. 마지막으로 Create 또는 CreateAsync 함수를 호출하여 순서를 완료합니다.

// IAggregatePartner partnerOperations;
// string customerId;
// string cartId;

var cart = partnerOperations.Customers.ById(customerId).Cart.ById(cartId).Checkout();

Java

파트너 센터 Java SDK를 사용하여 파트너 센터 리소스를 관리할 수 있습니다. 파트너 커뮤니티에서 기본 오픈 소스 프로젝트이며 Microsoft에서 공식적으로 지원하지 않습니다. 문제가 발생한 경우 커뮤니티에서 도움을 받거나 GitHub에서 문제를 열 수 있습니다.

고객의 주문을 검사 카트 및 고객 식별자를 사용하여 카트에 대한 참조를 가져옵니다. 마지막으로 create 함수를 호출하여 주문을 완료합니다.

// IAggregatePartner partnerOperations;
// String customerId;
// String cartId;

Cart cart = partnerOperations.getCustomers().byId(customerId).getCart().byId(cartId).checkout();

PowerShell

파트너 센터 PowerShell 모듈을 사용하여 파트너 센터 리소스를 관리할 수 있습니다. 파트너 커뮤니티에서 기본 오픈 소스 프로젝트이며 Microsoft에서 공식적으로 지원하지 않습니다. 문제가 발생한 경우 커뮤니티에서 도움을 받거나 GitHub에서 문제를 열 수 있습니다.

고객에 대한 주문을 검사 하려면 Submit-PartnerCustomerCart를 실행하여 주문을 완료합니다.

# $customerId
# $cartId

Submit-PartnerCustomerCart -CartId $cartId -CustomerId $customerId

REST 요청

요청 구문

메서드 요청 URI
POST {baseURL}/v1/customers/{customer-id}/carts/{cart-id}/검사out HTTP/1.1

URI 매개 변수

다음 경로 매개 변수를 사용하여 고객을 식별하고 검사 수레를 지정합니다.

이름 Type 필수 설명
customer-id string 고객을 식별하는 GUID 형식의 고객 ID입니다.
cart-id string 카트를 식별하는 GUID 형식의 cart-id입니다.

요청 헤더

자세한 내용은 파트너 센터 REST 헤더를 참조하세요.

요청 본문

없음.

요청 예제

POST /v1/customers/d6bf25b7-e0a8-4f2d-a31b-97b55cfc774d/carts/b4c8fdea-cbe4-4d17-9576-13fcacbf9605/checkout HTTP/1.1
Authorization: Bearer <token>
Accept: application/json
MS-RequestId: 4fa6dad6-a89f-4875-8247-8294a10ae1cf
MS-CorrelationId: 0e93c70c-977a-4a88-9580-7cf084c73286
X-Locale: en-US
MS-PartnerCenter-Client: Partner Center .NET SDK
Content-Type: application/json
Host: api.partnercenter.microsoft.com
Content-Length: 0
Expect: 100-continue

No-Content-Body

Important

2023년 6월 현재 최신 파트너 센터 .NET SDK 릴리스 3.4.0이 보관됩니다. 유용한 정보가 포함된 추가 정보 파일함께 GitHub에서 SDK 릴리스를 다운로드할 수 있습니다.

파트너는 파트너 센터 REST API계속 사용하는 것이 좋습니다.

REST 응답

성공하면 응답 본문에 채워진 CartCheckoutResult 리소스가 포함됩니다.

카트에 하나 이상의 구독이 포함된 경우 해당 구독이 API 호출 시 프로비전된 경우에만 해당 구독 ID 값이 REST 응답에 표시됩니다. 프로비전 구독은 비동기적으로 발생하므로 카트 체크 아웃 호출의 REST 응답에 구독 ID 값이 항상 표시되지 않을 수 있습니다. 그러나 각 구독이 프로비전되면 주문 가져오기 및 ID별 주문 가져오기 API 호출을 통해 구독 ID 값에 액세스할 수 있습니다.

응답 성공 및 오류 코드

각 응답에는 성공 또는 실패 및 더 많은 디버깅 정보를 나타내는 HTTP 상태 코드가 함께 제공됩니다. 네트워크 추적 도구를 사용하여 이 코드, 오류 유형 및 기타 매개 변수를 읽습니다. 전체 목록은 오류 코드를 참조하세요.

소프트웨어, 여러 예약, Azure 플랜 및 타사 제품 SKU에 대한 응답 예제

HTTP/1.1 201 Created
Content-Length: 764
Content-Type: application/json; charset=utf-8
MS-CorrelationId: 0e93c70c-977a-4a88-9580-7cf084c73286
MS-RequestId: 4fa6dad6-a89f-4875-8247-8294a10ae1cf
X-Locale: en-US,en-US
MS-CV: sF/wRa2ih0CzbABc.0
MS-ServerId: 000001
Date: Thu, 15 Mar 2018 17:15:01 GMT
?{
  "orders": [
    {
      "id": "3c6f2530-1e31-4088-8230-dd1c31a18bce",
      "alternateId": "3c6f2530-1e31-4088-8230-dd1c31a18bce",
      "referenceCustomerId": "28045616-f6b9-462f-9701-0d89b5e65c44",
      "billingCycle": "monthly",
      "currencyCode": "USD",
      "lineItems": [
        {
          "lineItemNumber": 0,
          "offerId": "MS-AZR-0145P",
          "subscriptionId": "EF2E1307-86E6-40E3-A794-872403FBD31C",
          "termDuration": "P1Y",
          "transactionType": "New",
          "friendlyName": "Microsoft Azure",
          "quantity": 1,
          "links": {...}
        }
      ],
      "creationDate": "2019-01-16T00:48:44.76+00:00",
      "status": "completed",
      "transactionType": "UserPurchase",
      "links": {...},
      ...
    },
    {
      "id": "311qiN8iFwkv-XARWMvXRYAwYKMACVqv1",
      "alternateId": "0a3624c6e47d",
      "referenceCustomerId": "28045616-f6b9-462f-9701-0d89b5e65c44",
      "billingCycle": "one_time",
      "currencyCode": "USD",
      "currencySymbol": "$",
      "lineItems": [
        {
          "lineItemNumber": 0,
          "offerId": "DZH318Z0BQ36:004G:DZH318Z08C0S",
          "termDuration": "P1Y",
          "transactionType": "New",
          "friendlyName": "Reserved VM Instance, Standard_NV12, US East 2, 1 Year",
          "quantity": 1,
          "links": {...}
        },
        {
          "lineItemNumber": 1,
          "offerId": "DZH318Z0BQ36:004J:DZH318Z08B8X",
          "termDuration": "P3Y",
          "transactionType": "New",
          "friendlyName": "Reserved VM Instance, Standard_NV12, US East 2, 3 Years",
          "quantity": 1,
          "links": {...}
        },
        {
          "lineItemNumber": 2,
          "offerId": "DG7GMGF0DWM3:0002:DG7GMGF0DT1M",
          "transactionType": "New",
          "friendlyName": "BizTalk Server 2016 Branch",
          "quantity": 1,
          "links": {...}
        }
      ],
      "creationDate": "2019-01-16T00:48:51.6578126Z",
      "status": "pending",
      "transactionType": "UserPurchase",
      "links": {...},
      ...
    },
    {
      "id": "HVu_cO8Ea7fNRQP4ia1QTpZap-kg_7P71",
      "alternateId": "55a4e6854d54",
      "referenceCustomerId": "28045616-f6b9-462f-9701-0d89b5e65c44",
      "billingCycle": "monthly",
      "currencyCode": "USD",
      "currencySymbol": "$",
      "lineItems": [
        {
          "lineItemNumber": 0,
          "offerId": "DZH318Z0BXWC:0002:DZH318Z0BMRV",
          "termDuration": "P1M",
          "transactionType": "New",
          "friendlyName": "Barracuda WaaS - Medium Plan",
          "quantity": 1,
          "links": {...}
        }
      ],
      "creationDate": "2019-01-16T00:48:44.4514129Z",
      "status": "pending",
      "transactionType": "UserPurchase",
      "links": {...},
      ...
    }
  ],
  ...
}

새 상거래 라이선스 기반 구독에 대한 응답 예제

  {
    "id": "a68736758d9c",
    "alternateId": "a68736758d9c",
    "referenceCustomerId": "94cd6638-11b6-4323-8c9f-6ae3088adc59",
    "billingCycle": "monthly",
    "currencyCode": "USD"
    "currencySymbol": "US$",
    "lineItems": [
        {
            "lineItemNumber": 0,
            "offerId": "CFQ7TTC0LF8S:0001:CFQ7TTC0N81H",
            "subscriptionId": "0c353b8e-da9d-4007-d0d4-bca8bd5b5ce1",
            "termDuration": "P1M",
            "transactionType": "New",
            "friendlyName": "Office 365 E5 without Audio Conferencing",
            "quantity": 1,
            "pricing": {
                "listPrice": 36.48,
                "discountedPrice": 36.48,
                "proratedPrice": 36.48,
                "price": 36.48,
                "extendedPrice": 36.48
            },
            "links": {
                "product": {
                    "uri": "/products/CFQ7TTC0LF8S?country=US",
                    "method": "GET",
                    "headers": []
                },
                "sku": {
                    "uri": "/products/CFQ7TTC0LF8S/skus/0001?country=US",
                    "method": "GET",
                    "headers": []
                },
                "availability": {
                    "uri": "/products/CFQ7TTC0LF8S/skus/0001/availabilities/CFQ7TTC0N81H?country=US",
                    "method": "GET",
                    "headers": []
                }
            }
        }
    ],
    "creationDate": "2023-04-18T22:03:45.4505136Z",
    "status": "pending",
    "transactionType": "UserPurchase",
    "links": {
        "self": {
            "uri": "/customers/94cd6638-11b6-4323-8c9f-6ae3088adc59/orders/a68736758d9c",
            "method": "GET",
            "headers": []
        },
        "provisioningStatus": {
            "uri": "/customers/94cd6638-11b6-4323-8c9f-6ae3088adc59/orders/a68736758d9c/provisioningstatus",
            "method": "GET",
            "headers": []
        },
        "patchOperation": {
            "uri": "/customers/94cd6638-11b6-4323-8c9f-6ae3088adc59/orders/a68736758d9c",
            "method": "PATCH",
            "headers": []
        }
    },
    "totalPrice": 36.48,
    "client": {},
    "attributes": {
        "objectType": "Order"
    }
}