Capture an order
Smartpay supports both manual and automatic capture. Automatic capture is the default in which case the order is automatically captured after the shopper completing the payment and you don't have to take any additional steps.
In case you are using manual capture, please follow the instructions below to capture an order.
Please note that the order is only valid for 7 days and needs to be captured within that time. If you do not capture it within 7 days, the order will be canceled automatically.
In the Smartpay dashboard
Smartpay dashboard only supports a single manual capture. You can capture any amount up to the total order amount. If you would like to create multiple partial captures, please use our API to do so.
If you capture an amount that is less than the total order amount, any uncaptured amount will be automatically cancelled and you won't be able to capture it later. Smartpay can not reverse this action for you. Make sure to only capture the order once you know the total amount that needs to be captured.
1. Find the order you wish to capture
After you login to your Smartpay dashboard you can see the list of your orders. You can filter for your uncaptured orders. You can search for a specific order by order id, reference, customer name and customer email.
Once you found the right order, click on it to open the order details page.
2. Capture the order
On the order details page click Capture.
Fill out the form with the amount you wish to capture and an optional description. Click Capture.
If you capture an amount that is less than the total order amount, any uncaptured amount will be automatically cancelled and you won't be able to capture it later. Smartpay can not reverse this action for you.
Using the Smartpay API
You can create multiple partial captures using the Smartpay API, as long as the total capture amount is less than or equal to the total order amount.
1. Capture the order
Using the orderId
for the order you wish to capture, create a payment (capture the order) using the Smartpay API.
For the full argument list please see the create a payment API endpoint. The following fields are mandatory:
- amount: A positive amount representing how much of this order to capture. You can capture only up to the remaining, uncaptured amount of the order.
- currency: Three-letter ISO currency code, in uppercase. Must be a supported currency.
- order: The unique identifier for the Order object.
By default, if you capture any amount less than the total order amount, any remainder will be canceled automatically and you won't be able to capture it later. Smartpay can not reverse this action for you. If you would like to create multiple partial captures please set the
cancelRemainder
argument tomanual
.
curl --request POST \
--url https://api.smartpay.co/v1/payments \
--header 'Accept: application/json' \
--header 'Authorization: Basic {secretKey}' \
--header 'Content-Type: application/json' \
--data '
{
"amount": 1500,
"cancelRemainder": "automatic",
"currency": "JPY",
"description": "Capture for my smartpay order",
"order": "order_test_bA1znhGULw5lROfDTpHChv",
"reference": "my_capture_reference"
}
'
$api = new \Smartpay\Api(getenv('SECRET_KEY'), getenv('PUBLIC_KEY'));
$payment = $api->createPayment([
'amount' => 1500,
'cancelRemainder' => 'automatic',
'currency' => 'JPY',
'description' => 'Description for my Smartpay capture',
'lineItems' => [],
'order' => 'order_test_bA1znhGULw5lROfDTpHChv',
'reference' => 'my_merchant_capture_reference'
]);
Smartpay.configure do |config|
config.public_key = ENV['PUBLIC_KEY']
config.secret_key = ENV['SECRET_KEY']
end
payment = Smartpay::Api.create_payment({
amount: 1500,
cancelRemainder: 'automatic',
currency: 'JPY',
description: 'Description for my Smartpay capture',
lineItems: [],
order: 'order_test_bA1znhGULw5lROfDTpHChv',
reference: 'my_merchant_capture_reference',
})
SECRET_KEY = os.environ.get('SECRET_KEY', '<YOUR_SECRET_KEY>')
PUBLIC_KEY = os.environ.get('PUBLIC_KEY', '<YOUR_PUBLIC_KEY>')
smartpay = Smartpay(SECRET_KEY, public_key=PUBLIC_KEY)
payment = smartpay.create_payment(
order="order_test_bA1znhGULw5lROfDTpHChv",
amount=1500,
currency="JPY",
reference="my_merchant_capture_reference",
description="Description for my Smartpay capture"
):
Updated 5 months ago