CARD PAYMENTS Copy Page
Refund a card payment (mock only)
POST https://production.dutchapi.co/v1/card-payments/{id}/refund
Marks an eligible succeeded mock payment refunded. This does not initiate a network refund or move money.
🔒 Send the project API key as a Bearer token and your Business ID with this call. Also requires an Idempotency-Key header.
AVAILABLE ON 25 DECEMBER 2026. Refund requests operate only on mock records in non-production mode; no real card transaction can be refunded by this foundation.
The /api/v1/card-payments/:id/refund compatibility prefix is also available.
Responses
201 400
{
"id": "cp_mock_4c8f70a64b22458c8de92f3a",
"status": "refunded",
"refundReference": "rf_mock_a813dfc7",
"refundedAt": "2026-10-28T12:30:00.000Z",
"mode": "mock",
"liveProcessing": false
}
{
"error": "idempotency_key_required",
"message": "Send an Idempotency-Key header."
}
Errors Status error Meaning 400 idempotency_key_requiredSend an Idempotency-Key header. 403 insufficient_scopeThis project key is not allowed to do that. 404 card_payment_not_foundNo payment with that id belongs to this business. 409 payment_not_refundableOnly a succeeded mock payment can be marked refunded. 503 card_payments_not_availableMock refunds are disabled.
Language Shell Node Ruby PHP Python
Credentials Bearer
curl --request POST --url "https://production.dutchapi.co/v1/card-payments/{id}/refund" \
--header "Authorization: Bearer $DUTCH_PROJECT_KEY" \
--header "X-Business-Id: $DUTCH_BUSINESS_ID" \
--header "Idempotency-Key: refund-card-payment-0001"const res = await fetch("https://production.dutchapi.co/v1/card-payments/{id}/refund", {
method: "POST",
headers: {
"Authorization": "Bearer " + process.env.DUTCH_PROJECT_KEY,
"X-Business-Id": process.env.DUTCH_BUSINESS_ID,
"Idempotency-Key": "refund-card-payment-0001",
}
});
console.log(await res.json());require "net/http"
require "json"
uri = URI("https://production.dutchapi.co/v1/card-payments/{id}/refund")
req = Net::HTTP::Post.new(uri)
req["Authorization"] = "Bearer #{ENV.fetch('DUTCH_PROJECT_KEY')}"
req["X-Business-Id"] = ENV.fetch("DUTCH_BUSINESS_ID")
req["Idempotency-Key"] = "refund-card-payment-0001"
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }
puts res.body<?php
$ch = curl_init("https://production.dutchapi.co/v1/card-payments/{id}/refund");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer " . getenv("DUTCH_PROJECT_KEY"),
"X-Business-Id: " . getenv("DUTCH_BUSINESS_ID"),
"Idempotency-Key: refund-card-payment-0001"],
]);
echo curl_exec($ch);import os, requests
res = requests.request(
"POST",
"https://production.dutchapi.co/v1/card-payments/{id}/refund",
headers={
"Authorization": "Bearer " + os.environ["DUTCH_PROJECT_KEY"],
"X-Business-Id": os.environ["DUTCH_BUSINESS_ID"],
"Idempotency-Key": "refund-card-payment-0001",
}
)
print(res.json())
Show example
Response Click `Show example` to see an example response. Nothing is sent from this page: endpoints are live, so run real requests from your own code with small amounts.
201 - Result 400 - Result
Table of Contents Responses Errors