"code": "InvalidDocumentTypeForRefund",
	"target": "Unknown",
	"details": [
			"code": "InvalidDocumentTypeForRefund",
			"number": 702,
			"message": "Invalid document type to process refund",
			"description": "The document type is -0-, we can only process refund on SalesInvoice document.",
			"faultCode": "Client",
			"helpLink": "",
			"severity": "Error"

Refunds can only be created on SalesInvoice records. This error indicates that the document you attempted to refund was not a SalesInvoice.

The refund API cannot correctly determine amounts for a refund on a PurchaseInvoice or a ReturnInvoice. Because those document types are defined by the seller, the seller would have to provide you information on what information those documents contain.