TABLE OF CONTENTS
Refunding a Payment
This API is used to refund a sale transaction after the sale has been completed.
This API depends on the Token API and the Charge Object
POST v1/payment/{mid}/refund
Request Parameters
The merchant id that the authorization
Request Body
Include a RefundRequest object as the body of the request.
Sample Request
POST https://sandX-api.acmeticketing.net/v1/987-654-321/refund
Response
Returns an RefundResponse object.
RefundRequest Object
Name | Type | Description | Required |
---|---|---|---|
saleId | string | The Sale Id that you are refunding | Required |
charge | The charge object for the refund. The amount being refunded on the order is required. It cannot be more than is remaining on the order or token if one is provided | Required |
RefundResponse Object
Name | Type | Description |
---|---|---|
refundId | string | The id of the refund |
saleId | string | The Sale Id that you are refunding |
charge | Charge Object › | The charge object associated with the refund. The amount refunded will match the input amount as we will error if there is insufficient funds on the order to be refunded to this token otherwise. |
card | Card Object › | The details of the credit card |
Sample Request Body
{ "saleId" : "sale_34de74b9-e409-4931-8a49-9982f986bd3a", "charge": { "amount" : 50.00 } }
Sample Response Body
Successful Refund Transaction
{ "refundId" : "refund_edc589c7-b510-42d8-b70a-a3b78f888b6c", "saleId" : "sale_34de74b9-e409-4931-8a49-9982f986bd3a", "charge": { "amount" : 50.00 }, "card": { "lastFour": "4242", "expirationDate": { "month": "12", "year": "2023" }, "postalCode": "T1X 0V6", "brand": "Visa", "firstName": "VISA", "lastName": "CARDHOLDER" } }
Failed Refund Transaction
If the error happens at ACME there will not be a processor or issuing error code. If the error happens at the issuing bank then both of those should be available. If it happens at the payment processor, then there will probably not be an issuing error but there will be a processor error.
{ "message": "Refund amount must be positive", "errorCode": 10026, "type": "NEGATIVE_REFUND_AMOUNT", "requestId": "6e360f6a-5d31-11ec-9ceb-064a412857e4" }