Capture of the order

A capture must be made when the product or products are sent with the import of the total price of the sale.

The creation of multiple captures is supported in case partial orders are sent. The sum of the amount of the catches must never exceed the value of the order.

{
    "amount": 10050,
    "id": "cf04aa87a6364f14b164e48a84e99936",
    "created": "2019-06-21T16:51:19.494155+02:00",
    "refunds": [],
    "refunded_amount": 0,
    "remaining_amount": 10050
}
Parameter Type Required Description
amount decimal yes Capture amount
id string yes Your capture ID
created string yes Date of the capture
refunds object no Refunds on capture done
refunded_amount decimal yes Refunded capture amount
remaining_amount decimal yes Remaining capture amount

01. Check remaining amount

GET /orders/:orderId/captures HTTP/1.1
Accept: application/vnd.aplazame.v1+json
Authorization: Bearer api_private_key
Host: api.aplazame.com
Parameter Type Required Description
:orderId string yes Order ID.

Response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
X-Aplazame-Media-Type: aplazame.v1

{
    "remaining_capture_amount": 60020,
    "results": [
        {
            "amount": 10050,
            "id": "cf04aa87a6364f14b164e48a84e99936",
            "created": "2019-06-21T16:51:19.494155+02:00",
            "refunds": [],
            "refunded_amount": 0,
            "remaining_amount": 10050
        }
    ]
}
Parameter Type Description
remaining_capture_amount decimal Remaining order amount without capture
results object Captures of order

02. Request capture

POST /orders/:orderId/captures HTTP/1.1
Accept: application/vnd.aplazame.v1+json
Authorization: Bearer api_private_key
Host: api.aplazame.com

{
  "amount": 10050
}
Parameter Type Required Description
:orderId string yes Order ID.
amount decimal yes Amount to capture

Response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
X-Aplazame-Media-Type: aplazame.v1

{
    "remaining_capture_amount": 49970,
    "amount": 10050,
    "id": "cf04aa87a6364f14b164e48a84e99936",
    "created": "2019-06-21T16:51:19.494155+02:00",
    "refunds": [],
    "refunded_amount": 0,
    "remaining_amount": 10050
}
Parameter Type Description
remaining_capture_amount decimal Remaining order amount without capture
amount decimal Capture amount
id string Your capture ID
created string Date of the capture
refunds object Refunds on capture done
refunded_amount decimal Refunded capture amount
remaining_amount decimal Remaining capture amount