{
  "swagger": "2.0",
  "info": {
    "title": "Google Standard Payments Google Hosted Redirect Payment Token API",
    "description": "This includes services hosted by Google for Redirect Payment Tokens.",
    "version": "v1"
  },
  "host": "vgw.googleapis.com",
  "basePath": "/gsp",
  "schemes": ["https"],
  "paths": {
    "/redirect-payment-token-v1/echo": {
      "post": {
        "tags": ["vgw"],
        "operationId": "Echo",
        "description": "Echos back the `clientMessage` passed in. The purpose of this method is to test basic connectivity between the payment integrator and Google. If the echo is successful, the endpoint will return an HTTP 200 and the response will be of type `EchoResponse`. If the endpoint encounters an error while processing the request, the endpoint will return HTTP 4xx or 5xx and the HTTP body will either be of type `ErrorResponse` or contain a generic error (e.g. a message similar to \"There was an error. Please try again later.\"). The generic error is used in situations where an `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 a generic error. If the request signature could be verified, additional information regarding the error will be returned in an `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/generatePaymentTokenRedirectCompleteNotification": {
      "post": {
        "tags": ["vgw"],
        "operationId": "GeneratePaymentTokenRedirectCompleteNotification",
        "description": "Notify Google of the status of a redirect payment. An example request looks like: { \"requestHeader\": { \"protocolVersion\": { \"major\": 1, \"minor\": 1, \"revision\": 0 }, \"requestId\": \"cmVxdWVzdDE\", \"requestTimestamp\": \"1481907920000\" }, \"redirectRequestId\": \"cmVxdWVzdDE\", \"result\": { \"chargeExceedsTransactionLimit\": {} } } An example response looks like: { \"responseHeader\": { \"responseTimestamp\": \"1481899949611\" }, \"result\": { \"accepted\": {} } } ",
        "parameters": [
          {
            "name": "body",
            "description": "The request body.",
            "in": "body",
            "schema": {
              "$ref": "#/definitions/GeneratePaymentTokenRedirectCompleteNotificationRequest"
            }
          }
        ],
        "responses": {
          "default": {
            "description": "Successful operation",
            "schema": {
              "$ref": "#/definitions/GeneratePaymentTokenRedirectCompleteNotificationResponse"
            }
          }
        }
      }
    },
    "/redirect-payment-token-v1/remittanceStatementDetails": {
      "post": {
        "tags": ["vgw"],
        "operationId": "RemittanceStatementDetails",
        "description": "Returns transaction detail information about a remittance statement. This is a paginated API. The number of transaction events per page can be specified with `numberOfEvents`. If unspecified, the maximum of 1000 events will be returned per page. Each request to this API will return a `nextEventOffset` pointing to the next transaction event in the statement, as well as `totalEvents` specifying the total number of transactions in the statement. If the current retrieved page contains the last transactions of the statement, `nextEventOffset` will not be present in the response. The `statementId` value is the `requestId` from the request to `remittanceStatementNotification` If the endpoint encounters an error while processing the request, the endpoint will return HTTP 4xx or 5xx and the HTTP body will either be of type `ErrorResponse` or contain a generic error (e.g. a message similar to \"There was an error. Please try again later.\"). The generic error is used in situations where an `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 a generic error. If the request signature could be verified, additional information regarding the error will be returned in an `ErrorResponse`. An example request looks like: { \"requestHeader\": { \"protocolVersion\": { \"major\": 1, \"minor\": 0, \"revision\": 0 }, \"requestId\": \"statement_detail_request_139932019\", \"requestTimestamp\": \"1502551332087\" }, \"paymentIntegratorAccountId\": \"InvisiCashUSA_USD\", \"statementId\": \"0123434-statement-abc\", \"numberOfEvents\": 4 } An example response looks like: { \"responseHeader\": { \"responseTimestamp\": \"1481900013178\" }, \"eventOffset\": 0, \"nextEventOffset\": 4, \"totalEvents\": 15, \"remittanceStatementSummary\": { \"statementDate\": \"1502521200000\", \"billingPeriod\": { \"startDate\": \"1502434800000\", \"endDate\": \"1502434800000\" }, \"dateDue\": \"1502348400000\", \"currencyCode\": \"INR\", \"totalDueByIntegrator\": \"1076000000\", \"totalPresentmentAmounts\": [ { \"amountMicros\": \"1076000000\", \"currencyCode\": \"INR\" } ], \"remittanceInstructions\": { \"memoLineId\": \"stmt-1AB-pp0-invisi\" } }, \"captureEvents\": [ { \"eventRequestId\": \"bWVyY2hhbnQgdHJhbnNhY3Rpb24gaWQ\", \"paymentIntegratorEventId\": \"ioj32SOIjf23oijSDfoij\", \"eventCharge\": \"700000000\", \"eventFee\": \"-28000000\" }, { \"eventRequestId\": \"Ggghvh78200PQ3Yrpb\", \"paymentIntegratorEventId\": \"iasdf23dSdfijSDfoij\", \"eventCharge\": \"800000000\", \"eventFee\": \"-32000000\" } ], \"refundEvents\": [ { \"eventRequestId\": \"liUrreQY233839dfFFb24gaQM\", \"paymentIntegratorEventId\": \"asd3SDf3f3oijSDfoij\", \"eventCharge\": \"-200000000\", \"eventFee\": \"8000000\" }, { \"eventRequestId\": \"IIghhhUrreQY233839II9qM==\", \"paymentIntegratorEventId\": \"DFjidoso12FSDFSDE\", \"eventCharge\": \"-150000000\", \"eventFee\": \"6000000\" } ] } ",
        "parameters": [
          {
            "name": "body",
            "description": "The request body.",
            "in": "body",
            "schema": {
              "$ref": "#/definitions/RemittanceStatementDetailsRequest"
            }
          }
        ],
        "responses": {
          "default": {
            "description": "Successful operation",
            "schema": {
              "$ref": "#/definitions/RemittanceStatementDetailsResponse"
            }
          }
        }
      }
    },
    "/redirect-payment-token-v1/acceptRemittanceStatement": {
      "post": {
        "tags": ["vgw"],
        "operationId": "AcceptRemittanceStatement",
        "description": "Tells Google that the statement indicated in this request will be paid. If the endpoint encounters an error while processing the request, the endpoint will return HTTP 4xx or 5xx and the HTTP body will either be of type `ErrorResponse` or contain a generic error (e.g. a message similar to \"There was an error. Please try again later.\"). The generic error is used in situations where an `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 a generic error. If the request signature could be verified, additional information regarding the error will be returned in an `ErrorResponse`. An example request looks like: { \"requestHeader\": { \"protocolVersion\": { \"major\": 1, \"minor\": 0, \"revision\": 0 }, \"requestId\": \"0123434-abc\", \"requestTimestamp\": \"1502545413098\" }, \"paymentIntegratorAccountId\": \"InvisiCashUSA_USD\", \"statementId\": \"0123434-statement-abc\" } An example response looks like: { \"responseHeader\": { \"responseTimestamp\": \"1519996752221\" }, \"acceptRemittanceStatementResultCode\": \"SUCCESS\" } ",
        "parameters": [
          {
            "name": "body",
            "description": "The request body.",
            "in": "body",
            "schema": {
              "$ref": "#/definitions/AcceptRemittanceStatementRequest"
            }
          }
        ],
        "responses": {
          "default": {
            "description": "Successful operation",
            "schema": {
              "$ref": "#/definitions/AcceptRemittanceStatementResponse"
            }
          }
        }
      }
    }
  },
  "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"
        }
      }
    },
    "GeneratePaymentTokenRedirectCompleteNotificationRequest": {
      "description": "Request object for the `generatePaymentTokenRedirectCompleteNotification` 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"
        },
        "result": {
          "description": "**REQUIRED**: Result of this redirect payment.",
          "$ref": "#/definitions/GeneratePaymentTokenRedirectCompleteNotificationRequestRedirectPaymentNotificationRequestResult"
        }
      }
    },
    "GeneratePaymentTokenRedirectCompleteNotificationRequestRedirectPaymentNotificationRequestResult": {
      "description": "Result details of the redirect payment.",
      "type": "object",
      "properties": {
        "success": {
          "description": "Successful redirect payment, deliver the goods.",
          "$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"
        },
        "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": {
      }
    },
    "GeneratePaymentTokenRedirectCompleteNotificationResponse": {
      "description": "Response object for the `generatePaymentTokenRedirectCompleteNotification` method.",
      "type": "object",
      "properties": {
        "responseHeader": {
          "description": "**REQUIRED**: Common header for all responses.",
          "$ref": "#/definitions/ResponseHeader"
        },
        "result": {
          "description": "**REQUIRED**: Contains the result of the request.",
          "$ref": "#/definitions/GeneratePaymentTokenRedirectCompleteNotificationResponseRedirectPaymentNotificationResult"
        }
      }
    },
    "GeneratePaymentTokenRedirectCompleteNotificationResponseRedirectPaymentNotificationResult": {
      "description": "Details corresponding to the result.",
      "type": "object",
      "properties": {
        "accepted": {
          "description": "The `RedirectPaymentCompleteNotificationRequest` was valid and is now being processed by Google.",
          "$ref": "#/definitions/Empty"
        }
      }
    },
    "RemittanceStatementDetailsRequest": {
      "description": "Request object for the remittance statement detail 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"
        },
        "statementId": {
          "description": "**REQUIRED**: Request ID of the statement notification.",
          "type": "string"
        },
        "eventOffset": {
          "description": "**OPTIONAL**: Return events starting at this offset. This should be set to the `nextEventOffset` if one was returned or left unspecified if this is the first request. If `eventOffset` is zero, events will be returned starting with the first event. If this is two, events will be returned starting with the third event. If unspecified, `eventOffset` will be assumed to be zero. *Note:* If `eventOffset` exceeds the total number of events (i.e. `eventOffset` >= `totalEvents`) then no events will be returned. ",
          "type": "integer",
          "format": "int32"
        },
        "numberOfEvents": {
          "description": "**OPTIONAL**: Number of events to show per page. If unspecified or greater than 1000, this will be 1000.",
          "type": "integer",
          "format": "int32"
        }
      }
    },
    "RemittanceStatementDetailsResponse": {
      "description": "Response object for the remittance statement detail method.",
      "type": "object",
      "properties": {
        "responseHeader": {
          "description": "**REQUIRED**: Common header for all responses.",
          "$ref": "#/definitions/ResponseHeader"
        },
        "remittanceStatementSummary": {
          "description": "**REQUIRED**: Summary of this remittance statement.",
          "$ref": "#/definitions/RemittanceStatementSummary"
        },
        "eventOffset": {
          "description": "**REQUIRED**: The event offset of this response.",
          "type": "integer",
          "format": "int32"
        },
        "nextEventOffset": {
          "description": "**OPTIONAL**: The offset of the next event to return. If unspecified there are no more events to retrieve for this statement.",
          "type": "integer",
          "format": "int32"
        },
        "totalEvents": {
          "description": "**REQUIRED**: Total number of events in this statement.",
          "type": "integer",
          "format": "int32"
        },
        "totalWithholdingTaxes": {
          "description": "**REQUIRED**: The sum of all taxes withheld for this statement. This value is in [micros]({{glossary_path}}#micros \"What are micros?\").",
          "type": "string",
          "format": "int64"
        },
        "captureEvents": {
          "description": "**REQUIRED**: Set of capture events. *Note:* this is a set, it has no defined order. ",
          "type": "array",
          "items": {
            "$ref": "#/definitions/RemittanceStatementDetailsResponseEvent"
          }
        },
        "refundEvents": {
          "description": "**REQUIRED**: Set of refund events. *Note:* this is a set, it has no defined order. ",
          "type": "array",
          "items": {
            "$ref": "#/definitions/RemittanceStatementDetailsResponseEvent"
          }
        },
        "reverseRefundEvents": {
          "description": "**OPTIONAL**: Set of reverse refund events. *Note:* this is a set, it has no defined order. ",
          "type": "array",
          "items": {
            "$ref": "#/definitions/RemittanceStatementDetailsResponseEvent"
          }
        },
        "chargebackEvents": {
          "description": "**OPTIONAL**: Set of chargeback events. *Note:* this is a set, it has no defined order. ",
          "type": "array",
          "items": {
            "$ref": "#/definitions/RemittanceStatementDetailsResponseEvent"
          }
        },
        "reverseChargebackEvents": {
          "description": "**OPTIONAL**: Set of reverse chargeback events. *Note:* this is a set, it has no defined order. ",
          "type": "array",
          "items": {
            "$ref": "#/definitions/RemittanceStatementDetailsResponseEvent"
          }
        },
        "adjustmentEvents": {
          "description": "**OPTIONAL**: Set of adjustment events. Adjustment events may be added at Google's discretion to reconcile billing discrepancies, for example if fees were undercomputed for a set of prior transactions, an adjustment may be used to make the integrator whole. *Note:* this is a set, it has no defined order. ",
          "type": "array",
          "items": {
            "$ref": "#/definitions/RemittanceStatementDetailsResponseEvent"
          }
        }
      }
    },
    "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"
        }
      }
    },
    "RemittanceStatementDetailsResponseEvent": {
      "description": "Structure representing a single event included in a remittance statement.",
      "type": "object",
      "properties": {
        "eventRequestId": {
          "description": "**REQUIRED**: For capture or refund events, this will be the `requestId` that Google sends with the request. For reverse refund, chargeback and reverse chargeback events, this will be the `requestId` that the Payment Integrator sends with the notification of that event. For adjustments, this will be a unique ID assigned by Google to the adjustment event.",
          "type": "string"
        },
        "paymentIntegratorEventId": {
          "description": "**REQUIRED**: ID the payment integrator returned for this event. For a capture this is the `paymentIntegratorTransactionId` from the response to a `capture` call, for a refund this is the `paymentIntegratorRefundId` from the response to a `refund` call. This field is of variable length, as an integrator whatever ID you supply for this event will be reflected here. If a value was not provided by the integrator for the corresponding event, this field will contain the same value as the `eventRequestId` field. For reverse refund, chargeback and reverse chargeback events this will be the `requestId` that the Payment Integrator sent with the notification of the event. The length and format of this field depends on the source field for each ID. Refer to the documentation for each of the source fields for details about length and character set requirements. In particular, note that this field can sometimes contain Google-generated IDs which may have different max length requirements than integrator-generated IDs.",
          "type": "string"
        },
        "eventCharge": {
          "description": "**REQUIRED**: In currency code defined by the statement. If this value is negative then this represents monetary value moving from Google to the payment integrator. If this is positive it is money from the payment integrator due to Google. For example, capture transactions will always be positive, and refund transactions will always be negative. Reverse refund and reverse chargeback events will always be positive. Chargeback events will always be negative. This value is in [micros]({{glossary_path}}#micros \"What are micros?\").",
          "type": "string",
          "format": "int64"
        },
        "eventFee": {
          "description": "**REQUIRED**: In currency code defined by the statement. If this value is negative then this represents monetary value moving from Google to the payment integrator. If this is positive it is money from the payment integrator due to Google. For example, if an agreement says that Google will pay 1% of the `transactionCharge` to the payment integrator, and will reverse that 1% upon refund of that transaction, then the capture fee will be negative and upon refund the refund fee will be positive. This value is in [micros]({{glossary_path}}#micros \"What are micros?\").",
          "type": "string",
          "format": "int64"
        },
        "presentmentChargeAmount": {
          "description": "**OPTIONAL**: Transaction amount in the presentment (aka transaction) currency prior to foreign exchange. This field follows the same sign convention as the `eventCharge` field. This value is in [micros]({{glossary_path}}#micros \"What are micros?\"). *Note:* This will be required in version 1.1 ",
          "type": "string",
          "format": "int64"
        },
        "presentmentCurrencyCode": {
          "description": "**OPTIONAL**: ISO 4217 3-letter currency code denominating the presentment (transaction) currency. *Note:* This will be required in version 1.1 ",
          "type": "string"
        },
        "exchangeRate": {
          "description": "**DEPRECATED**: The exchange rate used in converting the presentment amount to the settlement (invoice) amount. This value is in *micro* basis points (1 basis point = .0001 = .01%). That is, to get the exchange rate, divide this field by 10^10.",
          "type": "string",
          "format": "int64"
        },
        "nanoExchangeRate": {
          "description": "**OPTIONAL**: The exchange rate used in converting the presentment amount to the settlement (invoice) amount, expressed in nano basis points. This value is in *nano* basis points (1 basis point = .0001 = .01%). That is, to get the exchange rate, divide this field by 10^13. Both this field and exchange_rate will be populated. They are equivalent exchange rates expressed with different precision. In future versions, exchange_rate will be removed in favor of nano_exchange_rate. *Note:* This will be required in version 1.1 ",
          "type": "string",
          "format": "int64"
        }
      }
    },
    "AcceptRemittanceStatementRequest": {
      "description": "Request object for the `acceptRemittanceStatement` 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"
        },
        "statementId": {
          "description": "**REQUIRED**: Request ID of the statement notification.",
          "type": "string"
        }
      }
    },
    "AcceptRemittanceStatementResponse": {
      "description": "Response object for the `acceptRemittanceStatement` method.",
      "type": "object",
      "properties": {
        "responseHeader": {
          "description": "**REQUIRED**: Common header for all responses.",
          "$ref": "#/definitions/ResponseHeader"
        },
        "acceptRemittanceStatementResultCode": {
          "description": "**REQUIRED**: Result of the AcceptRemittanceStatement call.",
          "type": "string",
          "enum": [
            "UNKNOWN_RESULT",
            "SUCCESS"
          ]
        }
      }
    },
    "GeneratePaymentTokenRedirectResponse": {
      "description": "Response object for the Complete Redirect flow. Here's an example of a clear text JSON request: { \"redirectRequestId\": \"cmVxdWVzdDE\", \"result\": { \"success\": {} } } The `GeneratePaymentTokenRedirectResponse` 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 `GeneratePaymentTokenRedirectResponse` must be passed through the following functions: Base64UrlEncode( PGPSignAndEncrypt( { \"redirectRequestId\": \"cmVxdWVzdDE\", \"result\": { \"success\": {} } } ) ) or Base64UrlEncode( JWSignAndEncrypt( { \"redirectRequestId\": \"cmVxdWVzdDE\", \"result\": { \"success\": {} } } ) ) ",
      "type": "object",
      "properties": {
        "redirectRequestId": {
          "description": "**REQUIRED**: Unique identifier of the initiating redirect 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"
        },
        "result": {
          "description": "Result of this redirect payment if it was successful, declined, or pending.",
          "$ref": "#/definitions/GeneratePaymentTokenRedirectResult"
        },
        "errorResponse": {
          "description": "Details if the redirect failed because of an error. Redirect payments that receive this reply are kept open, and the integrator can later send a `redirectPaymentCompleteNotification` if the payment was successful or declined.",
          "$ref": "#/definitions/GeneratePaymentTokenRedirectErrorResponse"
        }
      }
    },
    "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"
        }
      }
    },
    "GeneratePaymentTokenRedirectErrorResponse": {
      "description": "Details about the error that occurred during the redirect payment.",
      "type": "object",
      "properties": {
        "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. Warning: Do not include any tokens in this message unless they are defined as public.",
          "type": "string"
        },
        "errorResponseResult": {
          "description": "**REQUIRED**: 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"
          ]
        }
      }
    }
  }
}
