openapi: 3.0.0
servers:
  - description: Production
    url: https://apiz.ebay.com{basePath}
    variables:
      basePath:
        default: /commerce/identity/v1
info:
  contact:
    name: eBay Inc,
    x-twitter: ebay
  description: <span class="tablenote"><b>Note:</b> Not all the account related fields are returned for an authenticated user. The fields returned in the response are controlled by the scopes and are available only to select developers approved by business units.</span><br /><br />Retrieves the authenticated user's account profile information. It can be used to let users log into your app or site using eBay, which frees you from needing to store and protect user's PII (Personal Identifiable Information) data.
  license:
    name: eBay API License Agreement
    url: https://go.developer.ebay.com/api-license-agreement
  title: Identity API
  version: v1.1.0
  x-apisguru-categories:
    - ecommerce
  x-logo:
    backgroundColor: "#FFFFFF"
    url: https://twitter.com/ebay/profile_image?size=original
  x-origin:
    - format: openapi
      url: https://developer.ebay.com/api-docs/master/commerce/identity/openapi/3/commerce_identity_v1_oas3.json
      version: "3.0"
  x-providerName: apiz.ebay.com
  x-serviceName: commerce-identity
paths:
  /user/:
    get:
      description: "This method retrieves the account profile information for an authenticated user, which requires a User access token. What is returned is controlled by the scopes. For a business account you use the default scope commerce.identity.readonly, which returns all the fields in the businessAccount container. These are returned because this is all public information. For an individual account, the fields returned in the individualAccount container are based on the scope you use. Using the default scope, only public information, such as eBay user ID, are returned. For details about what each scope returns, see the Identity API Overview. URLs for this method Production URL: https://apiz.ebay.com/commerce/identity/v1/user/ Sandbox URL: https://apiz.sandbox.ebay.com/commerce/identity/v1/user/ In the Sandbox, this method returns mock data. Note: You must use the correct scope or scopes for the data you want returned."
      operationId: getUser
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/UserResponse"
          description: OK
        "404":
          description: Not found
        "500":
          description: Internal Server Error
          x-response-codes:
            errors:
              "140000":
                category: APPLICATION
                description: There was a problem with an eBay internal system or process. Contact eBay developer support for assistance.
                domain: API_IDENTITY
      security:
        - api_auth:
            - https://api.ebay.com/oauth/api_scope/commerce.identity.readonly
            - https://api.ebay.com/oauth/api_scope/commerce.identity.status.readonly
            - https://api.ebay.com/oauth/api_scope/commerce.identity.name.readonly
            - https://api.ebay.com/oauth/api_scope/commerce.identity.address.readonly
            - https://api.ebay.com/oauth/api_scope/commerce.identity.email.readonly
            - https://api.ebay.com/oauth/api_scope/commerce.identity.phone.readonly
      tags:
        - user
components:
  schemas:
    Address:
      description: The type that defines the fields for an address.
      properties:
        addressLine1:
          description: The first line of the street address.
          type: string
        addressLine2:
          description: The second line of the street address. This field is not always used, but can be used for 'Suite Number' or 'Apt Number'.
          type: string
        city:
          description: The city of the address.
          type: string
        country:
          description: The two-letter ISO 3166 standard of the country of the address. For implementation help, refer to <a href='https://developer.ebay.com/api-docs/commerce/identity/types/bas:CountryCodeEnum'>eBay API documentation</a>
          type: string
        county:
          description: The county of the address.
          type: string
        postalCode:
          description: The postal code of the address.
          type: string
        stateOrProvince:
          description: The state or province of the address.
          type: string
      type: object
    BusinessAccount:
      description: The type that defines the fields for the business account information.
      properties:
        address:
          $ref: "#/components/schemas/Address"
          description: The container that returns the address of the business account.
        doingBusinessAs:
          description: An additional name that is used for their business on eBay. The business name is returned in the name field.
          type: string
        email:
          description: The email address of the business account.
          type: string
        name:
          description: The business name associated with the user's eBay account.
          type: string
        primaryContact:
          $ref: "#/components/schemas/Contact"
          description: The container that returns the contact details of the person who is the primary contact for this account.
        primaryPhone:
          $ref: "#/components/schemas/Phone"
          description: The container that returns the primary phone number for the business account.
        secondaryPhone:
          $ref: "#/components/schemas/Phone"
          description: The container that returns the secondary phone number for the business account.
        website:
          description: The business website address associated with the eBay account.
          type: string
      type: object
    Contact:
      description: The type that defines the fields for the information of the contact person for the account.
      properties:
        firstName:
          description: The first name of the contact person.
          type: string
        lastName:
          description: The last name of the contact person.
          type: string
      type: object
    Error:
      description: This type defines the fields that can be returned in an error.
      properties:
        category:
          description: Identifies the type of erro.
          type: string
        domain:
          description: Name for the primary system where the error occurred. This is relevant for application errors.
          type: string
        errorId:
          description: A unique number to identify the error.
          format: int32
          type: integer
        inputRefIds:
          description: An array of request elements most closely associated to the error.
          items:
            type: string
          type: array
        longMessage:
          description: A more detailed explanation of the error.
          type: string
        message:
          description: Information on how to correct the problem, in the end user's terms and language where applicable.
          type: string
        outputRefIds:
          description: An array of request elements most closely associated to the error.
          items:
            type: string
          type: array
        parameters:
          description: An array of name/value pairs that describe details the error condition. These are useful when multiple errors are returned.
          items:
            $ref: "#/components/schemas/ErrorParameter"
          type: array
        subdomain:
          description: "Further helps indicate which subsystem the error is coming from. System subcategories include: Initialization, Serialization, Security, Monitoring, Rate Limiting, etc."
          type: string
      type: object
    ErrorParameter:
      properties:
        name:
          description: The object of the error.
          type: string
        value:
          description: The value of the object.
          type: string
      type: object
    IndividualAccount:
      description: The type that defines the fields for the information of an individual account.
      properties:
        email:
          description: The eBay user's registration email address.
          type: string
        firstName:
          description: The eBay user's first name.
          type: string
        lastName:
          description: The eBay user's last name.
          type: string
        primaryPhone:
          $ref: "#/components/schemas/Phone"
          description: The container that returns the eBay user's primary phone number information.
        registrationAddress:
          $ref: "#/components/schemas/Address"
          description: The container that returns the eBay user's address information.
        secondaryPhone:
          $ref: "#/components/schemas/Phone"
          description: The container that returns the eBay user's secondary phone number information.
      type: object
    Phone:
      description: The type that defines the fields for the details of a phone.
      properties:
        countryCode:
          description: The two-letter ISO 3166 standard of the country to which the phone number belongs.
          type: string
        number:
          description: The numeric string representing the phone number.
          type: string
        phoneType:
          description: "The type of phone service. Valid Values: MOBILE or LAND_LINE Code so that your app gracefully handles any future changes to this list."
          type: string
      type: object
    UserResponse:
      description: The type that defines the fields for the getUser method.
      properties:
        accountType:
          description: "Indicates the user account type. This is determined when the user registers with eBay. If they register for a business account, this value will be BUSINESS. If they register for a private account, this value will be INDIVIDUAL. This designation is required by the tax laws in the following countries: EBAY_AT, EBAY_BE, EBAY_CH, EBAY_DE, EBAY_ES, EBAY_FR, EBAY_GB, EBAY_IE, EBAY_IT, EBAY_PL Valid Values: BUSINESS or INDIVIDUAL Code so that your app gracefully handles any future changes to this list. For implementation help, refer to <a href='https://developer.ebay.com/api-docs/commerce/identity/types/api:AccountTypeEnum'>eBay API documentation</a>"
          type: string
        businessAccount:
          $ref: "#/components/schemas/BusinessAccount"
          description: The container that returns the business account information of the user.
        individualAccount:
          $ref: "#/components/schemas/IndividualAccount"
          description: The account information of the user.
        registrationMarketplaceId:
          description: The eBay site on which the account is registered. For implementation help, refer to <a href='https://developer.ebay.com/api-docs/commerce/identity/types/bas:MarketplaceIdEnum'>eBay API documentation</a>
          type: string
        status:
          description: "Indicates the user's account status. Possible values: CONFIRMED, UNCONFIRMED, ACCOUNTONHOLD and UNDETERMINED. For implementation help, refer to <a href='https://developer.ebay.com/api-docs/commerce/identity/types/api:UserStatusEnum'>eBay API documentation</a>"
          type: string
        userId:
          description: The eBay immutable user ID of the user's account and can always be used to identify the user.
          type: string
        username:
          description: "The user name, which was specific by the user when they created the account. Note: This value can be changed by the user."
          type: string
      type: object
  securitySchemes:
    api_auth:
      description: The security definitions for this API. Please check individual operations for applicable scopes.
      flows:
        authorizationCode:
          authorizationUrl: https://auth.ebay.com/oauth2/authorize
          scopes:
            https://api.ebay.com/oauth/api_scope/commerce.identity.address.readonly: View a user's personal address information from their eBay member account
            https://api.ebay.com/oauth/api_scope/commerce.identity.email.readonly: View a user's personal email information from their eBay member account
            https://api.ebay.com/oauth/api_scope/commerce.identity.name.readonly: View a user's first and last name from their eBay member account
            https://api.ebay.com/oauth/api_scope/commerce.identity.phone.readonly: View a user's personal telephone information from their eBay member account
            https://api.ebay.com/oauth/api_scope/commerce.identity.readonly: View a user's basic information, such as username or business account details, from their eBay member account
            https://api.ebay.com/oauth/api_scope/commerce.identity.status.readonly: View a user's eBay member account status
          tokenUrl: https://api.ebay.com/identity/v1/oauth2/token
      type: oauth2
