Orders

Orders are a crucial part of any e-commerce system. Sleekshop provides a range of endpoints to manage orders efficiently. On this page, we'll explore the different order endpoints you can use to create, retrieve, and update orders.

The order model

The order model in Sleekshop contains all the information about an order, including customer details, products, payment, and delivery information.

Properties

  • Name
    id
    Type
    integer
    Description

    Unique identifier for the order.

  • Name
    order_number
    Type
    integer
    Description

    The order number.

  • Name
    creation_date
    Type
    string
    Description

    The date and time when the order was created.

  • Name
    username
    Type
    string
    Description

    The username of the customer who placed the order.

  • Name
    order_delivery_*
    Type
    string
    Description

    Various properties for delivery details (e.g., companyname, firstname, lastname, address).

  • Name
    order_invoice_*
    Type
    string
    Description

    Various properties for invoice details (e.g., companyname, firstname, lastname, address).

  • Name
    order_email
    Type
    string
    Description

    The email address associated with the order.

  • Name
    order_phone
    Type
    string
    Description

    The phone number associated with the order.

  • Name
    order_note
    Type
    string
    Description

    Any additional notes for the order.

  • Name
    payment_method
    Type
    string
    Description

    The payment method used for the order.

  • Name
    payment_state
    Type
    object
    Description

    The current state of the payment.

  • Name
    delivery_method
    Type
    string
    Description

    The delivery method for the order.

  • Name
    delivery_state
    Type
    object
    Description

    The current state of the delivery.

  • Name
    order_state
    Type
    string
    Description

    The current state of the order.

  • Name
    cart
    Type
    object
    Description

    The cart associated with the order, including all products and their details.


POSTset_order_details

Set order details

This endpoint allows you to set or update order details for a specific session.

Required attributes

  • Name
    session
    Type
    string
    Description

    A valid session.

Optional attributes

  • Name
    id_payment_method
    Type
    integer
    Description

    A valid ID specifying the desired payment method.

  • Name
    id_delivery_method
    Type
    integer
    Description

    A valid delivery ID.

  • Name
    delivery_*
    Type
    string
    Description

    Various delivery details (e.g., companyname, firstname, lastname, address).

  • Name
    invoice_*
    Type
    string
    Description

    Various invoice details (e.g., companyname, firstname, lastname, address).

  • Name
    note
    Type
    string
    Description

    A note to be attached to the order.

  • Name
    email
    Type
    string
    Description

    A valid email for the order.

  • Name
    phone
    Type
    string
    Description

    A phone number to be attached to the order.

  • Name
    attributes
    Type
    array
    Description

    An array containing additional attributes if needed.

Request

POST
set_order_details
curl https://demo.sleekshop.net/srv/service/ \
    -d licence_username='demo_NBSqhrcrhMci15Ir9UWI' \
    -d licence_password='s9vmrbwT23B7bmjR4Vmz' \
    -d request='set_order_details' \
    -d session='SESSION' \
    -d delivery_companyname="sleekcommerce" \
    -d delivery_firstname="test123" \
    -d delivery_lastname="test456" \
    -d invoice_firstname="invoice_test" \
    -d email="test@test.de" \
    -d phone="123321" \
    -d attributes='[{"lang":"en_EN","name":"more-infos","value":"here is something important"}]'

Response

{
    "object": "order_details",
    "user": {
        "id_user": 0,
        "username": "not_specified"
    },
    "order_payment_method": {
        "id": 0,
        "name": "not_specified"
    },
    "order_delivery_method": {
        "id": 0,
        "name": "not_specified"
    },
    "order_payment_state": {
        "id": 0,
        "name": "not_specified"
    },
    "order_delivery_state": {
        "id": 0,
        "name": "not_specified"
    },
    "order_state": {
        "id": 0,
        "name": "not_specified"
    },
    "order_type": {
        "id": 0,
        "name": "not_specified"
    },
    "order_number": "",
    "username_creator": "",
    "creation_date": "",
    "username_modifier": "",
    "modification_date": "",
    "delivery_companyname": "sleekcommerce",
    "delivery_department": "",
    "delivery_salutation": "",
    "delivery_firstname": "test123",
    "delivery_lastname": "test456",
    "delivery_street": "",
    "delivery_number": "",
    "delivery_zip": "0",
    "delivery_state": "",
    "delivery_city": "",
    "delivery_country": "",
    "delivery_country_code": "",
    "invoice_companyname": "",
    "invoice_department": "",
    "invoice_salutation": "",
    "invoice_firstname": "invoice_test",
    "invoice_lastname": "",
    "invoice_street": "",
    "invoice_number": "",
    "invoice_zip": "0",
    "invoice_state": "",
    "invoice_city": "",
    "invoice_country": "",
    "invoice_country_code": "",
    "note": "",
    "email": "test@test.de",
    "phone": "123321",
    "attributes": {
        "more-infos": {
            "name": "more-infos",
            "value": "here is something important"
        }
    }
}

POSTget_order_details

Get order details

This endpoint allows you to retrieve the order details for a specific session.

Required attributes

  • Name
    session
    Type
    string
    Description

    A valid session.

Request

POST
get_order_details
curl https://demo.sleekshop.net/srv/service/ \
-d licence_username='demo_NBSqhrcrhMci15Ir9UWI' \
-d licence_password='s9vmrbwT23B7bmjR4Vmz' \
-d request='get_order_details' \
-d session='SESSION'

Response

{
    "object": "order_details",
    "user": {
        "id_user": 0,
        "username": "not_specified"
    },
    "order_payment_method": {
        "id": 0,
        "name": "not_specified"
    },
    "order_delivery_method": {
        "id": 0,
        "name": "not_specified"
    },
    "order_payment_state": {
        "id": 0,
        "name": "not_specified"
    },
    "order_delivery_state": {
        "id": 0,
        "name": "not_specified"
    },
    "order_state": {
        "id": 0,
        "name": "not_specified"
    },
    "order_type": {
        "id": 0,
        "name": "not_specified"
    },
    "order_number": "",
    "username_creator": "",
    "creation_date": "",
    "username_modifier": "",
    "modification_date": "",
    "delivery_companyname": "sleekcommerce",
    "delivery_department": "",
    "delivery_salutation": "",
    "delivery_firstname": "test123",
    "delivery_lastname": "test456",
    "delivery_street": "",
    "delivery_number": "",
    "delivery_zip": "0",
    "delivery_state": "",
    "delivery_city": "",
    "delivery_country": "",
    "delivery_country_code": "",
    "invoice_companyname": "",
    "invoice_department": "",
    "invoice_salutation": "",
    "invoice_firstname": "invoice_test",
    "invoice_lastname": "",
    "invoice_street": "",
    "invoice_number": "",
    "invoice_zip": "0",
    "invoice_state": "",
    "invoice_city": "",
    "invoice_country": "",
    "invoice_country_code": "",
    "note": "",
    "email": "test@test.de",
    "phone": "123321",
    "attributes": {
        "more-infos": {
            "name": "more-infos",
            "value": "here is something important"
        }
    }
}

POSTget_order_by_id

Get order by ID

This endpoint allows you to retrieve the order details for a specific order ID.

Required attributes

  • Name
    id_order
    Type
    integer
    Description

    A valid order ID.

  • Name
    language
    Type
    string
    Description

    A valid language code.

Request

POST
get_order_by_id
curl https://demo.sleekshop.net/srv/service/ \
-d licence_username='demo_NBSqhrcrhMci15Ir9UWI' \
-d licence_password='s9vmrbwT23B7bmjR4Vmz' \
-d request='get_order_by_id' \
-d id_order=1 \
-d language='de_DE'

Response

{
    "object": "order",
    "id": 142,
    "order_number": 10247,
    "creation_date": "2022-09-18 19:41:54",
    "username": "guest",
    "order_delivery_companyname": "",
    "order_delivery_department": "",
    "order_delivery_salutation": "mr",
    "order_delivery_firstname": "k",
    "order_delivery_lastname": "r",
    "order_delivery_street": "max-brauer-allee",
    "order_delivery_number": "218",
    "order_delivery_zip": "22769",
    "order_delivery_state": "hamburg",
    "order_delivery_city": "hamburg",
    "order_delivery_country": "Germany",
    "order_delivery_country_code": "DE",
    "order_invoice_companyname": "",
    "order_invoice_department": "",
    "order_invoice_salutation": "MR",
    "order_invoice_firstname": "k",
    "order_invoice_lastname": "r",
    "order_invoice_street": "max-brauer-allee",
    "order_invoice_number": "218",
    "order_invoice_zip": "22769",
    "order_invoice_state": "",
    "order_invoice_city": "hamburg",
    "order_invoice_country": "Germany",
    "order_invoice_country_code": "DE",
    "order_email": "test123@test123.com",
    "order_phone": "",
    "order_note": "",
    "payment_method": "PayPal",
    "payment_state": {
        "name": "PAYMENT_NOT_RECEIVED",
        "label": "Payment not received"
    },
    "delivery_method": "Shipping",
    "delivery_state": {
        "name": "PROCESSING",
        "label": "Processing"
    },
    "order_state": "OPEN",
    "attributes": {
        "sys_success_url": {
            "name": "sys_success_url",
            "value": "here-we-go.com"
        },
        "sys_cancel_url": {
            "name": "sys_cancel_url",
            "value": "error-page.com"
        }
    },
    "cart": {
        "creation_date": "2022-09-18 19:41:34",
        "sum": 123,
        "contents": [
            {
                "type": "PRODUCT",
                "id": 465,
                "id_product": 537,
                "element_number": "117.1",
                "quantity": 1,
                "price": 123,
                "sum_price": 123,
                "tax": 19.6387,
                "sum_tax": 19.6387,
                "name": "tew",
                "description": "asd",
                "attributes": {
                    // Product attributes...
                }
            }
        ],
        "coupons": {
            "sum": 0,
            "positions": []
        },
        "delivery_costs": {
            "sum": 0,
            "positions": []
        }
    },
    "parcels": []
}

POSTupdate_order_details

Update order details

This endpoint allows you to update the details of an existing order.

Required attributes

  • Name
    id_order
    Type
    integer
    Description

    The ID of the order you want to update.

Optional attributes

  • Name
    id_payment_method
    Type
    integer
    Description

    A valid ID specifying the desired payment method.

  • Name
    id_delivery_method
    Type
    integer
    Description

    A valid delivery ID.

  • Name
    order_state
    Type
    string
    Description

    A valid order state. Options: OPEN, PROCESSING, CLOSED, CANCELED.

  • Name
    order_payment_state
    Type
    string
    Description

    The payment state. Options: PAYMENT_NOT_RECEIVED, PAYMENT_RECEIVED.

  • Name
    order_delivery_state
    Type
    string
    Description

    The delivery state. Options: PROCESSING, CLOSED.

  • Name
    delivery_*
    Type
    string
    Description

    Various delivery details (e.g., companyname, firstname, lastname, address).

  • Name
    invoice_*
    Type
    string
    Description

    Various invoice details (e.g., companyname, firstname, lastname, address).

  • Name
    note
    Type
    string
    Description

    A note to be attached to the order.

  • Name
    email
    Type
    string
    Description

    A valid email for the order.

  • Name
    phone
    Type
    string
    Description

    A phone number to be attached to the order.

  • Name
    attributes
    Type
    array
    Description

    An array containing additional attributes if needed.

Request

POST
update_order_details
curl https://demo.sleekshop.net/srv/service/ \
    -d licence_username='demo_NBSqhrcrhMci15Ir9UWI' \
    -d licence_password='s9vmrbwT23B7bmjR4Vmz' \
    -d licence_secret_key='' \
    -d request='update_order_details' \
    -d id_order=1 \
    -d delivery_companyname="sleekcommerce" \
    -d delivery_firstname="test123" \
    -d delivery_lastname="test456" \
    -d invoice_firstname="invoice_test" \
    -d email="test@test.de" \
    -d phone="123321" \
    -d attributes='[{"lang":"en_EN","name":"more-infos","value":"here is something important"}]'

Response

{
    "object": "update_order_details",
    "status": "success"
}

POSTcheckout

Checkout

This endpoint allows you to finalize an order, making it permanent.

Required attributes

  • Name
    session
    Type
    string
    Description

    A valid session with an order.

Request

POST
checkout
curl https://demo.sleekshop.net/srv/service/ \
    -d licence_username='demo_NBSqhrcrhMci15Ir9UWI' \
    -d licence_password='s9vmrbwT23B7bmjR4Vmz' \
    -d request='checkout' \
    -d session='SESSION'

Response

{
    "object": "checkout",
    "status": "success",
    "id_order": 65,
    "session": "",
    "message": "",
    "param": ""
}

POSTget_invoice

Get invoice

This endpoint allows you to retrieve the invoice for a specified order. The invoice is returned as a base64 encoded string, which needs to be decoded on the frontend.

Required attributes

  • Name
    id_order
    Type
    integer
    Description

    A valid order ID.

Optional attributes

  • Name
    args
    Type
    object
    Description

    An object containing individual attributes for replacements in the form.

Request

POST
get_invoice
curl https://demo.sleekshop.net/srv/service/ \
    -d licence_username='demo_NBSqhrcrhMci15Ir9UWI' \
    -d licence_password='s9vmrbwT23B7bmjR4Vmz' \
    -d request='get_invoice' \
    -d id_order=10

Response

{
    "object": "invoice",
    "invoice": "" // Base64 encoded invoice content will be here
}

POSTget_order_confirmation

Get order confirmation

This endpoint allows you to retrieve the order confirmation for a specified order. The confirmation is returned as a base64 encoded string, which needs to be decoded on the frontend.

Required attributes

  • Name
    id_order
    Type
    integer
    Description

    A valid order ID.

Optional attributes

  • Name
    args
    Type
    object
    Description

    An object containing individual attributes for replacements in the form.

Request

POST
get_order_confirmation
curl https://demo.sleekshop.net/srv/service/ \
    -d licence_username='demo_NBSqhrcrhMci15Ir9UWI' \
    -d licence_password='s9vmrbwT23B7bmjR4Vmz' \
    -d request='get_order_confirmation' \
    -d id_order=10 \
    -d args='{"invoice_link":"www.your-link"}'

Response

{
    "object": "order_confirmation",
    "order_confirmation": "" // Base64 encoded order confirmation content will be here
}

POSTget_delivery_countries

Get delivery countries

This endpoint allows you to retrieve all activated delivery countries.

Required attributes

  • Name
    licence_username
    Type
    string
    Description

    Your licence username.

  • Name
    licence_password
    Type
    string
    Description

    Your licence password.

Request

POST
get_delivery_countries
curl https://demo.sleekshop.net/srv/service/ \
    -d licence_username='demo_NBSqhrcrhMci15Ir9UWI' \
    -d licence_password='s9vmrbwT23B7bmjR4Vmz' \
    -d request='get_delivery_countries'

Response

{
    "object": "get_delivery_countries",
    "countries": [
        {
            "id": 1,
            "name": "AFGHANISTAN",
            "iso": "AF",
            "printable_name": "Afghanistan"
        },
    // More countries...
    ]
}

Was this page helpful?