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.

Example Request

{
	"amount": 152.98,
	"currency": "NZD",
	"returnUrl": "https://www.merchantsite.com/confirm-payment?i=7437377",
	"merchantReference": "REF-ORD10001",
  "tax":15.9
	"customer": {
		"firstName": "Jenny",
		"lastName": "Smith",
		"email": "[email protected]",
		"phone": "021000000"
	},
	"billingAddress": {
		"address1": "123 Crown Street",
		"city": "Auckland",
		"postcode": "1010",
		"country": "New Zealand"
	},
	"shippingAddress": {
		"name": "Timmy Smith",
		"address1": "Level 4, Goodsmiths Building",
		"address2": "123 Crown Street",
		"suburb": "Redvale",
		"city": "Auckland",
		"postcode": "1010",
		"country": "New Zealand",
		"phone": "097654321"
	},
	"items": [
		{
			"id": "Item-100001",
			"description": "Blue Widget",
			"quantity": 2,
			"price": 74.99
		},
		{
			"id": "SHIPPING",
			"description": "Shipping",
			"quantity": 1,
			"price": 5.00
		}
	]
}

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": "56e4d02d-f024-3cae-b989-26e3e72e1051",
  "paymentUrl": "https://sandbox-payment.laybuy.com/pay/56e4d02d-f024-3cae-b989-26e3e72e1051"
}
Language
Credentials
Basic
base64
:
Click Try It! to start a request and see the response here!