client_tokens:write
transactions:authorize
PAYMENT.STATUS
webhook notification event. Learn more about webhooks here.
statusReason
object is returned in response to your payment request, providing a decline code
and processor message
(if available) with further information that can help you recover the payment. You can also see this information on the payment’s Timeline
in the Dashboard.
paymentMethodToken
because the payment can never be successfully authorized unless the payment method data is changed. (Your customer’s expired card, for example, will never unexpire.)paymentMethodToken
to attempt authorization again.statusReason
object to handle next steps, or consider setting up a fallback or retry scenario in Workflows.
Information about HTTP error responses (4XX
) when making an API call to Primer can be found in the Errors section of the API Reference.
Network Transaction ID
, the ID assigned by card networks to an initial payment in a series of payments. Subsequent payments can then be routed to any processor, rather than being tied to the processor used for the initial authorization.
While the Network Transaction ID
is a universal value, every processor has additional, unique requirements around what data is sent for payments made using a stored payment method. Normally you would need to calculate these requirements yourself on a processor by processor basis, but at Primer we handle these fields for you.
Let’s take a common example - processing subscriptions, using three different processors. For various reasons, including fee and authorization rate optimization, a customer’s card could be against any one of those processors throughout the life of their subscription. But each processor has different requirements:
Code Requirement | Context | |
---|---|---|
Processor 1 | - merchant_initiated: recurring - first_stored: 01/01/1970 | - The type of merchant initiated transaction - Where the card was first stored. |
Processor 2 | - payment_type: subscription - customer_present: false - externally_stored: true | - The type of merchant initiated transaction - If the customer is present - Whether the card was stored with the processor or elsewhere |
Processor 3 | - charge_intent: subscription | - The type of merchant initiated transaction |
paymentType
parameter when processing recurring payments with API ≤v2.3.FIRST_PAYMENT
: a customer-initiated payment for subscriptions, unscheduled transactions, or “card-on-file” scenarios.ECOMMERCE
: Customer-initiated payment using a stored payment method where the cardholder is present.SUBSCRIPTION
: Merchant-initiated payment as part of a series of payments on a fixed schedule and for a set amount.UNSCHEDULED
: Merchant-initiated payment using stored payment details with no fixed schedule or amount.paymentMethod.firstPaymentReason
to indicate why the payment method is being stored.
CardOnFile
: For “card-on-file” scenarios, correlating with the ECOMMERCE paymentType.Recurring
: For future subscription payments, correlating with the SUBSCRIPTION paymentType.Unscheduled
: For future unscheduled payments, correlating with the UNSCHEDULED paymentType.firstPaymentReason
field for enhanced payment flows and compliance. While the implementation is complete for several key processors (e.g., Adyen, Cybersource, MPGS, Checkout), we continue to expand support to provide a seamless experience across additional platforms.
X-Idempotency-Key
.
paymentId
and paymentStatus
are only available from API version 2.2 onwards400
error will be returned with an errorId
set to TransactionRequestIdempotencyKeyAlreadyExists
.2.2
and later, we will include the paymentId
and paymentStatus
in the error response to provide more insights into the related payment. This data can be used to validate which payment was already created in case of a duplicate request.