Use this API to void a payment that has not been settled. This API is submitted in the following form:
curl -v https://<instance>.salesforce.com/services/apexrest/fw1/v2/payments \
-H 'Authorization: Bearer <access token>' \
-H 'Content-Type: application/json' \
-X POST \
-d '{<arguments>}'
To get an access token, read here: Authentication
EXAMPLE REQUEST
curl -v https://na14.salesforce.com/services/apexrest/fw1/v2/payments \
-H 'Authorization: Bearer 00Dx0000000exxV!AXXXXXfcKqHB0czbxxxxxHkyo9gt41BxxxhWPxxZzaXxXxbAJxx9Ov4Hno..mu1Xi5XXXX8MWHVD81JVr6ShxxxxxorGv6Uy' \
-H 'Content-Type: application/json' \
-X POST \
-d '{"trans_type":"Void",
"payment_id":"aXxA000XXXxxyXR"}'
EXAMPLE RESPONSE
{"type":null,
"status":null,
"salesforce_payment_id":null,
"processor_transaction_id":null,
"processor":null,
"payment_date":null,
"message":"This transaction has already been voided.",
"is_successful":false,
"cvv2_match":null,
"avs_code":null,
"amount_currency":null,
"amount":null}
is_successful (true/false) indicates if the payment was successfully voided or not. Any error message will be listed in message.
COMPLETE LIST OF ARGUMENTS
- trans_type – required, valid value is Void
- payment_id – required, the ID of the payment record in Salesforce
- void_note – optional, any note that you want to go with the transaction