Skip to main content
POST
Create an deal

Authorizations

Authorization
string
header
required

Default authentication mechanism

Body

application/json

Schema for creating an deal. The deliveryType determines if it stays as a draft, gets finalized immediately, or gets scheduled for later processing.

template
object
required

Deal template details

merchantId
string<uuid>
required

Unique identifier for the merchant (required)

Example:

"a1b2c3d4-e5f6-7890-abcd-ef1234567890"

deliveryType
enum<string>
required

How the deal should be processed: 'create' - finalize immediately, 'create_and_send' - finalize and send to merchant, 'scheduled' - schedule for automatic processing at specified date

Available options:
create,
create_and_send,
scheduled
Example:

"create"

fromDetails
object

Sender details in TipTap JSONContent format

Example:
paymentDetails
object

Payment details in TipTap JSONContent format

Example:
noteDetails
object

Additional notes for the deal in TipTap JSONContent format

Example:
dueDate
string<date-time>

Due date of the deal in ISO 8601 format. Defaults to issue date + payment terms (30 days) if not provided.

Example:

"2024-06-30T23:59:59.000Z"

issueDate
string<date-time>

Issue date of the deal in ISO 8601 format. Defaults to current date if not provided.

Example:

"2024-06-01T00:00:00.000Z"

dealNumber
string

Deal number as shown on the deal (auto-generated if not provided)

Example:

"D-0001"

logoUrl
string | null

URL of the logo to display on the deal

Example:

"https://example.com/logo.png"

discount
number | null

Discount applied to the deal

Example:

100

topBlock
object

Custom content block to display at the top of the deal in TipTap JSONContent format

Example:
bottomBlock
object

Custom content block to display at the bottom of the deal in TipTap JSONContent format

Example:
amount
number | null

Total amount of the deal

Example:

1500.75

lineItems
object[]

List of line items for the deal

scheduledAt
string<date-time>

Scheduled date of the deal in ISO 8601 format with timezone offset (e.g., Z or +00:00). Required when deliveryType is 'scheduled'. Must be in the future.

Example:

"2024-06-30T23:59:59.000Z"

Response

Deal created successfully. Status depends on deliveryType: 'scheduled' for scheduled deals, 'unpaid' for create/create_and_send.

Response after creating a draft deal

id
string<uuid>
required

Unique identifier for the draft deal

Example:

"b3b7e6e2-8c2a-4e2a-9b1a-2e4b5c6d7f8a"

status
enum<string>
required

Current status of the deal

Available options:
draft,
overdue,
paid,
unpaid,
canceled,
scheduled
Example:

"draft"

createdAt
string
required

Timestamp when the deal was created (ISO 8601)

Example:

"2024-06-01T07:00:00.000Z"

updatedAt
string
required

Timestamp when the deal was last updated (ISO 8601)

Example:

"2024-06-01T07:00:00.000Z"

pdfUrl
string | null
required

Direct URL to download the deal PDF

Example:

"https://app.abacuslabs.co/api/download/deal?token=eyJ..."

previewUrl
string | null
required

Direct URL to preview the deal in browser

Example:

"https://app.abacuslabs.co/i/eyJ..."