openapi: 3.0.3
info:
title: OAuth Client Credentials API
version: ''
description: |
The UPS OAuth Client Credentials API helps retrieve an OAuth Bearer token when the integration owner is also the UPS shipper. The integration owner uses their UPS login credentials, and the UPS account number, to receive a token that can be used in the authorization HTTP header of subsequent API calls to UPS APIs like the Ship API, Track API, etc.
- Client Credentials
- Accelerate API Integration with UPS SDKs
Try out UPS APIs with example requests using Postman and learn more about the UPS Postman Collection by visiting our Postman Guide. Explore API documentation and sample applications through GitHub.
paths:
"/security/v1/oauth/token":
post:
servers:
- url: https://wwwcie.ups.com/
description: Customer Integration Environment for Client Credentials
- url: https://onlinetools.ups.com/
description: Production for Client Credentials
summary: Create Token
tags:
- OAuth Client Credentials
security:
- BasicAuth: []
operationId: CreateToken
parameters:
- in: header
name: x-merchant-id
schema:
type: string
description: 6-digit UPS account number.
required: false
requestBody:
required: true
content:
application/x-www-form-urlencoded:
schema:
type: object
properties:
grant_type:
type: string
description: 'Valid values: client_credentials'
default: client_credentials
required:
- grant_type
responses:
'200':
description: successful operation
content:
application/json:
schema:
"$ref": "#/components/schemas/tokenSuccessResponse"
'400':
description: Invalid Request
content:
application/json:
schema:
"$ref": "#/components/schemas/tokenErrorResponse"
'401':
description: Unauthorized Request
content:
application/json:
schema:
"$ref": "#/components/schemas/tokenErrorResponse"
'403':
description: Blocked Merchant
content:
application/json:
schema:
"$ref": "#/components/schemas/tokenErrorResponse"
'429':
description: Quota Limit Exceeded
content:
application/json:
schema:
"$ref": "#/components/schemas/tokenErrorResponse"
components:
securitySchemes:
BasicAuth:
type: http
scheme: basic
description: |
Find your Client ID and Secret on your app info page.
1. Select \"Try It\"
2. In the Security section enter your Client ID as the Username and your Secret as the Password.
3. Enter any additional information in the Body and Parameters sections.
4. Select \"Send\" to execute your API request
schemas:
tokenSuccessResponse:
type: object
properties:
token_type:
description: Container for token response.
type: string
issued_at:
description: Issue time of requested token.
type: string
client_id:
description: Client id for requested token.
type: string
access_token:
description: Token to be used in API requests.
type: string
scope:
description: Scope for requested token.
type: string
expires_in:
description: Expire time for requested token in seconds.
type: string
refresh_count:
description: Number of refreshes for requested token.
type: string
status:
description: Status for requested token.
type: string
tokenErrorResponse:
type: object
properties:
response:
"$ref": "#/components/schemas/errorResponseWrapper"
errorResponseWrapper:
type: object
properties:
errors:
type: array
items:
"$ref": "#/components/schemas/errors"
errors:
type: object
properties:
code:
description: Error code
type: string
message:
description: Error message
type: string