{
  "swagger": "2.0",
  "info": {
    "title": "Google Standard Payments Google Hosted Chargeback Alert API",
    "description": "This includes services hosted by Google for Chargeback Alerts.",
    "version": "v1"
  },
  "host": "vgw.googleapis.com",
  "basePath": "/gsp",
  "schemes": ["https"],
  "paths": {
    "/chargeback-alert-v1/requestProactiveRefund": {
      "post": {
        "tags": ["vgw"],
        "operationId": "RequestProactiveRefund",
        "description": "Request that a transaction (possibly) be proactively refunded because a chargeback dispute is about to be filed against it.",
        "parameters": [
          {
            "name": "body",
            "description": "The request body.",
            "in": "body",
            "schema": {
              "$ref": "#/definitions/RequestProactiveRefundRequest"
            }
          }
        ],
        "responses": {
          "default": {
            "description": "Successful operation",
            "schema": {
              "$ref": "#/definitions/RequestProactiveRefundResponse"
            }
          }
        }
      }
    },
    "/chargeback-alert-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"
            }
          }
        }
      }
    }
  },
  "definitions": {
    "RequestProactiveRefundRequest": {
      "description": "Request payload for the `requestProactiveRefund` method.",
      "type": "object",
      "properties": {
        "requestHeader": {
          "description": "**REQUIRED**: Common header for all requests.",
          "$ref": "#/definitions/RequestHeader"
        },
        "paymentIntegratorAccountId": {
          "description": "**REQUIRED**: The payment integrator account identifier that identifies the caller and associated contractual constraints for this interaction.",
          "type": "string"
        },
        "paymentLookupCriteria": {
          "description": "**REQUIRED**: Criteria indicating the payment that is to be looked up for this inquiry.",
          "$ref": "#/definitions/PaymentLookupCriteria"
        },
        "requestOriginator": {
          "description": "**REQUIRED**: Information about the organization or organizational sub-group that originated this request.",
          "$ref": "#/definitions/RequestOriginator"
        },
        "amount": {
          "description": "**REQUIRED**: The requested refund amount.",
          "$ref": "#/definitions/Amount"
        },
        "fraudClassification": {
          "description": "**REQUIRED**: Whether the vendor considers the original transaction to be fraudulent.",
          "$ref": "#/definitions/FraudClassification"
        },
        "reasonCode": {
          "description": "**REQUIRED**: The reason for the chargeback alert.",
          "type": "string",
          "enum": [
            "UNKNOWN_REASON",
            "FRAUD",
            "FAMILIAR_FRAUD",
            "SUSPICIOUS",
            "CHARGE_NOT_RECOGNIZED",
            "CREDIT_NOT_PROCESSED",
            "DUPLICATE_PAYMENT",
            "SUBSCRIPTION_CANCELED",
            "INPUT_ERROR",
            "INSUFFICIENT_FUNDS",
            "NOT_DELIVERED",
            "DEFECTIVE_OR_NOT_AS_DESCRIBED",
            "INCORRECT_MERCHANDISE",
            "UNWANTED_MERCHANDISE",
            "TRANSACTION_AMOUNT_DIFFER",
            "PAID_BY_OTHER_MEANS",
            "LATE_PRESENTMENT"
          ]
        },
        "rawResult": {
          "description": "**OPTIONAL**: Raw result of this chargeback alert. Used to help inform Google's risk engine and analytics. In chargeback 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 chargeback 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 (example: \"10.4\").",
          "$ref": "#/definitions/RawResult"
        },
        "refundIssuer": {
          "description": "**REQUIRED**: Which party is responsible for issuing a refund.",
          "type": "string",
          "enum": [
            "UNKNOWN_TYPE",
            "MERCHANT",
            "ACQUIRER"
          ]
        }
      }
    },
    "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"
        }
      }
    },
    "PaymentLookupCriteria": {
      "description": "Container for criteria that can uniquely lookup a payment. One (and only one) member field must be populated.",
      "type": "object",
      "properties": {
        "arnCriteria": {
          "description": "Lookup based on Acquirer Reference Number (ARN).",
          "$ref": "#/definitions/PaymentLookupCriteriaArnCriteria"
        },
        "googleTransactionReferenceNumberCriteria": {
          "description": "Lookup based on the Google Transaction Reference Number.",
          "$ref": "#/definitions/PaymentLookupCriteriaGoogleTransactionReferenceNumberCriteria"
        }
      }
    },
    "PaymentLookupCriteriaArnCriteria": {
      "description": "Payment lookup criteria based on Acquirer Reference Number (ARN).",
      "type": "object",
      "properties": {
        "acquirerReferenceNumber": {
          "description": "**REQUIRED**: The Acquirer Reference Number (ARN) that uniquely identifies the payment. Must be 23-24 digits long.",
          "type": "string"
        },
        "authorizationCode": {
          "description": "**REQUIRED**: The Authorization Code for the transaction.",
          "type": "string"
        }
      }
    },
    "PaymentLookupCriteriaGoogleTransactionReferenceNumberCriteria": {
      "description": "Payment lookup criteria based on the Google-generated Transaction Reference Number.",
      "type": "object",
      "properties": {
        "googleTransactionReferenceNumber": {
          "description": "**REQUIRED**: The Google-generated Transaction Reference Number that uniquely identifies the payment.",
          "type": "string"
        },
        "authorizationCode": {
          "description": "**REQUIRED**: The Authorization Code for the transaction.",
          "type": "string"
        }
      }
    },
    "RequestOriginator": {
      "description": "Information about the organization or organizational sub-group, and optionally the employee, 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.",
      "type": "object",
      "properties": {
        "organizationId": {
          "description": "**REQUIRED**: An identifier of the company, organization, or organizational group from which this request originated. Must be unique within this `paymentIntegratorAccountId`.",
          "type": "string"
        },
        "organizationDescription": {
          "description": "**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.",
          "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"
        }
      }
    },
    "FraudClassification": {
      "description": "Container for whether or not the vendor considers the original transaction fraudulent. One (and only one) member field must be present.",
      "type": "object",
      "properties": {
        "fraudulent": {
          "description": "The original transaction was fraudulent.",
          "$ref": "#/definitions/FraudClassificationFraudulent"
        },
        "notFraudulent": {
          "description": "The original transaction was not fraudulent.",
          "$ref": "#/definitions/FraudClassificationNotFraudulent"
        }
      }
    },
    "FraudClassificationFraudulent": {
      "description": "Details for a transaction that was fraudulent.",
      "type": "object",
      "properties": {
        "fraudType": {
          "description": "**REQUIRED**: The type of Fraud.",
          "type": "string",
          "enum": [
            "UNKNOWN_TYPE",
            "FRAUDULENT_USE",
            "COUNTERFEIT",
            "LOST",
            "STOLEN",
            "ACCOUNT_TAKEOVER",
            "FRAUDULENT_APPLICATION",
            "CARD_NOT_RECEIVED",
            "OTHER",
            "SCAM",
            "MERCHANT_FRAUD"
          ]
        }
      }
    },
    "FraudClassificationNotFraudulent": {
      "description": "Details for a transaction that was not fraudulent.",
      "type": "object",
      "properties": {
      }
    },
    "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"
        }
      }
    },
    "RequestProactiveRefundResponse": {
      "description": "Response payload for the `requestProactiveRefund` method.",
      "type": "object",
      "properties": {
        "responseHeader": {
          "description": "**REQUIRED**: Common header for all responses.",
          "$ref": "#/definitions/ResponseHeader"
        },
        "result": {
          "description": "**REQUIRED**: The result of the proactive refund request.",
          "$ref": "#/definitions/RequestProactiveRefundResponseResult"
        }
      }
    },
    "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"
        }
      }
    },
    "RequestProactiveRefundResponseResult": {
      "description": "A container for the response details. Exactly one member field must be populated.",
      "type": "object",
      "properties": {
        "notRefunded": {
          "description": "The transaction was not and should not be refunded.",
          "$ref": "#/definitions/RequestProactiveRefundResponseResultNotRefunded"
        },
        "refunded": {
          "description": "Google refunded the transaction.",
          "$ref": "#/definitions/RequestProactiveRefundResponseResultRefunded"
        },
        "acquirerShouldRefund": {
          "description": "The acquirer should refund the transaction.",
          "$ref": "#/definitions/RequestProactiveRefundResponseResultAcquirerShouldRefund"
        }
      }
    },
    "RequestProactiveRefundResponseResultNotRefunded": {
      "description": "Details of why the transaction was not refunded.",
      "type": "object",
      "properties": {
        "decisionReason": {
          "description": "**REQUIRED**: The reason why the transaction was not and should not be refunded.",
          "type": "string",
          "enum": [
            "UNKNOWN_REASON",
            "PREVIOUSLY_REFUNDED",
            "PREVIOUSLY_CHARGED_BACK",
            "REQUEST_EXCEEDS_TRANSACTION_AMOUNT",
            "OTHER"
          ]
        }
      }
    },
    "RequestProactiveRefundResponseResultRefunded": {
      "description": "Google refunded the transaction.",
      "type": "object",
      "properties": {
        "amount": {
          "description": "**REQUIRED**: The amount refunded. This may differ from the requested amount if, for example, the amount requested exceeded that of the original transaction.",
          "$ref": "#/definitions/Amount"
        }
      }
    },
    "RequestProactiveRefundResponseResultAcquirerShouldRefund": {
      "description": "The acquirer should refund the transaction.",
      "type": "object",
      "properties": {
        "amount": {
          "description": "**REQUIRED**: The amount that should refunded. This may differ from the requested amount if, for example, the amount requested exceeded that of the original transaction.",
          "$ref": "#/definitions/Amount"
        }
      }
    },
    "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"
        }
      }
    },
    "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"
        }
      }
    },
    "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"
        }
      }
    }
  }
}
