Complete a Payment
The Complete the Payment method allows to complete a Payment. The Payment gets the Completed status if the method is successfully completed.
This operation is possible only for the Payments with the Waiting for payment status.
 POST /api/vendor/v1/payments/{id}/complete.json?api_token={api_token}Arguments
| Name | Parameter Type | Data type | Required/  | Description | 
|---|---|---|---|---|
| id | path | integer | Required | A payment ID. | 
| api_token | query | string | Required | API token of the manager who perform the operation (see API Token Authentication). | 
| payment_method_id | form | integer | Required | A payment method ID. | 
Response model
| Name | Data type | Description | 
|---|---|---|
| id | integer | An order ID. | 
| document_id | string | A payment document number. The mask of a payment number is set in the platform settings in the "Document ID format" group (see System settings in the ActivePlatform. Operator Control Panel). | 
| status | One of the following statuses of the payment: 
 | |
| account_id | integer | An account ID, which makes the payment. | 
| created_at | date | A date and time of the payment's creation. | 
| updated_at | date | A date and time of the changes last time. | 
| total | float | An amount of the payment. | 
| comment | string | Additional information about the payment. | 
| requester IP | string | An IP address of the user who makes the payment. | 
| manager_id | integer | A manager ID who is responsible for the handling of the payment. | 
| payment_method_id | integer | A payment method ID. | 
| payment_method_name | string | A payment method name. | 
| orders | array | A list of orders which are linked with the payment (see Get a List of Orders). | 
Request example
POST http://billing.activeplatform.com:80/api/vendor/v1/payments/2007041/complete.json?api_token=654321{  
 "payment_method_id": 1
}Response example
 {
  "id": 2007041,
  "document_id": "P006132",
  "status": "completed",
  "account_id": 2000532,
  "created_at": "2016-10-04T11:17:40.467+03:00",
  "updated_at": "2016-10-04T11:19:09.360+03:00",
  "total": 100,
  "comment": "Cash",
  "requester_ip": "178.159.242.50",
  "manager_id": null,
  "payment_method_id": 1,
  "payment_method_name": "Check",
  "orders": []
}