Skip to main content
POST
/
deals
/
Create deal
curl --request POST \
  --url https://api-dev.iclosed.io/deals/ \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "callId": 123,
  "productId": 123,
  "value": 123,
  "time": "2023-11-07T05:31:56Z",
  "transactionType": "WON",
  "type": "DEAL",
  "transactionIds": [
    123
  ],
  "transactionEmail": "jsmith@example.com"
}'
{
  "data": {
    "id": 123,
    "accountId": 456,
    "userId": 789,
    "productId": 101,
    "contactId": 202,
    "callId": 303,
    "value": 1500,
    "discount": 100,
    "priceFormat": "USD",
    "currency": "USD",
    "time": "2024-01-15T10:30:00Z",
    "transactionType": "WON",
    "recurring": false,
    "tagId": 404,
    "createdAt": "2024-01-15T10:30:00Z",
    "updatedAt": "2024-01-15T10:30:00Z",
    "deletedAt": null,
    "transaction": [
      {
        "id": 505,
        "value": 1500,
        "source": "STRIPE",
        "createdAt": "2024-01-15T10:30:00Z",
        "email": "customer@example.com",
        "name": "John Doe",
        "phoneNumber": "+1234567890"
      }
    ]
  }
}

Authorizations

Authorization
string
header
required

API key required in 'Authorization' header. Format: iclosed-<token>

Body

application/json
callId
integer
required

Call ID associated with the deal

productId
integer
required

Product ID

value
number | null
required

Deal value

transactionType
enum<string>
required

Type of transaction

Available options:
WON,
DEPOSIT,
RECURRING
type
enum<string> | null
required

Type of record

Available options:
DEAL,
TRANSACTION
time
string<date-time> | null

Deal date and time

transactionIds
integer[] | null

Array of transaction IDs

transactionEmail
string<email> | null

Transaction email

Response

Successfully created deal

data
object
I