A void is given if you need to return only the full amount of funds to the customer and the transaction has not cleared at the bank yet. To refund a transaction after the funds have cleared, please look at the Refund endpoint.
Note - Not all Payment Gateways offer Void facilities and therefore a refund should be used instead.
Method | Purpose |
---|---|
POST | Void a Card or Specific Payment |
Action: Create a request to Void a card transaction.
Method: POST
URL: https://pay.smarterpay.com/SmarterPayCardPaymentService/api/transaction/{ID}
{ID} denotes ID of the card record.
Request Parameters
Property | Mandatory | Description |
---|---|---|
payment_type | True | Always set to 'Void'. |
platform | True | Always set to 'SmarterPayCloud'. |
internal_payment_description | False | A long description of the transaction for internal use only. Not seen by the customer. |
gateway_payment_description | False | A long description of the transaction that will be forwarded to the Payment Gateway. Depending on the Payment Gateway, this may or may not be seen by the customer. |
custom_reference | False | Custom reference set on record. |
isAsnyc | False | Set to true if you do not wish to wait for the result of the transaction. You will receive 202 Accepted if this is set to true. You can view the result of the transaction via the SmarterPay Cloud Portal or via a Webhook. |
related_payment_id | False | If you wish to void a specific payment under the card, send the payment id in the request. |
metadata | False | Any additional data attached to the transaction. Recommendation to use key/value pairs or simple JSON structures. This will be sent out in any active Webhooks so can be used to tie information back to source records in another platform. |
Request Sample
{ "payment_type":"Void", "platform":"SmarterPayCloud", "internal_payment_description":"Void for something", "gateway_payment_description":"Void for something sent to the gateway", "custom_reference":"MYREFERENCE0001" , "isAsnyc": false, "related_payment_id":"P01YZ96J1D7WDK8NEWD" }
Response Parameters
Property | Description |
---|---|
card_id | The ID of the card that the void took place under. |
payment_id | The unique ID of the void transaction. |
platform | The platform that the transaction took place on. Always 'SmarterPayCloud'. |
payment_type | The type of transaction. In this case 'Void'. |
payment_gateway | Confirmation of the Payment Gateway that the transaction took place on. |
status | Normalised result of the transaction. See the possible values here. |
status_details | Normalised result details of the transaction. See the possible values here. |
status_code | Normalised result code of the transaction. See the possible values here. |
gateway_status | The result of the transaction as sent by the Payment Gateway. See Payment Gateway documentation for possible values. |
gateway_status_details | Additional result details provided by the Payment Gateway. Not all Payment Gateways supply this. See Payment Gateway documentation for possible values. |
gateway_status_code | Additional result code provided by the Payment Gateway. Not all Payment Gateways supply this. See Payment Gateway documentation for possible values. |
Response Sample
{ "card_id": "CD01MD1LRPM4748YEQG4", "payment_id": "P013ZN7JW3O3Z1JGEX5", "platform": "SmarterPayCloud", "payment_type": "Void", "payment_gateway": "OpayoPi", "status": "successful", "status_details": "", "status_code": "", "gateway_status": "Ok", "gateway_status_details": "", "gateway_status_code": "" }