Weav Docsv1

API reference / Checkouts

Cancel a checkout

POST/v1/checkouts/{reference_id}/cancel

Cancels an OPEN checkout, and the payment in progress with it. 409 4090301 when it isn't open; 409 4090302 when the provider can't cancel the payment in progress yet (retry shortly).

Path parameters

  • reference_idstringRequired

Headers

  • AuthorizationstringRequired
    Bearer plus your API key. See Authentication.

Responses

200 OK

Checkout canceled (code 2000301).

What data holds
  • checkoutobject
    23 fields in checkout
    • reference_idstring
    • external_reference_idstring | null
    • typestring
      One of: ORDER AMOUNT
    • statusstring
      One of: OPEN COMPLETED EXPIRED CANCELLED
    • currencystring
      ISO 4217. PHP today; more as they're enabled for your account.
      One of: PHP
    • amountnumber
      The total, in pesos.
    • descriptionstring | null
    • itemsarray of objects
      4 fields in items
      • namestringRequired
        Up to 255 characters
      • quantityintegerRequired
        At least 1At most 9999
      • unit_amountnumberRequired
        Pesos, as a JSON number.
      • amountnumber
        quantity × unit_amount.
    • channelsarray of strings | null
      One of: QR_PH GCASH MAYA CARD PAY_AND_GO PALAWANPAY BAYAD
    • qr_ph_appsarray of strings | null
    • customerobject
      4 fields in customer
      • idstring | null
        Your ID for the customer, with save_payment_method.
      • namestring | null
      • emailstring | null
      • mobile_nostring | null
    • save_payment_methodboolean
      A card payment also saves the card (the payment's payment_method_id).
    • checkout_urlstring (uri)
    • success_urlstring | null
    • cancel_urlstring | null
    • webhook_urlstring | null
    • paymentany
      The payment that paid it.
    • expires_atstring (date-time)
    • completed_atstring (date-time) | null
    • expired_atstring (date-time) | null
    • cancelled_atstring (date-time) | null
    • created_atstring (date-time)
    • updated_atstring (date-time)

401 Unauthorized

Missing, malformed or unknown API key (code 4010000).

403 Forbidden

The key can't make this request (code 4030000): an address outside the key's IP allowlist, a live key before your live mode is on, or an account that isn't active. A live key sent from a browser is refused (code 4030001): keep live keys on your server.

404 Not Found

Not found in this mode for your account (code 4040000).

409 Conflict

The request conflicts with the current state, e.g. an Idempotency-Key reused with a different body (4090001), a request still in progress (4090002), a payment that can't be canceled (4090101) or can't be canceled at the provider yet (4090102, retry shortly), or a webhook still being sent (4090201).

POST

Try it: Cancel a checkout

Test mode
Authorization
Path
cURL

Uses $WEAV_API_KEY, never your key. Paste it into a terminal, or import it into Postman.

Response

Send the request to see Weav's answer here.

curl -X POST https://api.weavpayments.com/v1/checkouts/CK4T8M2Q7X9KBA/cancel \
    -H "Authorization: Bearer $WEAV_API_KEY"
{
    "code": "2000301",
    "success": true,
    "message": "Checkout canceled",
    "data": {
        "checkout": {
            "reference_id": "CK4T8M2Q7X9KBA",
            "external_reference_id": "ORD-10541",
            "type": "ORDER",
            "status": "CANCELLED",
            "currency": "PHP",
            "amount": 1250.0,
            "description": null,
            "items": [
                {
                    "name": "Canvas tote bag",
                    "quantity": 1,
                    "unit_amount": 1000.0,
                    "amount": 1000.0
                },
                {
                    "name": "Canvas Strap",
                    "quantity": 2,
                    "unit_amount": 125.0,
                    "amount": 250.0
                }
            ],
            "channels": null,
            "qr_ph_apps": null,
            "customer": {
                "id": null,
                "name": null,
                "email": null,
                "mobile_no": null
            },
            "save_payment_method": false,
            "checkout_url": "https://pay.weavpayments.com/checkout/CK4T8M2Q7X9KBA",
            "success_url": "https://shop.example.com/orders/ORD-10541/thanks",
            "cancel_url": "https://shop.example.com/cart",
            "webhook_url": null,
            "payment": null,
            "expires_at": "2026-10-27T10:12:00+08:00",
            "completed_at": null,
            "expired_at": null,
            "cancelled_at": "2026-10-26T11:02:00+08:00",
            "created_at": "2026-10-26T10:12:00+08:00",
            "updated_at": "2026-10-26T11:02:00+08:00"
        }
    }
}