Skip to content

Confirm a payment authorization

POST
/checkout/preauth-success
curl --request POST \
--url https://acme.mykreezalid.com/api/v1/checkout/preauth-success \
--header 'Authorization: Basic <credentials>' \
--header 'Content-Type: application/json' \
--data '{ "checkout_entity_type": "cart", "checkout_entity_id": "321123", "transaction_id": "123", "tos_acceptance_at": "2023-09-20 10:00:00", "customer_checkout_message": "example", "request": "example", "response": "example", "note": "example" }'

Call it once your own checkout has authorized the customer’s payment. The orders are marked as paid by authorization with your active payment gateway, the cart is closed, and the checkout is recorded with your transaction identifier. Only a cart that is not closed yet, or an order still in draft, can be confirmed.

Media typeapplication/json
object
checkout_entity_type
required

What the customer checked out

string
Allowed values: cart order
checkout_entity_id
required

Identifier of the cart or the order

string

Example

321123
transaction_id
required

Identifier of the authorization at your payment provider

string

Example

123
tos_acceptance_at
required

When the customer accepted your terms, YYYY-MM-DD HH:MM:SS

string

Example

2023-09-20 10:00:00
customer_checkout_message

Message the customer left at checkout

string
request

Accepted for compatibility; must be a string when sent

string
response

Accepted for compatibility; must be a string when sent

string
note

Accepted for compatibility; must be a string when sent

string

The authorization has been recorded. The updated cart or order comes under the key cart or order, after the type you sent.

Media typeapplication/json
object
code
integer
status
string
message
string
cart

The updated cart, when you sent a cart

object
order

The updated order, when you sent an order

object

Example

{
"code": 200,
"status": "success",
"message": "Preauth saved and cart updated successfully"
}

Invalid parameters, listed in errors, or no payment gateway is active.

Media typeapplication/json
object
code

HTTP status code, repeated in the body.

integer
status
string
message
string
errors
Array<object>
object
field
string
message
string

Example

{
"code": 400,
"status": "error",
"message": "Some parameters are not correct",
"errors": [
{
"field": "tos_acceptance_at",
"message": "tos_acceptance_at is not a valid date (YYYY-MM-DD HH:MM:SS)"
}
]
}

The cart is already closed, or the order is no longer in draft.

Media typeapplication/json

Error body returned when the API refuses a request.

object
code

HTTP status code, repeated in the body.

integer
status
string
message
string

Example

{
"code": 400,
"status": "error",
"message": "Some parameters are not correct"
}