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 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/{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
Chargescharges
Correctionscorrections

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

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)


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


correctionsobject

The 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.
    • Fir 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:

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

      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

Request example

GET /api/v3/resellers/1/payments/9714?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": [
                    {
                        "id": "32",
                        "type": "corrections"
                    },
                    {
                        "id": "34",
                        "type": "corrections"
                    },
                    {
                        "id": "35",
                        "type": "corrections"
                    }
                ]
            },
            "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": {
                ...
            }
        }
    ]
}