Difference between revisions of "Offerit REST API Process Void"
From Offerit
OfferitRob (talk | contribs) (Created page with "{{Offerit Manual | show_rest_api_section = true }} == '''POST transaction/process_void''' == '''Description''' *Offerit has a REST API resource to void a transaction previous...") |
OfferitRob (talk | contribs) (→Parameters) |
||
(2 intermediate revisions by the same user not shown) | |||
Line 4: | Line 4: | ||
== '''POST transaction/process_void''' == | == '''POST transaction/process_void''' == | ||
'''Description''' | '''Description''' | ||
− | * | + | *This REST API resource is used to void a transaction that was previously converted |
'''Resource URL''' | '''Resource URL''' | ||
Line 20: | Line 20: | ||
== '''Parameters''' == | == '''Parameters''' == | ||
− | |||
− | |||
− | |||
− | |||
*'''transaction_hash''': ''The click_hash/transaction_hash of the transaction you want voided.'' | *'''transaction_hash''': ''The click_hash/transaction_hash of the transaction you want voided.'' | ||
**'''''type: string''''' | **'''''type: string''''' | ||
Line 44: | Line 40: | ||
**'''''optional''''' | **'''''optional''''' | ||
+ | *'''trans_custom1 ''': ''custom value to record with a transaction. -1 is a reserved value and should not be used.'' | ||
+ | **'''''type: string''''' | ||
+ | **'''''optional''''' | ||
+ | |||
+ | *'''trans_custom2 ''': ''custom value to record with a transaction. -1 is a reserved value and should not be used.'' | ||
+ | **'''''type: string''''' | ||
+ | **'''''optional''''' | ||
+ | *'''trans_custom3 ''': ''custom value to record with a transaction. -1 is a reserved value and should not be used.'' | ||
+ | **'''''type: string''''' | ||
+ | **'''''optional''''' | ||
+ | |||
+ | *'''trans_custom4 ''': ''custom value to record with a transaction. -1 is a reserved value and should not be used.'' | ||
+ | **'''''type: string''''' | ||
+ | **'''''optional''''' | ||
+ | |||
+ | *'''trans_custom5 ''': ''custom value to record with a transaction. -1 is a reserved value and should not be used.'' | ||
+ | **'''''type: string''''' | ||
+ | **'''''optional''''' | ||
== '''Example Request''' == | == '''Example Request''' == |
Latest revision as of 13:23, 24 June 2020
POST transaction/process_void
Description
- This REST API resource is used to void a transaction that was previously converted
Resource URL
- http://domain/api/transaction/process_void
- Replace domain with your Offerit network domain
- POST
Response Format
- JSON
- HTTP headers
Parameters
- transaction_hash: The click_hash/transaction_hash of the transaction you want voided.
- type: string
- optional
- click_hash: The click_hash/transaction_hash of the transaction you want voided.
- type: string
- optional
- orderid: The transaction identifier sent on conversion (orderid) you want voided.
- type: string
- optional
- transactionid: The Offerit generated transaction identifier you want voided
- type: string
- optional
- approved: Used in setups with pending conversions so the initial transaction identifier can be sent to void the associated approval
- type: string
- optional
- trans_custom1 : custom value to record with a transaction. -1 is a reserved value and should not be used.
- type: string
- optional
- trans_custom2 : custom value to record with a transaction. -1 is a reserved value and should not be used.
- type: string
- optional
- trans_custom3 : custom value to record with a transaction. -1 is a reserved value and should not be used.
- type: string
- optional
- trans_custom4 : custom value to record with a transaction. -1 is a reserved value and should not be used.
- type: string
- optional
- trans_custom5 : custom value to record with a transaction. -1 is a reserved value and should not be used.
- type: string
- optional
Example Request
POST
http://domain.com/api/transaction/process_void
- Response:
Success { "result": "success", "message": "*success*" } Failure { "result": "error", "message": "*error* - Void transaction exists." }
Example Code
PHP
<?php $curl = curl_init(); $data = array( 'type' => 'void', 'transaction_hash' => '156097c947ece92.38318951', ); $url = 'http://domain/api/transaction/process_void'; $headers = array( 'api-key: 44b5498dbcb481a0d00b404c0169af62', 'api-username: productsupport' ); curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_HTTPHEADER, $headers); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($data)); curl_setopt($curl, CURLOPT_URL, $url); $resp = curl_exec($curl); //dumps an associative array representation of the json response $output = json_decode($resp, true); if($output !== NULL) { //json was valid. Dump the decoded array print_r($output); } else { //invalid json, just dump the raw response print_r($resp); } // Close request to clear up some resources curl_close($curl); ?>