Moolah Payments API
Authorize Transaction
once you have a valid token, you can authorize a transaction an authorized transaction must be captured using the docid\ ku1esdj6fksruhuf1l o1 endpoint { "tab" "examples", "url" "https //process moolahpay cc/api/token/authorize", "name" "token authorize", "method" "post", "request" { "pathparameters" \[], "queryparameters" \[], "headerparameters" \[ { "kind" "required", "name" "authorization", "type" "string", "children" \[], "description" "every request to the server must include an authorization bearer header with your authorization token each business boarded at moolah will receive a token that is used to process the transaction this token should be pre pended with bearer \<token> " } ], "bodydataparameters" \[ { "kind" "required", "name" "amount", "type" "number", "description" "the amount to authorize is cents" }, { "kind" "required", "name" "cardtoken", "type" "string", "children" \[], "description" "the card token received using the token/tokenize end point" }, { "kind" "required", "name" "currency", "type" "string", "children" \[], "description" "currently only support usd transactions" }, { "kind" "optional", "name" "email", "type" "string", "children" \[], "description" "if an email is passed, a processor receipt will be sent to the customer, if an email is not sent the receipt will not be sent" }, { "kind" "optional", "name" "notes", "type" "string", "children" \[], "description" "a note that is attached to the transaction, and provided as part of receipt" } ], "formdataparameters" \[] }, "results" { "languages" \[ { "id" "awto60nkkclwo9hganjdi", "code" "{\n \\"id\\" \\"ee76f137 0ccb 47b2 bf9a 5cb82cdac5e0\\",\n \\"action\\" \\"authorize\\",\n \\"amounts\\" {\n \\"cashbackamount\\" 0,\n \\"currency\\" \\"usd\\",\n \\"customeroptednotip\\" false,\n \\"orderamount\\" 200,\n \\"transactionamount\\" 200,\n \\"tipamount\\" 0\n },\n \\"context\\" {\n \\"businesstype\\" \\"test merchant\\",\n \\"businessid\\" \\"08f7ce0a bd07 4016 8a28 c68f5c93aa38\\",\n \\"employeeuserid\\" 0,\n \\"mcc\\" \\"5999\\",\n \\"source\\" \\"web\\",\n \\"storedeviceid\\" \\"urn\ tid 033addd1 d4eb 3c97 b9e6 acaf0023c140\\",\n \\"storeid\\" \\"08f7ce0a bd07 4016 8a28 c68f5c93aa38\\",\n \\"sourceapp\\" \\"\\",\n \\"transmissionatlocal\\" \\"2022 12 07t18 41 13z\\"\n },\n \\"customeruserid\\" 6292857,\n \\"fundingsource\\" {\n \\"card\\" {\n \\"id\\" 36553314,\n \\"cardholderfirstname\\" \\"jane\\",\n \\"cardholderlastname\\" \\"smith\\",\n \\"cardholderfullname\\" \\"\\",\n \\"expirationmonth\\" 11,\n \\"expirationyear\\" 2029,\n \\"numberfirst6\\" \\"411111\\",\n \\"numberlast4\\" \\"1111\\",\n \\"numbermasked\\" \\"411111 1111\\",\n \\"status\\" \\"active\\",\n \\"type\\" \\"visa\\"\n },\n \\"cardtoken\\" \\"b0cb812a 7a72 468f 9b9a 31a43d256acb\\",\n \\"debit\\" false,\n \\"entrydetails\\" {\n \\"customerpresencestatus\\" \\"moto\\",\n \\"entrymode\\" \\"keyed\\"\n },\n \\"type\\" \\"credit debit\\"\n },\n \\"links\\" null,\n \\"notes\\" \\"hi there!\\",\n \\"processorresponse\\" {\n \\"acquirer\\" \\"poynt\\",\n \\"approvedamount\\" 200,\n \\"approvalcode\\" \\"419763\\",\n \\"processor\\" \\"mock\\",\n \\"retrievalrefnum\\" \\"ee76f137 0ccb 47b2 bf9a 5cb82cdac5e0\\",\n \\"status\\" \\"successful\\",\n \\"statuscode\\" \\"1\\",\n \\"statusmessage\\" \\"successful\\",\n \\"transactionid\\" \\"ee76f137 0ccb 47b2 bf9a 5cb82cdac5e0\\"\n },\n \\"receiptemailaddress\\" \\"customeremail\@domain cc\\",\n \\"references\\" null,\n \\"reversalvoid\\" false,\n \\"settled\\" false,\n \\"status\\" \\"authorized\\",\n \\"voided\\" false,\n \\"createdat\\" \\"2022 12 07t18 41 13z\\",\n \\"updatedat\\" \\"2022 12 07t18 41 16z\\"\n}", "language" "202", "customlabel" "" }, { "id" "3n28nisxww9efbub4rili", "code" "{\\"code\\" 0,\\"message\\" \\"you must send a key\\",\\"error\\" {}}", "language" "500", "customlabel" "" } ], "selectedlanguageid" "awto60nkkclwo9hganjdi" }, "examples" { "languages" \[ { "id" "vanhwpbdras8h6tpuxhbg", "code" "curl location request post 'https //process moolahpay cc/api/token/authorize' \\\\\n header 'accept application/json' \\\\\n header 'authorization string' \\\\\n data raw '{\\"amount\\" \\"number\\",\\"cardtoken\\" \\"string\\",\\"currency\\" \\"string\\",\\"email\\" \\"string\\",\\"notes\\" \\"string\\"}'", "language" "curl", "customlabel" "" }, { "id" "3qsl11prsnqmxosfvvx6j", "code" "var request = require('request');\nvar options = {\n 'method' 'post',\n 'url' 'https //process moolahpay cc/api/token/authorize',\n 'headers' {\n 'accept' 'application/json',\n 'authorization' 'string'\n },\n body '{\\"amount\\" \\"number\\",\\"cardtoken\\" \\"string\\",\\"currency\\" \\"string\\",\\"email\\" \\"string\\",\\"notes\\" \\"string\\"}'\n\n};\nrequest(options, function (error, response) {\n if (error) throw new error(error);\n console log(response body);\n});\n", "language" "nodejs", "customlabel" "" }, { "id" "aujt898gzfxco8v5camos", "code" "var myheaders = new headers();\nmyheaders append(\\"accept\\", \\"application/json\\");\nmyheaders append(\\"content type\\", \\"application/json\\");\nmyheaders append(\\"authorization\\", \\"string\\");\n\nvar raw = \\"{\\\\\\"amount\\\\\\" \\\\\\"number\\\\\\",\\\\\\"cardtoken\\\\\\" \\\\\\"string\\\\\\",\\\\\\"currency\\\\\\" \\\\\\"string\\\\\\",\\\\\\"email\\\\\\" \\\\\\"string\\\\\\",\\\\\\"notes\\\\\\" \\\\\\"string\\\\\\"}\\";\n\nvar requestoptions = {\n method 'post',\n headers myheaders,\n body raw,\n redirect 'follow'\n};\n\nfetch(\\"https //process moolahpay cc/api/token/authorize\\", requestoptions)\n then(response => response text())\n then(result => console log(result))\n catch(error => console log('error', error));", "language" "javascript", "customlabel" "" }, { "id" " b73fque6 ypx di6jjfm", "code" "import requests\n\nurl = \\"https //process moolahpay cc/api/token/authorize\\"\n\npayload = \\"{\\\\\\"amount\\\\\\" \\\\\\"number\\\\\\",\\\\\\"cardtoken\\\\\\" \\\\\\"string\\\\\\",\\\\\\"currency\\\\\\" \\\\\\"string\\\\\\",\\\\\\"email\\\\\\" \\\\\\"string\\\\\\",\\\\\\"notes\\\\\\" \\\\\\"string\\\\\\"}\\"\nheaders = {\n 'accept' 'application/json',\n 'authorization' 'string'\n}\n\nresponse = requests request(\\"post\\", url, headers=headers, data=payload)\n\nprint(response text)\n", "language" "python", "customlabel" "" }, { "id" "bevryuphcmnlviyu22bh5", "code" "require \\"uri\\"\nrequire \\"net/http\"\n\nurl = uri(\\"https //process moolahpay cc/api/token/authorize\\")\n\nhttps = net http new(url host, url port)\nhttps use ssl = true\n\nrequest = net http post new(url)\nrequest\[\\"accept\\"] = \\"application/json\\"\nrequest\[\\"authorization\\"] = \\"string\\"\nrequest body = \\"{\\\\\\"amount\\\\\\" \\\\\\"number\\\\\\",\\\\\\"cardtoken\\\\\\" \\\\\\"string\\\\\\",\\\\\\"currency\\\\\\" \\\\\\"string\\\\\\",\\\\\\"email\\\\\\" \\\\\\"string\\\\\\",\\\\\\"notes\\\\\\" \\\\\\"string\\\\\\"}\\"\n\nresponse = https request(request)\nputs response read body\n", "language" "ruby", "customlabel" "" } ], "selectedlanguageid" "vanhwpbdras8h6tpuxhbg" }, "description" "authorizes a token for later capture", "currentnewparameter" { "label" "body parameter", "value" "bodydataparameters" } } on a successful authorization the status property will be authorized if the authorization is declined the status property will be declined, with the processorresponse statusmessage as the reason the id is the transaction id, and is needed to capture the transaction once a transaction is authorized use the docid\ ku1esdj6fksruhuf1l o1 endpoint to capture the transaction for processing