|
| 1 | +## Document |
| 2 | + |
| 3 | +### Create a Document |
| 4 | + |
| 5 | +```py |
| 6 | + |
| 7 | +file = open('/Users/your_name/Downloads/sample_uploaded.jpeg', 'rb') |
| 8 | + |
| 9 | +x = client.document.create({ |
| 10 | + 'file': file, |
| 11 | + 'purpose': 'dispute_evidence' |
| 12 | +}) |
| 13 | +``` |
| 14 | + |
| 15 | +**Parameters:** |
| 16 | + |
| 17 | +| Name | Type | Description | |
| 18 | +|-------|-----------|--------------------------------------------------| |
| 19 | +| file* | string | The URL generated once the business proof document is uploaded. | |
| 20 | +| purpose | string | Possible value is `dispute_evidence` | |
| 21 | + |
| 22 | +**Response:** |
| 23 | +```json |
| 24 | +{ |
| 25 | + "id": "doc_EsyWjHrfzb59Re", |
| 26 | + "entity": "document", |
| 27 | + "purpose": "dispute_evidence", |
| 28 | + "name": "doc_19_12_2020.jpg", |
| 29 | + "mime_type": "image/png", |
| 30 | + "size": 2863, |
| 31 | + "created_at": 1590604200 |
| 32 | +} |
| 33 | +``` |
| 34 | +------------------------------------------------------------------------------------------------------- |
| 35 | + |
| 36 | +### Fetch Document Information |
| 37 | + |
| 38 | +```py |
| 39 | +documentId = "doc_NiyXWXXXXXXXXX" |
| 40 | + |
| 41 | +client.document.fetch(documentId) |
| 42 | +``` |
| 43 | + |
| 44 | +**Parameters:** |
| 45 | + |
| 46 | +| Name | Type | Description | |
| 47 | +|-------|-----------|--------------------------------------------------| |
| 48 | +| documentId | string | The unique identifier of the document. | |
| 49 | + |
| 50 | +**Response:** |
| 51 | +```json |
| 52 | +{ |
| 53 | + "entity": "document", |
| 54 | + "id": "doc_00000000000000", |
| 55 | + "purpose": "dispute_evidence", |
| 56 | + "created_at": 1701701378, |
| 57 | + "mime_type": "application/pdf", |
| 58 | + "display_name": "ppm_00000000000000", |
| 59 | + "size": 404678, |
| 60 | + "url": "" |
| 61 | +} |
| 62 | +``` |
| 63 | +------------------------------------------------------------------------------------------------------- |
| 64 | + |
| 65 | +**PN: * indicates mandatory fields** |
| 66 | +<br> |
| 67 | +<br> |
| 68 | +**For reference click [here](https://razorpay.com/docs/api/documents)** |
0 commit comments