Skip to main content

Cancellation API Usage

The full OpenAPI schema for this is available here.

Request

This request accepts the planId in the url of the GET request. eg:

GET /plans/{planId}/cancellation-summary

Response

The response contains the details of how much of the plan has been paid, each item with its refund policies and calculations. You can use this to provide the customer with an explanation for how much they would be refunded and why.

planTotalCost
required
number

The total cost (the sum of each item quantity x item cost)

totalPaymentsPaid
required
number

The amount paid off so far

currencyCode
required
string

Currency code eg. USD, AUD

totalNonRefundableAmount
required
number

The non refundable amount for all items combined

suggestedRefundAmount
required
number

The suggested amount to refund based on the active refund policy (totalPaymentsPaid - totalNonRefundableAmount)

required
Array of objects
{
  • "planTotalCost": 0,
  • "totalPaymentsPaid": 0,
  • "currencyCode": "string",
  • "totalNonRefundableAmount": 0,
  • "suggestedRefundAmount": 0,
  • "items": [
    ]
}

Cancel Plan

The full OpenAPI schema for this is available here.

Request

This request accepts the planId in the url of the POST request. eg:

POST /plans/{planId}/cancel

The body accepts the refundableAmount, a reason which in this use-case will usualy be CustomerRequest and any optional details you wish to provide.

refundableAmount
required
number
reason
required
string
Enum: "CustomerRequest" "MerchantRequest" "PaymentIssue" "MerchantRequestWithPaymentLink" "Other"
details
string
{
  • "refundableAmount": 0,
  • "reason": "CustomerRequest",
  • "details": "string"
}

Response

The response is either an error or a simple 200 OK with the following body:

{
"result": "ok"
}