Create Order

This page will provide the description for each individual fields

See also the Order response object.

Placing an Order

POST https://api.qa.optty.com/orders/

Placing an Order

POST https://api.qa.optty.com/orders/

For live environment please use https://api.optty.com

Headers

Name
Type
Description

Authentication*

string

Authorization: Bearer <token>

{
    "orderId": "LP000429e48ec-f6e3-49d2-bd38-8e1408d025c8",
    "orderToken": "5d47c4a0-9bfc-406d-9da1-bbc61202c722",
    "redirectUrl": "https://app.uat.latitudepay.com/r/NVXIFQBC",
    "bnplProvider": "LATITUDEPAY_AU",
    "orderReference": "LP000429e48ec-f6e3-49d2-bd38-8e1408d025c8",
    "orderAmount": 144.89,
    "orderPaymentOption": "buy now pay later",
    "orderDate": "2021-10-07T14:30:36.166Z",
    "paymentStatus": "pending",
    "transactionReference": "40ca337c3b"
}

Headers

Name
Type
Description

Authentication*

string

COv8JBe4ooYw

Parameters

Content Type: application/json

Field

Type

Description

orderReference

required

string

A unique order reference.

bnplProvider

required

enum

enum The Payment Method provider to place the order against.

eg:

KLARNA_US

LATITUDEPAY_AU

KLARNA_AU

OPENPAY_UK

purchaseCountry

required

string

The country code the purchase is originating from, in

eg: (US, AU, SG)

purchaseCurrency

required

string

The country currency the purchase is being made in, using ISO 4217 format.

eg: (USD, AUD, SGD)

locale

required

string

The country locale in RFC 1766 standard.

eg: (en_US)

orderAmount

required

number

The order amount, including tax, shipping and discount.

eg: 14.99

orderItems

required

Array of objects

Header A list of order items.

orderItems.name

required

string

The name of the order item.

eg: "Optty T-Shirt"

orderItems.quantity

required

number

The quantity of the order item. Must be an integer.

eg: 1

orderItems.sku

required

number

The SKU (product code) of the order item.

eg: "69309284M-1"

orderItems.unitPrice

required

number

The price per unit.

eg: 9.99

orderItems.totalAmount

required

number

The total cost of the item eg: 9.99.

orderItems.type

optional

string

The type of item e.g Flights.

orderItems.departureDate

optional

string

The departure date for items of type flight

orderItems.flightNumber optional

string

The flight number for items of type flight

orderItems.origin optional

string

The origin for items of type flight.

orderItems.destination optional

string

The destination for items of type flight.

orderItems.title optional

string

The title for the order item.

orderItems.unitAmount optional

number

Amount on unit.

orderItems.unitTaxAmount optional

number

Tax on unit.

orderItems.unitDiscountAmount optional

number

Discount on unit.

taxAmount

required

number

The tax amount for the order, pass 0 if don't have any.

eg: 3.00

shippingAmount

required

number

The shipping amount for the order, pass 0 if don't have any.

eg: 5.00

discountAmount

required

number

The discount amount for the order pass 0 if don't have any.

eg: 3.00

customer

required

object

The customer placing the order. All sub-fields are required.

customer.firstName

required

string

The customer’s first name.

customer.lastName

required

string

The customer’s last name.

customer.email

required

string

The customer email.

customer.phoneNumber

required

string

The customer’s phone number.

billingAddress

required

object

Header Customer's billing address

billingAddress.title

optional

string

The customer title

billingAddress.firstName

required

string

The customer’s first name.

billingAddress.lastName

required

string

The customer last name.

billingAddress.email

required

string

The customer email.

billingAddress.phoneNumber

required

string

The customer phone number.

billingAddress.streetAddress

required

string

The customer billing address line 1

billingAddress.streetAddress2

required

string

The customer billing address line 2

billingAddress.city

required

string

The customer billing address city

billingAddress.country

required

string

The customer billing address country. In ISO 3166 format

billingAddress.state

required

string

The customer billing address state

eg: "NSW", Send Country Code if do not have a state

billingAddress.region

required

string

eg: "Oceania" , Send country name if do not have a region.

billingAddress.postalCode

required

string

The customer billing address postal code

eg: "2000"

shippingAddress

conditional

object

Customer's shipping address

required for Klarna, AfterPay

*Recommend sending shipping fields, with most Payment Providers. It might help with the approval rate.

shippingAddress.title optional

string

Recipient title.

shippingAddress.firstName

conditional

string

Recipient’s first name

shippingAddress.lastName

conditional

string

Recipient’s last name

shippingAddress.email

conditional

string

Recipient's email

shippingAddress.phoneNumber

conditional

string

Recipient's phone number

shippingAddress.streetAddress

conditional

string

The customer shipping address line 1

shippingAddress.streetAddress2

conditional

string

The customer shipping address line 2

shippingAddress.city

conditional

string

The customer shipping city

shippingAddress.state

conditional

string

The customer shipping address state

eg: "NSW", Send Country Code if do not have a state

shippingAddress.country

conditional

string

The customer shipping address country. In ISO 3166 format

shippingAddress.region

conditional

string

eg: "Oceania" , Send country name if do not have a region.

shippingAddress.postalCode

conditional

string

The customer shipping address postal code

eg: "2000"

shippingType

conditional

string

The shipping type for this order

eg: "normal", "express"

shippingMethod

conditional

enum

The shipping method for this order

[delivery, store, digital, pickup] delivery - normal shipping digital - intangible that not required shipping store - pick up in store (should be store address) pickup - any pick up location

dynamicRedirectUrl optional

string

Redirect url to once a payment is completed

dynamicCallbackUrl optional

string

Callback url once payment is completed

sessionId

optional

string

The session ID of the payment.

customerToken

optional

string

cancellationTimeout optional

number

The cancellation timeout for the order.

autoCapture optional

boolean

Determine if payment should be auto captured or not

Full Example

{
   "bnplProvider":"LATITUDEPAY_AU",
   "locale":"en_AU",
   "customerToken":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjdXN0b21lcklkZW50aWZpZXIiOiI5OWIwODI1MDA4OTUxMDNjMmNjNTNiZmNhMGVlZTNjOTdjMjE2MGM4ZGFhMGM0MmQ4NmI3M2M4NWU5NjA0NTE5ZGEzMDI4MWE3MjlhYzYwMWZjYzMyZDc4ZTdjZmQ1NmJkMjllNjIwZTI2YWU0ZTYzYTRjZTVlOTc2NWE2ZjA3NCIsIm1lcmNoYW50SWQiOiJkNmJiZmQ5Zi02OWZhLTQ3MjgtOTU0YS04MWU0NWI4YWFkMmQiLCJpYXQiOjE2MDE2NjAwMTUsImV4cCI6MTYwMTY2MzYxNX0.Y0UKdtSNPVnJlLN3Xv53Y1_o2AbLPhjxJ1P5O0DSpnE",
   "orderReference":"LP000_OrderID",
   "orderAmount":144.89,
   "taxAmount":6.9,
   "shippingAmount":7.99,
   "discountAmount":0,
   "purchaseCountry":"AU",
   "purchaseCurrency":"AUD",
   "orderItems":[
      {
         "name":"Optty Striped Dress Shirt",
         "quantity":1,
         "sku":"69309284M-1",
         "unitPrice":130,
         "totalAmount":130
      }
   ],
   "customer":{
      "firstName":"Your FirstName",
      "lastName":"Your LastName",
      "email":"test@test.test",
      "phoneNumber":"(415) 200-0000"
   },
   "billingAddress":{
      "firstName":"Your FirstName",
      "lastName":"Your LastName",
      "email":"test@test.test",
      "phoneNumber":"(415) 200-0000",
      "streetAddress":"Your Address",
      "streetAddress2":"Your Address2",
      "city":"Sydney",
      "country":"AU",
      "region":"Oceanian",
      "postalCode":"2000",
      "state": "NSW"
   }
   "shippingAddress":{
      "firstName":"Your FirstName",
      "lastName":"Your LastName",
      "email":"test@test.test",
      "phoneNumber":"(415) 200-0000",
      "streetAddress":"Your Address",
      "streetAddress2":"Your Address2",
      "city":"Sydney",
      "country":"AU",
      "region":"Oceanian",
      "postalCode":"2000",
      "state": "NSW"
   }
   "shippingType": "normal",
   "shippingMethod": "store pick-up",
   "dynamicRedirectUrl": "YOUR_URL",
   "dynamicCallbackUrl": "YOUR_URL",
   "cancellationTimeout": 2880
}

Last updated