tdevapigists
12/6/2017 - 11:26 AM

svc-customer-products-swagger

{
"swagger": "2.0",
"info": {
"title": "Customer Products API",
"description": "This is a Customer Products API",
"version": "1.0.0",
"termsOfService": "https://dev.telstra.com/legal",
"license": {
"name": "Apache 2.0",
"url": "http://www.apache.org/licenses/LICENSE-2.0.html"
}
},
"host": "api.in.telstra.com.au",
"basePath": "/svc-customer-products/v1/products",
"schemes": [
 "https"
],
"paths": {
 "/products": {
  "get": {
   "operationId": "Products",
   "summary": "Retrieve Products",
   "description": "Retrieve customer products",
   "produces": [
    "application/json"
   ],
   "parameters": [
   {
   "in": "query",
   "name": "billingAccountId",
   "type": "string",
   "description": "Billing Account ID (ex: 2000214659383)",
   "required": true
   },
   {
   "in": "query",
   "name": "customerId",
   "type": "string",
   "description": "customer Id",
   "required": true
   },
   {
   "in": "query",
   "name": "serviceId",
   "type": "string",
   "description": "service Id",
   "required": true
   }
   ],
   "tags": [
    "products"
   ],
   "responses": {
   "200": {
    "description": "Success - Return product list",
    "schema": {
     "$ref": "#/definitions/GetProductResponse"
    }
   },
   "400": {
    "description": "Bad Request",
    "schema": {
     "$ref": "#/definitions/Error"
    }
   },   
   "401": {
    "description": "Authorization Error",
    "schema": {
     "$ref": "#/definitions/Error"
    }
   },
   "405": {
    "description": "Method Not Allowed",
    "schema": {
     "$ref": "#/definitions/Error"
    }
   },
   "429": {
    "description": "Rate Limiting/Spike arrest error",
    "schema": {
     "$ref": "#/definitions/Error"
    }
   },
   "422": {
    "description": "Invalid or missing parameter",
    "schema": {
     "$ref": "#/definitions/Error"
    }
   },
   "500": {
    "description": "An internal error occurred when processing the request",
    "schema": {
     "$ref": "#/definitions/Error"
    }
   },
   "503": {
    "description": "The service requested is currently unavailable",
    "schema": {
     "$ref": "#/definitions/Error"
    }
   }
   },
   "security": [
   {
   "OAuth2": [
    "SVCCUSPROD"
   ]
  }
 ]
 }
 }
 },
 "securityDefinitions": {
  "OAuth2": {
  "type": "oauth2",
  "tokenUrl": "/v1/oauth/token",
  "flow": "application",
  "scopes": {
   "SVCCUSPROD": "OAuth scope for SVC-Customer-Products"
  }
 }
},
"definitions": {
 "GetProductResponse": {
  "type": "object",
  "properties": {
   "status": {
    "type": "integer",
    "format": "int32",
    "description": "Http Status"
   },
   "time": {
    "type": "string",
    "description": "Timestamp"
   },
   "correlationId": {
    "type": "string",
    "description": "Correlation Id"
   },
   "path": {
    "type": "string",
    "description": "request path"
   },
   "method": {
    "type": "string",
    "description": "request method"
   },
   "data": {
    "type": "object",
    "properties": {
     "productCollections": {
      "type": "array",
      "items": {
       "$ref": "#/definitions/GetProductResponseOK"
      }
     }
    },
    "required": [
     "productCollections"
    ]
   },
  "required": [
   "status",
   "time",
   "correlationId",
   "path",
   "method",
   "data"
  ]
 },
 "GetProductResponseOK": {
  "type": "object",
  "properties": {
   "customerId": {
   "type": "string",
   "description": "The unique customer Id",
   "example": "a26O0000000cPRLIA2"
  },
  "billingAccountId": {
   "type": "string",
   "description": "Billing Account Id",
   "example": "2000214659383"
  },
  "products": {
   "type": "array",
   "items": {
    "$ref": "#/definitions/ProductsResponseOK"
   }
  }
 },
 "required": [
  "customerId",
  "billingAccountId",
  "products"
 ]
 },
 "ProductsResponseOK": {
  "type": "object",
  "properties": {
   "id": {
    "type": "string",
    "description": "Asset Integration Id"
   },
   "status": {
    "type": "string",
    "description": "Valid values include 'Active' and 'Pending'"
   },
   "productOffering": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string",
      "description": "The unique product Offering Id"
     },
     "name": {
      "type": "string",
      "description": "The unique product Offering Name"
     },
     "type": {
      "type": "string",
      "description": "For PI6 valid types are limited to 'Plan' and 'Service'"
     },
     "subtype": {
      "type": "string",
      "description": "Subtype"
     }
    },
    "required": [
     "id",
     "name",
     "type"
    ]
   },
   "productAttributes": {
    "type": "array",
    "items": {
     "$ref": "#/definitions/productAttributesResponseOK"
    }
   },
   "productRelatioships": {
    "type": "array",
    "items": {
     "$ref": "#/definitions/productRelatioshipsResponseOK"
    }
   }
  },
  "required": [
   "id",
   "status",
   "productOffering",
   "productAttributes"
  ]
 },
 "productRelatioshipsResponseOK": {
  "type": "object",
  "properties": {
   "type": {
    "type": "string",
    "description": "Product relationship type"
   },
   "products": {
    "type": "array",
    "items": {
     "$ref": "#/definitions/ProductsResponseOK"
    }
   }
  },
  "required": [
   "type",
   "products" 
  ]
 },
 "productAttributesResponseOK": {
  "type": "object",
  "properties": {
   "attributeName": {
    "type": "string",
    "description": "attribute name"
   },
   "attributeValue": {
    "type": "string",
    "description": "attribute value"
   }
  },
  "required": [
   "attributeName",
   "attributeValue"
  ]
 },
 "Error": {
  "type": "object",
  "properties": {
  "code": {
   "type": "integer", 
   "format": "int32",
   "description": "Error code"
  },
  "status": {
   "type": "integer",
   "format": "int32",
   "description": "The status code."
  },
  "time": {
   "type": "string",
   "description": "Timestamp"
  },
  "errors": {
   "type": "array",
   "items": {
    "type": "object",
    "properties": {
     "code": {
      "type": "integer",
      "format": "int32",
      "description": "Error Code"
     },
     "message": {
      "type": "string",
      "description": "Error message"
     }
    },
    "required": [
     "code",
     "message"
    ]
   }
  },
  "correlationId": {
   "type": "string",
   "description": "Correlation Id"
  },
  "message": {
   "type": "string",
   "description": "Message describing the error."
  }
  },
  "required": [
   "code",
   "status",
   "time",
   "correlationId",
   "message"
  ]
 }
}
}