{
  "openapi": "3.0.0",
  "info": {
    "title": "att-order-status-eapi",
    "version": "v1"
  },
  "paths": {
    "/contract-apex": {
      "post": {
        "summary": "Contract",
        "description": "This API allows users to create a contract for the submitted order.",
        "parameters": [
          {
            "name": "content-type",
            "in": "header",
            "description": "application/json",
            "required": true,
            "schema": {
              "type": "string",
              "example": "application/json"
            }
          },
          {
            "name": "accept",
            "in": "header",
            "description": "Specifies the format of the response message body. Structured text message payloads are required to support application/json.",
            "required": false,
            "schema": {
              "type": "string",
              "example": "application/json"
            }
          },
          {
            "name": "x-trace-id",
            "in": "header",
            "description": "This field is used for passing a trace ID between API hops for end-to-end traceability.",
            "required": true,
            "schema": {
              "type": "string",
              "example": "givingXTracing123456"
            }
          },
          {
            "name": "x-transaction-id",
            "in": "header",
            "description": "This field is used for passing a traceable Id to uniquely identify the transactions.",
            "required": false,
            "schema": {
              "type": "string",
              "example": "1234"
            }
          },
          {
            "name": "client_id",
            "in": "header",
            "description": "This field represents the client id.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "client_secret",
            "in": "header",
            "description": "This field represents the client secret.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "source",
            "in": "header",
            "description": "This field should identify the calling system/application.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/contractRequest"
              }
            }
          }
        },
        "x-page-slug": "contract-slug",
        "responses": {
          "200": {
            "description": "Your request was processed successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/contractResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StandardError"
                }
              }
            }
          },
          "401": {
            "description": "Not Authorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StandardError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StandardError"
                }
              }
            }
          },
          "404": {
            "description": "Requested resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StandardError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error / INVALID_SP / UNAUTHORIZED_SP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StandardError"
                }
              }
            }
          }
        }
      }
    }
  },
  "servers": [
    {
      "url": "Contact DL-APS_API_Services@att.com to get Endpoint details "
    }
  ],
  "components": {
    "schemas": {
      "StandardError": {
        "title": "Standard Error Response Item",
        "description": "Error Response",
        "x-amf-examples": {
          "example_2": {
            "node": "Store location System API",
            "code": 405,
            "message": "METHOD_NOT_ALLOWED",
            "description": "The method received in the request-line is known by the origin server but not supported by the target resource.",
            "transactionId": "803ec5202bd54576992d082da70e6338",
            "traceId": "712def66-c54a-11ea-87d0-0242ac130003",
            "error_context": {
              "time": "2021-07-29T01:51:15.000Z",
              "type": "DATA ERROR",
              "category": "Account",
              "payload": {},
              "error_identifier": "123",
              "action": "create"
            }
          },
          "amf_example_1": {
            "node": "Store location System API",
            "code": 403,
            "message": "FORBIDDEN",
            "description": "The server understood the request but refuses to authorize it. The client MAY repeat the request with new or different credentials.",
            "transactionId": "803ec5202bd54576992d082da70e6338",
            "traceId": "712def66-c54a-11ea-87d0-0242ac130003",
            "error_context": {
              "time": "2021-07-29T01:51:15.000Z",
              "type": "SYSTEM ERROR",
              "category": "Account",
              "payload": {},
              "error_identifier": "123",
              "action": "create"
            }
          },
          "example_1": {
            "node": "Store location System API",
            "code": 401,
            "message": "NOT_AUTHORIZED",
            "description": "The request has not been applied because it lacks valid authentication credentials for the target resource.",
            "transactionId": "803ec5202bd54576992d082da70e6338",
            "traceId": "712def66-c54a-11ea-87d0-0242ac130003",
            "error_context": {
              "time": "2021-07-29T01:51:15.000Z",
              "type": "DATA ERROR",
              "category": "Account",
              "payload": {},
              "error_identifier": "123",
              "action": "create"
            }
          },
          "amf_example_2": {
            "node": "Store location System API",
            "code": 404,
            "message": "RESOURCE_NOT_FOUND",
            "description": "The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.",
            "transactionId": "803ec5202bd54576992d082da70e6338",
            "traceId": "712def66-c54a-11ea-87d0-0242ac130003",
            "error_context": {
              "time": "2021-07-29T01:51:15.000Z",
              "type": "DATA ERROR",
              "category": "Account",
              "payload": {},
              "error_identifier": "123",
              "action": "create"
            }
          },
          "amf_example_4": {
            "node": "Store location System API",
            "code": 500,
            "message": "INTERNAL_SERVER_ERROR",
            "description": "The server encountered an unexpected condition that prevented it from fulfilling the request.",
            "transactionId": "803ec5202bd54576992d082da70e6338",
            "traceId": "712def66-c54a-11ea-87d0-0242ac130003",
            "error_context": {
              "time": "2021-07-29T01:51:15.000Z",
              "type": "SYSTEM ERROR",
              "category": "Account",
              "payload": {},
              "error_identifier": "123",
              "action": "create"
            }
          },
          "example_0": {
            "node": "Store location System API",
            "code": 400,
            "message": "BAD_REQUEST",
            "description": "The server cannot or will not process the request due to something that is perceived to be a client error.",
            "transactionId": "803ec5202bd54576992d082da70e6338",
            "traceId": "712def66-c54a-11ea-87d0-0242ac130003",
            "error_context": {
              "time": "2021-07-29T01:51:15.000Z",
              "type": "DATA ERROR",
              "category": "Account",
              "payload": {},
              "error_identifier": "123",
              "action": "create"
            }
          },
          "amf_example_3": {
            "node": "Store location System API",
            "code": 406,
            "message": "NOT_ACCEPTABLE",
            "description": "The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation.",
            "transactionId": "803ec5202bd54576992d082da70e6338",
            "traceId": "712def66-c54a-11ea-87d0-0242ac130003",
            "error_context": {
              "time": "2021-07-29T01:51:15.000Z",
              "type": "SYSTEM ERROR",
              "category": "Account",
              "payload": {},
              "error_identifier": "123",
              "action": "create"
            }
          },
          "example_3": {
            "node": "Store location System API",
            "code": 415,
            "message": "UNSUPPORTED_MEDIA_TYPE",
            "description": "The format problem might be due to the request's indicated Content-Type or Content-Encoding, or as a result of inspecting the data directly.",
            "transactionId": "803ec5202bd54576992d082da70e6338",
            "traceId": "712def66-c54a-11ea-87d0-0242ac130003",
            "error_context": {
              "time": "2021-07-29T01:51:15.000Z",
              "type": "DATA ERROR",
              "category": "Account",
              "payload": {},
              "error_identifier": "123",
              "action": "create"
            }
          }
        },
        "type": "object",
        "required": [
          "node",
          "code",
          "message",
          "description",
          "transactionId",
          "traceId"
        ],
        "properties": {
          "node": {
            "description": "API Name",
            "example": "Store location System API",
            "type": "string"
          },
          "code": {
            "description": "Status Code",
            "example": 401,
            "type": "number"
          },
          "message": {
            "description": "Error Message",
            "example": "NOT_AUTHORIZED",
            "type": "string"
          },
          "description": {
            "description": "Error Description",
            "example": "The request has not been applied because it lacks valid authentication credentials for the target resource.",
            "type": "string"
          },
          "transactionId": {
            "description": "Transaction ID",
            "example": "803ec5202bd54576992d082da70e6338",
            "type": "string"
          },
          "traceId": {
            "description": "Trace ID",
            "example": "712def66-c54a-11ea-87d0-0242ac130003",
            "type": "string"
          },
          "error_context": {
            "type": "object",
            "required": [
              "time",
              "type",
              "category",
              "payload",
              "error_identifier",
              "action"
            ],
            "properties": {
              "time": {
                "description": "",
                "type": "string"
              },
              "type": {
                "description": "",
                "enum": [
                  "DATA ERROR",
                  "SYSTEM ERROR"
                ],
                "type": "string"
              },
              "category": {
                "description": "e.g. Billing, Account, Order, Contact",
                "type": "string"
              },
              "payload": {
                "description": "payload that's being sent to the specific target system",
                "type": "object"
              },
              "error_identifier": {
                "description": "Any Identifier",
                "type": "string"
              },
              "action": {
                "description": "Target system action e.g. create, cancel, update, delete",
                "type": "string"
              }
            }
          }
        }
      },
      "contractRequest": {
        "type": "object",
        "properties": {
          "quoteId": {
            "type": "string",
            "description": "This field represents the quote id.",
            "example": "0Q0dx000002WN6nCAG"
          },
          "spId": {
            "type": "string",
            "description": "This field represents the ID associated with the solution provider.",
            "example": "A-06399x"
          },
          "approverEmail": {
            "type": "string",
            "description": "This field represents the approver email.",
            "example": "addagadda.tejasri@accenture.com"
          },
          "contractInput": {
            "type": "object",
            "description": "This field represents contract input.",
            "properties": {
              "endCustomerDetails": {
                "type": "object",
                "description": "This field is an object that represents the end customer details.",
                "properties": {
                  "companyName": {
                    "type": "string",
                    "description": "This field represents the company name.",
                    "example": "conrr"
                  },
                  "companyAddress": {
                    "type": "object",
                    "description": "This field is an object that represents the company address.",
                    "properties": {
                      "street": {
                        "type": "string",
                        "description": "This field represents the street.",
                        "example": "3400 W PLANO PKWY"
                      },
                      "city": {
                        "type": "string",
                        "description": "This field represents the city.",
                        "example": "Plano"
                      },
                      "state": {
                        "type": "string",
                        "description": "This field represents the state.",
                        "example": "TX"
                      },
                      "zipCode": {
                        "type": "string",
                        "description": "This field represents the zip code.",
                        "example": "75075-8011"
                      }
                    },
                    "required": [
                      "street",
                      "city",
                      "state",
                      "zipCode"
                    ]
                  }
                },
                "required": [
                  "companyName",
                  "companyAddress"
                ]
              }
            },
            "required": [
              "endCustomerDetails"
            ]
          }
        },
        "required": [
          "quoteId",
          "spId",
          "approverEmail",
          "contractInput"
        ]
      },
      "contractResponse": {
        "type": "object",
        "properties": {
          "ContractEnvelopeId": {
            "type": "string",
            "description": "This field represents the contract envelope Id.",
            "example": "a4Tdx000000cOxNEAU"
          },
          "ESignIntegrationResponseStep": {
            "type": "object",
            "description": "This field is an object that represents the eSign integration response step.",
            "properties": {
              "isSuccess": {
                "type": "boolean",
                "description": "This field represents the is success message.",
                "example": true
              },
              "esignRequestIdABV": {
                "type": "number",
                "description": "This field represents the eSign request id.",
                "example": 527957
              },
              "description": {
                "type": "string",
                "description": "This field represents status description.",
                "example": "Document has been sent to eSign successfully"
              },
              "code": {
                "type": "number",
                "description": "This field represents the status code.",
                "example": 200
              },
              "StatusMessage": {
                "type": "string",
                "description": "This field represents the status message.",
                "example": "SentToeSign"
              }
            }
          },
          "SetError": {
            "type": "boolean",
            "description": "This field represents the set error.",
            "example": false
          },
          "callContractMS": {
            "type": "boolean",
            "description": "This field represents the call contract MS.",
            "example": true
          }
        }
      }
    }
  }
}