Logo

How can we help you?

Search our knowledge base to get answers to your questions, access video training & more!

Developer

Refund Payment API

Updated 2 days ago

Use this API to refund a payment. Call this API 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":"Refund",
          "payment_id":"aXxA000XXXxxyXR"}'

 

EXAMPLE RESPONSE

{"type":null,
 "status":null,
 "salesforce_payment_id":null,
 "processor_transaction_id":null,
 "processor":null,
 "payment_date":null,
 "message":"Amount to refund must be greater than zero.",
 "is_successful":false,
 "cvv2_match":null,
 "avs_code":null,
 "amount_currency":null,
 "amount":null}

 

is_successful (true/false) indicates if the payment was successfully refunded or not. Any error message will be listed in message.

 

COMPLETE LIST OF ARGUMENTS

 

  • trans_type – required, valid value is Refund

  • payment_id – required, the ID  of the payment record in Salesforce

  • refund_type – optional, valid values are Full or Partial

  • amount_to_refund – optional, if this is not provided the open amount will be refunded

  • refund_note – optional, any note that you want to go with the transaction

 

Previous

Capture Payment API

Next