{

Captures

Create and update captures.

Capture a payment

Captures a payment for the full or partial amount, or changes the capture date to today. A new capture record will be created, and the status of the existing capture will be updated to CANCELED. But only if the existing capture(s) don't have the status STARTED or CAPTURED.

By default a capture for the full amount is created when the shopper authorizes the payment with a capture date of today. In this case the capture call is only needed if a lower amount should be captured.

On request the default capture can be changed to a day in the future, or no default capture at all. In the former case the capture call can be used to capture the payment earlier (today), or for a lower amount. In the latter case the capture call must be used, otherwise no money will be settled.

Note: Depending on the payment method the capture is already captured when authorized by the shopper, and has the status CAPTURED.

POST /ps/api/public/v1/merchants/{merchant_key}/orders/{order_key}/payments/{id}/captures

Identifiers

Name Description
merchant_key The key of the merchant.
order_key The key for the order.
id The id of the payment.

Parameters

Not applicable.

Request

Field Type M Description
amount Number O The capture amount in minor units, e.g. in cents.
currency Currency C The capture currency as ISO 4217 Alpha 3, e.g. "EUR".
Must be present if capture amount is given.

Response

Not applicable.

HTTP Status

Status Meaning
201 (Created) The capture is successfully created.
400 (Bad Request) The request was not valid, or there was already a capture with the status STARTED or CAPTURED.
401 (Unauthorized) Authorization header missing or invalid.
403 (Forbidden) The merchant key is not allowed.

Capture Payment example

> curl \
    -X POST \
    --header 'Content-Type: application/json' \
    --header 'Authorization: Basic RG9jZGF0YVBGOkJXazJhZkpV' \
    https://testsecure.docdatapayments.com/ps/api/public/v1/merchants/4ef08825-993a-424d-a769-3ee97116a1b6/orders/94D261BBF80E4AC7212B127D3BD2E279/payments/2163179782/captures \
    -d '{
        "amount"        : 1000,
        "currency"      : "EUR",
    }'

< Http 201 Created