Create a Direct API payment
Creates a payment using exactly one merchant-facing payment method.
Submit ordinary card details under payment_method_data.card, or submit
a prepared decrypted Apple Pay or Google Pay credential under its wallet
object. The
shopper IP belongs in customer_ip_address; optional payer identity or
billing data may be supplied when the merchant has it.
Apple Pay and Google Pay are Experimental: their support and this
guidance are still being refined and are not final, and the wallet
fields and validation described here can change. Ordinary card
requests are not affected. See
wallet contract availability.
The card number illustrates payload shape only. It does not guarantee a successful, declined, or 3D Secure outcome. In Sandbox the outcome comes from the amount, not from the card: see Sandbox testing.
Every new Direct Payment is admitted server-side. Ordinary card
payments receive a risk decision after processor preparation and before
issuer authentication. A confirmed risk denial returns HTTP 201 with
FAILED and fraud_filter; exhausted internal risk checking returns
HTTP 201 with FAILED and generic_decline only when that terminal
outcome is durably confirmed. Neither result sends issuer authentication.
If the terminal outcome cannot be confirmed, the request returns an HTTP
error. Wallet and emulated Sandbox outcomes retain their existing behavior.
The response contains the payment attempt status after bounded eligible
provider retries. Exhausted preparation before execution can return
FAILED with processor_unavailable or processor_error, not an issuer
decline. A definitive processor credential refusal also returns FAILED
with processor_unavailable for Direct card, Apple Pay and Google Pay.
An earlier uncertain authentication or wallet execution still takes precedence:
it is reconciled against the existing order;
technical read failures alone leave the payment nonterminal. If the
status is REQUIRES_ACTION, a browser action is required: redirect the customer to
next_action.redirect_url for the next_action.reason customer action,
then use GET /v1/payments/{id} as the source of truth for the final
result. Required-action redirect URLs are opaque and may change
while the payment is still REQUIRES_ACTION; redirect the customer again
only when the latest next_action.redirect_url differs from the one that
browser already visited.
return_url is required. Use an HTTPS URL; reaching it never proves
payment success.
New Direct Payments require one of the
supported payment currencies.
A well-formed unsupported currency returns 422 currency_not_supported
without creating a Payment. Existing Payments in other currencies remain
readable.
A new Direct Payment whose amount is below the highest payment fee of
your agreement plus its rolling reserve returns
422 amount_below_minimum_fee with param=amount, without creating a
Payment. Send a larger amount.
Use the Idempotency-Key header to safely retry requests without
creating duplicate charges.
Authorizations
Headers
A unique key to ensure one effective operation is processed only once.
If the same key and an equivalent operation-specific effective request
identity have already completed successfully, the original response is
returned. A different identity returns 409 idempotency_key_reused.
Non-2xx responses are not cached, so callers may retry after errors. No
fixed retention period is promised by this contract.
For one-shot requests, such as creating a payment from a checkout button, a random UUIDv4 is fine. For requests tied to a specific business operation, such as refunding an order, a deterministic key is preferred so retries collapse correctly across processes.
255Body
Payment amount in the currency's minor units, using its ISO 4217
exponent. For example, 4999 is EUR 49.99 (exponent 2). An amount
below the highest payment fee of your agreement plus its rolling
reserve returns 422 amount_below_minimum_fee.
x >= 14999
Three-letter ISO 4217 currency code supplied when creating a payment or payout. Accepted case-insensitively and with surrounding whitespace, then normalized to a canonical uppercase code before the operation is created.
A value that is not three letters is rejected with 400 parameter_invalid
(param=currency); a well-formed code that ecomm does not accept for
that operation is rejected with 422 currency_not_supported. Neither
creates a payment or payout. The available set is validated per request instead of
being enumerated here, so enabling another currency is not a breaking
contract change. For new Payment eligibility, see the
supported payment currencies;
Payout eligibility is independent.
3 - 16^\s*[A-Za-z]{3}\s*$"EUR"
Select exactly one payment method. Card, decrypted Apple Pay, and decrypted Google Pay are supported by this direct-payment contract. The selected method determines which credential fields are accepted; credentials are never inferred from another method's fields.
The apple_pay and google_pay methods are Experimental: their support
and this guidance are still being refined and are not final, and their
fields and validation can change. The card method is not affected. See
wallet contract availability.
- Option 1
- Option 2
- Option 3
Shopper IPv4 or IPv6 address observed by the merchant during checkout. Send one literal address, not a hostname, port, or comma-separated proxy chain. ecomm validates the complete IPv4 or IPv6 literal before registering the payment; the pattern is only an initial schema-level character and length guard.
3 - 45^(((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])|[0-9A-Fa-f:]*:[0-9A-Fa-f:.]*)$"203.0.113.7"
Stable merchant-scoped non-PII opaque identity. Reuse it for the same logical customer or recognized guest. Do not send an email, phone number, login, name, payment ID, order ID, attempt ID, fresh per-payment UUID, or any other fresh per-payment value. Case and whitespace are significant. The value must contain 1-255 Unicode scalar values, must be nonblank, and U+0000 is forbidden.
1 - 255"cust_opaque_42"
Response
Payment accepted and a Payment object was created. Check status
before treating the payment as complete; REQUIRES_ACTION includes
next_action.reason and next_action.redirect_url, while
PENDING or PROCESSING should be followed with GET /v1/payments/{id}.
Reconciliation can already have confirmed a terminal result.
FAILED is a terminal Payment result, not an HTTP request error.
A Payment represents one attempt to collect funds from the customer.
Merchants can use merchant_reference to associate multiple
payment attempts with the same order or checkout in their own systems.
Current status of a payment attempt.
PENDING-- The payment was accepted by ecomm and is awaiting provider submission or the next lifecycle decision.REQUIRES_ACTION-- Customer action is required, such as completing 3D Secure authentication or a hosted payment page.PROCESSING-- The payment is being processed by downstream payment systems.SUCCEEDED-- The payment completed successfully.FAILED-- The payment was declined or failed permanently.EXPIRED-- The customer did not complete a required action before its expiry time.
PENDING, REQUIRES_ACTION, PROCESSING, SUCCEEDED, FAILED, EXPIRED "SUCCEEDED"
Known submitted direct method or authoritative selected hosted-page method. Null means unknown, not card; the field is always present. This does not imply success. No wallet credentials or authentication payload is returned.
The apple_pay and google_pay values are Experimental: wallet support
and this guidance are still being refined and are not final. See
wallet contract availability.
Remaining amount that can be refunded, in the payment currency's minor units, per its ISO 4217 exponent. This is 0 unless status is SUCCEEDED, because no amount was captured on a payment that has not succeeded. For a SUCCEEDED payment it is the payment amount less anything already refunded or reserved for a refund in flight.
x >= 04999
Machine-readable reason code when the payment reaches a terminal failed status.
not_found, processor_error, processor_unavailable, generic_decline, do_not_honor, issuer_declined, insufficient_funds, invalid_number, invalid_expiry, expired_card, invalid_amount, invalid_currency, not_permitted, cardholder_limit, card_velocity_exceeded, lost_card, stolen_card, suspect_fraud, fraud_filter, three_d_secure_failed, three_d_secure_timeout, three_d_secure_not_supported, three_d_secure_error "insufficient_funds"