POST request to /v1/payments.
Mandatory fields
The basic data required to create a payment relates to:- The value of the payment:
amountandcurrency - The payment method to be used: passed in the PaymentMethod object
- Payment identifiers:
- Your own reference for the payment:
merchantReference. Uniqueness is not enforced and it is not an idempotency key (see Timeouts and retries). - A Paymend-defined identifier for the website where the payment originated:
source.storeId. Paymend creates one for each website during onboarding, so if you run several sites under one merchant, each site needs its ownstoreId.
- Your own reference for the payment:
- The type of goods being purchased:
goodsType - Who initiated the payment:
source.initiatedBy,MERCHANTfor rebills, subscription renewals and any other charge made without the cardholder present,CONSUMERotherwise. Only merchant-initiated payments can returnPENDINGand be retried later. See Merchant-initiated payments.
To check that a card is valid without charging it, send
amount: 0 with captureNow: false. See Card validation (amount 0).Key fields
In addition to the details noted above which must be provided, we highly recommend passing the following details in all requests:- Consumer and billing data: passed in the Consumer and Billing objects, respectively. These details increase the chances of approval and help with payment identification. Country and zip/postal code are the most useful billing fields; adding street and city can improve address verification (AVS) results.
- Determine the authorization type: use the
captureNowfield to actively determine whether funds are authorized and captured in a single or separate requests.captureNow: false(the default) authorizes only, and you capture later.captureNow: trueauthorizes and captures in one step, so the payment ends asCAPTUREDorFAILED, neverAUTHORIZED.
Card data
Every request, including rebills, must include the full card number. Send it in plain text (CARD) or encrypted with Evervault (ENCRYPTED_CARD); see PaymentMethod.
- We run AVS and CVV checks, but don’t currently return the results in the API response.
- We don’t accept externally authenticated 3DS data, and there is no 3DS step in the payment flow. We process mainly in the US market through US acquirers, where SCA is not mandated.
Statement descriptor
When we process on Paymend MIDs, we build the statement descriptor from the store insource.storeId, so the customer sees that store’s domain on their bank statement and each website shows its own domain. The descriptor field is not currently passed to the customer’s statement.
Request
Example payment creation request (authorize and capture in one step):Response
Example success response (200 OK):
Possible outcomes
If the response includes apaymentId, the payment exists. The one exception is a 500: a FAILED payment may have been created even though no paymentId is returned.
PENDING means we couldn’t complete the payment immediately and an attempt is either in flight or scheduled. It doesn’t necessarily mean an attempt has already failed. A webhook tells you the final result; see Recover payments.
Every payment that returns a paymentId, including a failed one, also triggers the PAYMENT_CREATED webhook and a second webhook with its result. A FAILED payment is final: its status won’t change.
Timeouts and retries
We don’t support an idempotency key or header. Every valid create request creates a new payment, even if it repeats amerchantReference, and you can’t look up a payment by merchantReference. Follow these rules when retrying:
- Response with a
paymentIdandstatus: FAILED: the payment is final and you can send a new one. For a422, fix the request first; for a503or504, retry after a short wait. 500: aFAILEDpayment may have been created, and you may receivePAYMENT_CREATEDandPAYMENT_FAILEDwebhooks for it. No transaction was attempted, so you can safely retry after a short wait.- Any other response without a
paymentId: no payment was created. Fix the request or credentials (400,401), or retry with backoff (429, a503without apaymentId, or402withBLOCKED_BY_PAYMEND). - Timeout: treat the outcome as unknown and don’t resend straight away. Every payment created from a valid request triggers a
PAYMENT_CREATEDwebhook within seconds, carrying yourmerchantReference(indata.merchantReference) and thepaymentId.PAYMENT_CREATEDarrives: the payment exists. Track it by itspaymentIdand don’t resend.- No
PAYMENT_CREATEDwithin 60 seconds of the timeout: no payment was created, and you can resend safely.
PAYMENT_CREATED webhook before resending.
Card validation (amount 0)
Send a payment withamount: 0 and captureNow: false to ask the issuer whether the card is valid, without charging it. Nothing is charged and no funds are held. Typical uses are checking a card before you store it, card registration, and starting a free trial.
A card validation is an ordinary payment request with the amount set to 0. There is no separate endpoint, payment type or field.
Request rules
- Send
amountas the integer0.0.00is rejected with HTTP400and “Amount must be a whole number”, as is any amount with decimals. - Set
captureNowtofalse, or leave it out (it defaults tofalse).amount: 0withcaptureNow: truereturns HTTP400INVALID_REQUEST.captureNow: nullis also rejected with400(“Capture now is required”). - Negative amounts return HTTP
400with “Amount must be zero or greater”.
400 creates no payment. The response lists each problem in details:
Result
The response is a normal payment withamount: 0:
The other outcomes in Possible outcomes can also occur. A failed validation is final: we don’t retry it. You receive the usual
PAYMENT_CREATED webhook, then PAYMENT_AUTHORIZED or PAYMENT_FAILED. The links in these webhooks don’t include capturePayment or voidPayment.
A validated payment stays AUTHORIZED. It can’t be captured, voided or refunded; see Card validations.
Example card validation request:
200 OK):
Things to know
- A successful validation doesn’t guarantee that a later charge on the same card will be approved.
- Some issuers decline zero-amount requests even when the card is valid.
- The cardholder may get a “card verified” notification from their bank, showing your billing name.
Rate limits and response times
Response time depends mainly on the acquirer. Set your client timeout to 30 seconds or more, and handle timeouts as described in Timeouts and retries.