CARD PAYMENTS Copy Page
Create a card payment (mock only)
POST https://production.dutchapi.co/v1/card-payments
Creates a development-mode mock payment record in pending status. It never contacts Visa, Mastercard, a payment provider, or a merchant wallet.
🔒 Send the project API key as a Bearer token and your Business ID with this call.
AVAILABLE ON 25 DECEMBER 2026. Before that date, this endpoint runs only outside production when CARD_PAYMENTS_MODE=mock is enabled. Production requests return 503 card_payments_not_available.
This route is also mounted at POST /api/v1/card-payments for compatibility; the standard API reference uses the /v1 base path.
The response includes mode: mock, liveProcessing: false and a placeholder checkout URL. No card is charged and no card numbers, CVV, PINs or track data may be sent.
Send an Idempotency-Key header. Status changes in development require a signed mock webhook callback; test events are not evidence of a real card transaction.
Body Params amountnumber required
Positive payment amount, up to two decimal places.
currencystring required
Supported three-letter currency code: USD, EUR, GBP, CAD, AUD, XAF, NGN, GHS, KES or ZAR.
merchantReferencestring required
Unique business reference, 4–64 letters, digits, dot, underscore, colon or hyphen.
customer.namestring optional
Customer name. Never include card credentials.
customer.emailstring optional
Customer email address.
descriptionstring optional
Optional description, up to 140 characters.
returnUrlstring optional
HTTPS URL for the hosted-checkout return.
webhookUrlstring optional
HTTPS URL metadata for payment event delivery.
Responses
201 400
{
"id": "cp_mock_4c8f70a64b22458c8de92f3a",
"object": "card_payment",
"merchantReference": "order-1042",
"amount": 25.5,
"currency": "USD",
"status": "pending",
"checkoutUrl": "https://checkout.dutchapi.co/mock/cp_mock_4c8f70a64b22458c8de92f3a",
"createdAt": "2026-10-28T12:00: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. 400 valid_amount_requiredamount must be positive and no greater than the documented limit. 400 unsupported_currencycurrency is not on the supported mock currency list. 400 merchant_reference_requiredmerchantReference must be 4–64 valid characters. 400 card_data_prohibitedCard numbers, CVV, PIN and track data must never be sent. 409 duplicate_merchant_referenceThis business already used merchantReference. 503 card_payments_not_availableLive card processing is not connected.
Language Shell Node Ruby PHP Python
Credentials Bearer
curl --request POST --url "https://production.dutchapi.co/v1/card-payments" \
--header "Authorization: Bearer $DUTCH_PROJECT_KEY" \
--header "X-Business-Id: $DUTCH_BUSINESS_ID" \
--header "Idempotency-Key: create-card-payment-0001" \
--header "Content-Type: application/json" \
--data '{"amount":25.5,"currency":"USD","merchantReference":"order-1042","customer":{"name":"Ada Example","email":"ada@example.com"},"description":"Order 1042","returnUrl":"https://merchant.example/return","webhookUrl":"https://merchant.example/webhooks/card-payments"}'const res = await fetch("https://production.dutchapi.co/v1/card-payments", {
method: "POST",
headers: {
"Authorization": "Bearer " + process.env.DUTCH_PROJECT_KEY,
"X-Business-Id": process.env.DUTCH_BUSINESS_ID,
"Idempotency-Key": "create-card-payment-0001",
"Content-Type": "application/json",
},
body: JSON.stringify({"amount": 25.5, "currency": "USD", "merchantReference": "order-1042", "customer": {"name": "Ada Example", "email": "ada@example.com"}, "description": "Order 1042", "returnUrl": "https://merchant.example/return", "webhookUrl": "https://merchant.example/webhooks/card-payments"})
});
console.log(await res.json());require "net/http"
require "json"
uri = URI("https://production.dutchapi.co/v1/card-payments")
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"] = "create-card-payment-0001"
req["Content-Type"] = "application/json"
req.body = "{\"amount\":25.5,\"currency\":\"USD\",\"merchantReference\":\"order-1042\",\"customer\":{\"name\":\"Ada Example\",\"email\":\"ada@example.com\"},\"description\":\"Order 1042\",\"returnUrl\":\"https://merchant.example/return\",\"webhookUrl\":\"https://merchant.example/webhooks/card-payments\"}"
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");
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: create-card-payment-0001",
"Content-Type: application/json"],
CURLOPT_POSTFIELDS => '{"amount":25.5,"currency":"USD","merchantReference":"order-1042","customer":{"name":"Ada Example","email":"ada@example.com"},"description":"Order 1042","returnUrl":"https://merchant.example/return","webhookUrl":"https://merchant.example/webhooks/card-payments"}',
]);
echo curl_exec($ch);import os, requests, json
res = requests.request(
"POST",
"https://production.dutchapi.co/v1/card-payments",
headers={
"Authorization": "Bearer " + os.environ["DUTCH_PROJECT_KEY"],
"X-Business-Id": os.environ["DUTCH_BUSINESS_ID"],
"Idempotency-Key": "create-card-payment-0001",
},
json=json.loads("{\"amount\":25.5,\"currency\":\"USD\",\"merchantReference\":\"order-1042\",\"customer\":{\"name\":\"Ada Example\",\"email\":\"ada@example.com\"},\"description\":\"Order 1042\",\"returnUrl\":\"https://merchant.example/return\",\"webhookUrl\":\"https://merchant.example/webhooks/card-payments\"}")
)
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