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

Description

id

path

integer

Required

A payment ID.

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

  • waiting for payment – payment has been added, but not approved;
  • completed – payment has been successfully processed (added and approved);
  • receipt creating - a receipt is being created by the manager manually;
  • receipt sent - receipt has been manually created by the manager;
  • cancelled – an order has been cancelled.
account_idintegerAn account ID, which makes the payment.
created_atdateA date and time of the payment's creation.
updated_atdateA date and time of the changes last time.
totalfloatAn amount of the payment.
commentstringAdditional 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_idintegerA payment method ID.

payment_method_name

stringA payment method name.
ordersarrayA 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": []
}