This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Authorizes a payment using an order's saved payment method.
Use the delayedCaptureSettings
field to specify whether the payment should also be captured/voided immediately or at a later time.
Alternatively, the payment can be manually captured or voided using the Capture Authorized Payments or Void Authorized Payments methods.
You can only call this method when authenticated as a Wix app or Wix user identity.
Order ID.
The order must have a saved payment method associated.
Pass the order ID to the List Transactions For Single Order method and search the response for a payment with regularPaymentDetails.savedPaymentMethod: true
.
If no saved payment exists, the call will fail.
Amount to authorize.
Currency code, in ISO-4217 format.
Settings for scheduled action to perform automatically.
Authorized payment.
Order transactions updated with authorized payment.
curl -X POST \
'https://www.wixapis.com/ecom/v1/order-billing/authorize-charge-with-saved-payment-method' \
-H 'Content-Type: application/json' \
-H 'Authorization: <AUTH>' \
--data-binary '{
"orderId": "3545c2f2-7768-4e6e-b64b-dcc11dc7a7f9",
"amount": {
"amount": "1"
},
"currency": "USD",
"delayedCaptureSettings": {
"scheduledAction": "VOID",
"delayDuration": {
"count": 1,
"unit": "DAYS"
}
}
}'
{
"payment": {
"id": "496aaea1-4e2f-4cb1-9522-6b85f49b91e2",
"regularPaymentDetails": {
"paymentOrderId": "dc6e6d53-51d6-48a4-8755-ca87a4e370bf",
"offlinePayment": false,
"status": "PENDING",
"savedPaymentMethod": false,
"authorizationDetails": {
"delayedCapture": true,
"captures": [],
"scheduledAction": {
"actionType": "VOID"
}
}
},
"createdDate": "2024-12-25T08:46:04.257Z",
"updatedDate": "2024-12-25T08:46:04.257Z",
"amount": {
"amount": "1",
"formattedAmount": "$1.00"
},
"refundDisabled": false
},
"orderTransactions": {
"orderId": "3545c2f2-7768-4e6e-b64b-dcc11dc7a7f9",
"payments": [
{
"id": "23af2de7-b24d-41d5-8d27-cf925d378d32",
"regularPaymentDetails": {
"paymentOrderId": "eead5fa5-29c2-4f7e-957c-a5eb0286c235",
"gatewayTransactionId": "afba164b-a96c-4cb2-a22d-6eec692e1148",
"paymentMethod": "Credit/Debit Cards",
"providerTransactionId": "afba164b-a96c-4cb2-a22d-6eec692e1148",
"offlinePayment": false,
"status": "APPROVED",
"savedPaymentMethod": true,
"creditCardDetails": {
"lastFourDigits": "1111",
"brand": "visa"
}
},
"createdDate": "2024-12-25T08:36:29.499Z",
"updatedDate": "2024-12-25T08:36:32.351Z",
"amount": {
"amount": "2.0",
"formattedAmount": "$2.00"
},
"refundDisabled": false
},
{
"id": "496aaea1-4e2f-4cb1-9522-6b85f49b91e2",
"regularPaymentDetails": {
"paymentOrderId": "dc6e6d53-51d6-48a4-8755-ca87a4e370bf",
"offlinePayment": false,
"status": "PENDING",
"savedPaymentMethod": false,
"authorizationDetails": {
"delayedCapture": true,
"captures": [],
"scheduledAction": {
"actionType": "VOID"
}
}
},
"createdDate": "2024-12-25T08:46:04.257Z",
"updatedDate": "2024-12-25T08:46:04.257Z",
"amount": {
"amount": "1",
"formattedAmount": "$1.00"
},
"refundDisabled": false
}
],
"refunds": []
}
}
There are 2 errors with this status code.
There is 1 error with this status code.
There are 3 errors with this status code.
This method may also return standard errors. Learn more about standard Wix errors.