# Method: getOrderDetails

- [HTTP request](https://developers.google.com/standard-payments/google-order-details-api/v1/TopLevel/getOrderDetails#body.HTTP_TEMPLATE)
- [Request body](https://developers.google.com/standard-payments/google-order-details-api/v1/TopLevel/getOrderDetails#body.request_body)
  - [JSON representation](https://developers.google.com/standard-payments/google-order-details-api/v1/TopLevel/getOrderDetails#body.request_body.SCHEMA_REPRESENTATION)
- [Response body](https://developers.google.com/standard-payments/google-order-details-api/v1/TopLevel/getOrderDetails#body.response_body)
  - [JSON representation](https://developers.google.com/standard-payments/google-order-details-api/v1/TopLevel/getOrderDetails#body.GetOrderDetailsResponse.SCHEMA_REPRESENTATION)
- [RequestHeader](https://developers.google.com/standard-payments/google-order-details-api/v1/TopLevel/getOrderDetails#RequestHeader)
  - [JSON representation](https://developers.google.com/standard-payments/google-order-details-api/v1/TopLevel/getOrderDetails#RequestHeader.SCHEMA_REPRESENTATION)
- [Version](https://developers.google.com/standard-payments/google-order-details-api/v1/TopLevel/getOrderDetails#Version)
  - [JSON representation](https://developers.google.com/standard-payments/google-order-details-api/v1/TopLevel/getOrderDetails#Version.SCHEMA_REPRESENTATION)
- [OrderLookupCriteria](https://developers.google.com/standard-payments/google-order-details-api/v1/TopLevel/getOrderDetails#OrderLookupCriteria)
  - [JSON representation](https://developers.google.com/standard-payments/google-order-details-api/v1/TopLevel/getOrderDetails#OrderLookupCriteria.SCHEMA_REPRESENTATION)
- [ArnCriteria](https://developers.google.com/standard-payments/google-order-details-api/v1/TopLevel/getOrderDetails#ArnCriteria)
  - [JSON representation](https://developers.google.com/standard-payments/google-order-details-api/v1/TopLevel/getOrderDetails#ArnCriteria.SCHEMA_REPRESENTATION)
- [GoogleTransactionReferenceNumberCriteria](https://developers.google.com/standard-payments/google-order-details-api/v1/TopLevel/getOrderDetails#GoogleTransactionReferenceNumberCriteria)
  - [JSON representation](https://developers.google.com/standard-payments/google-order-details-api/v1/TopLevel/getOrderDetails#GoogleTransactionReferenceNumberCriteria.SCHEMA_REPRESENTATION)
- [RequestOriginator](https://developers.google.com/standard-payments/google-order-details-api/v1/TopLevel/getOrderDetails#RequestOriginator)
  - [JSON representation](https://developers.google.com/standard-payments/google-order-details-api/v1/TopLevel/getOrderDetails#RequestOriginator.SCHEMA_REPRESENTATION)
- [ResponseHeader](https://developers.google.com/standard-payments/google-order-details-api/v1/TopLevel/getOrderDetails#ResponseHeader)
  - [JSON representation](https://developers.google.com/standard-payments/google-order-details-api/v1/TopLevel/getOrderDetails#ResponseHeader.SCHEMA_REPRESENTATION)
- [GetOrderDetailsResultCode](https://developers.google.com/standard-payments/google-order-details-api/v1/TopLevel/getOrderDetails#GetOrderDetailsResultCode)
- [Order](https://developers.google.com/standard-payments/google-order-details-api/v1/TopLevel/getOrderDetails#Order)
  - [JSON representation](https://developers.google.com/standard-payments/google-order-details-api/v1/TopLevel/getOrderDetails#Order.SCHEMA_REPRESENTATION)
- [Item](https://developers.google.com/standard-payments/google-order-details-api/v1/TopLevel/getOrderDetails#Item)
  - [JSON representation](https://developers.google.com/standard-payments/google-order-details-api/v1/TopLevel/getOrderDetails#Item.SCHEMA_REPRESENTATION)
- [Tax](https://developers.google.com/standard-payments/google-order-details-api/v1/TopLevel/getOrderDetails#Tax)
  - [JSON representation](https://developers.google.com/standard-payments/google-order-details-api/v1/TopLevel/getOrderDetails#Tax.SCHEMA_REPRESENTATION)

Get an order that provides the basis to the Google partners for charging the end-users.

If the endpoint encounters an error while processing the request, the response from this endpoint will be of type `https://developers.google.com/standard-payments/google-order-details-api/v1/ErrorResponse`.

Responses to this query may be empty if this method does not return an HTTP 200. The response body is empty in situations where an `https://developers.google.com/standard-payments/google-order-details-api/v1/ErrorResponse` with a clear description could be used to help an attacker understand the payment integrator account identifier of other integrators. In these situations, where either the signing key doesn't match, the payment integrator identifier was not found, or the encryption key was unknown, this method will return an HTTP 404 with an empty body. If the request signature could be verified, additional information regarding the error will be returned in the response body.

An example request looks like:


    {
      "requestHeader": {
        "protocolVersion": {
          "major": 1,
          "minor": 1,
          "revision": 0
        },
        "requestId": "HsKv5pvtQKTtz7rdcw1YqE",
        "requestTimestamp": "1519996751331"
      },
      "paymentIntegratorAccountId": "IntegratorFakeAccount",
      "orderLookupCriteria": {
        "googleTransactionReferenceNumberCriteria": {
          "googleTransactionReferenceNumber": "714545417102363157911822",
          "authorizationCode": "111111"
        }
      },
      "requestOriginator": {
        "organizationId": "ISSUER_256",
        "organizationDescription": "Community Bank of Some City"
      }
    }

An example response looks like:


    {
      "responseHeader": {
        "responseTimestamp": "1519996752221"
      },
      "result": "SUCCESS",
      "order": {
        "timestamp": "1517992525972",
        "orderId": "UPG.DEFC.X6F4.MEOM.CDWF",
        "currencyCode": "USD",
        "subTotalAmount": "399000000",
        "totalAmount": "459000000",
        "taxes": [],
        "items": [
          {
            "description": "YouTube TV membership",
            "merchant": "fake org",
            "googleProductName": "YouTube TV",
            "quantity": "1",
            "totalPrice": "399000000"
          },
          {
            "description": "Showtime",
            "merchant": "fake org",
            "googleProductName": "YouTube TV",
            "quantity": "1",
            "totalPrice": "6000000"
          }
        ]
      }
    }

### HTTP request

`POST https://vgw.googleapis.com/secure-serving/gsp/v1/getOrderDetails/https://developers.google.com/standard-payments/reference/glossary#payment_integrator_account_id`

### Request body

The request body contains data with the following structure:

| JSON representation |
|---|
| ``` { "requestHeader": { object (`https://developers.google.com/standard-payments/google-order-details-api/v1/TopLevel/getOrderDetails#RequestHeader`) }, "paymentIntegratorAccountId": string, "orderLookupCriteria": { object (`https://developers.google.com/standard-payments/google-order-details-api/v1/TopLevel/getOrderDetails#OrderLookupCriteria`) }, "requestOriginator": { object (`https://developers.google.com/standard-payments/google-order-details-api/v1/TopLevel/getOrderDetails#RequestOriginator`) } } ``` |

| Fields ||
|---|---|
| `requestHeader` | ``object (`https://developers.google.com/standard-payments/google-order-details-api/v1/TopLevel/getOrderDetails#RequestHeader`)`` **REQUIRED**: Common header for all requests. |
| `paymentIntegratorAccountId` | `string` **REQUIRED**: The payment integrator account identifier that identifies the caller and associated contractual constraints for this interaction. |
| `orderLookupCriteria` | ``object (`https://developers.google.com/standard-payments/google-order-details-api/v1/TopLevel/getOrderDetails#OrderLookupCriteria`)`` **REQUIRED**: Criteria indicating the order that is to be looked up. |
| `requestOriginator` | ``object (`https://developers.google.com/standard-payments/google-order-details-api/v1/TopLevel/getOrderDetails#RequestOriginator`)`` **OPTIONAL**: Information about the organization or organizational sub-group that originated this request (if the integrator is calling us on behalf of another organization). |

### Response body

Response payload for the `getOrderDetails` method.

If successful, the response body contains data with the following structure:

| JSON representation |
|---|
| ``` { "responseHeader": { object (`https://developers.google.com/standard-payments/google-order-details-api/v1/TopLevel/getOrderDetails#ResponseHeader`) }, "result": enum (`https://developers.google.com/standard-payments/google-order-details-api/v1/TopLevel/getOrderDetails#GetOrderDetailsResultCode`), "order": { object (`https://developers.google.com/standard-payments/google-order-details-api/v1/TopLevel/getOrderDetails#Order`) } } ``` |

| Fields ||
|---|---|
| `responseHeader` | ``object (`https://developers.google.com/standard-payments/google-order-details-api/v1/TopLevel/getOrderDetails#ResponseHeader`)`` **REQUIRED**: Common header for all responses. |
| `result` | ``enum (`https://developers.google.com/standard-payments/google-order-details-api/v1/TopLevel/getOrderDetails#GetOrderDetailsResultCode`)`` **REQUIRED**: Result of this call. |
| `order` | ``object (`https://developers.google.com/standard-payments/google-order-details-api/v1/TopLevel/getOrderDetails#Order`)`` **OPTIONAL** : Information regarding the order on which the payment was made. (Present if and only if `result` is SUCCESS.) |

## RequestHeader

Header object that is defined on all requests sent to the server.

| JSON representation |
|---|
| ``` { "requestId": string, "requestTimestamp": string, "userLocale": string, "protocolVersion": { object (`https://developers.google.com/standard-payments/google-order-details-api/v1/TopLevel/getOrderDetails#Version`) } } ``` |

| Fields ||
|---|---|
| `requestId` | `string` **REQUIRED**: Unique identifier of this request. This is a string that has a max length of 100 characters, and contains only the characters "a-z", "A-Z", "0-9", ":", "-", and "_". |
| `requestTimestamp` | `string (https://developers.google.com/discovery/v1/type-format format)` **REQUIRED**: Timestamp of this request represented as milliseconds since epoch. The receiver should verify that this timestamp is ± 60s of 'now'. This request timestamp is not idempotent upon retries. |
| `userLocale (deprecated)` | `string` > [!WARNING] > This was never implemented and is being removed in future versions. This field is ignored. **DEPRECATED** : A two- or three-letter ISO 639-2 Alpha 3 language code optionally followed by a hyphen and an ISO 3166-1 Alpha-2 country code, e.g.'pt', 'pt-BR', 'fil', or 'fil-PH'. Use this to help drive the `userMessage` fields in the response. |
| `protocolVersion` | ``object (`https://developers.google.com/standard-payments/google-order-details-api/v1/TopLevel/getOrderDetails#Version`)`` **REQUIRED**: The version of this request. |

## Version

Version object which is a structured form of the classic `a.b.c` version structure. Major versions of the same number are guaranteed to be compatible. Note that minor and revisions can change frequently and without notice. The integrator must support all requests for the same major version.

| JSON representation |
|---|
| ``` { "major": integer, "minor": integer, "revision": integer } ``` |

| Fields ||
|---|---|
| `major` | `integer` **REQUIRED**: Major version. This is marked for compatibility requests with different versions are not guaranteed to be compatible. |
| `minor` | `integer` **REQUIRED**: Minor version. This denotes significant bug fixes. |
| `revision` | `integer` **REQUIRED**: Minor version. This denotes minor bug fixes. |

## OrderLookupCriteria

Order lookup criteria.

| JSON representation |
|---|
| ``` { // Union field `criteria` can be only one of the following: "dcb3CorrelationId": string, "arnCriteria": { object (`https://developers.google.com/standard-payments/google-order-details-api/v1/TopLevel/getOrderDetails#ArnCriteria`) }, "googleTransactionReferenceNumberCriteria": { object (`https://developers.google.com/standard-payments/google-order-details-api/v1/TopLevel/getOrderDetails#GoogleTransactionReferenceNumberCriteria`) } // End of list of possible types for union field `criteria`. } ``` |

| Fields ||
|---|---|
| Union field `criteria`. `criteria` can be only one of the following: ||
| `dcb3CorrelationId` | `string` Lookup based on the Google-generated DCB correlation ID that uniquely identifies the payment. This value was generated by Google and sent to the carrier billing payment integrator during the Auth call. |
| `arnCriteria` | ``object (`https://developers.google.com/standard-payments/google-order-details-api/v1/TopLevel/getOrderDetails#ArnCriteria`)`` Lookup based on Acquirer Reference Number (ARN). |
| `googleTransactionReferenceNumberCriteria` | ``object (`https://developers.google.com/standard-payments/google-order-details-api/v1/TopLevel/getOrderDetails#GoogleTransactionReferenceNumberCriteria`)`` Lookup based on the Google Transaction Reference Number. |

## ArnCriteria

Payment lookup criteria based on Acquirer Reference Number (ARN).

| JSON representation |
|---|
| ``` { "acquirerReferenceNumber": string, "authorizationCode": string } ``` |

| Fields ||
|---|---|
| `acquirerReferenceNumber` | `string` **REQUIRED**: The Acquirer Reference Number (ARN) that uniquely identifies the payment. Must be 23 digits long. |
| `authorizationCode` | `string` **REQUIRED**: The Authorization Code for the transaction. |

## GoogleTransactionReferenceNumberCriteria

Payment lookup criteria based on the Google-generated Transaction Reference Number.

| JSON representation |
|---|
| ``` { "googleTransactionReferenceNumber": string, "authorizationCode": string } ``` |

| Fields ||
|---|---|
| `googleTransactionReferenceNumber` | `string` **REQUIRED**: The Google-generated Transaction Reference Number that uniquely identifies the payment. |
| `authorizationCode` | `string` **REQUIRED**: The Authorization Code for the transaction. |

## RequestOriginator

Information about the organization or organizational sub-group from which this request originated. This allows Google to identify issues or abuse and implement controls at a finer-grained level than the `paymentIntegratorAccountId`. It is especially valuable when the caller is an intermediary service provider that sources requests from multiple external clients.

| JSON representation |
|---|
| ``` { "organizationId": string, "organizationDescription": string } ``` |

| Fields ||
|---|---|
| `organizationId` | `string` **REQUIRED** : An identifier of the company, organization, or organizational group from which this request originated. Must be unique within this `paymentIntegratorAccountId`. |
| `organizationDescription` | `string` **REQUIRED**: A human-readable name or description of the organization that can be used to ease communication between employees of Google and the integrator regarding that organization. |

## ResponseHeader

Header object that is defined on all responses sent from the server.

| JSON representation |
|---|
| ``` { "responseTimestamp": string } ``` |

| Fields ||
|---|---|
| `responseTimestamp` | `string (https://developers.google.com/discovery/v1/type-format format)` **REQUIRED**: Timestamp of this response represented as milliseconds since epoch. The receiver should verify that this timestamp is ± 60s of 'now'. |

## GetOrderDetailsResultCode

The result of the `getOrderDetails` method call.

| Enums ||
|---|---|
| `GET_ORDER_DETAILS_RESULT_CODE_UNKNOWN` | Do not ever set this default value! |
| `SUCCESS` | The order was found and returned. |
| `ORDER_CANNOT_BE_RETURNED` | The requested order that exists, but cannot be returned. Reasons include cases where the order was removed at the request of its owner. > [!NOTE] > **Note:** that this is a permanent state. <br /> |
| `PAYMENT_TOO_OLD` | The requested payment was found, but an order details was not provided due to the age of the payment. |
| `PAYMENT_NOT_FOUND` | The requested payment was not found. |
| `NO_ADDITIONAL_DETAILS` | The requested payment was found, but order details are not available. |

## Order

Information about the order.

| JSON representation |
|---|
| ``` { "timestamp": string, "orderId": string, "currencyCode": string, "subTotalAmount": string, "totalAmount": string, "items": [ { object (`https://developers.google.com/standard-payments/google-order-details-api/v1/TopLevel/getOrderDetails#Item`) } ], "taxes": [ { object (`https://developers.google.com/standard-payments/google-order-details-api/v1/TopLevel/getOrderDetails#Tax`) } ] } ``` |

| Fields ||
|---|---|
| `timestamp` | `string (https://developers.google.com/discovery/v1/type-format format)` **OPTIONAL**: Timestamp of when the order was made, represented as milliseconds since epoch. Not available for all order types. |
| `orderId` | `string` **OPTIONAL**: A string uniquely identifying this order. Not available for all order types. |
| `currencyCode` | `string` **OPTIONAL**: ISO 4217 3-letter currency code for all amounts in this order. Not available for all order types. |
| `subTotalAmount` | `string (https://developers.google.com/discovery/v1/type-format format)` **OPTIONAL** : Total amount of this order before tax, represented as micros of the currency specified in `order.currencyCode`. This is equal to `SUM(items.totalPrice)`. Not available for all order types. |
| `totalAmount` | `string (https://developers.google.com/discovery/v1/type-format format)` **OPTIONAL** : Total amount of this order including tax, represented as micros of the currency specified in `order.currencyCode`. This is equal to `subTotalAmount + SUM(taxes.amount)`. Not available for all order types. |
| `items[]` | ``object (`https://developers.google.com/standard-payments/google-order-details-api/v1/TopLevel/getOrderDetails#Item`)`` **REQUIRED**: List of items that were part of this order. |
| `taxes[]` | ``object (`https://developers.google.com/standard-payments/google-order-details-api/v1/TopLevel/getOrderDetails#Tax`)`` **OPTIONAL**: List of taxes that were part of this order. |

## Item

Information about an item in the order.

| JSON representation |
|---|
| ``` { "description": string, "merchant": string, "quantity": string, "totalPrice": string, "googleProductName": string } ``` |

| Fields ||
|---|---|
| `description` | `string` **OPTIONAL**: A description of the item that was purchased. Not available for all order types. |
| `merchant` | `string` **REQUIRED**: The seller, artist, or maker of the item. |
| `quantity` | `string (https://developers.google.com/discovery/v1/type-format format)` **OPTIONAL**: The quantity that were ordered of this item. This field will be omitted if integer quantities are not applicable to the product (metered products may have fractional quantities for example). |
| `totalPrice` | `string (https://developers.google.com/discovery/v1/type-format format)` **OPTIONAL** : The total price of this item, represented as micros of the currency specified in `order.currencyCode`. If `quantity` is populated, this reflects the total price of the entire quantity. Not available for all order types. |
| `googleProductName` | `string` **REQUIRED**: Name of Google product service for the item. |

## Tax

Information about a tax that applies to this order.

| JSON representation |
|---|
| ``` { "description": string, "amount": string } ``` |

| Fields ||
|---|---|
| `description` | `string` **REQUIRED**: A description of the tax. |
| `amount` | `string (https://developers.google.com/discovery/v1/type-format format)` **REQUIRED** : The amount of the tax, represented as micros of the currency specified in `order.currencyCode`. |