Advanced Custom Checkouts
As part of processing custom checkouts, your platform can take advantage of these options:
Delayed Capture
Using custom checkout with a credit card as the payment method, you can delay capture up to 7 days.
The credit card will not be automatically charged with delayed capture, it will only be authorized for the amount set in /checkout/create. The authorized amount will show up as a pending charge on the payer’s card statement. The associated checkout will not progress past the state of authorized
until a call to /checkout/capture is made. If 7 days pass without having called /checkout/capture, the checkout will transition to a cancelled
state.
Step 1
After tokenizing a credit card, call /checkout/create with the payment_method.credit_card.auto_capture
parameter set to false
.
Example
{
"account_id": 1234567890,
"type": "personal",
"amount": 100,
"callback_uri": "https://webhook.site/",
"currency": "USD",
"unique_id": "Ae0h238nnd943",
"fees": {
"app_fee": 10
},
"payment_method": {
"type": "credit_card",
"credit_card": {
"id": 0987654321,
"auto_capture": false
}
}
}
Step 2
Call /checkout/capture within 7 days to capture the authorized amount
.
Example
{
"checkout_id": 012345
}
Partial Capture
BETA
Using custom checkout with a credit card as the payment method, you can send /checkout/capture to only capture a portion of the amount
and app_fee
originally sent in /checkout/create.
This feature is currently in BETA, so your application may receive the following error:
{
"error": "invalid_request",
"error_description": "Partial capture is not supported",
"error_code": 4007,
"details": [
],
"documentation_url": "https://developer.wepay.com/api/api-calls/checkout#capture"
}
In order to support partial capture for your application, reach out to your relationship executive or api@wepay.com.
Step 1
After tokenizing a credit card, call /checkout/create with the payment_method.credit_card.auto_capture
parameter set to false
.
Example
{
"account_id": 1234567890,
"type": "personal",
"amount": 100,
"callback_uri": "https://webhook.site/",
"currency": "USD",
"unique_id": "Ae0h238nnd943",
"fees": {
"app_fee": 10
},
"payment_method": {
"type": "credit_card",
"credit_card": {
"id": 0987654321,
"auto_capture": false
}
}
}
Step 2
Before the 7-day time-to-live of the checkout is over, use /checkout/capture to capture an amount
and/or app_fee
less than the initial values.
Example
{
"checkout_id": 012345,
"amounts": {
"amount": 10,
"app_fee": 1
}
}