From 757e2ba48546b490ddc9c3b1dca64abc597a9463 Mon Sep 17 00:00:00 2001 From: Tom Bloor Date: Wed, 19 Apr 2017 22:30:41 +0100 Subject: [PATCH] Created Transaction Upload API (markdown) --- Transaction-Upload-API.md | 56 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 Transaction-Upload-API.md diff --git a/Transaction-Upload-API.md b/Transaction-Upload-API.md new file mode 100644 index 0000000..7eb6ed6 --- /dev/null +++ b/Transaction-Upload-API.md @@ -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 : , + transaction_type : 1, + transaction_value : 2.99, + organisation_id : +} +``` + +### Known but Unvalidated Organisation + +``` +{ + session_key : , + transaction_type : 2, + transaction_value : 2.99, + organisation_id : +} +``` + +### Unknown Organisation + +``` +{ + 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. \ No newline at end of file