Praxis Wiki logo

Get Subscription Payment history

GET /api/v1.3/subscription/{subscriptionId}/payment-history method is your endpoint to get the list of payments within the customer subscriptions.

To get the list of payments by the specific subscription, the request should contain subscription_id parameter. If the parameter is not specified, the response will contain a list of all payments for all subscriptions for a specific customer (cid).

ENDPOINTS

Name URL
Sandbox https://pci-gw-test.praxispay.com/api/v1.3/subscription/{subscriptionId}/payment-history
Live https://gw.praxisgate.com/api/v1.3/subscription/{subscriptionId}/payment-history

REQUEST PARAMS

✓ - required value
? - optional, value or null
✕ - always appears as null

Variable Type Description
merchant_id varchar(50) Merchant API client account identifier
application_key varchar(32) Identifier of your application (website)
cid varchar(32) ? Customer ID
subscription_id varchar(32) Subscription ID
page int(3) ? Current results page
per-page int(3) ? Count of entities for one page
version varchar(4) API version. Default value - v1.3
timestamp int(11) Response time (unix timestamp, seconds)

RESPONSE PARAMS

Variable Type Description
status int API communication status -
- 0 if the request was successful
- Negative integer if internal server/network error occurs
- Positive integer if application/logical error occurs
description varchar(256) Accurate description of the result. Return the actual error for any exception as it helps to diagnose issues in production
cid varchar(32) Customer ID
payments string Array of transactions for selected subscription
page int(3) ? Current results page
per-page int(3) ? Count of entities for one page
pages_count int(3) Count of pages in result
records_count int(3) Count of entities in full result
version varchar(3) API version
timestamp int(11) Response time (unix timestamp, seconds)

Signature

To execute the request, it is necessary to undergo the authentication process. The general authentication algorithm can be found in the Authentication section.

Request signature parameters

  1. merchant_id
  2. application_key
  3. timestamp

Response signature parameters

  1. status
  2. timestamp

Example

Request

/api/v1.3/subscription/1GQ0xJonekLvqKTUdH1ELyYs/payments-history?
merchant_id=API-Merchant&
application_key=test-application&
cid=user-1234&
page=0&
per_page=20&
version=1.3&
timestamp=1680712861

Response (successful scenario)

{
  "status": 0,
  "description": "Payments history fetched successfully",
  "cid": "user-1234",
  "payments": [
    {
      "subscription_id": "1GQ0xJonekLvqKTUdH1ELyYs",
      "tid": 10004,
      "card_number": "444433******1111",
      "amount": 20000,
      "currency": "USD",
      "gateway": "4b82384fe2c4d163ab41cf0e408c2d0a",
      "status_code": "GE-006",
      "status_details": "Insufficient funds",
      "status": "rejected",
      "created_at": 1680821826,
      "retry_number": 2
    },
    {
      "subscription_id": "1GQ0xJonekLvqKTUdH1ELyYs",
      "tid": 10003,
      "card_number": "444433******1111",
      "amount": 20000,
      "currency": "USD",
      "gateway": "4b82384fe2c4d163ab41cf0e408c2d0a",
      "status_code": "GE-006",
      "status_details": "Insufficient funds",
      "status": "rejected",
      "created_at": 1680820215,
      "retry_number": 1
    },
    {
      "subscription_id": "1GQ0xJonekLvqKTUdH1ELyYs",
      "tid": 10002,
      "card_number": "444433******1111",
      "amount": 20000,
      "currency": "USD",
      "gateway": "4b82384fe2c4d163ab41cf0e408c2d0a",
      "status_code": "GE-006",
      "status_details": "Insufficient funds",
      "status": "rejected",
      "created_at": 1680820104,
      "retry_number": null
    }
  ],
  "page": 0,
  "per_page": 20,
  "pages_count": 13,
  "records_count": 250,
  "version": 1.3,
  "timestamp": 1680712861
}

Response (unsuccessful scenario)

{
  "status": -1,
  "description": "Customer subscriptions not found",
  "version": 1.3,
  "timestamp": 1680712861
}