Get list of payments

The Get list of payments method returns the list of payments of the current reseller or any of its downstream resellers.

An API token of a manager is required for authorization. To get an API token via the Operator Control Panel, see Viewing and updating manager's information

The manager's API token specified in an API request determines:

  • The role and access level of the manager, which determine the availability of a method.
  • The current reseller and downstream resellers accessible within a method.

GET {base_url}/api/v3/resellers/{reseller_id}/payments

Arguments

Name

Parameter Type

Data type

Required/ Optional

Description

X-Api-TokenheaderstringRequiredAPI token of a manager that performs the operation (see Viewing and updating manager's information)
Content-TypeheaderstringRequiredMedia type of the request. Specify the following: application/vnd.api+json
AcceptheaderstringRequired

Supported media types of the answer. Specify the following: application/vnd.api+json

base_urlpathstringRequiredActivePlatform URL
reseller_idpathintegerRequiredID of the current reseller or any of its downstream resellers (see Viewing and updating reseller general information)
page[size]queryintegerOptionalPage navigation: number of elements per page. The default value is 50
page[number]queryintegerOptionalPage navigation: page number
sortqueryintegerOptional

Sorting payments by the specified parameter:

  • sort={parameter} — ascending order.
  • sort={-parameter} — descending order.

The {parameter} can be any field

filter[created_at]

query

string

Optional

Filtering payments by the date and time when the payment was created in the YYYY-MM-DD or YYYY-MM-DDTHH:MM:SS format for the platform time zone or in the specified time zone (for example, YYYY-MM-DDTHH:MM:SSZ for UTC, see RFC 3339). To specify the period, the following filters are used:

  • filter[created_at][gt] — date and time are greater than the specified.
  • filter[created_at][lt] — date and time are less than the specified.
filter[updated_at]

query

string

Optional

Filtering payments by the date and time when the payment was updated in the YYYY-MM-DD or YYYY-MM-DDTHH:MM:SS format for the platform time zone or in the specified time zone (for example, YYYY-MM-DDTHH:MM:SSZ for UTC, see RFC 3339). To specify the period, the following filters are used:

  • filter[updated_at][gt] — date and time are greater than the specified.
  • filter[updated_at][lt] — date and time are less than the specified.
filter[closed_at]querystringOptional

Filtering payments by the date and time when the payment was completed in the YYYY-MM-DD or YYYY-MM-DDTHH:MM:SS format for the platform time zone or in the specified time zone (for example, YYYY-MM-DDTHH:MM:SSZ for UTC, see RFC 3339). To specify the period, the following filters are used:

  • filter[created_at][gt] — date and time are greater than the specified.
  • filter[created_at][lt] — date and time are less than the specified.
filter[account_id]

query

string

Optional

Filtering payments by the account ID
filter[payment_method_id]

query

string

Optional

Filtering payments by the ID of the payment method that was used for completing the payment (see Viewing the list of payment methods)

filter[document_id]

query

string

Optional

Filtering payments by the payment number

filters[status]

query

string

Optional

Filtering payments by the payment status (for the list of statuses, see Payment types)

includequerystringOptional

Returns additional information about objects related to payments. The parameter can be a comma-separated list if information about several objects is required. The following objects and possible values are supported:

Object

Parameter Value

Invoicesinvoices
Ordersorders
Accountaccount
Payment methodpayment_method
Resellerreseller
Chargescharges
Correctionscorrections

Response model

Name

Data type

Description

dataarrayResponse data


id

stringPayment ID

typestringData type

attributesobjectInformation about the payment


created_atstringDate and time when the payment was created


updated_atstringDate and time when the payment was updated


account_idintegerAccount ID


discount_amount

stringDiscount amount


total

stringTotal amount of the payment


currency_codestringPayment currency code


comment

stringComment on the payment


statusstringPayment status (for the list of statuses, see Payment types)


document_id

string

Payment number



expiration_date

stringExpiration date of the payment for a postpaid subscription. Returns null if absent


payment_method_id

integerID of the payment method that was used for completing the payment (see Viewing the list of payment methods). Returns null if absent


requester_ip

string

IP address of the payer. Returns null if absent



manager_id

integer

The ID of the current personal manager of the account. Returns null if absent



purposestringThe purpose of the top-up payment displayed in the receipt (see Creating a payment manually)


external_totalstringThe third-party invoice amount. Only for a payment linked to a postpaid invoice with external management (see Approve invoice). Returns null if absent


external_currencystringThe ISO code of the third-party invoice currency. Only for a payment linked to a postpaid invoice with external management (see Approve invoice). Returns null if absent


due_datestringThe latest date for completing the payment for a postpaid subscription (YYYY-MM-DD). Calculated as expiration_date minus 1 day. Returns null if absent


payment_method_name

stringName of the payment method that was used for completing the payment. Returns null if absent


closed_at

stringDate and time when the payment was completed

relationshipsobjectRelated objects


ordersobjectThe list of orders to pay



dataarray

Related object information:

NameData typeDescription
idstringID of the object
typestringData type


invoicesobjectThe list of invoices



dataarray

Related object information:

NameData typeDescription
idstringID of the object
typestringData type


chargesobjectThe list of charges



dataarray

Related object information:

NameData typeDescription
idstringID of the object
typestringData type


correctionsobjectThe list of corrections (see Complete payment by document ID)



dataarray

Related object information:

NameData typeDescription
idstringID of the object
typestringData type


resellerobjectInformation about the reseller



dataobject

Related object information:

NameData typeDescription
idstringID of the object
typestringData type


accountobjectInformation about the account



dataobject

Related object information:

NameData typeDescription
idstringID of the object
typestringData type


payment_methodobjectInformation about the payment method that was used for completing the payment



dataobject

Related object information:

NameData typeDescription
idstringID of the object
typestringData type
includedarray

Additional information about objects listed in the request:

NameData typeDescription
idintegerID of the object
typestringData type
attributesarrayAttributes of the object (see details below)
    • For an invoice, see Get invoice.
    • For an account, see Get account.
    • For a reseller, see Get downstream reseller.
    • For a charge, see Get end-customer charge.
    • For an order:

      NameData typeDescription

      created_at

      stringDate and time when the order was created

      updated_at

      stringDate and time when the order was updated

      account_id

      integerAccount ID

      total

      stringTotal amount of the order

      payment_id

      integerID of the payment Method (see Viewing the list of payment methods)

      status

      stringOrder status (for the list of statuses, see Viewing order details)

      type

      stringOrder type (for the list of types, see Viewing order details)

      expiration_date

      stringExpiration date of the order (см. Creating an account class)

      owner_id

      integerID of the account owner

      promo_code

      stringPromo code used to apply a discount

      document_id

      stringOrder number

      requester_ip

      stringIP address of the requester

      manager_id

      integerManager ID

      custom_price

      boolAttribute of the individual prices:

      net_cost

      stringSubscription net cost

      discount_amount

      stringAmount of the discount

      payment_model

      stringPayment model:
      • prepay
      • postpay

      closed_at

      stringDate and time when the order was completed
    • For a payment method:

      NameData typeDescription

      created_at

      stringDate and time when the payment method was created

      updated_at

      stringDate and time when the payment method was updated

      name

      stringName of the payment method

      description

      stringDescription of the payment method

      enabled

      boolStatus of the payment method:
      • true — the payment method is available in the Operator Control Panel and Customer Control Panel.
      • false — the payment method is not available.

      plugin_id

      stringName of the payment plugin (see Viewing the list of plugins)
    • For a correction (see Complete payment by document ID):

      Name

      Data type

      Description

      created_at

      stringDate and time of the correction creation

      updated_at

      stringDate and time of the correction update

      account_id

      integerThe ID of an account for which the correction is applied

      status

      stringThe current status of the correction:
      • approval_required — the correction is created but not processed.
      • approved — the correction is approved.
      • declined — the correction is declined.

      total

      stringThe correction amount
      bool

      A comment for the correction

      period_from

      stringAlways null

      period_to

      stringAlways null
      approved_atstringThe date of the correction approval (YYYY-MM-DD)

      subscription_id

      integerAlways null
linksobjectPage navigation links that use the defined page navigation parameters

selfstringCurrent page link

firststringFirst page link

prevstringPrevious page link

nextstringNext page link

laststringLast page link

Request example

GET /api/v3/resellers/1/payments?page[size]=2&page[number]=7&filter[created_at][gt]=2022-03-22&include=invoices,orders,account,payment_method,reseller,charges
Host: test.activeplatform.com
Content-Type: application/vnd.api+json
X-Api-Token: vY5fwetestK3gJXZH5uHCw
Accept: application/vnd.api+json

Response example

{
    "data": [
        {
            "id": "9714",
            "type": "payments",
            "attributes": {
                "created_at": "2022-03-22T16:37:21.321874+0300",
                "updated_at": "2022-03-22T16:37:30.163316+0300",
                "account_id": 1349,
                "discount_amount": "0.0",
                "total": "715.76",
				"currency_code": "USD",
                "comment": "Payment for order 14759",
                "status": "completed",
                "document_id": "2007136",
                "expiration_date": null,
                "payment_method_id": 3,
                "requester_ip": "10.20.30.40",
                "manager_id": null,
                "purpose": "",
                "external_total": null,
                "external_currency": null,
                "due_date": null,
                "payment_method_name": "Bank Transfer",
                "closed_at": "2022-03-22T16:37:30.163316+0300"
            },
            "relationships": {
                "orders": {
                    "data": [
                        {
                            "id": "14759",
                            "type": "prolong_orders"
                        }
                    ]
                },
                "invoices": {
                    "data": []
                },
                "charges": {
                    "data": [
                        {
                            "id": "94591",
                            "type": "charges"
                        }
                    ]
                },
                "corrections": {
                    "data": []
                },
                "reseller": {
                    "data": {
                        "id": "1",
                        "type": "resellers"
                    }
                },
                "account": {
                    "data": {
                        "id": "1349",
                        "type": "accounts"
                    }
                },
                "payment_method": {
                    "data": {
                        "id": "3",
                        "type": "payment_methods"
                    }
                }
            }
        },
        {
            "id": "9715",
            "type": "payments",
            "attributes": {
                "created_at": "2022-03-22T16:51:34.290462+0300",
                "updated_at": "2022-03-22T16:53:35.452802+0300",
                "account_id": 1349,
                "discount_amount": "0.0",
                "total": "511.26",
				"currency_code": "USD",
                "comment": "Payment for order 14760",
                "status": "completed",
                "document_id": "2007137",
                "expiration_date": null,
                "payment_method_id": 3,
                "requester_ip": "10.20.30.40",
                "manager_id": null,
                "purpose": "",
                "external_total": null,
                "external_currency": null,
                "due_date": null, 
                "payment_method_name": "Bank Transfer",
                "closed_at": "2022-03-22T16:53:35.452802+0300"
            },
            "relationships": {
                "orders": {
                    "data": [
                        {
                            "id": "14760",
                            "type": "renewal_orders"
                        }
                    ]
                },
                "invoices": {
                    "data": []
                },
                "charges": {
                    "data": [
                        {
                            "id": "94592",
                            "type": "charges"
                        },
                        {
                            "id": "94593",
                            "type": "charges"
                        }
                    ]
                },
                "corrections": {
                    "data": []
                },
                "reseller": {
                    "data": {
                        "id": "1",
                        "type": "resellers"
                    }
                },
                "account": {
                    "data": {
                        "id": "1349",
                        "type": "accounts"
                    }
                },
                "payment_method": {
                    "data": {
                        "id": "3",
                        "type": "payment_methods"
                    }
                }
            }
        }
    ],
    "included": [
        {
            "id": "14759",
            "type": "prolong_orders",
            "attributes": {
                ...
            }
        },
        {
            "id": "94591",
            "type": "charges",
            "attributes": {
                ...
            },
            "relationships": {
                ...
            }
        },
        {
            "id": "1",
            "type": "resellers",
            "attributes": {
                ...
            }
        },
        {
            "id": "1349",
            "type": "accounts",
            "attributes": {
                ...
            },
            "relationships": {
                ...
            }
        },
        {
            "id": "3",
            "type": "payment_methods",
            "attributes": {
                ...
            }
        },
        {
            "id": "14760",
            "type": "renewal_orders",
            "attributes": {
                ...
            }
        },
        {
            "id": "94592",
            "type": "charges",
            "attributes": {
                ...
            },
            "relationships": {
                ...
            }
        },
        {
            "id": "94593",
            "type": "charges",
            "attributes": {
                ...
            },
            "relationships": {
                ...
            }
        }
    ],
    "links": {
        "self": "https://test.activeplatform.com/api/v3/resellers/1/payments?filter%5Bcreated_at%5D%5Bgt%5D=2022-03-22&include=invoices%2Corders%2Caccount%2Cpayment_method%2Creseller%2Ccharges&page%5Bnumber%5D=7&page%5Bsize%5D=2",
        "first": "https://test.activeplatform.com/api/v3/resellers/1/payments?filter%5Bcreated_at%5D%5Bgt%5D=2022-03-22&include=invoices%2Corders%2Caccount%2Cpayment_method%2Creseller%2Ccharges&page%5Bnumber%5D=1&page%5Bsize%5D=2",
        "prev": "https://test.activeplatform.com/api/v3/resellers/1/payments?filter%5Bcreated_at%5D%5Bgt%5D=2022-03-22&include=invoices%2Corders%2Caccount%2Cpayment_method%2Creseller%2Ccharges&page%5Bnumber%5D=6&page%5Bsize%5D=2",
        "next": "https://test.activeplatform.com/api/v3/resellers/1/payments?filter%5Bcreated_at%5D%5Bgt%5D=2022-03-22&include=invoices%2Corders%2Caccount%2Cpayment_method%2Creseller%2Ccharges&page%5Bnumber%5D=8&page%5Bsize%5D=2",
        "last": "https://test.activeplatform.com/api/v3/resellers/1/payments?filter%5Bcreated_at%5D%5Bgt%5D=2022-03-22&include=invoices%2Corders%2Caccount%2Cpayment_method%2Creseller%2Ccharges&page%5Bnumber%5D=153&page%5Bsize%5D=2"
    }
}