UPS

UPS OAuth API

OAuth 2.0 token management

OpenAPI Specification

ups-oauth-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: UPS Shipping Address Validation OAuth API
  description: The UPS Shipping API enables developers to create and manage shipments, generate shipping labels, validate addresses, retrieve rates, track packages, schedule pickups, manage returns, and access time-in-transit information. UPS uses OAuth 2.0 with client credentials for authentication.
  version: v1
  contact:
    name: UPS Developer Support
    url: https://developer.ups.com/
  termsOfService: https://www.ups.com/us/en/help-center/legal-terms-conditions/developer-terms-of-service.page
servers:
- url: https://onlinetools.ups.com/api
  description: UPS Production API
- url: https://wwwcie.ups.com/api
  description: UPS Customer Integration Environment (CIE - Testing)
security:
- BearerAuth: []
tags:
- name: OAuth
  description: OAuth 2.0 token management
paths:
  /security/v1/oauth/token:
    post:
      operationId: getOAuthToken
      summary: Get OAuth Token
      description: Obtain an OAuth 2.0 access token using client credentials grant type. The access token is used to authenticate all subsequent API requests.
      tags:
      - OAuth
      security: []
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              required:
              - grant_type
              properties:
                grant_type:
                  type: string
                  enum:
                  - client_credentials
                  description: OAuth grant type
      responses:
        '200':
          description: Access token response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OAuthTokenResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
components:
  responses:
    Unauthorized:
      description: OAuth token missing or expired
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  schemas:
    OAuthTokenResponse:
      type: object
      properties:
        token_type:
          type: string
          example: Bearer
        issued_at:
          type: string
        client_id:
          type: string
        access_token:
          type: string
          description: Bearer token for API authorization
        expires_in:
          type: string
          example: '14399'
        status:
          type: string
          example: approved
    ErrorResponse:
      type: object
      properties:
        response:
          type: object
          properties:
            errors:
              type: array
              items:
                type: object
                properties:
                  code:
                    type: string
                  message:
                    type: string
  securitySchemes:
    OAuth2:
      type: oauth2
      flows:
        clientCredentials:
          tokenUrl: https://onlinetools.ups.com/api/security/v1/oauth/token
          scopes: {}
    BearerAuth:
      type: http
      scheme: bearer
      description: OAuth 2.0 bearer token from /security/v1/oauth/token