Get a List of the Reseller's Payments
The Get a List of Payments method returns the list of Payments of the current Reseller or any of its downstream Resellers.
Access to the current Reseller and downstream Resellers is determined by the Manager's token in the API request.
GET {base_url}/api/v3/resellers/{reseller_id}/payments
Arguments
Name | Parameter Type | Data type | Required/ Optional | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
X-Api-Token | header | string | Required | API token of the Manager that performs the operation (see Viewing and updating manager's information) | ||||||||||||
Content-Type | header | string | Required | Indicates the media type (text/html or text/JSON) of the request that is sent to the server by the client (browser) | ||||||||||||
Accept | header | string | Required | Information about data types that the client (browser) supports | ||||||||||||
reseller_id | path | integer | Required | ID of the current Reseller or any of its downstream Resellers (see Viewing and updating reseller general information) | ||||||||||||
page[size] | query | integer | Optional | Page navigation: number of elements per page. The default value is 50 | ||||||||||||
page[number] | query | integer | Optional | Page navigation: page number | ||||||||||||
sort | query | integer | Optional | Sorting Payments by the specified parameter:
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 RFC 3339 format (for example, 2017-10-04T15:12:01.558009%2B03:00). To specify the period, the following filters are used:
| ||||||||||||
filter[updated_at] | query | string | Optional | Filtering Payments by the date and time when the Payment was updated in the RFC 3339 format (for example, 2017-10-04T15:12:01.558009%2B03:00). To specify the period, the following filters are used:
| ||||||||||||
filter[closed_at] | query | string | Optional | Filtering Payments by the date and time when the Payment was completed in the RFC 3339 format (for example, 2017-10-04T15:12:01.558009%2B03:00). To specify the period, the following filters are used:
| ||||||||||||
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) | ||||||||||||
include | query | string | Optional | 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:
|
Response model
Name | Data type | Description | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
data | array | Response data | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
id | string | Payment ID | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
type | string | Data type | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
attributes | object | Information about the Payment | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
created_at | string | Date and time when the Payment was created | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
updated_at | string | Date and time when the Payment was updated | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
account_id | number | Account ID | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
discount_amount | string | Discount amount | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
total | string | Total amount of the Payment | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
comment | string | Comment on the Payment | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
status | string | Payment status (for the list of statuses, see Payment types) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
document_id | string | Payment number | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
expiration_date | string | Expiration date of the Payment for a postpaid Subscription. Returns null if absent | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
payment_method_id | number | ID 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 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
manager_id | number | ID of the Manager responsible for processing the Payment. Returns | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
purpose | string | The purpose of the top-up Payment displayed in the receipt (see Creating a payment manually) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
payment_method_name | string | Name of the Payment Method that was used for completing the Payment. Returns null if absent | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
closed_at | string | Date and time when the Payment was completed | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
relationships | object | Related objects | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
orders | object | The list of Orders to pay | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
data | array | Related object information:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
invoices | object | The list of Invoices | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
data | array | Related object information:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
reseller | object | Information about the Reseller | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
data | object | Related object information:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
account | object | Information about the Account | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
data | object | Related object information:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
payment_method | object | Information about the Payment Method that was used for completing the Payment | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
data | object | Related object information:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
included | array | Additional information about objects listed in the request:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
links | object | Page navigation links that use the defined page navigation parameters | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
self | string | Current page link | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
first | string | First page link | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
prev | string | Previous page link | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
next | string | Next page link | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
last | string | Last page link |
Request example
GET /api/v3/resellers/1/payments?page[size]=2&page[number]=3&sort=closed_at&filter[created_at][gt]=2019-10-11T09:00:00.000000%2B0300&filter[status]=completed&include=invoices,orders,account,payment_method
Host: test.activeplatform.com
Content-Type: application/vnd.api+json
X-Api-Token: vY5fwetestK3gJXZH5uHCw
Accept: application/vnd.api+json
Response example
{
"data": [
{
"id": "6463",
"type": "payments",
"attributes": {
"created_at": "2019-10-21T04:14:30.311240+0300",
"updated_at": "2019-10-21T04:14:35.994562+0300",
"account_id": 502,
"discount_amount": "0.0",
"total": "420.0",
"comment": "Payment for order 8126",
"status": "completed",
"document_id": "2005246",
"expiration_date": null,
"payment_method_id": 1,
"requester_ip": "10.0.0.203",
"manager_id": null,
"purpose": "",
"payment_method_name": "Check",
"closed_at": "2019-10-21T04:14:35.994562+0300"
},
"relationships": {
"orders": {
"data": [
{
"id": "8126",
"type": "sales_orders"
}
]
},
"invoices": {
"data": []
},
"reseller": {
"data": {
"id": "1",
"type": "resellers"
}
},
"account": {
"data": {
"id": "502",
"type": "accounts"
}
},
"payment_method": {
"data": {
"id": "1",
"type": "payment_methods"
}
}
}
},
{
"id": "6465",
"type": "payments",
"attributes": {
"created_at": "2019-10-21T07:02:54.651997+0300",
"updated_at": "2019-10-21T07:03:00.230411+0300",
"account_id": 502,
"discount_amount": "0.0",
"total": "360.0",
"comment": "Payment for order 8128",
"status": "completed",
"document_id": "2005248",
"expiration_date": null,
"payment_method_id": 2,
"requester_ip": "10.0.0.203",
"manager_id": null,
"purpose": "",
"payment_method_name": "Cash",
"closed_at": "2019-10-21T07:03:00.230411+0300"
},
"relationships": {
"orders": {
"data": [
{
"id": "8128",
"type": "change_orders"
}
]
},
"invoices": {
"data": []
},
"reseller": {
"data": {
"id": "1",
"type": "resellers"
}
},
"account": {
"data": {
"id": "502",
"type": "accounts"
}
},
"payment_method": {
"data": {
"id": "2",
"type": "payment_methods"
}
}
}
}
],
"included": [
{
"id": "8126",
"type": "sales_orders",
"attributes": {
"created_at": "2019-10-21T04:14:29.507521+0300",
"updated_at": "2019-10-21T04:14:39.686214+0300",
"account_id": 502,
"total": "420.0",
"payment_id": 6463,
"status": "completed",
"type": "SalesOrder",
"expiration_date": "2019-10-28",
"owner_id": 864,
"promo_code": null,
"document_id": "SO004750",
"requester_ip": "10.0.0.203",
"manager_id": 214,
"custom_price": false,
"net_cost": null,
"discount_amount": "0.0",
"payment_model": "prepay",
"closed_at": "2019-10-21T04:14:39.686214+0300"
}
},
{
"id": "502",
"type": "accounts",
"attributes": {
"created_at": "2019-08-22T15:11:47.339+03:00",
"updated_at": "2019-10-21T07:03:00.217+03:00",
"reseller_id": 1,
"name": "Vit Ada",
"account_class_id": 1601,
"primary_name": "DepV0304-4",
"first_name": "Vit",
"middle_name": "",
"last_name": "Ada",
"country": "TW",
"region": "MSK",
"city": "Moscow",
"street": "Tverskaya",
"building": "",
"office": "",
"zip": "119002",
"phone": "+74950000001",
"email": "test@example.com",
"status": "active",
"balance": "1293.12",
"usable_balance": "770.45",
"current_debt": 80.09,
"subscription_credit_limit": 100.0,
"financial_blocking_threshold": 100.0,
"account_type_id": 1564,
"manager_id": null,
"owner_id": 864,
"tech_user_id": 864,
"bill_user_id": 864,
"custom_attributes": {},
"manager": null,
"default_payment_model": "postpay",
"account_type": {
"id": 1564,
"name": "FL",
"created_at": "2017-03-20T16:34:28.163+03:00",
"updated_at": "2017-03-20T16:34:28.163+03:00",
"reseller_id": 1,
"name_pattern": "%first_name %middle_name %last_name",
"primary_name": "",
"key": "personal",
"default_payment_method_id": null,
"ancestry": "1562",
"use_by_default": false
},
"account_class": {
"id": 1601,
"reseller_id": 1,
"name": "543535",
"created_at": "2018-07-23T17:41:37.677+03:00",
"updated_at": "2019-10-27T10:58:37.566+03:00",
"financial_blocking_threshold": "100.0",
"due_order_period": 7,
"subzero_period": -1,
"stop_subscription_type": "automatically",
"key": "3535535353",
"color": "grey",
"guaranteed_payment_limit": 1000,
"guaranteed_payment_period": 7,
"delete_subscription_type": "automatically",
"denominated": false,
"buy_with_negative_balance": false,
"receipt_day": null,
"payment_model": "postpay",
"default": false,
"due_payment_period": 6,
"subscription_credit_limit": "100.0"
}
},
"relationships": {
"subscriptions": {
"data": [
{
"id": "3005731",
"type": "subscriptions"
},
{
"id": "3005729",
"type": "subscriptions"
},
{
"id": "3005648",
"type": "subscriptions"
}
]
}
}
},
{
"id": "1",
"type": "payment_methods",
"attributes": {
"created_at": "2016-08-25T09:26:12.919132+0300",
"updated_at": "2017-10-04T14:05:48.334229+0300",
"name": "Check",
"description": "Description",
"enabled": true,
"plugin_id": "check_cash"
}
},
{
"id": "8128",
"type": "change_orders",
"attributes": {
"created_at": "2019-10-21T07:02:54.273531+0300",
"updated_at": "2019-10-21T07:03:00.465342+0300",
"account_id": 502,
"total": "360.0",
"payment_id": 6465,
"status": "completed",
"type": "ChangeOrder",
"expiration_date": "2019-10-28",
"owner_id": 864,
"promo_code": null,
"document_id": "CO001022",
"requester_ip": "10.0.0.203",
"manager_id": 214,
"custom_price": false,
"net_cost": null,
"discount_amount": "0.0",
"payment_model": "prepay",
"closed_at": "2019-10-21T07:03:00.465342+0300"
}
},
{
"id": "2",
"type": "payment_methods",
"attributes": {
"created_at": "2016-08-25T09:26:12.947229+0300",
"updated_at": "2017-10-03T11:20:32.446864+0300",
"name": "Cash",
"description": "",
"enabled": true,
"plugin_id": "check_cash"
}
}
],
"links": {
"self": "https://test.activeplatform.com/api/v3/resellers/1/payments?filter%5Bcreated_at%5D%5Bgt%5D=2019-10-11T09%3A00%3A00.000000%2B0300&filter%5Bstatus%5D=completed&include=invoices%2Corders%2Caccount%2Cpayment_method&page%5Bnumber%5D=3&page%5Bsize%5D=2&sort=closed_at",
"first": "https://test.activeplatform.com/api/v3/resellers/1/payments?filter%5Bcreated_at%5D%5Bgt%5D=2019-10-11T09%3A00%3A00.000000%2B0300&filter%5Bstatus%5D=completed&include=invoices%2Corders%2Caccount%2Cpayment_method&page%5Bnumber%5D=1&page%5Bsize%5D=2&sort=closed_at",
"prev": "https://test.activeplatform.com/api/v3/resellers/1/payments?filter%5Bcreated_at%5D%5Bgt%5D=2019-10-11T09%3A00%3A00.000000%2B0300&filter%5Bstatus%5D=completed&include=invoices%2Corders%2Caccount%2Cpayment_method&page%5Bnumber%5D=2&page%5Bsize%5D=2&sort=closed_at",
"next": "https://test.activeplatform.com/api/v3/resellers/1/payments?filter%5Bcreated_at%5D%5Bgt%5D=2019-10-11T09%3A00%3A00.000000%2B0300&filter%5Bstatus%5D=completed&include=invoices%2Corders%2Caccount%2Cpayment_method&page%5Bnumber%5D=4&page%5Bsize%5D=2&sort=closed_at",
"last": "https://test.activeplatform.com/api/v3/resellers/1/payments?filter%5Bcreated_at%5D%5Bgt%5D=2019-10-11T09%3A00%3A00.000000%2B0300&filter%5Bstatus%5D=completed&include=invoices%2Corders%2Caccount%2Cpayment_method&page%5Bnumber%5D=130&page%5Bsize%5D=2&sort=closed_at"
}
}