Ziwako Docs
ZiwakoRéférence APIBookings

Create Booking

POST
/bookings

Authorization

X-API-Key<token>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/bookings" \  -H "Content-Type: application/json" \  -d '{    "product": "string",    "startDate": "2019-08-24T14:15:22Z",    "owner": "string",    "proProfil": "string"  }'
{  "type": "success",  "code": "string",  "status": 0,  "message": "string",  "data": {    "id": "string",    "product": {      "_id": "string",      "name": "string",      "description": "string",      "pictures": [        {          "Key": "string",          "Bucket": "string",          "Location": "string",          "public": "string"        }      ],      "attributes": {        "specifications": {},        "pricing": {          "amount": 29.99,          "currency": "USD",          "pricingType": "buy",          "frequency": "monthly",          "promotion": 10,          "negotiable": false        },        "attachedServices": [          null        ],        "condition": "new",        "conditionDetails": "string",        "warranty": {          "hasWarranty": true,          "duration": 1,          "durationType": "days",          "description": "string",          "terms": "string",          "type": "seller"        },        "stock": {          "available": 0,          "sku": "string",          "location": "string"        },        "shipping": {          "weightKg": 0,          "dimensions": {            "length": 0,            "width": 0,            "height": 0          },          "isDeliveryFree": false        },        "legal": {          "ageRestriction": 0,          "certifications": [            "string"          ]        },        "booking": {          "allowInstallments": true,          "maxInstallments": 0        }      },      "metadata": {        "isArchived": false,        "archivedAt": "2019-08-24T14:15:22Z"      },      "owner": "string",      "createdAt": "2019-08-24T14:15:22Z",      "updatedAt": "2019-08-24T14:15:22Z"    },    "pricing": {      "amount": 29.99,      "currency": "USD",      "pricingType": "buy",      "frequency": "monthly",      "promotion": 10,      "negotiable": false    },    "startDate": "2019-08-24T14:15:22Z",    "endDate": "2019-08-24T14:15:22Z",    "owner": "string",    "proProfil": "string",    "status": "pending",    "paymentStatus": "unpaid",    "paymentMethod": "wallet",    "paymentMethodAllowed": [      "wallet"    ],    "createdAt": "2019-08-24T14:15:22Z",    "updatedAt": "2019-08-24T14:15:22Z",    "paidAmount": 0,    "installments": [      {        "_id": "string",        "label": "string",        "amount": 0,        "dueDate": "2019-08-24T14:15:22Z",        "status": "pending",        "paidAt": "2019-08-24T14:15:22Z",        "paymentId": "string"      }    ],    "installmentsAllowed": true,    "paymentLink": {      "token": "string",      "url": "string",      "createdAt": "2019-08-24T14:15:22Z",      "expiresAt": "2019-08-24T14:15:22Z",      "usedAt": "2019-08-24T14:15:22Z"    },    "accesses": [      {        "_id": "string",        "targetType": "Profil",        "target": "string",        "role": "viewer",        "grantedBy": "string",        "grantedAt": "2019-08-24T14:15:22Z",        "revokedAt": "2019-08-24T14:15:22Z",        "status": "active"      }    ],    "priceAdjustments": [      {        "previousAmount": 0,        "newAmount": 0,        "by": "string",        "at": "2019-08-24T14:15:22Z",        "reason": "string"      }    ],    "bookingNumber": "string",    "referredBy": "string"  }}