{
  "openapi": "3.0.0",
  "info": {
    "title": "GooglePay API",
    "description": "REST 2.0 GooglePay API",
    "version": "1.1.0"
  },
  "servers": [
    {
      "url": "https://api-sandbox.nuvei.com/google-pay-api",
      "description": "sandbox"
    },
    {
      "url": "https://api.nuvei.com/google-pay-api",
      "description": "prod"
    }
  ],
  "tags": [
    {
      "name": "Google Pay Sessions"
    },
    {
      "name": "Domains Operations"
    }
  ],
  "paths": {
    "/entities/{entity-id}/domains": {
      "get": {
        "tags": [
          "Domains Operations"
        ],
        "summary": "Returns the list of registered domains for the Entity.",
        "description": "Returns the list of registered domains for the Entity.",
        "operationId": "getDomains",
        "parameters": [
          {
            "name": "entity-id",
            "in": "path",
            "description": "Entity ID",
            "required": true,
            "style": "simple",
            "explode": false,
            "schema": {
              "$ref": "#/components/schemas/EntityId"
            },
            "example": "45416a62-1eb5-456b-a25c-a70b3e1c323d"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetDomainsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetDomainsResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetDomainsResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetDomainsResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetDomainsResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetDomainsResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "accessToken": []
          },
          {
            "apiKey": []
          }
        ]
      }
    },
    "/entities/{entity-id}/domains/register": {
      "post": {
        "tags": [
          "Domains Operations"
        ],
        "summary": "Registers the provided list of domains for the Entity.",
        "description": "Registers the provided list of domains for the Entity",
        "operationId": "registerDomains",
        "parameters": [
          {
            "name": "entity-id",
            "in": "path",
            "description": "Entity ID",
            "required": true,
            "style": "simple",
            "explode": false,
            "schema": {
              "$ref": "#/components/schemas/EntityId"
            },
            "example": "45416a62-1eb5-456b-a25c-a70b3e1c323d"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RegisterDomainsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RegisterDomainsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RegisterDomainsResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RegisterDomainsResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RegisterDomainsResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RegisterDomainsResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RegisterDomainsResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "accessToken": []
          },
          {
            "apiKey": []
          }
        ]
      }
    },
    "/entities/{entity-id}/domains/unregister": {
      "post": {
        "tags": [
          "Domains Operations"
        ],
        "summary": "Unegisters the provided list of domains for the Entity.",
        "description": "Unregisters the provided list of domains for the Entity",
        "operationId": "unregisterDomains",
        "parameters": [
          {
            "name": "entity-id",
            "in": "path",
            "description": "Entity ID",
            "required": true,
            "style": "simple",
            "explode": false,
            "schema": {
              "$ref": "#/components/schemas/EntityId"
            },
            "example": "45416a62-1eb5-456b-a25c-a70b3e1c323d"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UnregisterDomainsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnregisterDomainsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnregisterDomainsResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnregisterDomainsResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnregisterDomainsResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnregisterDomainsResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnregisterDomainsResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "accessToken": []
          },
          {
            "apiKey": []
          }
        ]
      }
    },
    "/entities/{entity-id}/merchant-info": {
      "get": {
        "tags": [
          "Google Pay Sessions"
        ],
        "summary": "Retrieves a JWT for use with Google Wallet API.",
        "description": "Retrieves a JWT for use with Google Wallet API",
        "operationId": "getMerchantInfo",
        "parameters": [
          {
            "name": "entity-id",
            "in": "path",
            "description": "Entity ID",
            "required": true,
            "style": "simple",
            "explode": false,
            "schema": {
              "$ref": "#/components/schemas/EntityId"
            },
            "example": "45416a62-1eb5-456b-a25c-a70b3e1c323d"
          },
          {
            "name": "merchant_name",
            "in": "query",
            "description": "Merchant Name",
            "required": false,
            "style": "form",
            "explode": true,
            "schema": {
              "$ref": "#/components/schemas/MerchantName"
            },
            "example": "ACME Corporation"
          },
          {
            "name": "merchant_origin",
            "in": "query",
            "description": "Merchant Origin",
            "required": false,
            "style": "form",
            "explode": true,
            "schema": {
              "$ref": "#/components/schemas/DomainName"
            },
            "example": "www.acme.com"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantInfoResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantInfoResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantInfoResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantInfoResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantInfoResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantInfoResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "accessToken": []
          },
          {
            "apiKey": []
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "DomainStatus": {
        "type": "string",
        "enum": [
          "ACTIVE",
          "DISABLED"
        ]
      },
      "DomainName": {
        "maxLength": 2000,
        "minLength": 1,
        "type": "string"
      },
      "DomainNames": {
        "minItems": 1,
        "uniqueItems": true,
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/DomainName"
        }
      },
      "Domain": {
        "required": [
          "name",
          "status"
        ],
        "type": "object",
        "properties": {
          "name": {
            "$ref": "#/components/schemas/DomainName"
          },
          "status": {
            "$ref": "#/components/schemas/DomainStatus"
          }
        }
      },
      "Domains": {
        "uniqueItems": true,
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/Domain"
        }
      },
      "DomainsWrapped": {
        "type": "object",
        "properties": {
          "domains": {
            "$ref": "#/components/schemas/Domains"
          }
        }
      },
      "GetDomainsResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/DomainsWrapped"
          },
          {
            "$ref": "#/components/schemas/BaseApiResponse"
          }
        ]
      },
      "DomainResult": {
        "required": [
          "domain",
          "result"
        ],
        "type": "object",
        "properties": {
          "domain": {
            "$ref": "#/components/schemas/DomainName"
          },
          "result": {
            "$ref": "#/components/schemas/BaseApiResultOutput"
          }
        }
      },
      "DomainsResults": {
        "uniqueItems": true,
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/DomainResult"
        }
      },
      "DomainsResultsWrapped": {
        "type": "object",
        "properties": {
          "domains": {
            "$ref": "#/components/schemas/DomainsResults"
          }
        }
      },
      "RegisterDomainsRequest": {
        "required": [
          "domains",
          "googlePayTermsAndConditionsAccepted"
        ],
        "type": "object",
        "properties": {
          "googlePayTermsAndConditionsAccepted": {
            "type": "boolean"
          },
          "domains": {
            "$ref": "#/components/schemas/DomainNames"
          }
        }
      },
      "RegisterDomainsResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/DomainsResultsWrapped"
          },
          {
            "$ref": "#/components/schemas/BaseApiResponse"
          }
        ]
      },
      "UnregisterDomainsRequest": {
        "required": [
          "domains"
        ],
        "type": "object",
        "properties": {
          "domains": {
            "$ref": "#/components/schemas/DomainNames"
          }
        }
      },
      "UnregisterDomainsResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/DomainsResultsWrapped"
          },
          {
            "$ref": "#/components/schemas/BaseApiResponse"
          }
        ]
      },
      "MerchantId": {
        "maxLength": 100,
        "type": "string"
      },
      "MerchantName": {
        "maxLength": 100,
        "type": "string"
      },
      "Jwt": {
        "type": "string"
      },
      "MerchantInfo": {
        "type": "object",
        "properties": {
          "merchantId": {
            "$ref": "#/components/schemas/MerchantId"
          },
          "merchantOrigin": {
            "$ref": "#/components/schemas/DomainName"
          },
          "merchantName": {
            "$ref": "#/components/schemas/MerchantName"
          },
          "authJwt": {
            "$ref": "#/components/schemas/Jwt"
          }
        }
      },
      "MerchantInfoWrapped": {
        "type": "object",
        "properties": {
          "merchantInfo": {
            "$ref": "#/components/schemas/MerchantInfo"
          }
        }
      },
      "MerchantInfoResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/MerchantInfoWrapped"
          },
          {
            "$ref": "#/components/schemas/BaseApiResponse"
          }
        ]
      },
      "EntityId": {
        "type": "string",
        "description": "Entity ID",
        "format": "uuid"
      },
      "BaseApiResponse": {
        "required": [
          "result"
        ],
        "type": "object",
        "properties": {
          "result": {
            "$ref": "#/components/schemas/BaseApiResultOutput"
          }
        }
      },
      "BaseApiResultOutput": {
        "required": [
          "status"
        ],
        "type": "object",
        "properties": {
          "status": {
            "$ref": "#/components/schemas/BaseResultStatus"
          },
          "errors": {
            "$ref": "#/components/schemas/ResultError"
          }
        }
      },
      "BaseResultStatus": {
        "type": "string",
        "description": "Status of the request: success | error",
        "enum": [
          "success",
          "error"
        ]
      },
      "ResultError": {
        "required": [
          "code"
        ],
        "type": "object",
        "properties": {
          "code": {
            "maxLength": 11,
            "type": "string",
            "description": "If an error occurred on the request side, an error code is returned in this parameter.",
            "example": "7000.1000"
          },
          "reason": {
            "maxLength": 400,
            "type": "string",
            "description": "If an error occurred on the request side, then an error reason is returned in this parameter.",
            "example": "Internal Processing Error"
          },
          "reference": {
            "maxLength": 400,
            "type": "string",
            "description": "Reference value for troubleshooting",
            "example": "110.1260"
          }
        },
        "description": "If an error occurred on the request side, an error code is returned in this parameter."
      }
    },
    "parameters": {
      "entity-id": {
        "name": "entity-id",
        "in": "path",
        "description": "Entity ID",
        "required": true,
        "style": "simple",
        "explode": false,
        "schema": {
          "$ref": "#/components/schemas/EntityId"
        },
        "example": "45416a62-1eb5-456b-a25c-a70b3e1c323d"
      },
      "merchant_name": {
        "name": "merchant_name",
        "in": "query",
        "description": "Merchant Name",
        "required": false,
        "style": "form",
        "explode": true,
        "schema": {
          "$ref": "#/components/schemas/MerchantName"
        },
        "example": "ACME Corporation"
      },
      "merchant_origin": {
        "name": "merchant_origin",
        "in": "query",
        "description": "Merchant Origin",
        "required": false,
        "style": "form",
        "explode": true,
        "schema": {
          "$ref": "#/components/schemas/DomainName"
        },
        "example": "www.acme.com"
      }
    },
    "securitySchemes": {
      "accessToken": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      },
      "apiKey": {
        "type": "apiKey",
        "name": "X-API-KEY",
        "in": "header"
      }
    }
  }
}