{
  "openapi": "3.0.0",
  "info": {
    "title": "att-order-status-eapi",
    "version": "v1"
  },
  "paths": {
    "/creditCheck-apex": {
      "post": {
        "summary": "Credit Check",
        "description": "This API allows users to conduct customer credit checks.",
        "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/creditCheckRequest"
              }
            }
          }
        },
        "x-page-slug": "credit-check-slug",
        "responses": {
          "200": {
            "description": "Your request was processed successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/creditCheckResponse"
                }
              }
            }
          },
          "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 / INVALID_QUOTEID / Service Unavailable",
            "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"
              }
            }
          }
        }
      },
      "creditCheckRequest": {
        "type": "object",
        "properties": {
          "quoteId": {
            "type": "string",
            "description": "This field represents quote id.",
            "example": "0Q0dx000002BpxKCAS"
          },
          "spId": {
            "type": "string",
            "description": "This field represents Solution Provider id.",
            "example": "A-06399x"
          }
        },
        "required": [
          "quoteId",
          "spId"
        ]
      },
      "creditCheckResponse": {
        "type": "object",
        "properties": {
          "flowName": {
            "type": "string",
            "description": "Name of the process flow executed.",
            "example": "createCreditCheck"
          },
          "id": {
            "type": "string",
            "description": "Unique identifier for the flow execution.",
            "example": "1234"
          },
          "status": {
            "type": "string",
            "description": "Overall status of the flow execution.",
            "example": "Success"
          },
          "statusMessage": {
            "type": "string",
            "description": "Message describing the outcome of the flow execution.",
            "example": "New credit check record has been created"
          },
          "creditCheckId": {
            "type": "string",
            "description": "Unique identifier for the credit check record.",
            "example": "a9Xdx000000VF2nEAG"
          },
          "creditCheckDetails": {
            "type": "object",
            "description": "This object contains credit check details given in the request.",
            "properties": {
              "Approval_Date__c": {
                "type": "string",
                "description": "Date when the credit check was approved.",
                "example": "2026-02-27"
              },
              "Service_Address_City__c": {
                "type": "string",
                "description": "City of the service address.",
                "example": "Minneapolis"
              },
              "Service_Address_Line1__c": {
                "type": "string",
                "description": "Street address line 1 of the service location.",
                "example": "901 Marquette Ave Ste 700"
              },
              "Status__c": {
                "type": "string",
                "description": "Status of the credit check record.",
                "example": "Open"
              },
              "Requested_By__c": {
                "type": "string",
                "description": "ID of the user who requested the credit check.",
                "example": "005DV00000F2577YAB"
              },
              "Opportunity__c": {
                "type": "string",
                "description": "Associated Opportunity record ID.",
                "example": "006dx00000Gr2ybAAB"
              },
              "IsValidated__c": {
                "type": "boolean",
                "description": "Boolean flag indicating whether the credit check is validated.",
                "example": true
              },
              "OwnerId": {
                "type": "string",
                "description": "ID of the record owner.",
                "example": "005DV00000F2577YAB"
              },
              "LegalEntity_Address_Country__c": {
                "type": "string",
                "description": "Country of the legal entity’s address.",
                "example": "US"
              },
              "LegalEntity_Address_Zip__c": {
                "type": "string",
                "description": "ZIP code of the legal entity’s address.",
                "example": "55402-3247"
              },
              "LegalEntity_Address_State__c": {
                "type": "string",
                "description": "State of the legal entity’s address.",
                "example": "MN"
              },
              "LegalEntity_Address_City__c": {
                "type": "string",
                "description": "City of the legal entity’s address.",
                "example": "Minneapolis"
              },
              "LegalEntity_Address_Line1__c": {
                "type": "string",
                "description": "Street address line 1 of the legal entity.",
                "example": "901 Marquette Ave Ste 700"
              },
              "Service_Address_Country__c": {
                "type": "string",
                "description": "Country of the service address.",
                "example": "US"
              },
              "Service_Address_Zip__c": {
                "type": "string",
                "description": "ZIP code of the service address.",
                "example": "55402-3247"
              },
              "Service_Address_State__c": {
                "type": "string",
                "description": "State of the service address.",
                "example": "MN"
              },
              "Bureau_Name__c": {
                "type": "string",
                "description": "Name of the credit bureau used.",
                "example": "NON"
              },
              "Credit_Check_Type__c": {
                "type": "string",
                "description": "Type of credit check performed.",
                "example": "Wireline"
              },
              "Doing_Business_As_Name__c": {
                "type": "string",
                "description": "DBA (Doing Business As) name of the business.",
                "example": "ATCI APEX Test Account"
              },
              "Business_Name__c": {
                "type": "string",
                "description": "Legal business name.",
                "example": "ATCI APEX Test Account"
              },
              "Account__c": {
                "type": "string",
                "description": "Associated Account record ID.",
                "example": "001DV00001qQX1QYAW"
              },
              "Credit_Result__c": {
                "type": "string",
                "description": "Result of the credit check.",
                "example": "Verified"
              },
              "Credit_Class__c": {
                "type": "string",
                "description": "Classification of credit.",
                "example": "UNKNOWN"
              },
              "Approval_Status__c": {
                "type": "string",
                "description": "Status of approval.",
                "example": "Approved"
              },
              "Quote__c": {
                "type": "string",
                "description": "Associated Quote record ID.",
                "example": "0Q0dx000002f0e2CAA"
              }
            }
          }
        }
      }
    }
  }
}