# Models

## The BankDetail object

```json
{"openapi":"3.0.3","info":{"title":"Payments API","version":"1.0.0"},"components":{"schemas":{"BankDetail":{"type":"object","properties":{"pk":{"type":"integer","description":"Bank unique identifier"},"name":{"type":"string","description":"Bank name"},"slug":{"type":"string","description":"Bank slug identifier"},"logo":{"type":"string","format":"uri","nullable":true,"description":"Bank logo image URL"},"logo_path":{"type":"string","nullable":true,"description":"Bank logo file path"}}}}}}
```

## The CardTypeDetail object

```json
{"openapi":"3.0.3","info":{"title":"Payments API","version":"1.0.0"},"components":{"schemas":{"CardTypeDetail":{"type":"object","properties":{"pk":{"type":"integer","description":"Card type unique identifier"},"name":{"type":"string","description":"Card type name"},"slug":{"type":"string","description":"Card type slug identifier"},"logo":{"type":"string","format":"uri","nullable":true,"description":"Card type logo image URL"},"logo_path":{"type":"string","nullable":true,"description":"Card type logo file path"}}}}}}
```

## The InstallmentDetail object

```json
{"openapi":"3.0.3","info":{"title":"Payments API","version":"1.0.0"},"components":{"schemas":{"InstallmentDetail":{"type":"object","properties":{"pk":{"type":"integer","description":"Installment plan unique identifier"},"installment_count":{"type":"integer","description":"Number of installments"},"interest_rate":{"type":"number","format":"float","description":"Interest rate percentage"},"label":{"type":"string","description":"Display label for installment plan"},"is_active":{"type":"boolean","description":"Whether installment plan is active"},"amount":{"type":"number","format":"float","description":"Original purchase amount"},"interest_amount":{"type":"number","format":"float","description":"Total interest amount for this installment plan"},"total_amount":{"type":"number","format":"float","description":"Total amount including interest"},"single_installment_amount":{"type":"number","format":"float","description":"Amount per installment"}}}}}}
```

## The CardDetail object

```json
{"openapi":"3.0.3","info":{"title":"Payments API","version":"1.0.0"},"components":{"schemas":{"CardDetail":{"type":"object","properties":{"pk":{"type":"integer","description":"Card unique identifier"},"name":{"type":"string","description":"Card display name"},"card_payment_type":{"type":"string","description":"Payment type (credit or debit)","enum":["credit","debit"]},"card_type":{"$ref":"#/components/schemas/CardTypeDetail"},"bank":{"$ref":"#/components/schemas/BankDetail"},"installments":{"type":"array","description":"Available installment plans for this card","items":{"$ref":"#/components/schemas/InstallmentDetail"}}}},"CardTypeDetail":{"type":"object","properties":{"pk":{"type":"integer","description":"Card type unique identifier"},"name":{"type":"string","description":"Card type name"},"slug":{"type":"string","description":"Card type slug identifier"},"logo":{"type":"string","format":"uri","nullable":true,"description":"Card type logo image URL"},"logo_path":{"type":"string","nullable":true,"description":"Card type logo file path"}}},"BankDetail":{"type":"object","properties":{"pk":{"type":"integer","description":"Bank unique identifier"},"name":{"type":"string","description":"Bank name"},"slug":{"type":"string","description":"Bank slug identifier"},"logo":{"type":"string","format":"uri","nullable":true,"description":"Bank logo image URL"},"logo_path":{"type":"string","nullable":true,"description":"Bank logo file path"}}},"InstallmentDetail":{"type":"object","properties":{"pk":{"type":"integer","description":"Installment plan unique identifier"},"installment_count":{"type":"integer","description":"Number of installments"},"interest_rate":{"type":"number","format":"float","description":"Interest rate percentage"},"label":{"type":"string","description":"Display label for installment plan"},"is_active":{"type":"boolean","description":"Whether installment plan is active"},"amount":{"type":"number","format":"float","description":"Original purchase amount"},"interest_amount":{"type":"number","format":"float","description":"Total interest amount for this installment plan"},"total_amount":{"type":"number","format":"float","description":"Total amount including interest"},"single_installment_amount":{"type":"number","format":"float","description":"Amount per installment"}}}}}}
```

## The CardListResponse object

```json
{"openapi":"3.0.3","info":{"title":"Payments API","version":"1.0.0"},"components":{"schemas":{"CardListResponse":{"type":"object","properties":{"count":{"type":"integer","description":"Total number of cards"},"next":{"type":"string","format":"uri","nullable":true,"description":"Next page URL"},"previous":{"type":"string","format":"uri","nullable":true,"description":"Previous page URL"},"results":{"type":"array","description":"List of available cards with installment options","items":{"$ref":"#/components/schemas/CardDetail"}}}},"CardDetail":{"type":"object","properties":{"pk":{"type":"integer","description":"Card unique identifier"},"name":{"type":"string","description":"Card display name"},"card_payment_type":{"type":"string","description":"Payment type (credit or debit)","enum":["credit","debit"]},"card_type":{"$ref":"#/components/schemas/CardTypeDetail"},"bank":{"$ref":"#/components/schemas/BankDetail"},"installments":{"type":"array","description":"Available installment plans for this card","items":{"$ref":"#/components/schemas/InstallmentDetail"}}}},"CardTypeDetail":{"type":"object","properties":{"pk":{"type":"integer","description":"Card type unique identifier"},"name":{"type":"string","description":"Card type name"},"slug":{"type":"string","description":"Card type slug identifier"},"logo":{"type":"string","format":"uri","nullable":true,"description":"Card type logo image URL"},"logo_path":{"type":"string","nullable":true,"description":"Card type logo file path"}}},"BankDetail":{"type":"object","properties":{"pk":{"type":"integer","description":"Bank unique identifier"},"name":{"type":"string","description":"Bank name"},"slug":{"type":"string","description":"Bank slug identifier"},"logo":{"type":"string","format":"uri","nullable":true,"description":"Bank logo image URL"},"logo_path":{"type":"string","nullable":true,"description":"Bank logo file path"}}},"InstallmentDetail":{"type":"object","properties":{"pk":{"type":"integer","description":"Installment plan unique identifier"},"installment_count":{"type":"integer","description":"Number of installments"},"interest_rate":{"type":"number","format":"float","description":"Interest rate percentage"},"label":{"type":"string","description":"Display label for installment plan"},"is_active":{"type":"boolean","description":"Whether installment plan is active"},"amount":{"type":"number","format":"float","description":"Original purchase amount"},"interest_amount":{"type":"number","format":"float","description":"Total interest amount for this installment plan"},"total_amount":{"type":"number","format":"float","description":"Total amount including interest"},"single_installment_amount":{"type":"number","format":"float","description":"Amount per installment"}}}}}}
```

## The PhoneNumberRequest object

```json
{"openapi":"3.0.3","info":{"title":"Payments API","version":"1.0.0"},"components":{"schemas":{"PhoneNumberRequest":{"type":"object","required":["phone_number"],"properties":{"phone_number":{"type":"string","minLength":10,"maxLength":14,"description":"Phone number for OTP verification (leading 0 removed automatically)"}}}}}}
```

## The PhoneNumberResponse object

```json
{"openapi":"3.0.3","info":{"title":"Payments API","version":"1.0.0"},"components":{"schemas":{"PhoneNumberResponse":{"type":"object","properties":{"phone_number":{"type":"string","description":"Current user's phone number"}}}}}}
```

## The OtpRequest object

```json
{"openapi":"3.0.3","info":{"title":"Payments API","version":"1.0.0"},"components":{"schemas":{"OtpRequest":{"type":"object","required":["otp"],"properties":{"otp":{"type":"string","minLength":4,"maxLength":8,"description":"OTP verification code received via SMS"}}}}}}
```

## The MasterpassJSConfig object

```json
{"openapi":"3.0.3","info":{"title":"Payments API","version":"1.0.0"},"components":{"schemas":{"MasterpassJSConfig":{"type":"object","properties":{"js":{"type":"string","format":"uri","description":"Masterpass JavaScript library URL"},"client_id":{"type":"string","description":"OAuth client identifier for Masterpass API"},"merchant_id":{"type":"string","description":"Merchant identifier (empty for custom merchant type)"},"s3d_return_url":{"type":"string","format":"uri","description":"Return URL after 3D Secure verification"}}}}}}
```

## The ErrorResponse object

```json
{"openapi":"3.0.3","info":{"title":"Payments API","version":"1.0.0"},"components":{"schemas":{"ErrorResponse":{"type":"object","properties":{"detail":{"type":"string","description":"Error message"},"errors":{"type":"object","description":"Field-specific validation errors","additionalProperties":{"type":"array","items":{"type":"string"}}}}}}}}
```
