Get payment

The Get payment method returns payment details 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 current reseller and downstream resellers accessible within a method.

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

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)
payment_idpathintegerRequiredPayment ID
includequerystringOptional

Returns additional information about objects related to the payment. 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

Response model

Name

Data type

Description

dataobjectResponse 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_idnumberAccount ID


discount_amount

stringDiscount amount


total

stringTotal amount of the payment


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

numberID 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

number

ID of the manager responsible for processing the payment. Returns null if absent



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


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


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 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

      numberAccount ID

      total

      stringTotal amount of the order

      payment_id

      numberID 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

      numberID 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

      numberManager 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:

      НазваниеТип данныхОписание

      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)

Request example

GET /api/v3/resellers/1/payments/6465?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": "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": "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": "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": "Yamskaya",
                "building": "",
                "office": "",
                "zip": "119002",
                "phone": "+74950000001",
                "email": "test@example.com",
                "status": "active",
                "balance": "1293.12",
                "usable_balance": "770.45",
                "current_debt": 99.26,
                "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": "3005710",
                            "type": "subscriptions"
                        },
                        {
                            "id": "3005731",
                            "type": "subscriptions"
                        },
                        {
                            "id": "3005648",
                            "type": "subscriptions"
                        }
                    ]
                }
            }
        },
        {
            "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"
            }
        }
    ]
}