Create a new order

Create a new order entry

Request

UAT URL

POST https://api-uat.staging.nexway.build/connect/order/new

Production URL

POST https://api.nexway.store/connect/order/new

Request headers

Parameter name Value Description Additional
secret string

Access secret

Required

Request body

The request body takes a complete CreateOrderRequest resource, containing the following writable properties:

{
    "affiliateId": "int32",
    "currency": "string",
    "customer": {
        "email": "string",
        "ipV4": "string",
        "ipV6": "string",
        "language": "string",
        "locationDelivery": {
            "address1": "string",
            "address2": "string",
            "city": "string",
            "companyName": "string",
            "country": "string",
            "fax": "string",
            "firstName": "string",
            "lastName": "string",
            "phone": "string",
            "province": "string",
            "title": "int32",
            "zipCode": "string"
        },
        "locationInvoice": {
            "address1": "string",
            "address2": "string",
            "city": "string",
            "companyName": "string",
            "country": "string",
            "fax": "string",
            "firstName": "string",
            "lastName": "string",
            "phone": "string",
            "province": "string",
            "title": "int32",
            "zipCode": "string"
        },
        "partnerId": "string"
    },
    "discounts": [
        {
            "foreignRef": "string",
            "label": "string",
            "operation": "string",
            "operationValue": "float",
            "priceDelta": "float"
        }
    ],
    "marketingProgramId": "string",
    "metadata": [
        {
            "key": "string",
            "value": "string"
        }
    ],
    "orderDate": "string",
    "orderLines": [
        {
            "amountDutyFree": "float",
            "amountTotal": "float",
            "discounts": [
                {
                    "foreignRef": "string",
                    "label": "string",
                    "operation": "string",
                    "operationValue": "float",
                    "priceDelta": "float"
                }
            ],
            "endUserEmail": "string",
            "productRef": "string",
            "quantity": "int32",
            "vatRate": "float"
        }
    ],
    "partnerOrderNumber": "string",
    "payment": {
        "paymentMethod": "string",
        "transactionId": "string"
    }
}

Properties

Name Type Description Additional
affiliateId int32

The ID of the affiliate partner

Optional
currency string

The currency used for the transaction, must respect the ISO 4217 format. Example: EUR

customer object

Contains information about the customer

customer.email string

Email address of the customer

customer.ipV4 string

IPv4 address of the customer

Optional
customer.ipV6 string

IPv6 address of the customer

Optional
customer.language string

Language of the customer, must respect the ISO 639_ISO 3166 format. Example: fr_FR

customer.locationDelivery object

The information about customer's locations

customer.locationDelivery.address1 string

The address of the customer

customer.locationDelivery.address2 string

The complement of the address of the customer

Optional
customer.locationDelivery.city string

The city of the customer

customer.locationDelivery.companyName string

In case the customer wish the order to be delivered at his work place

Optional
customer.locationDelivery.country string

The country of the customer

customer.locationDelivery.fax string

The fax of the customer

customer.locationDelivery.firstName string

The first name of the customer

customer.locationDelivery.lastName string

The last name of the customer

customer.locationDelivery.phone string

The phone of the customer

customer.locationDelivery.province string

The province (format ISO 3166-2) - can be required in the invoice node if the customer lives in the US, CA, BR or AU (USA, Canada, Brazil or Australia)

Optional
customer.locationDelivery.title int32

The title of the customer, 0: Unknown; 1: Mr; 2: Mrs; 3: Ms

customer.locationDelivery.zipCode string

The zip code of the customer

customer.locationInvoice object

The information about customer's locations

customer.locationInvoice.address1 string

The address of the customer

customer.locationInvoice.address2 string

The complement of the address of the customer

Optional
customer.locationInvoice.city string

The city of the customer

customer.locationInvoice.companyName string

In case the customer wish the order to be delivered at his work place

Optional
customer.locationInvoice.country string

The country of the customer

customer.locationInvoice.fax string

The fax of the customer

customer.locationInvoice.firstName string

The first name of the customer

customer.locationInvoice.lastName string

The last name of the customer

customer.locationInvoice.phone string

The phone of the customer

customer.locationInvoice.province string

The province (format ISO 3166-2) - can be required in the invoice node if the customer lives in the US, CA, BR or AU (USA, Canada, Brazil or Australia)

Optional
customer.locationInvoice.title int32

The title of the customer, 0: Unknown; 1: Mr; 2: Mrs; 3: Ms

customer.locationInvoice.zipCode string

The zip code of the customer

customer.partnerId string

Unique ID of the customer

discounts[] array

Allows to set one or many discounts

Optional
discounts[].foreignRef string

The reference of the discount in your system

discounts[].label string

The label of the discount

discounts[].operation string

The type of discount (Amount/Percents). Example: Percents

discounts[].operationValue float

The value of the discount

discounts[].priceDelta float

The real amount of the discount

marketingProgramId string

Allows the marketing department to find the order

metadata[] array

Allows to set various type of data

Optional
metadata[].key string

The name of the data

metadata[].value string

The value of the data

orderDate string

The date of the order, must respect the ISO 8601 format. Example: 2004-02-12T15:19:21+00:00

orderLines[] array

The details of products in the order

orderLines[].amountDutyFree float

The cost of product tax free

orderLines[].amountTotal float

The amount total = amountDutyFree * quantity + ((amountDutyFree * quantity) * (vatRate/100))

orderLines[].discounts[] array

Allows to set a discount attached to an order line

Optional
orderLines[].discounts[].foreignRef string

The reference of the discount in your system

orderLines[].discounts[].label string

The label of the discount

orderLines[].discounts[].operation string

The type of discount (Amount/Percents). Example: Percents

orderLines[].discounts[].operationValue float

The value of the discount

orderLines[].discounts[].priceDelta float

The real amount of the discount

orderLines[].endUserEmail string

The email of the person who really made the order

Optional
orderLines[].productRef string

The ID of the product

orderLines[].quantity int32

The number of product bought

orderLines[].vatRate float

The rate of VAT

partnerOrderNumber string

Your unique order number

payment object

Contains payment information.

Optional
payment.paymentMethod string

The method used for the payment. Default value: External Payment

payment.transactionId string

The ID of the transaction - required if paymentMethod is not 'External Payment'

Optional

Authorisation

This request requires the use of one of following authorisation methods: OAuth2.

Response

The following HTTP status codes may be returned, optionally with a response resource.

Status code Description Resource
201 Created

Success

CreateOrderResponse
401 Unauthorized

Unauthorized

403 Forbidden

Forbidden

404 Not Found

Not Found

500 Internal Server Error

Failure

Example

{
    "affiliateId": 123,
    "currency": "EUR",
    "customer": {
        "email": "XXXXX@XX",
        "ipV4": "127.0.0.1",
        "ipV6": "2001:0db8:0000:85a3:0000:0000:ac1f:8001",
        "language": "fr_FR",
        "locationDelivery": {
            "address1": "XXXXXXXXXX",
            "address2": "XXXXXXXXXX",
            "city": "XXXXXXXXXX",
            "companyName": "XXXXXXXXXX",
            "country": "XXXXXXXXXX",
            "fax": "XXXXXXXXXX",
            "firstName": "XXXXXXXXXX",
            "lastName": "XXXXXXXXXX",
            "phone": "XXXXXXXXXX",
            "province": "XXXXXXXXXX",
            "title": "Mr",
            "zipCode": "XXXXXXXXXX"
        },
        "locationInvoice": {
            "address1": "XXXXXXXXXX",
            "address2": "XXXXXXXXXX",
            "city": "XXXXXXXXXX",
            "companyName": "XXXXXXXXXX",
            "country": "XXXXXXXXXX",
            "fax": "XXXXXXXXXX",
            "firstName": "XXXXXXXXXX",
            "lastName": "XXXXXXXXXX",
            "phone": "XXXXXXXXXX",
            "province": "XXXXXXXXXX",
            "title": "Mr",
            "zipCode": "XXXXXXXXXX"
        },
        "partnerId": "XXXXXXX"
    },
    "marketingProgramId": "XXXXXXXXXXXXX",
    "orderDate": "2004-02-12T15:19:21+00:00",
    "partnerOrderNumber": "XXXXXXXXXXXXX",
    "payment": {
        "paymentMethod": "XXXXXXX",
        "transactionId": "1009"
    }
}

Explore this API

order

order

Request Content-Type
secret

Access secret

Response Content-Type

Choose an authorisation method:

Access Token Access token to be used for request
Try it out!