Partner API Documentation Help

Create new partner order

Authentication

This method requires authentication.

Summary

Create Order

Description

This method creates an order based on the provided details which include the customer's details, payment method, date, and time slot for the work, address details, and some additional partner details.

Steps to create a new customer's order:

  1. You have to get customer's first name, last name, address and phone number.

  2. You have to compose object Partner details object using data from your profile and Get item list.

  3. You have to compose object Datetime object using data from Get free master slots and wishes of customer.

  4. You have to set field payment_method to "stripe" if customer wants to pay by credit card or to "cash" if he wants to pay by cash.

  5. You have to Upload image of store receipt to the Service and pass result id to the image_uuids field.

  6. Having all this you can send POST request to this endpoint.

Body Parameters

customer   payment_methodstringdatetime   address   image_uuids   partner_details   phone_numberstringfirst_namestringlast_namestring   dateYYYY-MM-DD stringtimeslotstringaddressstringcoordinates   detailsstringzipstringlatdoublelondoublestringstringstore_idstringitems   instockbooleandelivery_typestring      idintegercountintegerdeliverybooleanassemblybooleanidstringcountintegerdeliverybooleanassemblyboolean

name

type

data type

default

description

customer

required

object customer

N/A

customer info

address

optional

object address

N/A

delivery/assembly address

partner_details

required

object of details

N/A

delivery type

datetime

required

array of datetime

N/A

datetime that customer prefers

payment_method

required

string [stripe, cash]

N/A

payment method

image_uuids

required

array of strings

N/A

array of uploaded images linked to this order

Customer object

See more: Customer

name

type

data type

default

description

phone_number

required

string

N/A

mobile phone number of customer

first_name

required

string

N/A

first name of customer

last_name

required

string

N/A

last name of customer

Datetime object

See more: Datetime

name

type

data type

default

description

date

required

string (YYYY-MM-DD)

N/A

date of work

timeslot

required

string [0712, 1217, 1721]

N/A

timeslot to work

Address object

See more: Address

name

type

data type

default

description

address

required

string

N/A

string representing the address

coordinates

required

{ lat: double, lon: double }

N/A

object containing coordinates of point

details

required

string

N/A

string providing detailed information about the address

zip

required

string

N/A

string representing the post code of the address

Partner details object

name

type

data type

default

description

store_id

required

string

N/A

store id (see store ids)

items

required

array of item

N/A

items (see Get item list)

instock

required

boolean

N/A

flag if all items are in stock

delivery_type

required

string [to_pavement, to_door_by_lift, to_door_by_stairs]

to_pavement

delivery type

Item object

See more: Get item list, Find items by name

name

type

data type

default

description

id

required

integer

N/A

item id (see Get item list)

count

required

integer

N/A

count of items

delivery

required

boolean

false

flag if delivery is needed for this item

assembly

required

boolean

false

flag if assembly is needed for thi item

Response

The response data is an object with the following properties:

_id: integer

Unique id of order

title: string

Title of order (sets on creation)

_status: string

Current status of order (see Statuses)

_substatus: string

Current substatus of order (see Substatuses)

partner: string

Partner name for whom this order was created

partner_details: object

This property contains additional details about the order:

  • instock: boolean. Flag showing if all order items are in stock

  • store_id: string. Store id

  • store_title: string. Store title

Good Response example

{ "status": "ok", "statusCode": 200, "data": { "_id": 0, "title": "your-order-title", "_status": "order-status", "_substatus": "order-substatus", "partner": "partner-name", "partner_details": { "instock": true, "store_id": "your-store-id", "store_title": "your-store-title" }, "created_at": "2024-01-22T13:31:07.908Z" } }

Bad Responses Examples

http code

response example

401

see 401 Unauthorized

422

see 422 ValidationError

Last modified: 09 February 2024