curl --location --request POST 'https://api.ticaret.pro/wa/chats//messages//ai-actions/create-order?providerSessionId' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data-raw '{
"customerId": "string",
"contactId": "string",
"items": [
{
"productId": "string",
"quantity": 0,
"variantNote": "string",
"metadata": {}
}
],
"shipping": {},
"payment": {},
"notes": "string",
"tags": [
"string"
],
"metadata": {},
"allowDuplicate": false
}'{
"status": true,
"data": {
"order": {
"id": "string",
"accountId": "string",
"orderNo": "string",
"customerId": "string",
"contactId": "string",
"customer": {
"id": "string",
"title": "string",
"shortName": "string",
"status": "string"
},
"contact": {
"id": "string",
"displayName": "string",
"email": "string",
"phone": "string",
"status": "string"
},
"status": "draft",
"paymentStatus": "unpaid",
"fulfillmentStatus": "unfulfilled",
"source": {
"channel": "manual",
"sourceType": "string",
"sourceId": "string",
"threadId": "string",
"messageId": "string",
"externalThreadId": "string",
"externalMessageId": "string",
"label": "string",
"metadata": {}
},
"items": [
{
"id": "string",
"productId": "string",
"sku": "string",
"name": "string",
"unitPrice": 0,
"currency": "string",
"quantity": 0,
"discountAmount": 0,
"taxRate": 0,
"taxAmount": 0,
"lineSubtotal": 0,
"lineTotal": 0,
"productSnapshot": {},
"metadata": {}
}
],
"subtotal": 0,
"discountTotal": 0,
"taxTotal": 0,
"shippingTotal": 0,
"grandTotal": 0,
"currency": "string",
"payment": {},
"shipping": {},
"notes": "string",
"tags": [
"string"
],
"metadata": {},
"createdAt": "2019-08-24T14:15:22.123Z",
"updatedAt": "2019-08-24T14:15:22.123Z",
"entityVersion": "2019-08-24T14:15:22.123Z"
},
"analysis": {
"id": "string",
"accountId": "string",
"providerSessionId": "string",
"remoteJid": "string",
"messageId": "string",
"provider": "openai",
"model": "string",
"status": "pending",
"sourceType": "text",
"trigger": "auto",
"intent": "string",
"action": "string",
"priority": "string",
"sentiment": "string",
"summary": "string",
"suggestedReply": "string",
"confidence": 0,
"entities": {
"productName": "string",
"color": "string",
"size": "string",
"amount": "string",
"date": "string"
},
"visualDescription": "string",
"warnings": [
"string"
],
"result": {},
"input": {},
"usage": {},
"openaiResponseId": "string",
"attemptCount": 0,
"maxAttempts": 0,
"nextAttemptAt": "2019-08-24T14:15:22.123Z",
"lastError": {},
"completedAt": "2019-08-24T14:15:22.123Z",
"failedAt": "2019-08-24T14:15:22.123Z",
"skippedAt": "2019-08-24T14:15:22.123Z",
"createdAt": "2019-08-24T14:15:22.123Z",
"updatedAt": "2019-08-24T14:15:22.123Z",
"entityVersion": "string",
"productMatches": [
{
"productId": "string",
"sku": "string",
"name": "string",
"confidence": 0,
"price": 0,
"currency": "string",
"stockStatus": "string",
"stockQuantity": 0,
"productUrl": "string",
"matchStatus": "high_confidence"
}
],
"visualSearch": {
"query": "string",
"visualDescription": "string",
"attributes": {
"productType": "string",
"color": "string",
"model": "string",
"pattern": "string",
"material": "string",
"brand": "string",
"visibleText": "string",
"style": "string",
"shape": "string",
"otherFeatures": "string"
},
"warnings": [
"string"
],
"candidateCount": 0,
"matchStatus": "not_searched",
"responseId": "string",
"usage": {}
},
"commerce": {
"stage": "none",
"orderReadiness": "not_applicable",
"missingFields": [
"customer"
],
"orderDraft": {
"customerId": "string",
"contactId": "string",
"items": [
{
"productId": "string",
"sku": "string",
"name": "string",
"quantity": 0,
"variantNote": "string",
"notes": "string",
"unitPrice": 0,
"currency": "string",
"stockStatus": "string",
"stockQuantity": 0,
"productUrl": "string",
"variantRequired": true
}
],
"source": {
"channel": "provider_whatsapp",
"sourceId": "string",
"sourceType": "string",
"threadId": "string",
"messageId": "string"
},
"notes": "string"
},
"nextBestActions": [
"reply"
]
},
"appliedActions": [
{
"type": "create_order",
"orderId": "string",
"orderNo": "string",
"actorType": "string",
"actorId": "string",
"allowDuplicate": true,
"createdAt": "2019-08-24T14:15:22.123Z"
}
]
}
}
}