{
  "openapi": "3.0.1",
  "info": {
    "title": "Auth APIs",
    "description": "This is the API to manage credentials and generate token",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://api-sandbox.sendpro360.pitneybowes.com/auth",
      "description": "Sandbox Server"
    },
    {
      "url": "https://api.sendpro360.pitneybowes.com/auth",
      "description": "Production Server (uses live data)"
    },
    {
      "url": "https://api-ppd.shipping360.pitneybowes.com/ca/auth",
      "description": "Sandbox Server for Canada"
    },
    {
      "url": "https://api.sendpro360.pitneybowes.com/ca/auth",
      "description": "Production Server for Canada"
    }
  ],
  "paths": {
    "/api/v1/token": {
      "post": {
        "summary": "Get Access Token",
        "description": "Each request to the Shipping 360 API requires authentication via an OAuth token. This API call generates the OAuth token based on the Base64-encoded value of the Client ID and Secret associated with your developer account. The token expires after 4 hours. `Client ID` is the The unique identifier assigned to the client application and `Secret` is a confidential string used to authenticate the client. These both are required to generate token. Use `Client ID` as User Name and `Secret` as Password for getting access token while trying out in security options.",
        "operationId": "getAccessToken",
        "parameters": [
          {
            "name": "Content-Type",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "default": "application/json"
            },
            "example": "application/json"
          }
        ],
        "security": [
          {
            "basicAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The token has been generated successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "access_token": {
                      "type": "string",
                      "example": "token"
                    },
                    "expires_in": {
                      "type": "number",
                      "example": 14400
                    },
                    "scope": {
                      "type": "string",
                      "example": "psapi"
                    },
                    "token_type": {
                      "type": "string",
                      "example": "Bearer"
                    }
                  }
                },
                "examples": {
                  "response": {
                    "value": {
                      "access_token": "token",
                      "expires_in": 14400,
                      "scope": "psapi",
                      "token_type": "Bearer"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "error": {
        "type": "object",
        "properties": {
          "errorCode": {
            "type": "string"
          },
          "errorSummary": {
            "type": "string"
          },
          "errorLink": {
            "type": "string"
          },
          "errorId": {
            "type": "string"
          },
          "errorCauses": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "message",
          "code"
        ]
      }
    },
    "responses": {
      "UnauthorizedError": {
        "description": "The request could not be authorized.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/error"
            }
          }
        }
      }
    },
    "securitySchemes": {
      "basicAuth": {
        "type": "http",
        "scheme": "basic"
      }
    }
  }
}