# Payment Transaction

## Search Payments

> Retrieve a list of payments based on search and filter criteria.

```json
{"openapi":"3.0.1","info":{"title":"Recurring Payments API","version":"2.0"},"paths":{"/rest/v2/payments":{"get":{"tags":["Payment Transaction"],"summary":"Search Payments","description":"Retrieve a list of payments based on search and filter criteria.","operationId":"searchPayments","parameters":[{"name":"api-key","in":"header","description":"An access API key issued to you by Xplor Pay.","required":true,"schema":{"type":"string"}},{"name":"customer-key","in":"query","description":"Filters payment by the unique identifier of the associated customer.","required":true,"schema":{"type":"string"}},{"name":"plan-key","in":"query","description":"Filters results by the unique identifier of the payment plan.","required":true,"schema":{"type":"string"}},{"name":"page","in":"query","description":"Specifies the page number of results to return when pagination is applied.","required":true,"schema":{"type":"integer"}},{"name":"page-size","in":"query","description":"Specifies the number of results to return per page.","required":true,"schema":{"type":"integer"}},{"name":"isDescending","in":"query","description":"Specifies the sort order of the results. Set to true for descending order. Default is true.","required":true,"schema":{"type":"boolean"}},{"name":"order-by","in":"query","description":"Specifies the field used to sort the results.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchGetPaymentTransactionPayload"}},"application/xml":{"schema":{"$ref":"#/components/schemas/SearchGetPaymentTransactionPayload"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorPayloadResponsePayload"}},"application/xml":{"schema":{"$ref":"#/components/schemas/ErrorPayloadResponsePayload"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorPayloadResponsePayload"}},"application/xml":{"schema":{"$ref":"#/components/schemas/ErrorPayloadResponsePayload"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorPayloadResponsePayload"}},"application/xml":{"schema":{"$ref":"#/components/schemas/ErrorPayloadResponsePayload"}}}}}}}},"components":{"schemas":{"SearchGetPaymentTransactionPayload":{"type":"object","properties":{"searchGetPaymentTransactions":{"type":"array","items":{"$ref":"#/components/schemas/SearchGetPaymentTransaction"}},"page":{"$ref":"#/components/schemas/page"}}},"SearchGetPaymentTransaction":{"type":"object","properties":{"viewId":{"type":"integer","description":"Identifier for the transaction view.","format":"int32"},"paymentId":{"type":"integer","description":"Unique identifier of the payment.","format":"int32"},"transactionId":{"type":"integer","description":"Identifier of the transaction.","format":"int32"},"achTransactionId":{"type":"string","description":"Identifier of the ACH transaction."},"paymentStatus":{"type":"string","description":"Current status of the payment.","enum":["STARTED","APPROVED","DECLINED","ERROR"]},"scheduledDateTime":{"type":"string","description":"Date when the payment was scheduled.","format":"date-time"},"fired":{"type":"string","description":"Date when the payment was initiated.","format":"date-time"},"completed":{"type":"string","description":"Date when the payment completed.","format":"date-time"},"exchangeId":{"type":"string","description":"Identifier used to trace the transaction exchange."},"result":{"type":"string","description":"Result message returned by the processor."},"planName":{"type":"string","description":"Name of the pricing or billing plan."},"merchantId":{"type":"string","description":"The merchant's unique identification number."},"customerKey":{"type":"string","description":"System generated customer key."},"amount":{"type":"number","description":"Transaction amount."},"authorizationCode":{"type":"string","description":"Authorization code returned by the processor."},"avsResult":{"type":"string","description":"Address Verification Service (AVS) result code."},"avsStreet":{"type":"string","description":"AVS street address."},"avsZip":{"type":"string","description":"AVS ZIP code."},"batchStringID":{"type":"string","description":"Processor batch identifier."},"billingIsShipping":{"type":"integer","description":"Indicates whether the billing address matches the shipping address.","format":"int32"},"cardHolder":{"type":"string","description":"Name of the card holder."},"cardType":{"type":"string","description":"Type of the card."},"clientIp":{"type":"string","description":"IP address from which the transaction originated."},"comments":{"type":"string","description":"Additional comments associated with the transaction."},"created":{"type":"string","description":"Date when the transaction record was created.","format":"date-time"},"cscResult":{"type":"string","description":"CSC verification result."},"gatewayCustomerId":{"type":"string","description":"Identifier of the customer as stored in the payment gateway."},"description":{"type":"string","description":"Description associated with the transaction."},"emailAddress":{"type":"string","description":"Customer's email address."},"entryMethod":{"type":"integer","description":"Method used to enter the payment information.","format":"int64"},"errorCode":{"type":"string","description":"Error code returned when the transaction fails."},"expired":{"type":"integer","description":"Indicates whether the payment or authorization has expired.","format":"int32"},"expiryDate":{"type":"string","description":"Expiration date of the card."},"firstName":{"type":"string","description":"Customer's first name."},"invoice":{"type":"string","description":"Invoice number associated with the payment."},"lastFour":{"type":"string","description":"Last four digits of the card number."},"lastName":{"type":"string","description":"Customer's last name."},"locationCity":{"type":"string","description":"City where the transaction occurred."},"locationCountry":{"type":"string","description":"Country where the transaction occurred."},"locationMeta":{"type":"string","description":"Additional location metadata."},"locationState":{"type":"string","description":"State where the transaction occurred."},"orderId":{"type":"string","description":"Merchant-defined order identifier"},"purchaseOrder":{"type":"string","description":"Purchase order number associated with the payment."},"reason":{"type":"string","description":"Reason provided for the transaction result"},"refundTotal":{"type":"string","description":"Total amount refunded for the transaction."},"response":{"type":"string","description":"Processor response message."},"resultCode":{"type":"string","description":"Processor result code for the transaction."},"status":{"type":"string","description":"Overall transaction status."},"switchId":{"type":"number","description":"Identifier of the processing switch."},"transactionType":{"type":"string","description":"Type of transaction performed."},"voidCount":{"type":"integer","description":"Number of times the transaction was voided.","format":"int64"},"batchId":{"type":"number","description":"Identifier of the batch that includes the transaction."},"originatorId":{"type":"number","description":"Identifier of the transaction originator."},"refTranId":{"type":"number","description":"Reference ID of the related transaction."},"terminalId":{"type":"number","description":"Identifier of the terminal used for processing."},"tipAmount":{"type":"number","description":"Tip amount applied to the transaction."},"originalAmount":{"type":"number","description":"Original transaction amount before adjustments."},"tipAdjusted":{"type":"integer","description":"Indicates whether the tip was adjusted.","format":"int64"},"tipAdjustmentAmount":{"type":"number","description":"Amount used to adjust the tip."},"customerTokenID":{"type":"string","description":"Tokenized identifier for the customer payment method."},"customerID":{"type":"string","description":"Unique identifier of the customer."},"paymentTransactionKey":{"type":"string","description":"Unique key for the payment transaction."},"paymentTransactionId":{"type":"integer","description":"Unique identifier of the payment transaction record.","format":"int32"},"planDetailKey":{"type":"string","description":"Identifier of the plan detail configuration."},"planKey":{"type":"string","description":"Unique identifier of the plan."},"paymentType":{"type":"string","description":"Type of payment method used."}},"description":"payload"},"page":{"type":"object","properties":{"number":{"type":"integer","description":"Current page number in the result set.","format":"int32"},"size":{"type":"integer","description":"Number of records returned per page.","format":"int32"},"sort":{"$ref":"#/components/schemas/Sort"},"first":{"type":"boolean","description":"Indicates whether this is the first page."},"last":{"type":"boolean","description":"Indicates whether this is the last page."},"total-pages":{"type":"integer","description":"Total number of available pages.","format":"int32"},"number-of-elements":{"type":"integer","description":"Number of records returned in the current page.","format":"int32"},"total-elements":{"type":"integer","description":"Total number of records matching the search criteria.","format":"int64"}},"description":"Contains pagination details for the returned payment results.","xml":{"name":"page"}},"Sort":{"type":"object","properties":{"field":{"type":"object","additionalProperties":{"type":"string","description":"Specifies the field name used to sort the result set."},"description":"Specifies the field name used to sort the result set."}},"description":"Sorting details applied to the result set."},"ErrorPayloadResponsePayload":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/ErrorPayload"},"payloadType":{"type":"string","description":"Type of payload returned in the response.","xml":{"name":"type","attribute":true}}},"description":"Payload","xml":{"name":"payload"}},"ErrorPayload":{"type":"object","properties":{"error-message":{"type":"string","description":"Describes the reason for the error."},"result-code":{"type":"string","description":"Numeric code that identifies the type of error returned by the request."},"time-stamp":{"type":"string","description":"Date and time when the error occurred, ISO 8601 format (UTC)."}},"xml":{"name":"error"}}}}}
```
