Overview
This method allows merchants to confirm the payment process, resulting in a finalised Laybuy order.
If the customer`s order has changed on the merchant site since the Laybuy order was created, the merchant should restart the process by creating a new order.
Important : Merchants have three options when confirming an order, depending on the level of validation required against the original order that was sent to Laybuy.
Merchants can specify :
-
- The payment token only,
-
- or The payment token and payment amount,
-
- or The payment token,
-
- payment amount,
-
- and order items.
Important: This method is idempotent for a limited period. Duplicate requests to confirm an single order (by payment token) will return the same response for a period, after which any duplicate requests will result in an error.
Important: confirm/Order needs to pass currencies.
Example request - token only
Specifying only the payment token will bypass any additional checks. The amount from the original order will be assumed to be correct, and that the order items have not changed.
{
"token":"31b50752-0378-3346-a6bf-158c8186aae3"
}
Example request - token and amount
Specifying the amount will cause an additional check to ensure that the amount specified matches the amount on the original order.
{
"token":"31b50752-0378-3346-a6bf-158c8186aae3",
"amount":152.98,
"currency":"NZD"
}
Example request - token, amount and items
Specifying the amount and items will cause additional checks to ensure that the amount specified matches the amount on the original order, and that the order items have not changed (excluding changes to item descriptions).
{
"token":"31b50752-0378-3346-a6bf-158c8186aae3",
"amount":152.98,
"currency":"NZD"
"items":[
{
"id":"Item-100001",
"description":"Blue Widget",
"quantity":2,
"price":74.99
},
{
"id":"SHIPPING",
"description":"Shipping",
"quantity":1,
"price":3.00
},
]
}
Response data
See the response fields and data returned by the interface and their descriptions on the right - >
Example response
{
"result":"ERROR",
"error":"Invalid payment token specified"
}
Example response - error (insufficient funds)
{
"result":"DECLINED",
"error":"The payment was declined"
}
Example response - success
{
"result":"SUCCESS",
"orderId":"c65f0ff2-b815-4267-963c-63569f06affc"
}