AfroPin Developers
Postman Sign in Get test keys

Withdraw a quote

Withdraw an unpaid quote: its pay_url stops taking payment. A buyer who was already paying when you withdrew it still gets their cards.

POST https://afropin.com/api/v1/brand/quotes/{quote_id}/cancel

HMAC-signed request with a unique Idempotency-Key header. Authentication

With an SDK
PHP$afropin->brand->quotes->cancel($quoteId, $params)
Node.jsafropin.brand.quotes.cancel(quoteId, params)
Pythonafropin.brand.quotes.cancel(quote_id, params)
Javaafropin.brand().quotes().cancel(quoteId, params)

Path parameters

quote_id uuid | string Required

The quote's id or reference.

Only a quote that is open or paying can be withdrawn; a paid, sent or already withdrawn one fails with quote_not_cancellable. Its webhook gets quote.cancelled.

Response 200

{
    "ok": true,
    "data": {
        "id": "7d0e4f2a-1c9b-4e83-a5d6-2b8f0c3e9a14",
        "reference": "QTE-K7Q2M9XW",
        "external_reference": "deal-2041",
        "status": "cancelled",
        "mode": "live",
        "source": "api",
        "catalog_id": "3f8a1c2e-6b4d-4f90-8e7a-5c1d9b2e4f63",
        "pin_type": "Grams Fresh Bakes",
        "currency": "NGN",
        "card_value": 10000,
        "quantity": 50,
        "discount_percent": 5,
        "face_total": 500000,
        "price": 475000,
        "company": "Acme Ltd",
        "message": "Staff appreciation week",
        "pay_url": null,
        "delivery": "recipients",
        "recipients_count": 50,
        "buyer": null,
        "cards": null,
        "webhook_id": "ca1d075c-f6b0-4d4a-b498-d126239ee0a4",
        "expires_at": "2026-11-19T22:59:59.000000Z",
        "paid_at": null,
        "created_at": "2026-11-05T09:14:22.000000Z"
    }
}

Errors

Failed requests return a stable code with a translated message. Branch on code, never on the message.

403 wrong_account_type Your account type cannot use this endpoint
403 issuing_disabled Issuing PINs is not switched on for your account. Contact support
404 quote_not_found No quote of yours has this id or reference
409 quote_not_cancellable This quote has been paid or withdrawn already, so it cannot be withdrawn
429 rate_limited Too many requests. Wait a moment and try again
500 internal_error Something went wrong on our side. Try again; if it keeps happening, contact support
{
    "ok": false,
    "error": {
        "code": "quote_not_found",
        "message": "No quote of yours has this id or reference",
        "fields": null
    }
}
All error codes →