Create Order
This page will provide the description for each individual fields
post
https://api.qa.optty.com
/orders/
Placing an Order
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 | |
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. |
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.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.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 |
Sample Request
{
"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":"[email protected]",
"phoneNumber":"(415) 200-0000"
},
"billingAddress":{
"firstName":"Your FirstName",
"lastName":"Your LastName",
"email":"[email protected]",
"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":"[email protected]",
"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",
}
Last modified 1mo ago