Cancel a payment

Cancels a one-time payment and returns it with orderStatus: canceled. A cancel is final and cannot be undone. It ends the whole order, order bumps included, puts the product, variant and order bump stock back, and removes the buyer's access to the order's files and license key. It does not move money: pass refund to also refund the customer in the same request. Revenue totals stay gross. Optional sendCancellationEmail emails the customer. Fires the payment.canceled webhook.

POST/v1/payments/:paymentId/cancel

Authorization

api_key_auth
AuthorizationBearer <token>

API key authentication. Use "Bearer YOUR_API_KEY" format.

In: header

Path Parameters

paymentId*string

The ID of the payment to cancel. Bookings for event pages have their own IDs and cannot be canceled here.

Match^[0-9a-fA-F]{24}$

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://api.checkoutpage.com/v1/payments/:paymentId/cancel" \  -H "Content-Type: application/json" \  -d '{    "reason": "string"  }'
{
  "data": {
    "id": "string",
    "status": "created",
    "orderId": "string",
    "orderStatus": "active",
    "customerEmail": "string",
    "customerName": "string",
    "customerId": "string",
    "sellerId": "string",
    "pageId": "string",
    "pageSlug": "string",
    "clientIp": "string",
    "currency": "string",
    "amount": 0,
    "amountPaid": 0,
    "amountDue": 0,
    "amountRefunded": 0,
    "amountUsd": 0,
    "amountExcludingTax": 0,
    "taxAmount": 0,
    "taxBreakdown": [
      {
        "taxType": "string",
        "taxabilityReason": "string",
        "taxableAmount": 0,
        "taxAmount": 0,
        "taxRateDetails": {
          "country": "string",
          "percentageDecimal": 0,
          "state": "string",
          "taxType": "string"
        }
      }
    ],
    "taxSource": "fixed_tax_rate",
    "taxRates": [
      {
        "taxRate": "string",
        "stripeId": "string",
        "displayName": "VAT",
        "default": true,
        "active": true,
        "inclusive": true,
        "percentage": 0,
        "createdAt": "2019-08-24T14:15:22Z",
        "updatedAt": "2019-08-24T14:15:22Z"
      }
    ],
    "stripeTaxCalculationId": "string",
    "stripeTaxTransactionId": "string",
    "dynamicPrice": 0,
    "fees": [
      {
        "name": "string",
        "amount": 0,
        "percentage": 0,
        "percentageAmount": 0,
        "fixedAmount": 0
      }
    ],
    "processingFeeContribution": {
      "name": "string",
      "amount": 0,
      "percentage": 0,
      "percentageAmount": 0,
      "fixedAmount": 0
    },
    "billing": {
      "name": "string",
      "companyName": "string",
      "email": "string",
      "billingEmail": "string",
      "phone": "string",
      "address": {
        "line1": "string",
        "line2": "string",
        "city": "string",
        "state": "string",
        "postalCode": "string",
        "country": "string"
      }
    },
    "shipping": {
      "name": "string",
      "phone": "string",
      "address": {
        "line1": "string",
        "line2": "string",
        "city": "string",
        "state": "string",
        "postalCode": "string",
        "country": "string"
      }
    },
    "fields": [
      {
        "fieldId": "string",
        "label": "string",
        "value": "string",
        "values": [
          "string"
        ],
        "element": "checkbox",
        "type": "",
        "meta": {
          "property1": null,
          "property2": null
        },
        "reference": "string"
      }
    ],
    "coupon": {
      "id": "string",
      "label": "string",
      "code": "string",
      "amountOff": 0,
      "percentOff": 0,
      "discount": 0
    },
    "discount": {
      "minQuantity": 0,
      "maxQuantity": 0,
      "percentOff": 0,
      "amountOff": 0,
      "amount": 0
    },
    "livemode": true,
    "paymentError": "string",
    "paymentMethod": {
      "gateway": "stripe",
      "method": "string",
      "wallet": "string",
      "mode": "default",
      "brand": "string",
      "last4": "string",
      "country": "string",
      "exp_month": 0,
      "exp_year": 0,
      "expMonth": 0,
      "expYear": 0,
      "funding": "string"
    },
    "paymentOption": {
      "type": "manual",
      "name": "string",
      "description": "string",
      "instructions": "string",
      "partialAmount": 0,
      "manualType": "invoice"
    },
    "locale": "string",
    "sessionId": "string",
    "userAgent": "string",
    "screenWidth": 0,
    "visitId": "string",
    "queryParameters": {
      "property1": "string",
      "property2": "string"
    },
    "stripePaymentIntentId": "string",
    "stripeChargeId": "string",
    "upsell": true,
    "upsellPageId": "string",
    "isComplimentary": true,
    "complimentaryDiscountAmount": 0,
    "upsellChargeId": "string",
    "upsellSubscriptionId": "string",
    "invoiceId": "string",
    "transactionIds": [
      "string"
    ],
    "paidAt": "2019-08-24T14:15:22Z",
    "lastRefundAt": "2019-08-24T14:15:22Z",
    "lastRefundReason": "string",
    "lastRefundReasonNote": "string",
    "canceledAt": "string",
    "canceledBy": "string",
    "canceledByApiKey": "string",
    "canceledByApiKeyName": "string",
    "canceledReason": "string",
    "archivedAt": "string",
    "archivedBy": "string",
    "isAbandoned": true,
    "recoveredAt": "2019-08-24T14:15:22Z",
    "abandonmentStatus": "abandoned",
    "abandonedCartEmailStatus": "pending",
    "abandonedCartEmailSentAt": "2019-08-24T14:15:22Z",
    "createdAt": "2019-08-24T14:15:22Z",
    "updatedAt": "2019-08-24T14:15:22Z",
    "productId": "string",
    "productTitle": "string",
    "productPrice": 0,
    "priceId": "string",
    "priceSnapshot": {
      "priceId": "string",
      "label": "string",
      "description": "string",
      "badge": "string",
      "reference": "string",
      "billingType": "string",
      "amount": 0,
      "currency": "string",
      "discountedFromPrice": 0,
      "setupFee": 0,
      "setupFeeMultipliesWithQuantity": true,
      "stripePriceId": "string",
      "stripePriceLivemode": true,
      "managedInStripe": true,
      "payWhatYouWant": true,
      "pwywSuggestedPrice": 0,
      "recurring": {
        "interval": "string",
        "intervalCount": 0,
        "trialPeriodDays": 0,
        "billingCycleAnchorConfig": {
          "enabled": true,
          "dayOfMonth": 0,
          "month": 0
        },
        "startDate": "2019-08-24T14:15:22Z"
      },
      "paymentPlan": {
        "interval": "string",
        "intervalCount": 0,
        "trialPeriodDays": 0,
        "billingCycleAnchorConfig": {
          "enabled": true,
          "dayOfMonth": 0,
          "month": 0
        },
        "startDate": "2019-08-24T14:15:22Z",
        "planIterations": 0
      }
    },
    "payWhatYouWantPrice": 0,
    "discountedFromPrice": 0,
    "setupFee": 0,
    "quantity": 0,
    "sku": "string",
    "variants": [
      {
        "name": "string",
        "variantId": "string",
        "reference": "string",
        "selectionType": "single",
        "selectedOptions": [
          {
            "optionId": "string",
            "optionName": "string",
            "sku": "string",
            "quantity": 0,
            "additionalChargeAmount": 0,
            "originalAdditionalChargeAmount": 0,
            "discount": {
              "minQuantity": 0,
              "maxQuantity": 0,
              "percentOff": 0,
              "amountOff": 0,
              "amount": 0
            }
          }
        ]
      }
    ],
    "licenseKeyId": "string"
  }
}
{
  "status": "error",
  "type": "error",
  "message": "Not Found",
  "errors": [
    {
      "param": "string",
      "message": "string",
      "value": null
    }
  ],
  "property1": null,
  "property2": null
}
{
  "status": "error",
  "type": "error",
  "message": "Not Found",
  "errors": [
    {
      "param": "string",
      "message": "string",
      "value": null
    }
  ],
  "property1": null,
  "property2": null
}
{
  "status": "error",
  "type": "error",
  "message": "Not Found",
  "errors": [
    {
      "param": "string",
      "message": "string",
      "value": null
    }
  ],
  "property1": null,
  "property2": null
}
{
  "status": "error",
  "type": "error",
  "message": "Not Found",
  "errors": [
    {
      "param": "string",
      "message": "string",
      "value": null
    }
  ],
  "property1": null,
  "property2": null
}
{
  "status": "error",
  "type": "error",
  "message": "Not Found",
  "errors": [
    {
      "param": "string",
      "message": "string",
      "value": null
    }
  ],
  "property1": null,
  "property2": null
}
{
  "status": "error",
  "type": "error",
  "message": "Not Found",
  "errors": [
    {
      "param": "string",
      "message": "string",
      "value": null
    }
  ],
  "property1": null,
  "property2": null
}
{
  "status": "error",
  "type": "error",
  "message": "Not Found",
  "errors": [
    {
      "param": "string",
      "message": "string",
      "value": null
    }
  ],
  "property1": null,
  "property2": null
}