{
  "openapi": "3.0.3",
  "info": {
    "version": "1.0.0",
    "title": "extpartneromnisvcsms",
    "description": "This is OpenAPI Spec APIs for external partners to perform Payment Operations.",
    "contact": {
      "name": "Omni API Support",
      "email": "DL-OmniAdapter@att.com"
    }
  },
  "servers": [
    {
      "url": "https://partner.att.com/omni-svcs"
    }
  ],
  "tags": [
    {
      "name": "omni-svcs-payment",
      "description": "omni service payment methods"
    }
  ],
  "paths": {
    "/v1/payment-methods": {
      "post": {
        "tags": [
          "omni-svcs-payment"
        ],
        "description": "Payment transaction",
        "summary": "Payment updates on the account",
        "operationId": "payment",
        "requestBody": {
          "description": "Payment transaction request payload",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Payment"
              },
              "examples": {
                "Payment__createpaymentprofile": {
                  "value": {
                    "payment": {
                      "paymentMethods": [
                        {
                          "id": "paymentmethod_1",
                          "amount": 1,
                          "Card": {
                            "cardNumber": 1234,
                            "cardHolderName": "",
                            "expireMonth": 12,
                            "expireYear": 2025,
                            "billingAddress": {
                              "zipCode": ""
                            }
                          },
                          "accountNumber": "123454",
                          "savePaymentProfile": true,
                          "storeTermsConditionConsent": true,
                          "tncId": "111",
                          "customerAgreement": "",
                          "profileOwnerId": "",
                          "profileName": ""
                        }
                      ]
                    }
                  }
                },
                "Payment_createpaymentbankaccount": {
                  "value": {
                    "payment": {
                      "paymentMethods": [
                        {
                          "id": "paymentmethod_1",
                          "amount": 1,
                          "bankAccount": {
                            "bankAccountNumber": 1234,
                            "accountHolderName": "",
                            "routingNumber": 12
                          },
                          "accountNumber": "123454",
                          "savePaymentProfile": true,
                          "storeTermsConditionConsent": true,
                          "tncId": "111",
                          "customerAgreement": "",
                          "profileOwnerId": "",
                          "profileName": ""
                        }
                      ]
                    }
                  }
                },
                "Payment_validate": {
                  "value": {
                    "payment": {
                      "paymentMethods": [
                        {
                          "id": "paymentmethod_1",
                          "amount": 0,
                          "Card": {
                            "cardNumber": 1234,
                            "cardHolderName": "",
                            "expireMonth": 12,
                            "expireYear": 2025,
                            "billingAddress": {
                              "zipCode": ""
                            }
                          },
                          "accountNumber": "123454",
                          "savePaymentProfile": false
                        }
                      ]
                    }
                  }
                },
                "Payment_authorize": {
                  "value": {
                    "payment": {
                      "paymentMethods": [
                        {
                          "id": "paymentmethod_1",
                          "amount": 123,
                          "Card": {
                            "cardNumber": 1234,
                            "cardHolderName": "",
                            "expireMonth": 12,
                            "expireYear": 2025,
                            "billingAddress": {
                              "zipCode": ""
                            }
                          },
                          "accountNumber": "123454",
                          "savePaymentProfile": false
                        }
                      ]
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/PaymentResponse"
          },
          "400": {
            "$ref": "#/components/responses/PaymentErrorResponse"
          }
        }
      }
    }
  },
  "components": {
    "requestBodies": {
      "PaymentRequest": {
        "description": "Payment transaction request payload",
        "required": true,
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Payment"
            },
            "examples": {
              "Payment__createpaymentprofile": {
                "value": {
                  "payment": {
                    "paymentMethods": [
                      {
                        "id": "paymentmethod_1",
                        "amount": 1,
                        "Card": {
                          "cardNumber": 1234,
                          "cardHolderName": "",
                          "expireMonth": 12,
                          "expireYear": 2025,
                          "billingAddress": {
                            "zipCode": ""
                          }
                        },
                        "accountNumber": "123454",
                        "savePaymentProfile": true,
                        "storeTermsConditionConsent": true,
                        "tncId": "111",
                        "customerAgreement": "",
                        "profileOwnerId": "",
                        "profileName": ""
                      }
                    ]
                  }
                }
              },
              "Payment_createpaymentbankaccount": {
                "value": {
                  "payment": {
                    "paymentMethods": [
                      {
                        "id": "paymentmethod_1",
                        "amount": 1,
                        "bankAccount": {
                          "bankAccountNumber": 1234,
                          "accountHolderName": "",
                          "routingNumber": 12
                        },
                        "accountNumber": "123454",
                        "savePaymentProfile": true,
                        "storeTermsConditionConsent": true,
                        "tncId": "111",
                        "customerAgreement": "",
                        "profileOwnerId": "",
                        "profileName": ""
                      }
                    ]
                  }
                }
              },
              "Payment_validate": {
                "value": {
                  "payment": {
                    "paymentMethods": [
                      {
                        "id": "paymentmethod_1",
                        "amount": 0,
                        "Card": {
                          "cardNumber": 1234,
                          "cardHolderName": "",
                          "expireMonth": 12,
                          "expireYear": 2025,
                          "billingAddress": {
                            "zipCode": ""
                          }
                        },
                        "accountNumber": "123454",
                        "savePaymentProfile": false
                      }
                    ]
                  }
                }
              },
              "Payment_authorize": {
                "value": {
                  "payment": {
                    "paymentMethods": [
                      {
                        "id": "paymentmethod_1",
                        "amount": 123,
                        "Card": {
                          "cardNumber": 1234,
                          "cardHolderName": "",
                          "expireMonth": 12,
                          "expireYear": 2025,
                          "billingAddress": {
                            "zipCode": ""
                          }
                        },
                        "accountNumber": "123454",
                        "savePaymentProfile": false
                      }
                    ]
                  }
                }
              }
            }
          }
        }
      }
    },
    "responses": {
      "PaymentResponse": {
        "description": "Payment transaction update response ",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/PaymentResponse"
            },
            "examples": {
              "payment_authorize_payment_response": {
                "value": {
                  "paymentResponse": {
                    "status": "success",
                    "paymentMethodId": ""
                  }
                }
              }
            }
          }
        }
      },
      "PaymentErrorResponse": {
        "description": "Error Response body for Payment transaction",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "error": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "schemas": {
      "PaymentItemRequest": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "amount": {
              "type": "number"
            },
            "accountNumber": {
              "type": "string"
            },
            "action": {
              "type": "string",
              "description": "Holds the value for which payment is made either debt,payup,payoff"
            }
          }
        }
      },
      "Payment": {
        "type": "object",
        "properties": {
          "paymentMethods": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "amount": {
                  "type": "number"
                },
                "storeTermsConditionConsent": {
                  "type": "boolean"
                },
                "tncId": {
                  "type": "string"
                },
                "customerAgreement": {
                  "type": "string"
                },
                "profileOwnerId": {
                  "type": "string"
                },
                "profileName": {
                  "type": "string"
                },
                "Card": {
                  "type": "object",
                  "properties": {
                    "cardNumber": {
                      "type": "number"
                    },
                    "expireMonth": {
                      "type": "integer"
                    },
                    "expireYear": {
                      "type": "integer"
                    },
                    "securityCode": {
                      "type": "integer"
                    },
                    "cardHolderName": {
                      "type": "string"
                    },
                    "verifyCardIndicator": {
                      "type": "boolean"
                    },
                    "billingAddress": {
                      "type": "object",
                      "properties": {
                        "zipCode": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "bankAccount": {
                  "type": "object",
                  "properties": {
                    "bankAccountNumber": {
                      "type": "integer"
                    },
                    "accountHolderName": {
                      "type": "string"
                    },
                    "routingNumber": {
                      "type": "integer"
                    },
                    "accountType": {
                      "type": "string"
                    }
                  }
                },
                "accountNumber": {
                  "type": "string"
                },
                "savePaymentProfile": {
                  "type": "boolean"
                },
                "paymentItemRequest": {
                  "$ref": "#/components/schemas/PaymentItemRequest"
                }
              }
            }
          }
        }
      },
      "PaymentResponse": {
        "type": "object",
        "properties": {
          "paymentMethodId": {
            "type": "string"
          },
          "paymentProfileId": {
            "type": "string"
          },
          "status": {
            "type": "string"
          }
        }
      },
      "Error": {
        "type": "object",
        "properties": {
          "errorCode": {
            "type": "string",
            "example": "<400-INVALID-REQUEST>"
          },
          "errorDescription": {
            "type": "string",
            "example": "Validation Failure"
          },
          "errorList": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "action": {
                  "type": "string",
                  "example": "payment",
                  "description": "Holds the action that is being perfomed causing the error"
                },
                "errorCode": {
                  "type": "string",
                  "example": "Payment-XXX"
                },
                "errorDescription": {
                  "type": "string",
                  "example": "Payment xxx"
                },
                "errorDetails": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "system": {
                        "type": "string",
                        "example": "Payment"
                      },
                      "errorCode": {
                        "type": "string",
                        "example": "Payment"
                      },
                      "errorDescription": {
                        "type": "string",
                        "example": "Payment"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}