---
title: "Process a payment transaction"
method: POST
path: "/payment/processPayment"
tags: ["Payment Service"]
---

# Process a payment transaction

`POST /payment/processPayment`

Accepts payment details and processes the transaction.

## Request body

- PaymentRequest — Request used to process a payment transaction. Provide payment information in the payment object. If using a stored payment method, provide storedPaymentMethodId and do not provide shopperPaymentInfo. If not using a stored payment method, provide shopperPaymentInfo based on payment.type. Include items when processing a payment. Do not include items when the request is intended only for payment method tokenization. If storePaymentMethod is true and subscriptionId is not provided, a new subscriptionId is created during payment processing and returned in the response. If subscriptionId is provided, the payment method is associated with the existing subscription.
  - `items` Item[] — List of items to be paid. Do not include this field when the request is intended only for payment method tokenization.
    - `itemKey` string — The item's key
    - `amount` number — The amount to pay for the item
    - `instanceId` string — SKU
    - `attributes` ItemAttribute[] — Additional attributes
      - `receiptDisplay` boolean — Determines whether or not the attribute is displayed on the receipt
      - `attribute` string — Attribute name
      - `value` string — Attribute value
  - `address` Address — Payer address information.
    - `street1` string, required — Address line 1
    - `street2` string — Address line 2
    - `city` string, required — City
    - `postalCode` string, required — Zip/Postal code
    - `state` string, required — State/Province
    - `countryCode` string, required — Country Code
  - `customer` Customer — Customer information.
    - `username` string — Username
    - `phone` string — Primary phone number
    - `phone2` string — Secondary phone number
    - `company` string — Company name
    - `email` string — Email address
    - `fax` string — Fax number
    - `firstName` string — First name
    - `lastName` string — Last name
    - `middleName` string — Middle name
    - `ip` string — IP address
    - `deviceFingerprint` string — Device fingerprint
    - `identities` CustomerIdentity[] — Extra identity information needed when grand total is $3000 or more
      - `identityTypeId` 0 | 1 | 2 | 3 | 4, required — Valid values: 1=SSN, 2=Passport, 4=Alien Registration Number for Identity One; 0=Other, 3=Driver’s License for Identity Two
      - `value` string, required — The identity's value
      - `countryCode` string, required — Country code
      - `region` string — (optional for SSN, Passport, and Alien Registration Number; required for Driver's license and Other)Region/state code
    - `employer` boolean — Indicates whether or not you are an employer
    - `employerFein` string — Employer FEIN
  - `payment` Payment, required — Payment information used to process a transaction. Use payment.type to indicate the payment method. If using a stored payment method, provide storedPaymentMethodId in the request and do not provide shopperPaymentInfo. If not using a stored payment method, provide shopperPaymentInfo based on payment.type. Supported payment.type values in this document: - creditcard - echeck
    - `type` 'creditcard' | 'echeck' — Type of payment method.
    - `shopperPaymentInfo` object — Payment details for the selected payment type. For creditcard, provide: - encryptedCardNumber - encryptedSecurityCode - encryptedExpiryMonth - encryptedExpiryYear - cardHolderName For echeck, provide: - accountNumber - routingNumber - either firstName and lastName, or businessName
    - `storePaymentMethod` boolean — Whether the entered payment method should be stored for future use. If true and subscriptionId is not provided, a new subscriptionId is created during payment processing.
  - `storedPaymentMethodId` string — Identifier of a previously stored payment method, such as a credit card or bank account. When provided, the payment is processed using the stored payment method.
  - `subscriptionId` string — Unique subscription identifier associated with the customer and payment method. Provide this field to use an existing subscription. If storePaymentMethod is true and this field is not provided, a new subscriptionId is created during payment processing.

## Response `200`

Payment request processed successfully. The payment may be approved or declined. Check the response status for the transaction outcome.

- PaymentResponse — Response returned after a payment transaction is processed. For successful payments, orderId and status are returned. If the payment method was requested to be stored, storePaymentMethodStatus indicates whether the payment method was stored successfully. If the transaction fails, errorMessage and errorDetails may be returned. retry indicates whether the payment attempt can be retried.
  - `orderId` integer — Unique identifier of the payment transaction.
  - `paymentTimestamp` string, date-time — Date and time when the payment transaction was processed.
  - `amount` number — Base payment amount for the transaction, excluding fees.
  - `feeAmount` number — Fee amount applied to the transaction.
  - `totalAmount` number — Total amount charged for the transaction, including fees.
  - `subscriptionId` string — Unique subscription identifier associated with the customer. Returned when an existing subscription is used, or when a new subscriptionId is created because storePaymentMethod is true and subscriptionId was not provided in the request.
  - `storedPaymentMethodId` string — Identifier of the stored payment method. Returned when storePaymentMethod is true and the payment method is successfully stored.
  - `status` 'Success' | 'Refused' | 'Failed' | 'Cancelled' | 'PendingPayment' | 'PendingSettle' | 'Review' — Status of the payment transaction.
  - `errorMessage` string — Error message returned when the transaction fails.
  - `errorDetails` string — Detailed error information for troubleshooting purposes.
  - `storePaymentMethodStatus` 'success' | 'failed' — Status of storing the payment method. Returned only when storePaymentMethod is true in the request.
  - `retry` boolean — Indicates whether the payment attempt can be retried.

## Other responses

- `400` — Invalid input data
- `401` — Unauthorized. The access token is missing, invalid, or expired.
- `500` — Internal server error

---

[API](https://skmtc.dev/civikestpayment/apis/pays-service-api-specifications.md) · [All operations](https://skmtc.dev/civikestpayment/apis/pays-service-api-specifications/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/civikestpayment/pays-service-api-specifications/revisions/e94a116dff94/schema)
