NATS5 REST API Payment GET dump-formats
From TMM Wiki
Jump to navigationJump to searchGET /payment/dump-formats
Description
- Get dump formats available for payvias
Resource URL
- http://domain/api/payment/dump-formats
- Replace domain with the nats domain
- GET
Response Format
- JSON
- HTTP headers
Parameters
Parameters can be sent as url encoded params
- active_only
- type: boolean_digit
- optional
- payvia_type_id
- type: digit
- optional
Example Request
Method: GET
URL: http://domain/api/payment/dump-formats
Response:
{ "success": true, "dumps": [ { "dumpid": 17, "name": "Check CSV Default", "custom": 0, "payvia_types": [ { "payvia_type_id": "2", "name": "Inteca" } ], "payvia_active": 1 }, { "dumpid": 8, "name": "Check Default", "custom": 0, "payvia_types": [ { "payvia_type_id": "1", "name": "Check" } ], "payvia_active": 1 }, { "dumpid": 13, "name": "Check Letter Default", "custom": 0, "payvia_types": [], "payvia_active": 0 }, { "dumpid": 28, "name": "Chexx Inc", "custom": 0, "payvia_types": [], "payvia_active": 0 }, { "dumpid": 999, "name": "debugger", "custom": 0, "payvia_types": [], "payvia_active": 0 }, { "dumpid": 32, "name": "EMP2\/IPAYOUT CSV", "custom": 0, "payvia_types": [ { "payvia_type_id": "6", "name": "EMC2\/IPAYOUT" } ], "payvia_active": 1 }, { "dumpid": 5, "name": "Epassporte", "custom": 0, "payvia_types": [ { "payvia_type_id": "3", "name": "ePassporte" } ], "payvia_active": 1 }, { "dumpid": 9, "name": "Epassporte 2 Default", "custom": 0, "payvia_types": [], "payvia_active": 0 }, { "dumpid": 18, "name": "Epassporte CSV Default", "custom": 0, "payvia_types": [], "payvia_active": 0 }, { "dumpid": 11, "name": "Epassporte Letter Default", "custom": 0, "payvia_types": [], "payvia_active": 0 }, { "dumpid": 35, "name": "ePayService", "custom": 0, "payvia_types": [ { "payvia_type_id": "10", "name": "ePayService" } ], "payvia_active": 1 }, { "dumpid": 33, "name": "FirstChoice Pay", "custom": 0, "payvia_types": [ { "payvia_type_id": "7", "name": "FirstChoice Pay" } ], "payvia_active": 1 }, { "dumpid": 38, "name": "Intercash Check", "custom": 0, "payvia_types": [ { "payvia_type_id": "13", "name": "Intercash Check" } ], "payvia_active": 1 }, { "dumpid": 37, "name": "Intercash Prepaid Card", "custom": 0, "payvia_types": [ { "payvia_type_id": "12", "name": "Intercash Prepaid Card" } ], "payvia_active": 1 }, { "dumpid": 19, "name": "International Wire CSV Default", "custom": 0, "payvia_types": [], "payvia_active": 0 }, { "dumpid": 3, "name": "International Wire Default", "custom": 0, "payvia_types": [ { "payvia_type_id": "5", "name": "International Wire" } ], "payvia_active": 1 }, { "dumpid": 12, "name": "International Wire Letter Default", "custom": 0, "payvia_types": [], "payvia_active": 0 }, { "dumpid": 20, "name": "Moneybookers CVS Default", "custom": 0, "payvia_types": [], "payvia_active": 0 }, { "dumpid": 4, "name": "MoneyBookers Default", "custom": 0, "payvia_types": [], "payvia_active": 0 }, { "dumpid": 14, "name": "Moneybookers letter Default", "custom": 0, "payvia_types": [], "payvia_active": 0 }, { "dumpid": 34, "name": "Paxum CSV", "custom": 0, "payvia_types": [ { "payvia_type_id": "9", "name": "Paxum" } ], "payvia_active": 1 }, { "dumpid": 21, "name": "Paypal CSV Default", "custom": 0, "payvia_types": [], "payvia_active": 0 }, { "dumpid": 7, "name": "Paypal Default", "custom": 0, "payvia_types": [ { "payvia_type_id": "8", "name": "Paypal" } ], "payvia_active": 1 }, { "dumpid": 15, "name": "Paypal letter Default", "custom": 0, "payvia_types": [], "payvia_active": 0 }, { "dumpid": 36, "name": "Payza", "custom": 0, "payvia_types": [ { "payvia_type_id": "11", "name": "Payza" } ], "payvia_active": 1 }, { "dumpid": 1, "name": "Quickbooks", "custom": 0, "payvia_types": [], "payvia_active": 0 }, { "dumpid": 2, "name": "Quickbooks Check Default", "custom": 0, "payvia_types": [], "payvia_active": 0 }, { "dumpid": 23, "name": "Quickbooks Epassporte Default (for book keeping)", "custom": 0, "payvia_types": [], "payvia_active": 0 }, { "dumpid": 24, "name": "Quickbooks International Wire Default (for book keeping)", "custom": 0, "payvia_types": [], "payvia_active": 0 }, { "dumpid": 26, "name": "Quickbooks Moneybookers Default (for book keeping)", "custom": 0, "payvia_types": [], "payvia_active": 0 }, { "dumpid": 27, "name": "Quickbooks Paypal Default (for book keeping)", "custom": 0, "payvia_types": [], "payvia_active": 0 }, { "dumpid": 25, "name": "Quickbooks US Wire Default (for booK keeping)", "custom": 0, "payvia_types": [], "payvia_active": 0 }, { "dumpid": 10, "name": "Quickbooks Vendor Default", "custom": 0, "payvia_types": [], "payvia_active": 0 }, { "dumpid": 39, "name": "Red Pass", "custom": 0, "payvia_types": [ { "payvia_type_id": "14", "name": "Red Pass" } ], "payvia_active": 1 }, { "dumpid": 30, "name": "RevUpCard CVS", "custom": 0, "payvia_types": [], "payvia_active": 0 }, { "dumpid": 1000, "name": "test name", "custom": 1, "payvia_types": [], "payvia_active": 0 }, { "dumpid": 22, "name": "US Wire CSV Default", "custom": 0, "payvia_types": [], "payvia_active": 0 }, { "dumpid": 6, "name": "US Wire Default", "custom": 0, "payvia_types": [ { "payvia_type_id": "4", "name": "Domestic Wire" } ], "payvia_active": 1 }, { "dumpid": 16, "name": "US Wire Letter Default", "custom": 0, "payvia_types": [], "payvia_active": 0 }, { "dumpid": 29, "name": "Webmasterchecks", "custom": 0, "payvia_types": [], "payvia_active": 0 }, { "dumpid": 31, "name": "Webmasterchecks Wire", "custom": 0, "payvia_types": [], "payvia_active": 0 } ] }
Example Code
PHP
<?php $headers = array( //set your username and API key here 'api-key: 44b5498dbcb481a0d00b404c0169af62', 'api-username: tmm1phrvezsbu' ); $url = 'http://yourdomain.com'; //set your NATS URL here $data = array( // Add API parameters here ); $request = Array( 'method' => 'GET', 'path' => 'v1/payment/dump-formats', 'data' => $data ); /*code below is the same for (almost) every API call */ $curl = curl_init(); $url = $url.'/api/'.$request['path']; $query = http_build_query($request['data']); if($request['method'] == 'GET'){ //add query string parameters to the end of the url $url = $url.'?'.$query; }else{ //send parameters as POST fields curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_POSTFIELDS, $query); if($request['method'] != 'POST'){ $headers[] ='X-HTTP-Method: '.$request['method']; //send custom request method } } curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_HTTPHEADER, $headers); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); $resp = curl_exec($curl); //dumps an associative array representation of the json var_dump(json_decode($resp, true)); // Close request to clear up some resources curl_close($curl); ?>