PAYMENTS
SIMPLIFIED


Offer all the payment features your
customers want with a fast integration
that limits your PCI scope.

GET STARTED

API Base URLs

  • Production Server

    For processing live transactions

    https://api.payjunction.com

  • Test Server

    For development

    https://api.payjunctionlabs.com

Most Commonly Referred to Articles

GET /settlements/?offset={index}

This API endpoint uses pagination.

To ensure all query results are received make sure to read our Pagination article.

Allows you to pull a list of all batches identified by their settlementIds.  

 

Production Request

curl -X GET -u "login:password" -H "Accept: application/json" -H "X-PJ-Application-Key: YOUR_PRODUCTION_APP_KEY" \
    "https://api.payjunction.com/settlements/?offset=0"

Sandbox Request

curl -X GET -u "pj-ql-01:pj-ql-01p" -H "Accept: application/json" -H "X-PJ-Application-Key: YOUR_LABS_APP_KEY" \
    "https://api.payjunctionlabs.com/settlements/?offset=0"

The above will return the first 50 records (index 0-49). To pull the next 50 records send offset=50 (index 50-99). Generally it is easiest to grab the URL in the "next" parameter returned in the response to get the correct index for the next set of records. The next field will not be set once you have reached the last page, therefore it is important to verify the parameter exists in the response before referencing it in your code (isset() in PHP and hasOwnProperty() in JavaScript).

In addition to the offset and limit query parameters supported by all paginated endpoints, the following query parameter is accepted by this endpoint:

Name Format Description
 terminalId numeric  Limits the results to settlements on the specified terminal in the PayJunction account. The terminalIds available in an account can be obtained from the GET /terminals endpoint. 

Example Response

{
     "next": "https://api.payjunctionlabs.com/settlements/?offset=50",
     "results": [ {
          "settlementId": 477,
          "terminalId": 11495,
          "created": "2018-08-28T00:00:04Z",
          "amountNet": -3105.11,
          "status": "COMPLETE"
     }, {
          "settlementId": 475,
          "terminalId": 11495,
          "created": "2018-08-25T00:00:03Z",
          "amountNet": 117.7,
          "status": "COMPLETE"
     }, {
          "settlementId": 379,
          "terminalId": 11495,
          "created": "2018-05-19T00:00:02Z",
          "amountNet": 100.30,
          "status": "PENDING"
     } ]
}

HTTP 400 - Validation Error

{
     "errors": [
     {
          "message" : "Terminal does not exist or you do not have permission to access it.",
          "type" : "invalid"
     }
}

Response Fields

Name Format Description
settlementId numeric Unique identifier for the settlement on the associated merchant account
terminalId numeric The specific merchant account that the transactions contained within the settlement were processed on.
created string Date in UTC that the settlement was created
amountNet amount The net amount for this settlement. essentially, the sum of charge amounts - (minus) the sum of refund amounts
status string

COMPLETE - transactions have been settled with the card issuing bank.

PENDING - transactions are in the process of being settled with the card issuing bank.