Skip to main content
Create a payment by submitting a POST request to /v1/payments.
A create request can return PENDING instead of a final result. Handling PENDING is required for every integration, and we strongly recommend webhooks for tracking the result; see Recover payments.

Mandatory fields

The basic data required to create a payment relates to:
  • The value of the payment: amount and currency
  • 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 own storeId.
  • The type of goods being purchased: goodsType
  • Who initiated the payment: source.initiatedBy, MERCHANT for rebills, subscription renewals and any other charge made without the cardholder present, CONSUMER otherwise. Only merchant-initiated payments can return PENDING and 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 captureNow field 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: true authorizes and captures in one step, so the payment ends as CAPTURED or FAILED, never AUTHORIZED.
All payments must be in USD. We accept cards issued in any country, and there are no restrictions on the billing or shipping address country. You don’t need to send any transaction codes, Level 2/Level 3 data, industry-specific codes or account flags.
If you’re using Paymend for payment recovery, take a look at the PreviousFailure object too. See our guide on payment recovery via Paymend here.

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 in source.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 a paymentId, 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 a merchantReference, and you can’t look up a payment by merchantReference. Follow these rules when retrying:
  • Response with a paymentId and status: FAILED: the payment is final and you can send a new one. For a 422, fix the request first; for a 503 or 504, retry after a short wait.
  • 500: a FAILED payment may have been created, and you may receive PAYMENT_CREATED and PAYMENT_FAILED webhooks 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, a 503 without a paymentId, or 402 with BLOCKED_BY_PAYMEND).
  • Timeout: treat the outcome as unknown and don’t resend straight away. Every payment created from a valid request triggers a PAYMENT_CREATED webhook within seconds, carrying your merchantReference (in data.merchantReference) and the paymentId.
    • PAYMENT_CREATED arrives: the payment exists. Track it by its paymentId and don’t resend.
    • No PAYMENT_CREATED within 60 seconds of the timeout: no payment was created, and you can resend safely.
This only works if your webhook endpoint is receiving events. If your endpoint was failing at the time, check your logs for the PAYMENT_CREATED webhook before resending.

Card validation (amount 0)

Send a payment with amount: 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 amount as the integer 0. 0.00 is rejected with HTTP 400 and “Amount must be a whole number”, as is any amount with decimals.
  • Set captureNow to false, or leave it out (it defaults to false). amount: 0 with captureNow: true returns HTTP 400 INVALID_REQUEST. captureNow: null is also rejected with 400 (“Capture now is required”).
  • Negative amounts return HTTP 400 with “Amount must be zero or greater”.
A 400 creates no payment. The response lists each problem in details:

Result

The response is a normal payment with amount: 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:
Example success response (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.