POST api/me/userproperties/{userPropertyId}/cases/{caseId}/payments/{paymentId}

Use this method to refund existing payment to user on the user case. This will create another payment record of type 'Refund' and will set Refundable flag to false on the original transaction.

Requires Authorization!

Request Information

URI Parameters

NameDescriptionTypeAdditional information
userPropertyId

Id of the user property record

integer

Required

caseId

Id of the user case record

integer

Required

paymentId

Id of the payment record being refunded

integer

Required

Body Parameters

Refund instructions data

RefundPaymentDataBindingModel
NameDescriptionTypeAdditional information
RefundAmount

decimal number

Required

RefundReason

string

Required

PaymentMethodId

integer

Required

CheckNumber

string

None.

Request Formats

application/json, text/json

Sample:
{
  "refundAmount": 1.0,
  "refundReason": "sample string 2",
  "paymentMethodId": 3,
  "checkNumber": "sample string 4"
}

text/html

Sample:
{"refundAmount":1.0,"refundReason":"sample string 2","paymentMethodId":3,"checkNumber":"sample string 4"}

application/xml, text/xml

Sample:
<RefundPaymentDataBindingModel xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Ptd.Model.WebModels.Payments">
  <CheckNumber>sample string 4</CheckNumber>
  <PaymentMethodId>3</PaymentMethodId>
  <RefundAmount>1</RefundAmount>
  <RefundReason>sample string 2</RefundReason>
</RefundPaymentDataBindingModel>

application/x-www-form-urlencoded

Sample:

Failed to generate the sample for media type 'application/x-www-form-urlencoded'. Cannot use formatter 'JQueryMvcFormUrlEncodedFormatter' to write type 'RefundPaymentDataBindingModel'.

Response Information

Resource Description

Transaction response data that may contain stripe error information in case transaction fails

TransactionCompletedCaseResponseModel
NameDescriptionTypeAdditional information
IsSuccess

boolean

None.

ErrorMessage

string

None.

Cases

Collection of PaidCaseDetailModel

None.

IsCaseOrder

boolean

None.

OrderId

integer

None.

Response Formats

application/json, text/json

Sample:
{
  "isSuccess": true,
  "errorMessage": "sample string 2",
  "cases": [
    {
      "caseId": 1,
      "userPropertyId": 1,
      "caseTypeId": 2,
      "companyId": 3
    },
    {
      "caseId": 1,
      "userPropertyId": 1,
      "caseTypeId": 2,
      "companyId": 3
    }
  ],
  "isCaseOrder": true,
  "orderId": 4
}

text/html

Sample:
{"isSuccess":true,"errorMessage":"sample string 2","cases":[{"caseId":1,"userPropertyId":1,"caseTypeId":2,"companyId":3},{"caseId":1,"userPropertyId":1,"caseTypeId":2,"companyId":3}],"isCaseOrder":true,"orderId":4}

application/xml, text/xml

Sample:
<TransactionCompletedCaseResponseModel xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Ptd.Model.WebModels.CaseBinding">
  <Cases>
    <PaidCaseDetailModel>
      <CaseId>1</CaseId>
      <CaseTypeId>2</CaseTypeId>
      <CompanyId>3</CompanyId>
      <UserPropertyId>1</UserPropertyId>
    </PaidCaseDetailModel>
    <PaidCaseDetailModel>
      <CaseId>1</CaseId>
      <CaseTypeId>2</CaseTypeId>
      <CompanyId>3</CompanyId>
      <UserPropertyId>1</UserPropertyId>
    </PaidCaseDetailModel>
  </Cases>
  <ErrorMessage>sample string 2</ErrorMessage>
  <IsCaseOrder>true</IsCaseOrder>
  <IsSuccess>true</IsSuccess>
  <OrderId>4</OrderId>
</TransactionCompletedCaseResponseModel>