{"method":"POST","path":"https://api.revcent.com/v2/transactions/{transaction_id}/refund","summary":"Refund A Transaction","description":"Refund a credit card transaction directly using the transaction ID. If partially refunding, provide the amount property in the request body. If the amount property is not provided, the transaction will be refunded entirely. <br><br>Note: This is not the recommended method and should be avoided if you wish to run detailed metrics reports on a per item type basis. Use the VoidSale, RefundProductSale, RefundShipment, RefundTax, or RefundSubscriptionRenewal operations in order to target the specific item in question. View markdown documentation at https://revcent.com/documentation/markdown/mcp/operation/RefundTransaction.md for an in-depth overview of this operation.","operationId":"RefundTransaction","parameters":[{"in":"path","name":"transaction_id","description":"The transaction ID","required":true,"schema":{"type":"string","description":"A 20 character transaction ID.","minLength":20,"maxLength":20}}],"requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"amount":{"description":"The amount to refund. If not provided the entire transaction amount will be refunded.","type":"number","format":"float"},"refunded_offsite":{"description":"You have the option to refund a credit card transaction within RevCent, without refunding the transaction at the gateway level. If set to true, RevCent will mark all entities as having a refund, but will not contact the gateway to return the money to the customer. This is useful for reporting within RevCent when a transaction was refunded outside of RevCent, i.e. Rapid Dispute Resolution, mailed a check, etc. Default is false.","type":"boolean"}},"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"description":"","properties":{"api_call_id":{"type":"string","description":"A 20 character API call ID.","minLength":20,"maxLength":20},"api_call_unix":{"description":"Unix timestamp of when the API call was initiated.","type":"integer","format":"unix-time"},"code":{"description":"API call response code.","type":"integer","format":"int32","enum":[1]},"amount":{"description":"The amount refunded.","type":"number","format":"float"},"origin_campaign_id":{"type":"string","description":"A 20 character campaign ID of the transactions' associated campaign.","minLength":20,"maxLength":20},"origin_customer_id":{"type":"string","description":"A 20 character customer ID of the transactions' associated customer.","minLength":20,"maxLength":20},"origin_sale_id":{"type":"string","description":"A 20 character sale ID of the transactions' associated sale, if applicable.","minLength":20,"maxLength":20},"origin_transaction_id":{"type":"string","description":"A 20 character transaction ID of the transaction being refunded.","minLength":20,"maxLength":20},"pending_refund":{"items":{"type":"string","description":"A 20 character pending refund ID.","minLength":20,"maxLength":20},"type":"array","description":"An array containing the ID's of any pending refunds created as a result of the refund."},"result":{"type":"string"}},"type":"object","additionalProperties":false}}},"description":"Successful response."},"default":{"content":{"application/json":{"schema":{"description":"","properties":{"api_call_id":{"type":"string","description":"A 20 character API call ID.","minLength":20,"maxLength":20},"api_call_unix":{"description":"Unix timestamp of when the API call was initiated.","type":"integer","format":"unix-time"},"code":{"description":"This value indicates that there is an error. Will always be 0.","type":"integer","enum":[0]},"error_code":{"description":"The specific error code.","type":"string"},"message":{"description":"A human readable description of the error.","type":"string"},"result":{"description":"A description of the API call result.","type":"string"}},"title":"APIStandardErrors","type":"object","additionalProperties":false}}},"description":"Error response."}}}