Difference between revisions of "NATS4 API Get Payment Data"
From TMM Wiki
Jump to navigationJump to search (Created page with "{{NATS4 Manual | show_api_admin_section = true }} ''This feature is not yet available'' Category:NATS4 API Articles") |
|||
Line 3: | Line 3: | ||
}} | }} | ||
''This feature is not yet available'' | ''This feature is not yet available'' | ||
+ | |||
+ | == '''Parameters''' == | ||
+ | get_payment_data accepts the following parameters | ||
+ | * '''loginid''' - filter for a specific affiliate using their ID | ||
+ | * '''filter_inhouse''' - Set to 1 to exclude in-house affiliates from the results | ||
+ | * '''start_date''' - any string accepted by PHP strtotime | ||
+ | * '''end_date''' - any string accepted by PHP strtotime | ||
+ | * '''payvia_type_id''' - pass a numeric ID to limit to a specific payvia type | ||
+ | * '''payment_type''' - pass a numeric ID to limit to a specific payment type | ||
+ | * '''open''' - 0 or 1, hide or show open payments in the output | ||
+ | * '''stored''' - 0 or 1, hide or show stored payments in the output | ||
+ | * '''paid''' - 0 or 1, hide or show paid payments in the output | ||
+ | |||
+ | == '''Example''' == | ||
+ | |||
+ | NuSOAP Example (continuing from [[NATS4_API#Example|main article NuSOAP Example]]): | ||
+ | <pre> | ||
+ | //get all payments for loginid 4 | ||
+ | $api_function = "get_payment_data"; | ||
+ | $loginid=4; | ||
+ | |||
+ | $arguments = Array( | ||
+ | Array( | ||
+ | 'loginid' => $loginid, | ||
+ | 'open' => 1, | ||
+ | 'stored' => 1, | ||
+ | 'paid' => 1, | ||
+ | ), | ||
+ | ); | ||
+ | $result = $client->call($api_function , $arguments, 'natsapiadmin_wsdl'); | ||
+ | var_dump($result); | ||
+ | </pre> | ||
+ | Output: | ||
+ | <pre> | ||
+ | Array | ||
+ | ( | ||
+ | [0] => Array | ||
+ | ( | ||
+ | [0] => Array | ||
+ | ( | ||
+ | [loginid] => 4 | ||
+ | [stored] => Array | ||
+ | ( | ||
+ | [0] => Array | ||
+ | ( | ||
+ | [paymentid] => 2 | ||
+ | [loginid] => 4 | ||
+ | [payvia_type_id] => 1 | ||
+ | [payvia_type_nice] => Check ($-1.00) | ||
+ | [start] => 1412136000 | ||
+ | [end] => 1413345600 | ||
+ | [type] => 50 | ||
+ | [type_nice] => Account Rep Payment | ||
+ | [amount] => 3000 | ||
+ | [stored] => 1425272400 | ||
+ | [paid] => 0 | ||
+ | [paid_reference] => | ||
+ | [received] => 0 | ||
+ | ) | ||
+ | |||
+ | ) | ||
+ | |||
+ | [open] => Array | ||
+ | ( | ||
+ | [0] => Array | ||
+ | ( | ||
+ | [paymentid] => 10 | ||
+ | [loginid] => 4 | ||
+ | [payvia_type_id] => 1 | ||
+ | [payvia_type_nice] => Check ($-1.00) | ||
+ | [start] => 1420088400 | ||
+ | [end] => 1421298000 | ||
+ | [type] => 50 | ||
+ | [type_nice] => Account Rep Payment | ||
+ | [amount] => 3000 | ||
+ | [stored] => 0 | ||
+ | [paid] => 0 | ||
+ | [paid_reference] => | ||
+ | [received] => 0 | ||
+ | ) | ||
+ | ) | ||
+ | |||
+ | [paid] => Array | ||
+ | ( | ||
+ | [0] => Array | ||
+ | ( | ||
+ | [paymentid] => 5 | ||
+ | [loginid] => 4 | ||
+ | [payvia_type_id] => 1 | ||
+ | [payvia_type_nice] => Check ($-1.00) | ||
+ | [start] => 1425272400 | ||
+ | [end] => 1425272400 | ||
+ | [type] => 5 | ||
+ | [type_nice] => Manual Invoice | ||
+ | [amount] => 5500 | ||
+ | [stored] => 1425272400 | ||
+ | [paid] => 1425272400 | ||
+ | [paid_reference] => | ||
+ | [received] => 0 | ||
+ | ) | ||
+ | |||
+ | ) | ||
+ | ) | ||
+ | ) | ||
+ | ) | ||
+ | |||
+ | </pre> | ||
[[Category:NATS4 API Articles]] | [[Category:NATS4 API Articles]] |
Latest revision as of 20:14, 27 March 2015
This feature is not yet available
Parameters
get_payment_data accepts the following parameters
- loginid - filter for a specific affiliate using their ID
- filter_inhouse - Set to 1 to exclude in-house affiliates from the results
- start_date - any string accepted by PHP strtotime
- end_date - any string accepted by PHP strtotime
- payvia_type_id - pass a numeric ID to limit to a specific payvia type
- payment_type - pass a numeric ID to limit to a specific payment type
- open - 0 or 1, hide or show open payments in the output
- stored - 0 or 1, hide or show stored payments in the output
- paid - 0 or 1, hide or show paid payments in the output
Example
NuSOAP Example (continuing from main article NuSOAP Example):
//get all payments for loginid 4 $api_function = "get_payment_data"; $loginid=4; $arguments = Array( Array( 'loginid' => $loginid, 'open' => 1, 'stored' => 1, 'paid' => 1, ), ); $result = $client->call($api_function , $arguments, 'natsapiadmin_wsdl'); var_dump($result);
Output:
Array ( [0] => Array ( [0] => Array ( [loginid] => 4 [stored] => Array ( [0] => Array ( [paymentid] => 2 [loginid] => 4 [payvia_type_id] => 1 [payvia_type_nice] => Check ($-1.00) [start] => 1412136000 [end] => 1413345600 [type] => 50 [type_nice] => Account Rep Payment [amount] => 3000 [stored] => 1425272400 [paid] => 0 [paid_reference] => [received] => 0 ) ) [open] => Array ( [0] => Array ( [paymentid] => 10 [loginid] => 4 [payvia_type_id] => 1 [payvia_type_nice] => Check ($-1.00) [start] => 1420088400 [end] => 1421298000 [type] => 50 [type_nice] => Account Rep Payment [amount] => 3000 [stored] => 0 [paid] => 0 [paid_reference] => [received] => 0 ) ) [paid] => Array ( [0] => Array ( [paymentid] => 5 [loginid] => 4 [payvia_type_id] => 1 [payvia_type_nice] => Check ($-1.00) [start] => 1425272400 [end] => 1425272400 [type] => 5 [type_nice] => Manual Invoice [amount] => 5500 [stored] => 1425272400 [paid] => 1425272400 [paid_reference] => [received] => 0 ) ) ) ) )