Created Transaction Upload API (markdown)
parent
302037c2e2
commit
757e2ba485
1 changed files with 56 additions and 0 deletions
56
Transaction-Upload-API.md
Normal file
56
Transaction-Upload-API.md
Normal file
|
@ -0,0 +1,56 @@
|
|||
# Transaction Upload API
|
||||
|
||||
_Last Updated 2017-04-19_
|
||||
|
||||
## `POST /api/upload`
|
||||
|
||||
Takes a `multipart/form-data` upload, with the following parts:
|
||||
|
||||
* File under the form key `file2`
|
||||
* JSON Object with required arguments under `json` key
|
||||
|
||||
The JSON can be one of the following types:
|
||||
|
||||
* Known and Validated Organisation
|
||||
* Known but Unvalidated Organisation
|
||||
* Unknown Organisation
|
||||
|
||||
### Known and Validated Organisation
|
||||
|
||||
Request JSON
|
||||
|
||||
```
|
||||
{
|
||||
session_key : <current session key>,
|
||||
transaction_type : 1,
|
||||
transaction_value : 2.99,
|
||||
organisation_id : <id_number>
|
||||
}
|
||||
```
|
||||
|
||||
### Known but Unvalidated Organisation
|
||||
|
||||
```
|
||||
{
|
||||
session_key : <current session key>,
|
||||
transaction_type : 2,
|
||||
transaction_value : 2.99,
|
||||
organisation_id : <id_number>
|
||||
}
|
||||
```
|
||||
|
||||
### Unknown Organisation
|
||||
|
||||
```
|
||||
{
|
||||
session_key : <current session key>,
|
||||
transaction_type : 3,
|
||||
transaction_value : 2.99,
|
||||
organisation_name : 'Org Name',
|
||||
street_name : '7 High Street',
|
||||
town : 'Lancaster',
|
||||
postcode : 'LA1 1AA',
|
||||
}
|
||||
```
|
||||
|
||||
**Note** `street_name` and `postcode` are optional.
|
Reference in a new issue