/order/create

Overview

This method allows merchants to define a Laybuy order and create a new payment process.
If successful, the merchant should store the token within their system and redirect the customer to the payment URL provided in the response in order to initiate the payment interface.
When a new order is created, any active orders for the same customer (based on the email address) for the merchant will be cancelled. Any further interactions with any cancelled order will result in an error.
If the customer`s order changes on the merchant site after the Laybuy order is created, the merchant should restart the process by creating a new order.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…

Example Request (Typical)

{
	"amount": 156.90,
	"currency": "NZD",
	"merchantReference": "17125026",
	"origin": "ABCPOS",
	"originData": {
		"branch": "Redvale",
		"callbackUrl": "https://abcretail.com/order/17125026"
	},
	"customer": {
		"phone": "0219876543"
	}
}

Response Data

See the response fields and data returned by the interface and their descriptions on the right - >

Example response - Error

{
	"result": "ERROR",
	"error": "Amount is below the minimum"
}

Example response - Success

{
	"result": "SUCCESS",
	"token": "frOilqUU0DboUCiyRtnzH1VdBXnrj7kD39NWhgsD",
	"paymentUrl": "https://payment.laybuy.com/pay/frOilqUU0DboUCiyRtnzH1VdBXnrj7kD39NWhgsD"
}

Cancel order

OVERVIEW

This method allows merchants to explicitly cancel the payment process for an unconfirmed Laybuy order.

END POINT

Body Params
number
required

The total for the customer to pay. This amount is validated against the sum of the amounts in the items attribute.

string

The currency of the amount. If not specified, the currency of the merchant is used.

string
required

The merchant's unique reference for the order.

number
required

The amount of tax contained within amount.

string
enum
required

The origin code for the order. For use with in-store retail systems. This value will be provided by Labuy by prior arrangement. Needs to be POS

Allowed:
originData
object
required

A JSON-encoded object containing any parameters to be passed alongside the origin. For use with in-store retail systems. The requirements for this data vary by origin.

customer
object
required

Container for the customer details.

billingAddress
object

Container for the billing address.

shippingAddress
object

Container for the shipping address.

items
array of objects

Container for the items.

items
Response

Language
Credentials
Basic
base64
:
URL
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json