{
  "swagger": "2.0",
  "info": {
    "title": "Google Standard Payments Payment Integrator Hosted Redirect Payment Token API",
    "description": "This includes services hosted by Payment Integrators for Redirect Payment Tokens",
    "version": "v1"
  },
  "host": "www.integratorhost.example.com",
  "basePath": "/integrator-base-path",
  "schemes": ["https"],
  "paths": {
    "/redirect-payment-token-v1/echo": {
      "post": {
        "tags": ["payment_integrator_redirect_payment_token_api"],
        "operationId": "Echo",
        "description": "Echos back the `clientMessage` that is passed in. The purpose of this method is to test basic connectivity between the payment integrator and Google. This method may be called by Google multiple times per minute with valid or invalid parameters in order to test that security constraints are being held properly. Google also calls this method ad-hoc at the integrator's direction as well as at Google's direction. Google will never call this faster than once every 10s, and never more than 30 times in a 15 minute window. Examples of security constraint tests are (but not limited to): - Test to ensure payment integrator's endpoint doesn't negotiate to weak cipher suites. - Test to ensure payment integrator's endpoint doesn't negotiate to anything but TLS 1.2 - Test to ensure payment integrator's endpoint doesn't support HTTP. - Test to ensure payment integrator's endpoint mandates at least one known PGP signing key. - Test to ensure payment integrator's endpoint supports multiple PGP key signatures, both known and unknown, both expired and active. - Test to ensure payment integrator only support strict JSON parsing. If the endpoint encounters an error while processing the request, the response body from this endpoint should be of type `ErrorResponse`. An example request looks like: { \"requestHeader\": { \"protocolVersion\": { \"major\": 1, \"minor\": 0, \"revision\": 0 }, \"requestId\": \"ZWNobyB0cmFuc2FjdGlvbg\", \"requestTimestamp\": \"1481899949606\" }, \"clientMessage\": \"client message\" } An example response looks like: { \"responseHeader\": { \"responseTimestamp\": \"1481900013178\" }, \"clientMessage\": \"client message\", \"serverMessage\": \"server message\" } ",
        "parameters": [
          {
            "name": "body",
            "description": "The request body.",
            "in": "body",
            "schema": {
              "$ref": "#/definitions/EchoRequest"
            }
          }
        ],
        "responses": {
          "default": {
            "description": "Successful operation",
            "schema": {
              "$ref": "#/definitions/EchoResponse"
            }
          }
        }
      }
    },
    "/redirect-payment-token-v1/getGeneratePaymentTokenRedirectStatus": {
      "post": {
        "tags": ["payment_integrator_redirect_payment_token_api"],
        "operationId": "GetGeneratePaymentTokenRedirectStatus",
        "description": "Get completion details about a specific redirect payment. If the user never redirected back to Google or there was a problem with the redirect, this API will be called to obtain the final result of a payment. An example request looks like: { \"requestHeader\": { \"protocolVersion\": { \"major\": 1, \"minor\": 1, \"revision\": 0 }, \"requestId\": \"cmVxdWVzdDE\", \"requestTimestamp\": \"1481907920000\" }, \"redirectRequestId\": \"cmVxdWVzdDE\" } An example response looks like: { \"responseHeader\": { \"responseTimestamp\": \"1481899949611\" }, \"result\": { \"success\": {} } } ",
        "parameters": [
          {
            "name": "body",
            "description": "The request body.",
            "in": "body",
            "schema": {
              "$ref": "#/definitions/GetGeneratePaymentTokenRedirectStatusRequest"
            }
          }
        ],
        "responses": {
          "default": {
            "description": "Successful operation",
            "schema": {
              "$ref": "#/definitions/GetGeneratePaymentTokenRedirectStatusResponse"
            }
          }
        }
      }
    },
    "/redirect-payment-token-v1/remittanceStatementNotification": {
      "post": {
        "tags": ["payment_integrator_redirect_payment_token_api"],
        "operationId": "RemittanceStatementNotification",
        "description": "Notifies the integrator of a new remittance statement. Statement notifications occur everytime a new statement is raised that represents money that Google will pay the integrator or the money that the integrator owes Google. If the integrator returns a success, then it acknowledges receipt of the statement. The `requestId` is also the statement Id (used elsewhere). The `requestId` within the header is the idempotency key and uniquely identifies this statement. If the endpoint encounters an error while processing the request, the response body from this endpoint should be of type `ErrorResponse`. An example request looks like: { \"requestHeader\": { \"protocolVersion\": { \"major\": 1, \"minor\": 0, \"revision\": 0 }, \"requestId\": \"0123434-statement-abc\", \"requestTimestamp\": \"1502632800000\" }, \"paymentIntegratorAccountId\": \"InvisiCashUSA_USD\", \"remittanceStatementSummary\": { \"statementDate\": \"1502607600000\", \"billingPeriod\": { \"startDate\": \"1502434800000\", \"endDate\": \"1502521199000\" }, \"dateDue\": \"1503212400000\", \"currencyCode\": \"INR\", \"totalDueByIntegrator\": \"1076000000\", \"totalPresentmentAmounts\": [ { \"amountMicros\": \"1076000000\", \"currencyCode\": \"INR\" } ], \"remittanceInstructions\": { \"memoLineId\": \"stmt-1AB-pp0-invisi\" } } } An example response looks like: { \"responseHeader\": { \"responseTimestamp\": \"1502632802000\" }, \"paymentIntegratorStatementId\": \"334a\", \"result\": \"ACCEPTED\" } ",
        "parameters": [
          {
            "name": "body",
            "description": "The request body.",
            "in": "body",
            "schema": {
              "$ref": "#/definitions/RemittanceStatementNotificationRequest"
            }
          }
        ],
        "responses": {
          "default": {
            "description": "Successful operation",
            "schema": {
              "$ref": "#/definitions/RemittanceStatementNotificationResponse"
            }
          }
        }
      }
    },
    "/redirect-payment-token-v1/refund": {
      "post": {
        "tags": ["payment_integrator_redirect_payment_token_api"],
        "operationId": "Refund",
        "description": "Refunds a portion of or the entire transaction initiated through `capture`. The `requestId` within the header is the idempotency key, which uniquely identifies this transaction. If the endpoint encounters an error while processing the request, the response body from this endpoint should be of type `ErrorResponse`. An example request looks like: { \"requestHeader\": { \"protocolVersion\": { \"major\": 1, \"minor\": 0, \"revision\": 0 }, \"requestId\": \"liUrreQY233839dfFFb24gaQM\", \"requestTimestamp\": \"1502220434778\" }, \"paymentIntegratorAccountId\": \"InvisiCashUSA_USD\", \"captureRequestId\": \"bWVyY2hhbnQgdHJhbnNhY3Rpb24gaWQ\", \"currencyCode\": \"INR\", \"refundAmount\": \"208000000\" } An example response looks like: { \"responseHeader\": { \"responseTimestamp\": \"1481900013178\" }, \"result\": \"SUCCESS\", \"paymentIntegratorRefundId\": \"cmVmdW5kIGlkZW50aWZpZXINCg\" } ",
        "parameters": [
          {
            "name": "body",
            "description": "The request body.",
            "in": "body",
            "schema": {
              "$ref": "#/definitions/RefundRequest"
            }
          }
        ],
        "responses": {
          "default": {
            "description": "Successful operation",
            "schema": {
              "$ref": "#/definitions/RefundResponse"
            }
          }
        }
      }
    },
    "/redirect-payment-token-v1/reserveFunds": {
      "post": {
        "tags": ["payment_integrator_redirect_payment_token_api"],
        "operationId": "ReserveFunds",
        "description": "Reserve funds on a token. This call synchronously attempts to reserve funds from a previously tokenized account. The response to this message will return the result of that attempt. No money is directly moved as the result of this call. The requested amount of funds should be reserved until a `captureFundsReservation`, a `cancelFundsReservation`, or until the reservation has reached the `reservationExpirationTimestamp` specified in the ReserveFundsResponse. The `requestId` within the header is the idempotency key and uniquely identifies this transaction. All mutations on this transaction (`cancelFundsReservation`, `captureFundsReservation`) populate the `requestId` value in their `reserveFundsRequestId` field. If the endpoint encounters an error while processing the request, the response body from this endpoint should be of type `ErrorResponse`. An example request looks like: { \"requestHeader\": { \"protocolVersion\": { \"major\": 1, \"minor\": 0, \"revision\": 0 }, \"requestId\": \"bWVyY2hhbnQgdHJhbnNhY3Rpb24gaWQ\", \"requestTimestamp\": \"1502220196077\" }, \"paymentIntegratorAccountId\": \"InvisiCashUSA_USD\", \"googlePaymentToken\": \"ZXhhbXBsZSB1bmlxdWUgcGF5bWVudCB0b2tlbiB2YWx1ZQ\", \"transactionDescription\": \"Google - Music\", \"currencyCode\": \"INR\", \"amount\": \"728000000\", \"reserveFundsContext\": { \"userIpAddress\":\"2001:4860:4860::8888\", \"shippingAddress\": { \"name\": \"Example Customer\", \"addressLine\": [\"123 Main St\"], \"localityName\": \"Springfield\", \"administrativeAreaName\": \"CO\", \"postalCodeNumber\": \"80309\", \"countryCode\": \"US\" } } } An example response looks like: { \"responseHeader\": { \"responseTimestamp\": \"1481900013178\" }, \"result\": \"SUCCESS\", \"paymentIntegratorTransactionId\": \"aW50ZWdyYXRvciB0cmFuc2FjdGlvbiBpZA\", \"expirationTimestamp\": \"1481900033178\", \"installmentPlan\": { \"installmentPlanType\": \"PAY_IN_3_INSTALLMENTS\" } } ",
        "parameters": [
          {
            "name": "body",
            "description": "The request body.",
            "in": "body",
            "schema": {
              "$ref": "#/definitions/ReserveFundsRequest"
            }
          }
        ],
        "responses": {
          "default": {
            "description": "Successful operation",
            "schema": {
              "$ref": "#/definitions/ReserveFundsResponse"
            }
          }
        }
      }
    },
    "/redirect-payment-token-v1/cancelFundsReservation": {
      "post": {
        "tags": ["payment_integrator_redirect_payment_token_api"],
        "operationId": "CancelFundsReservation",
        "description": "Initiates canceling the funds that were reserved by a `reserveFunds` call. This cancels the pending transaction by freeing the reserved funds. The `reserveFundsRequestId` identifies which funds reservation is being canceled. When this is used, there is no money movement from a customer's account for this transaction. The `requestId` within the header is the idempotency key and uniquely identifies this transaction. If the reservation of funds has expired or the payment integrator has automatically canceled the reservation, consider it a successful cancel rather than an error. Therefore, return a success result. If the endpoint encounters an error while processing the request, the response body from this endpoint should be of type `ErrorResponse`. An example request looks like: { \"requestHeader\": { \"protocolVersion\": { \"major\": 1, \"minor\": 0, \"revision\": 0 }, \"requestId\": \"G1NMPDFX4AW395L\", \"requestTimestamp\": \"1481907920000\" }, \"paymentIntegratorAccountId\": \"SpeedyPaymentsIndia_INR\", \"reserveFundsRequestId\": \"G1MQ0YERJ0Q7LPM\" } An example response looks like: { \"responseHeader\": { \"responseTimestamp\": \"1481907920760\" }, \"result\": \"SUCCESS\" } ",
        "parameters": [
          {
            "name": "body",
            "description": "The request body.",
            "in": "body",
            "schema": {
              "$ref": "#/definitions/CancelFundsReservationRequest"
            }
          }
        ],
        "responses": {
          "default": {
            "description": "Successful operation",
            "schema": {
              "$ref": "#/definitions/CancelFundsReservationResponse"
            }
          }
        }
      }
    },
    "/redirect-payment-token-v1/captureFundsReservation": {
      "post": {
        "tags": ["payment_integrator_redirect_payment_token_api"],
        "operationId": "CaptureFundsReservation",
        "description": "Initiates a capture of the funds reserved by a `reserveFunds` call. This initiates money movement by capturing funds that were previous reserved in a call to `reserveFunds`. The `reserveFundsRequestId` specifies which funds reservation is to be captured. The amount captured can be less than or equal to the amount reserved but each reservation may only be captured once. The `requestId` within the header is the idempotency key and uniquely identifies this transaction. All mutations on this transaction (`refund`) populate the `requestId` value in their `captureRequestId` field. If the endpoint encounters an error while processing the request, the response body from this endpoint should be of type `ErrorResponse`. An example request looks like: { \"requestHeader\": { \"protocolVersion\": { \"major\": 1, \"minor\": 0, \"revision\": 0 }, \"requestId\": \"G112YZH4XPDV88J\", \"requestTimestamp\": \"1481907920000\" }, \"paymentIntegratorAccountId\": \"SpeedyPaymentsIndia_INR\", \"reserveFundsRequestId\": \"G1MQ0YERJ0Q7LPM\", \"amount\": \"728000000\" } An example response looks like: { \"responseHeader\": { \"responseTimestamp\": \"1481907920760\" }, \"result\": \"SUCCESS\", \"paymentIntegratorCaptureId\": \"invicash\/ID::1323_abc\" } ",
        "parameters": [
          {
            "name": "body",
            "description": "The request body.",
            "in": "body",
            "schema": {
              "$ref": "#/definitions/CaptureFundsReservationRequest"
            }
          }
        ],
        "responses": {
          "default": {
            "description": "Successful operation",
            "schema": {
              "$ref": "#/definitions/CaptureFundsReservationResponse"
            }
          }
        }
      }
    }
  },
  "definitions": {
    "EchoRequest": {
      "description": "Request object for the echo method.",
      "type": "object",
      "properties": {
        "requestHeader": {
          "description": "**REQUIRED**: Common header for all requests.",
          "$ref": "#/definitions/RequestHeader"
        },
        "clientMessage": {
          "description": "**REQUIRED**: Message to echo in the response.",
          "type": "string"
        }
      }
    },
    "RequestHeader": {
      "description": "Header object that is defined on all requests sent to the server.",
      "type": "object",
      "properties": {
        "requestId": {
          "description": "**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 \"_\".",
          "type": "string"
        },
        "requestTimestamp": {
          "description": "**REQUIRED**: Timestamp of this request represented as milliseconds since epoch. The receiver should verify that this timestamp is \u00B1 60s of 'now'. This request timestamp is not idempotent upon retries.",
          "type": "string",
          "format": "int64"
        },
        "userLocale": {
          "description": "**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.",
          "type": "string"
        },
        "protocolVersion": {
          "description": "**REQUIRED**: The version of this request.",
          "$ref": "#/definitions/Version"
        }
      }
    },
    "Version": {
      "description": "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.",
      "type": "object",
      "properties": {
        "major": {
          "description": "**REQUIRED**: Major version. This is marked for compatibility requests with different versions are not guaranteed to be compatible.",
          "type": "integer",
          "format": "int32"
        },
        "minor": {
          "description": "**REQUIRED**: Minor version. This denotes significant bug fixes.",
          "type": "integer",
          "format": "int32"
        },
        "revision": {
          "description": "**REQUIRED**: Minor version. This denotes minor bug fixes.",
          "type": "integer",
          "format": "int32"
        }
      }
    },
    "EchoResponse": {
      "description": "Response object for the echo method.",
      "type": "object",
      "properties": {
        "responseHeader": {
          "description": "**REQUIRED**: Common header for all responses.",
          "$ref": "#/definitions/ResponseHeader"
        },
        "clientMessage": {
          "description": "**REQUIRED**: Message received in the request.",
          "type": "string"
        },
        "serverMessage": {
          "description": "**OPTIONAL**: Server message, independent of the `clientMessage` being echoed.",
          "type": "string"
        }
      }
    },
    "ResponseHeader": {
      "description": "Header object that is defined on all responses sent from the server.",
      "type": "object",
      "properties": {
        "responseTimestamp": {
          "description": "**REQUIRED**: Timestamp of this response represented as milliseconds since epoch. The receiver should verify that this timestamp is \u00B1 60s of 'now'.",
          "type": "string",
          "format": "int64"
        }
      }
    },
    "ErrorResponse": {
      "description": "Error Response object for all methods.",
      "type": "object",
      "properties": {
        "responseHeader": {
          "description": "**REQUIRED**: Common header for all responses.",
          "$ref": "#/definitions/ResponseHeader"
        },
        "errorResponseCode": {
          "description": "**OPTIONAL**: A code that captures the type of error that occurred.",
          "type": "string",
          "enum": [
            "UNKNOWN_ERROR_RESPONSE_CODE",
            "INVALID_API_VERSION",
            "INVALID_PAYLOAD_SIGNATURE",
            "INVALID_PAYLOAD_ENCRYPTION",
            "REQUEST_TIMESTAMP_OUT_OF_RANGE",
            "INVALID_IDENTIFIER",
            "IDEMPOTENCY_VIOLATION",
            "INVALID_FIELD_VALUE",
            "MISSING_REQUIRED_FIELD",
            "PRECONDITION_VIOLATION",
            "USER_ACTION_IN_PROGRESS",
            "INVALID_DECRYPTED_REQUEST",
            "FORBIDDEN"
          ]
        },
        "errorDescription": {
          "description": "**OPTIONAL**: Provide a description of this status for support reps to debug errors. Note that this is never shown to users. It can contain descriptive, non-sensitive text used for debugging. Note that some values for errorResponseCode should be accompanied by additional detail in this field. For example, `INVALID_IDENTIFIER` should be accompanied by information in this field as to which type of identifier was invalid. Warning: Do not include any tokens in this message unless they are defined as public.",
          "type": "string"
        },
        "paymentIntegratorErrorIdentifier": {
          "description": "**OPTIONAL**: This identifier is specific to the integrator and is generated by the integrator. It is used for debugging purposes only in order to identify this call. This is the identifier that the integrator knows this call by.",
          "type": "string"
        }
      }
    },
    "GetGeneratePaymentTokenRedirectStatusRequest": {
      "description": "Request object for the `GetGeneratePaymentTokenRedirectStatus` method.",
      "type": "object",
      "properties": {
        "requestHeader": {
          "description": "**REQUIRED**: Common header for all requests.",
          "$ref": "#/definitions/RequestHeader"
        },
        "redirectRequestId": {
          "description": "**REQUIRED**: The `requestId` sent in the original\/initiating redirect payment 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 \"_\".",
          "type": "string"
        }
      }
    },
    "GetGeneratePaymentTokenRedirectStatusResponse": {
      "description": "Response object for the `GetGeneratePaymentTokenRedirectStatus` method.",
      "type": "object",
      "properties": {
        "responseHeader": {
          "description": "**REQUIRED**: Common header for all responses.",
          "$ref": "#/definitions/ResponseHeader"
        },
        "result": {
          "description": "**REQUIRED**: Result of this redirect payment.",
          "$ref": "#/definitions/GeneratePaymentTokenRedirectResult"
        }
      }
    },
    "GeneratePaymentTokenRedirectResult": {
      "description": "Result details of the redirect payment.",
      "type": "object",
      "properties": {
        "success": {
          "description": "Successful redirect payment, deliver the goods.",
          "$ref": "#/definitions/Empty"
        },
        "pending": {
          "description": "Payment is pending a final answer. This is a non-terminal state to indiciate the token generation was inconclusive and will resolve to be a `success` or decline in the future via a `generatePaymentTokenRedirectCompleteNotification`. Depending on the Google product being purchased, if it takes too long for the integrator to tell Google the payment was successful, the payment may be considered canceled due to the user dropping out of session. A payment that is late in being marked successful (for some products) will immediately be refunded after the payment was reported as `success`. A `pending` result should not be used to indicate system errors, those should be reported using the `ErrorResponse`.",
          "$ref": "#/definitions/Empty"
        },
        "chargeExceedsTransactionLimit": {
          "description": "This redirect payment token request `amount` exceeds per-transaction limit.",
          "$ref": "#/definitions/Empty"
        },
        "chargeUnderLimit": {
          "description": "This redirect payment request `amount` does not meet the minimum transaction amount.",
          "$ref": "#/definitions/Empty"
        },
        "insufficientFunds": {
          "description": "This account does not have sufficient funds to guarantee this redirect payment token request.",
          "$ref": "#/definitions/Empty"
        },
        "userIneligible": {
          "description": "This user is not eligible for this redirect payment token request.",
          "$ref": "#/definitions/Empty"
        },
        "accountDoesNotSupportCurrency": {
          "description": "This account does not support the requested currency.",
          "$ref": "#/definitions/Empty"
        },
        "userExitedGeneratePaymentTokenFlow": {
          "description": "User canceled the whole payment attempt. At any point in the payment flow, the user performed an action that canceled the payment. This should be used only when the payment will not complete in the future.",
          "$ref": "#/definitions/Empty"
        },
        "riskDeclined": {
          "description": "The transaction was declined due to a risk check done by the integrator.",
          "$ref": "#/definitions/Empty"
        }
      }
    },
    "Empty": {
      "description": " This object is used for extensibility because booleans and enumerations often need to be extended with extra data. The implementer uses it to determine presence. The enumeration this represents may be extended to contain data in future versions. The JSON representation for `Empty` is empty JSON object `{}`.",
      "type": "object",
      "properties": {
      }
    },
    "RemittanceStatementNotificationRequest": {
      "description": "Request object for the remittance statement notification method.",
      "type": "object",
      "properties": {
        "requestHeader": {
          "description": "**REQUIRED**: Common header for all requests.",
          "$ref": "#/definitions/RequestHeader"
        },
        "paymentIntegratorAccountId": {
          "description": "**REQUIRED**: This is the payment integrator account identifier that identifies contractual constraints around this statement.",
          "type": "string"
        },
        "remittanceStatementSummary": {
          "description": "**REQUIRED**: Summary of this remittance statement.",
          "$ref": "#/definitions/RemittanceStatementSummary"
        }
      }
    },
    "RemittanceStatementSummary": {
      "description": "Summary object about a remittance statement.",
      "type": "object",
      "properties": {
        "statementDate": {
          "description": "**REQUIRED**: Date (in America\/Los Angeles) that this statement was created.",
          "type": "string",
          "format": "int64"
        },
        "billingPeriod": {
          "description": "**REQUIRED**: The billing period this statement covers.",
          "$ref": "#/definitions/BillingPeriod"
        },
        "dateDue": {
          "description": "**OPTIONAL**: The date that the remittance is due. This is represented as milliseconds from epoch. It is a date (and therefore will always start at the first millisecond of the day in the billing timezone). This is set as long as the `totalDueByIntegrator` is greater than 0.",
          "type": "string",
          "format": "int64"
        },
        "currencyCode": {
          "description": "**REQUIRED**: ISO 4217 3-letter currency code.",
          "type": "string"
        },
        "totalDueByIntegrator": {
          "description": "**REQUIRED**: This value is in micros in the currency of `currencyCode`. This value is always positive.",
          "type": "string",
          "format": "int64"
        },
        "remittanceInstructions": {
          "description": "**REQUIRED**: Details on how to remit payment",
          "$ref": "#/definitions/RemittanceInstructions"
        },
        "totalPresentmentAmounts": {
          "description": "**REQUIRED**: This is the total amount presented to the customer. There will be one entry for each presentment currency.",
          "type": "array",
          "items": {
            "$ref": "#/definitions/Amount"
          }
        }
      }
    },
    "BillingPeriod": {
      "description": "Billing period of this statement.",
      "type": "object",
      "properties": {
        "startDate": {
          "description": "**REQUIRED**: The start date of the billing period. This is represented as milliseconds from epoch. It is a date (and therefore will always start at the first millisecond of the day in the billing timezone). This is the first millisecond of the day of the billing period, 00:00:00.000",
          "type": "string",
          "format": "int64"
        },
        "endDate": {
          "description": "**REQUIRED**: The end date of the billing period. This is represented as milliseconds from epoch. This is the last millisecond of the last day of the billing period, 23:59:59.999",
          "type": "string",
          "format": "int64"
        }
      }
    },
    "RemittanceInstructions": {
      "description": "Structure holding information about how to pay this remittance notification.",
      "type": "object",
      "properties": {
        "memoLineId": {
          "description": "**REQUIRED**: Identifier that is mandatory to be put on the memo line for the payment for remittance identification.",
          "type": "string"
        }
      }
    },
    "Amount": {
      "description": "Associates an amount in micros with a currency code.",
      "type": "object",
      "properties": {
        "amountMicros": {
          "description": "**REQUIRED**: An amount in [micros]({{glossary_path}}#micros \"What are micros?\").",
          "type": "string",
          "format": "int64"
        },
        "currencyCode": {
          "description": "**REQUIRED**: ISO 4217 3-letter currency code",
          "type": "string"
        }
      }
    },
    "RemittanceStatementNotificationResponse": {
      "description": "Response object for the remittance statement notification method.",
      "type": "object",
      "properties": {
        "responseHeader": {
          "description": "**REQUIRED**: Common header for all responses.",
          "$ref": "#/definitions/ResponseHeader"
        },
        "paymentIntegratorStatementId": {
          "description": "**REQUIRED**: Identifier the integrator knows this statement as. This is integrator generated.",
          "type": "string"
        },
        "result": {
          "description": "**REQUIRED**: Result of this statement notification.",
          "type": "string",
          "enum": [
            "UNKNOWN_RESULT",
            "ACCEPTED"
          ]
        }
      }
    },
    "RefundRequest": {
      "description": "Request object for the refund method.",
      "type": "object",
      "properties": {
        "requestHeader": {
          "description": "**REQUIRED**: Common header for all requests.",
          "$ref": "#/definitions/RequestHeader"
        },
        "paymentIntegratorAccountId": {
          "description": "**REQUIRED**: This is the payment integrator account ID that defines contractual constraints around this transaction.",
          "type": "string"
        },
        "captureRequestId": {
          "description": "**REQUIRED**: A unique identifier for this transaction. This is the `requestId` generated by Google during the `capture` call which this request is associated with.",
          "type": "string"
        },
        "currencyCode": {
          "description": "**REQUIRED**: ISO 4217 3-letter currency code",
          "type": "string"
        },
        "refundAmount": {
          "description": "**REQUIRED**: The amount of the refund, a positive number of [micros]({{glossary_path}}#micros \"What are micros?\") of the currency unit.",
          "type": "string",
          "format": "int64"
        }
      }
    },
    "RefundResponse": {
      "description": "Response object for the refund method.",
      "type": "object",
      "properties": {
        "responseHeader": {
          "description": "**REQUIRED**: Common header for all responses.",
          "$ref": "#/definitions/ResponseHeader"
        },
        "paymentIntegratorRefundId": {
          "description": "**OPTIONAL**: This identifier is specific to the integrator and is generated by the integrator. This is the identifier that the integrator knows this refund by. For convenience, this identifier is included with in the remittance details",
          "type": "string"
        },
        "result": {
          "description": "**REQUIRED**: Result of this refund.",
          "type": "string",
          "enum": [
            "UNKNOWN_RESULT",
            "SUCCESS",
            "NO_MONEY_LEFT_ON_TRANSACTION",
            "ACCOUNT_CLOSED",
            "ACCOUNT_CLOSED_ACCOUNT_TAKEN_OVER",
            "ACCOUNT_CLOSED_FRAUD",
            "ACCOUNT_ON_HOLD",
            "REFUND_EXCEEDS_MAXIMUM_BALANCE",
            "REFUND_WINDOW_EXCEEDED",
            "CAPTURE_USED_PROMOTIONAL_BALANCE",
            "ISSUER_DOES_NOT_SUPPORT_REFUND",
            "GOOGLE_PAYMENT_TOKEN_INVALIDATED_BY_USER"
          ]
        },
        "rawResult": {
          "description": "**OPTIONAL**: Raw result of this refund. Used to help inform Google's risk engine and analytics. In decline code\u2013mapping situations, data is sometimes lost. The integrator can choose to give Google a raw code. For example, a credit card gateway (the integrator) may use this field to communicate to Google the exact decline code that was received from the VISA network. In that case, the `scope` would be \"visa\" and the `rawCode` would be whatever the VISA network returned. This value is **required** if the `result` is not `SUCCESS`.",
          "$ref": "#/definitions/RawResult"
        }
      }
    },
    "RawResult": {
      "description": "Raw result object.",
      "type": "object",
      "properties": {
        "scope": {
          "description": "**OPTIONAL**: Scope of the raw_code, can be empty.",
          "type": "string"
        },
        "rawCode": {
          "description": "**REQUIRED**: Raw code from the integrator or subsystems within it.",
          "type": "string"
        }
      }
    },
    "ReserveFundsRequest": {
      "description": "Request object for the reserve funds method.",
      "type": "object",
      "properties": {
        "requestHeader": {
          "description": "**REQUIRED**: Common header for all requests.",
          "$ref": "#/definitions/RequestHeader"
        },
        "paymentIntegratorAccountId": {
          "description": "**REQUIRED**: This is the payment integrator account identifier that identifies contractual constraints around this transaction.",
          "type": "string"
        },
        "googlePaymentToken": {
          "description": "**REQUIRED**: This is the token that both companies will use to identify the account for purchases between each other.",
          "type": "string"
        },
        "transactionDescription": {
          "description": "**REQUIRED**: This is the description of the transaction that can be put on the customer's statement. Localized to the userLocale found in the `request_header`. This format can be changed without notice and must never be parsed.",
          "type": "string"
        },
        "currencyCode": {
          "description": "**REQUIRED**: ISO 4217 3-letter currency code",
          "type": "string"
        },
        "amount": {
          "description": "**REQUIRED**: The amount of the purchase, in micros of the currency unit.",
          "type": "string",
          "format": "int64"
        },
        "reserveFundsContext": {
          "description": "**REQUIRED**: Context about this funds reservation.",
          "$ref": "#/definitions/ReserveFundsContext"
        }
      }
    },
    "ReserveFundsContext": {
      "description": "This object provides context about how the funds reservation was requested.",
      "type": "object",
      "properties": {
        "userIpAddress": {
          "description": "**OPTIONAL**: This is the IP address of the user's device if the purchase was made by a user in session. If the user was not in session this will empty. If the particular contract doesn't stipulate the need for this field it will always be empty.",
          "type": "string"
        },
        "shippingAddress": {
          "description": "**OPTIONAL**: This is the shipping address for a physical goods order. If the particular contract doesn't stipulate the need for this field it will always be empty.",
          "$ref": "#/definitions/Address"
        }
      }
    },
    "Address": {
      "description": "Structure holding information about an address.",
      "type": "object",
      "properties": {
        "name": {
          "description": "**OPTIONAL**: Customer's full name.",
          "type": "string"
        },
        "addressLine": {
          "description": "**OPTIONAL**: This holds unstructured Address text.",
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "localityName": {
          "description": "**OPTIONAL**: This is something of a fuzzy term, but it generally refers to the city\/town portion of an address. In regions of the world where localities are not well defined or do not fit into this structure well (for example, Japan and China), leave locality_name empty and use address_line. Examples: US city, IT comune, UK post town.",
          "type": "string"
        },
        "administrativeAreaName": {
          "description": "**OPTIONAL**: Top-level administrative subdivision of this country\" Examples: US state, IT region, CN province, JP prefecture.\"",
          "type": "string"
        },
        "postalCodeNumber": {
          "description": "**OPTIONAL**: Despite the name, postal_code_number values are frequently alphanumeric. Examples: \"94043\", \"SW1W\", \"SW1W 9TQ\".",
          "type": "string"
        },
        "countryCode": {
          "description": "**OPTIONAL**: Customer address country code, expected to be ISO-3166-1 Alpha-2.",
          "type": "string"
        }
      }
    },
    "ReserveFundsResponse": {
      "description": "Response object for the funds reservation method.",
      "type": "object",
      "properties": {
        "responseHeader": {
          "description": "**REQUIRED**: Common header for all responses.",
          "$ref": "#/definitions/ResponseHeader"
        },
        "paymentIntegratorTransactionId": {
          "description": "**REQUIRED**: This identifier is specific to the integrator and is generated by the integrator. This is the identifier that the integrator knows this transaction by.",
          "type": "string"
        },
        "result": {
          "description": "**REQUIRED**: Result of this funds reservation.",
          "type": "string",
          "enum": [
            "RESERVE_FUNDS_RESULT_CODE_UNSPECIFIED",
            "SUCCESS",
            "CHARGE_EXCEEDS_TRANSACTION_LIMIT",
            "CHARGE_EXCEEDS_DAILY_LIMIT",
            "CHARGE_EXCEEDS_MONTHLY_LIMIT",
            "CHARGE_UNDER_LIMIT",
            "INSUFFICIENT_FUNDS",
            "ACCOUNT_DOES_NOT_SUPPORT_CURRENCY",
            "ACCOUNT_CLOSED",
            "ACCOUNT_CLOSED_ACCOUNT_TAKEN_OVER",
            "ACCOUNT_ON_HOLD",
            "ACCOUNT_CLOSED_FRAUD",
            "GOOGLE_PAYMENT_TOKEN_INVALIDATED_BY_USER",
            "TOKEN_REFRESH_REQUIRED",
            "RISK_DECLINED"
          ]
        },
        "rawResult": {
          "description": "**OPTIONAL**: Raw result of this reservation. Used to help inform Google's risk engine and analytics. In decline code\u2013mapping situations, data is sometimes lost. The integrator can choose to give Google a raw code. For example, a credit card gateway (the integrator) may use this field to communicate to Google the exact decline code that was received from the VISA network. In that case, the `scope` would be \"visa\" and the `raw_code` would be whatever the VISA network returned. This value is **required** if the `result` is not `SUCCESS`.",
          "$ref": "#/definitions/RawResult"
        },
        "transactionLimit": {
          "description": "**OPTIONAL**: If Result is `CHARGE_EXCEEDS_TRANSACTION_LIMIT`, then this is the maximum amount the user could spend on a transaction (in micros). This is used for structured, user facing messaging and decline rate analysis. This must be a limit relative to the `currencyCode` on the request.",
          "type": "string",
          "format": "int64"
        },
        "expirationTimestamp": {
          "description": "**OPTIONAL**: The expiration timestamp for this funds reservation represented as milliseconds since epoch. This value is **required** if the `result` is `SUCCESS`.",
          "type": "string",
          "format": "int64"
        },
        "installmentPlan": {
          "description": "**OPTIONAL**: Information about the installment plan that this funds reservation is associated with. This field is **required** if the funds reservation is associated with an installment or financing plan. This information may be used to calculate processor fees.",
          "$ref": "#/definitions/ReserveFundsResponseInstallmentPlan"
        }
      }
    },
    "ReserveFundsResponseInstallmentPlan": {
      "description": "Information about an installment plan.",
      "type": "object",
      "properties": {
        "installmentPlanType": {
          "description": "**REQUIRED**: The installment plan type.",
          "type": "string",
          "enum": [
            "INSTALLMENT_PLAN_TYPE_UNSPECIFIED",
            "TERM_LOAN_24_MONTHS",
            "PAY_IN_3_INSTALLMENTS",
            "PAY_IN_4_INSTALLMENTS",
            "PAY_IN_6_INSTALLMENTS",
            "PAY_IN_9_INSTALLMENTS",
            "PAY_IN_12_INSTALLMENTS",
            "PAY_IN_18_INSTALLMENTS",
            "PAY_IN_36_INSTALLMENTS",
            "PAY_NOW",
            "PAY_30_DAYS_LATER"
          ]
        }
      }
    },
    "CancelFundsReservationRequest": {
      "description": "Request object for the cancel funds reservation method.",
      "type": "object",
      "properties": {
        "requestHeader": {
          "description": "**REQUIRED**: Common header for all requests.",
          "$ref": "#/definitions/RequestHeader"
        },
        "paymentIntegratorAccountId": {
          "description": "**REQUIRED**: This is the payment integrator account identifier that identifies contractual constraints around this transaction.",
          "type": "string"
        },
        "reserveFundsRequestId": {
          "description": "**REQUIRED**: `requestId` of the reserve funds call for this transaction.",
          "type": "string"
        }
      }
    },
    "CancelFundsReservationResponse": {
      "description": "Response object for the cancel method.",
      "type": "object",
      "properties": {
        "responseHeader": {
          "description": "**REQUIRED**: Common header for all responses.",
          "$ref": "#/definitions/ResponseHeader"
        },
        "result": {
          "description": "**REQUIRED**: Result of this cancel.",
          "type": "string",
          "enum": [
            "CANCEL_RESERVED_FUNDS_RESULT_CODE_UNSPECIFIED",
            "SUCCESS"
          ]
        }
      }
    },
    "CaptureFundsReservationRequest": {
      "description": "Request object for the capture funds reservation method.",
      "type": "object",
      "properties": {
        "requestHeader": {
          "description": "**REQUIRED**: Common header for all requests.",
          "$ref": "#/definitions/RequestHeader"
        },
        "paymentIntegratorAccountId": {
          "description": "**REQUIRED**: This is the payment integrator account identifier that identifies contractual constraints around this transaction.",
          "type": "string"
        },
        "reserveFundsRequestId": {
          "description": "**REQUIRED**: `requestId` of the reserve funds call for this transaction.",
          "type": "string"
        },
        "amount": {
          "description": "**REQUIRED**: The amount of the purchase, in micros of the currency unit specified in the prior funds reservation. This amount can be less than or equal to the amount specified in the prior funds reservation. An example situation when this would occur would be, if Google runs out of stock for one item in a an order with multiple items.",
          "type": "string",
          "format": "int64"
        }
      }
    },
    "CaptureFundsReservationResponse": {
      "description": "Response object for the capture method.",
      "type": "object",
      "properties": {
        "responseHeader": {
          "description": "**REQUIRED**: Common header for all responses.",
          "$ref": "#/definitions/ResponseHeader"
        },
        "paymentIntegratorCaptureId": {
          "description": "**REQUIRED**: This identifier is specific to the integrator and is generated by the integrator. This is the identifier that the integrator knows this capture by. For convenience, this identifier is included with in the remittance details",
          "type": "string"
        },
        "result": {
          "description": "**REQUIRED**: Result of this capture.",
          "type": "string",
          "enum": [
            "CAPTURE_RESERVED_FUNDS_RESULT_CODE_UNSPECIFIED",
            "SUCCESS",
            "FUNDS_RESERVATION_EXPIRED"
          ]
        },
        "rawResult": {
          "description": "**OPTIONAL**: Raw result of this capture. Used to help inform Google's risk engine and analytics. In decline code\u2013mapping situations, data is sometimes lost. The integrator can choose to give Google a raw code. For example, a credit card gateway (the integrator) may use this field to communicate to Google the exact decline code that was received from the VISA network. In that case, the `scope` would be \"visa\" and the `rawCode` would be whatever the VISA network returned. This value is **required** if the `result` is not `SUCCESS`.",
          "$ref": "#/definitions/RawResult"
        }
      }
    },
    "GeneratePaymentTokenRedirectRequest": {
      "description": "Request object for the Generate Payment Token Redirect flow. Here's an example of a clear text JSON request: { \"requestHeader\": { \"protocolVersion\": { \"major\": 1, \"minor\": 1, \"revision\": 0 }, \"requestId\": \"G112YZH4XPDV88J\", \"requestTimestamp\": \"1481907920000\" }, \"paymentIntegratorAccountId\": \"InvisiCashUSA_USD\", \"transactionAmount\": { \"amountMicros\": \"109900000\", \"currencyCode\": \"INR\" }, \"transactionDescription\": \"Google Store Purchase\", \"shippingAddress\": { \"name\": \"Example Customer\", \"addressLine\": [\"123 Main St\"], \"localityName\": \"Springfield\", \"administrativeAreaName\": \"CO\", \"postalCodeNumber\": \"80309\", \"countryCode\": \"US\" }, \"shippingAddressType\": \"STORE\", \"googleAccountDetails\": { \"emailAddress\": \"example@gmail.com\" }, \"customerPaymentHistorySignal\": { \"positivePaymentHistory\": {} } } The `GeneratePaymentTokenRedirectRequest` is encrypted and signed using PGP or JWE+JWS. Further, this value is web-safe `base64` encoded. This encoding is referred to below as `Base64UrlEncode`. In other words, the clear text JSON version of the `GeneratePaymentTokenRedirectRequest` must be passed through the following functions: Base64UrlEncode( PGPSignAndEncrypt( { \"requestHeader\": { \"protocolVersion\": { \"major\": 1, \"minor\": 1, \"revision\": 0 }, \"requestId\": \"G112YZH4XPDV88J\", \"requestTimestamp\": \"1481907920000\" }, \"paymentIntegratorAccountId\": \"InvisiCashUSA_USD\", \"transactionAmount\": { \"amountMicros\": \"109900000\", \"currencyCode\": \"INR\" }, \"transactionDescription\": \"Google Store Purchase\", \"shippingAddress\": { \"name\": \"Example Customer\", \"addressLine\": [\"123 Main St\"], \"localityName\": \"Springfield\", \"administrativeAreaName\": \"CO\", \"postalCodeNumber\": \"80309\", \"countryCode\": \"US\" }, \"shippingAddressType\": \"STORE\", \"googleAccountDetails\": { \"emailAddress\": \"example@gmail.com\" }, \"customerPaymentHistorySignal\": { \"positivePaymentHistory\": {} } } ) ) or Base64UrlEncode( JWSignAndEncrypt( { \"requestHeader\": { \"protocolVersion\": { \"major\": 1, \"minor\": 1, \"revision\": 0 }, \"requestId\": \"G112YZH4XPDV88J\", \"requestTimestamp\": \"1481907920000\" }, \"paymentIntegratorAccountId\": \"InvisiCashUSA_USD\", \"transactionAmount\": { \"amountMicros\": \"109900000\", \"currencyCode\": \"INR\" }, \"transactionDescription\": \"Google Store Purchase\", \"shippingAddress\": { \"name\": \"Example Customer\", \"addressLine\": [\"123 Main St\"], \"localityName\": \"Springfield\", \"administrativeAreaName\": \"CO\", \"postalCodeNumber\": \"80309\", \"countryCode\": \"US\" }, \"shippingAddressType\": \"STORE\", \"googleAccountDetails\": { \"emailAddress\": \"example@gmail.com\" }, \"customerPaymentHistorySignal\": { \"positivePaymentHistory\": {} } } ) ) ",
      "type": "object",
      "properties": {
        "requestHeader": {
          "description": "**REQUIRED**: Common header for all requests.",
          "$ref": "#/definitions/RequestHeader"
        },
        "paymentIntegratorAccountId": {
          "description": "**REQUIRED**: This is the payment integrator account identifier that identifies contractual constraints around this transaction.",
          "type": "string"
        },
        "transactionAmount": {
          "description": "**REQUIRED**: The amount of the transaction.",
          "$ref": "#/definitions/Amount"
        },
        "transactionDescription": {
          "description": "**REQUIRED**: A description of the transaction that can be shown to the user.",
          "type": "string"
        },
        "shippingAddress": {
          "description": "**OPTIONAL**: The shipping address of the customer\/store. This is used when there are physical goods being shipped to the user\/store.",
          "$ref": "#/definitions/Address"
        },
        "shippingAddressType": {
          "description": "**OPTIONAL**: Indicates the type of the shipping address. Should not be provided if shipping_address is not provided.",
          "type": "string",
          "enum": [
            "SHIPPING_ADDRESS_TYPE_UNSPECIFIED",
            "USER_ADDRESS",
            "STORE",
            "THIRD_PARTY_PICKUP_POINT"
          ]
        },
        "googleAccountDetails": {
          "description": "**OPTIONAL**: This is information about the user's Google account that Google has verified.",
          "$ref": "#/definitions/GoogleAccountDetails"
        },
        "enableAdditionalPaymentOptions": {
          "description": "**DEPRECATED**: If present, additional payment options may be presented to the user.",
          "$ref": "#/definitions/Empty"
        },
        "customerPaymentHistorySignal": {
          "description": "**OPTIONAL**: Carries signals about a customer's payment history, which can be used by payment integrators to inform risk decisions. Note: This signal is best-effort and may not always be present.",
          "$ref": "#/definitions/CustomerPaymentHistorySignal"
        }
      }
    },
    "GoogleAccountDetails": {
      "description": "Details about the user's Google account.",
      "type": "object",
      "properties": {
        "emailAddress": {
          "description": "**OPTIONAL**: The email address associated with the customer.",
          "type": "string"
        }
      }
    },
    "CustomerPaymentHistorySignal": {
      "description": "Carries signals about a customer's payment history, which can be used by payment integrators to inform risk decisions. This signal is computed on a best-effort basis.",
      "type": "object",
      "properties": {
        "positivePaymentHistory": {
          "description": "Indicates the user has transacted with Google previously and has a positive payment history.",
          "$ref": "#/definitions/Empty"
        },
        "noPaymentHistory": {
          "description": "Indicates the user has not transacted with Google previously.",
          "$ref": "#/definitions/Empty"
        }
      }
    }
  }
}
