Create an deal
curl --request POST \
--url https://api.abacuslabs.co/deals \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"template": {
"title": "Deal",
"customerLabel": "Bill To",
"fromLabel": "From",
"dealNoLabel": "Deal #",
"issueDateLabel": "Issue Date",
"dueDateLabel": "Due Date",
"descriptionLabel": "Description",
"priceLabel": "Rate",
"quantityLabel": "Qty",
"totalLabel": "Amount",
"totalSummaryLabel": "Total",
"paymentLabel": "Payment Information",
"noteLabel": "Notes",
"logoUrl": "https://example.com/logo.png",
"currency": "USD",
"paymentDetails": {
"type": "doc",
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Wire Transfer: Chase Bank, Account: 1234567890, Routing: 021000021"
}
]
}
]
},
"fromDetails": {
"type": "doc",
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "TechCorp Inc, 123 Business Ave, San Francisco, CA 94105"
}
]
}
]
},
"size": "letter",
"discountLabel": "Discount",
"includeDiscount": false,
"includeUnits": true,
"includeDecimals": true,
"includePdf": true,
"sendCopy": true,
"includeQr": false,
"dateFormat": "MM/dd/yyyy",
"deliveryType": "create",
"timezone": "America/Los_Angeles",
"locale": "en-US"
},
"fromDetails": {
"type": "doc",
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "TechCorp Inc",
"marks": [
{
"type": "strong"
}
]
}
]
},
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "123 Business Ave"
}
]
},
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "San Francisco, CA 94105"
}
]
}
]
},
"merchantId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"paymentDetails": {
"type": "doc",
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Wire Transfer:",
"marks": [
{
"type": "strong"
}
]
}
]
},
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Chase Bank, Account: 1234567890"
}
]
},
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Routing: 021000021"
}
]
}
]
},
"noteDetails": {
"type": "doc",
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Payment is due within 30 days of deal date."
}
]
},
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Thank you for your business!",
"marks": [
{
"type": "italic"
}
]
}
]
}
]
},
"dueDate": "2024-07-15T23:59:59.000Z",
"issueDate": "2024-06-15T00:00:00.000Z",
"dealNumber": "D-0001",
"logoUrl": "https://example.com/logo.png",
"topBlock": {
"type": "doc",
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Thank you for choosing TechCorp for your software development needs.",
"marks": [
{
"type": "strong"
}
]
}
]
},
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "This deal covers the development work completed in June 2024."
}
]
}
]
},
"bottomBlock": {
"type": "doc",
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Terms & Conditions:",
"marks": [
{
"type": "strong"
}
]
}
]
},
{
"type": "bulletList",
"content": [
{
"type": "listItem",
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Payment is due within 30 days of deal date"
}
]
}
]
},
{
"type": "listItem",
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Late payments may incur a 1.5% monthly service charge"
}
]
}
]
},
{
"type": "listItem",
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "All work is subject to our standard terms of service"
}
]
}
]
}
]
},
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Questions? Contact us at billing@techcorp.com or (555) 123-4567",
"marks": [
{
"type": "italic"
}
]
}
]
}
]
},
"amount": 1085,
"lineItems": [
{
"name": {
"type": "doc",
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Web Development Services",
"marks": [
{
"type": "strong"
}
]
}
]
},
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Custom React application with TypeScript",
"marks": [
{
"type": "italic"
}
]
}
]
}
]
},
"quantity": 40,
"price": 75
},
{
"name": {
"type": "doc",
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "UI/UX Design",
"marks": [
{
"type": "strong"
}
]
}
]
},
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "User interface design and user experience optimization",
"marks": [
{
"type": "italic"
}
]
}
]
}
]
},
"quantity": 20,
"price": 50
}
],
"deliveryType": "create",
"scheduledAt": "2024-07-01T09:00:00.000Z"
}
'import requests
url = "https://api.abacuslabs.co/deals"
payload = {
"template": {
"title": "Deal",
"customerLabel": "Bill To",
"fromLabel": "From",
"dealNoLabel": "Deal #",
"issueDateLabel": "Issue Date",
"dueDateLabel": "Due Date",
"descriptionLabel": "Description",
"priceLabel": "Rate",
"quantityLabel": "Qty",
"totalLabel": "Amount",
"totalSummaryLabel": "Total",
"paymentLabel": "Payment Information",
"noteLabel": "Notes",
"logoUrl": "https://example.com/logo.png",
"currency": "USD",
"paymentDetails": {
"type": "doc",
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Wire Transfer: Chase Bank, Account: 1234567890, Routing: 021000021"
}
]
}
]
},
"fromDetails": {
"type": "doc",
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "TechCorp Inc, 123 Business Ave, San Francisco, CA 94105"
}
]
}
]
},
"size": "letter",
"discountLabel": "Discount",
"includeDiscount": False,
"includeUnits": True,
"includeDecimals": True,
"includePdf": True,
"sendCopy": True,
"includeQr": False,
"dateFormat": "MM/dd/yyyy",
"deliveryType": "create",
"timezone": "America/Los_Angeles",
"locale": "en-US"
},
"fromDetails": {
"type": "doc",
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "TechCorp Inc",
"marks": [{ "type": "strong" }]
}
]
},
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "123 Business Ave"
}
]
},
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "San Francisco, CA 94105"
}
]
}
]
},
"merchantId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"paymentDetails": {
"type": "doc",
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Wire Transfer:",
"marks": [{ "type": "strong" }]
}
]
},
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Chase Bank, Account: 1234567890"
}
]
},
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Routing: 021000021"
}
]
}
]
},
"noteDetails": {
"type": "doc",
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Payment is due within 30 days of deal date."
}
]
},
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Thank you for your business!",
"marks": [{ "type": "italic" }]
}
]
}
]
},
"dueDate": "2024-07-15T23:59:59.000Z",
"issueDate": "2024-06-15T00:00:00.000Z",
"dealNumber": "D-0001",
"logoUrl": "https://example.com/logo.png",
"topBlock": {
"type": "doc",
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Thank you for choosing TechCorp for your software development needs.",
"marks": [{ "type": "strong" }]
}
]
},
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "This deal covers the development work completed in June 2024."
}
]
}
]
},
"bottomBlock": {
"type": "doc",
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Terms & Conditions:",
"marks": [{ "type": "strong" }]
}
]
},
{
"type": "bulletList",
"content": [
{
"type": "listItem",
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Payment is due within 30 days of deal date"
}
]
}
]
},
{
"type": "listItem",
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Late payments may incur a 1.5% monthly service charge"
}
]
}
]
},
{
"type": "listItem",
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "All work is subject to our standard terms of service"
}
]
}
]
}
]
},
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Questions? Contact us at billing@techcorp.com or (555) 123-4567",
"marks": [{ "type": "italic" }]
}
]
}
]
},
"amount": 1085,
"lineItems": [
{
"name": {
"type": "doc",
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Web Development Services",
"marks": [{ "type": "strong" }]
}
]
},
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Custom React application with TypeScript",
"marks": [{ "type": "italic" }]
}
]
}
]
},
"quantity": 40,
"price": 75
},
{
"name": {
"type": "doc",
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "UI/UX Design",
"marks": [{ "type": "strong" }]
}
]
},
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "User interface design and user experience optimization",
"marks": [{ "type": "italic" }]
}
]
}
]
},
"quantity": 20,
"price": 50
}
],
"deliveryType": "create",
"scheduledAt": "2024-07-01T09:00:00.000Z"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
template: {
title: 'Deal',
customerLabel: 'Bill To',
fromLabel: 'From',
dealNoLabel: 'Deal #',
issueDateLabel: 'Issue Date',
dueDateLabel: 'Due Date',
descriptionLabel: 'Description',
priceLabel: 'Rate',
quantityLabel: 'Qty',
totalLabel: 'Amount',
totalSummaryLabel: 'Total',
paymentLabel: 'Payment Information',
noteLabel: 'Notes',
logoUrl: 'https://example.com/logo.png',
currency: 'USD',
paymentDetails: {
type: 'doc',
content: [
{
type: 'paragraph',
content: [
{
type: 'text',
text: 'Wire Transfer: Chase Bank, Account: 1234567890, Routing: 021000021'
}
]
}
]
},
fromDetails: {
type: 'doc',
content: [
{
type: 'paragraph',
content: [
{type: 'text', text: 'TechCorp Inc, 123 Business Ave, San Francisco, CA 94105'}
]
}
]
},
size: 'letter',
discountLabel: 'Discount',
includeDiscount: false,
includeUnits: true,
includeDecimals: true,
includePdf: true,
sendCopy: true,
includeQr: false,
dateFormat: 'MM/dd/yyyy',
deliveryType: 'create',
timezone: 'America/Los_Angeles',
locale: 'en-US'
},
fromDetails: {
type: 'doc',
content: [
{
type: 'paragraph',
content: [{type: 'text', text: 'TechCorp Inc', marks: [{type: 'strong'}]}]
},
{type: 'paragraph', content: [{type: 'text', text: '123 Business Ave'}]},
{type: 'paragraph', content: [{type: 'text', text: 'San Francisco, CA 94105'}]}
]
},
merchantId: 'a1b2c3d4-e5f6-7890-abcd-ef1234567890',
paymentDetails: {
type: 'doc',
content: [
{
type: 'paragraph',
content: [{type: 'text', text: 'Wire Transfer:', marks: [{type: 'strong'}]}]
},
{
type: 'paragraph',
content: [{type: 'text', text: 'Chase Bank, Account: 1234567890'}]
},
{type: 'paragraph', content: [{type: 'text', text: 'Routing: 021000021'}]}
]
},
noteDetails: {
type: 'doc',
content: [
{
type: 'paragraph',
content: [{type: 'text', text: 'Payment is due within 30 days of deal date.'}]
},
{
type: 'paragraph',
content: [
{type: 'text', text: 'Thank you for your business!', marks: [{type: 'italic'}]}
]
}
]
},
dueDate: '2024-07-15T23:59:59.000Z',
issueDate: '2024-06-15T00:00:00.000Z',
dealNumber: 'D-0001',
logoUrl: 'https://example.com/logo.png',
topBlock: {
type: 'doc',
content: [
{
type: 'paragraph',
content: [
{
type: 'text',
text: 'Thank you for choosing TechCorp for your software development needs.',
marks: [{type: 'strong'}]
}
]
},
{
type: 'paragraph',
content: [
{
type: 'text',
text: 'This deal covers the development work completed in June 2024.'
}
]
}
]
},
bottomBlock: {
type: 'doc',
content: [
{
type: 'paragraph',
content: [{type: 'text', text: 'Terms & Conditions:', marks: [{type: 'strong'}]}]
},
{
type: 'bulletList',
content: [
{
type: 'listItem',
content: [
{
type: 'paragraph',
content: [{type: 'text', text: 'Payment is due within 30 days of deal date'}]
}
]
},
{
type: 'listItem',
content: [
{
type: 'paragraph',
content: [{type: 'text', text: 'Late payments may incur a 1.5% monthly service charge'}]
}
]
},
{
type: 'listItem',
content: [
{
type: 'paragraph',
content: [{type: 'text', text: 'All work is subject to our standard terms of service'}]
}
]
}
]
},
{
type: 'paragraph',
content: [
{
type: 'text',
text: 'Questions? Contact us at billing@techcorp.com or (555) 123-4567',
marks: [{type: 'italic'}]
}
]
}
]
},
amount: 1085,
lineItems: [
{
name: {
type: 'doc',
content: [
{
type: 'paragraph',
content: [{type: 'text', text: 'Web Development Services', marks: [{type: 'strong'}]}]
},
{
type: 'paragraph',
content: [
{
type: 'text',
text: 'Custom React application with TypeScript',
marks: [{type: 'italic'}]
}
]
}
]
},
quantity: 40,
price: 75
},
{
name: {
type: 'doc',
content: [
{
type: 'paragraph',
content: [{type: 'text', text: 'UI/UX Design', marks: [{type: 'strong'}]}]
},
{
type: 'paragraph',
content: [
{
type: 'text',
text: 'User interface design and user experience optimization',
marks: [{type: 'italic'}]
}
]
}
]
},
quantity: 20,
price: 50
}
],
deliveryType: 'create',
scheduledAt: '2024-07-01T09:00:00.000Z'
})
};
fetch('https://api.abacuslabs.co/deals', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.abacuslabs.co/deals",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'template' => [
'title' => 'Deal',
'customerLabel' => 'Bill To',
'fromLabel' => 'From',
'dealNoLabel' => 'Deal #',
'issueDateLabel' => 'Issue Date',
'dueDateLabel' => 'Due Date',
'descriptionLabel' => 'Description',
'priceLabel' => 'Rate',
'quantityLabel' => 'Qty',
'totalLabel' => 'Amount',
'totalSummaryLabel' => 'Total',
'paymentLabel' => 'Payment Information',
'noteLabel' => 'Notes',
'logoUrl' => 'https://example.com/logo.png',
'currency' => 'USD',
'paymentDetails' => [
'type' => 'doc',
'content' => [
[
'type' => 'paragraph',
'content' => [
[
'type' => 'text',
'text' => 'Wire Transfer: Chase Bank, Account: 1234567890, Routing: 021000021'
]
]
]
]
],
'fromDetails' => [
'type' => 'doc',
'content' => [
[
'type' => 'paragraph',
'content' => [
[
'type' => 'text',
'text' => 'TechCorp Inc, 123 Business Ave, San Francisco, CA 94105'
]
]
]
]
],
'size' => 'letter',
'discountLabel' => 'Discount',
'includeDiscount' => false,
'includeUnits' => true,
'includeDecimals' => true,
'includePdf' => true,
'sendCopy' => true,
'includeQr' => false,
'dateFormat' => 'MM/dd/yyyy',
'deliveryType' => 'create',
'timezone' => 'America/Los_Angeles',
'locale' => 'en-US'
],
'fromDetails' => [
'type' => 'doc',
'content' => [
[
'type' => 'paragraph',
'content' => [
[
'type' => 'text',
'text' => 'TechCorp Inc',
'marks' => [
[
'type' => 'strong'
]
]
]
]
],
[
'type' => 'paragraph',
'content' => [
[
'type' => 'text',
'text' => '123 Business Ave'
]
]
],
[
'type' => 'paragraph',
'content' => [
[
'type' => 'text',
'text' => 'San Francisco, CA 94105'
]
]
]
]
],
'merchantId' => 'a1b2c3d4-e5f6-7890-abcd-ef1234567890',
'paymentDetails' => [
'type' => 'doc',
'content' => [
[
'type' => 'paragraph',
'content' => [
[
'type' => 'text',
'text' => 'Wire Transfer:',
'marks' => [
[
'type' => 'strong'
]
]
]
]
],
[
'type' => 'paragraph',
'content' => [
[
'type' => 'text',
'text' => 'Chase Bank, Account: 1234567890'
]
]
],
[
'type' => 'paragraph',
'content' => [
[
'type' => 'text',
'text' => 'Routing: 021000021'
]
]
]
]
],
'noteDetails' => [
'type' => 'doc',
'content' => [
[
'type' => 'paragraph',
'content' => [
[
'type' => 'text',
'text' => 'Payment is due within 30 days of deal date.'
]
]
],
[
'type' => 'paragraph',
'content' => [
[
'type' => 'text',
'text' => 'Thank you for your business!',
'marks' => [
[
'type' => 'italic'
]
]
]
]
]
]
],
'dueDate' => '2024-07-15T23:59:59.000Z',
'issueDate' => '2024-06-15T00:00:00.000Z',
'dealNumber' => 'D-0001',
'logoUrl' => 'https://example.com/logo.png',
'topBlock' => [
'type' => 'doc',
'content' => [
[
'type' => 'paragraph',
'content' => [
[
'type' => 'text',
'text' => 'Thank you for choosing TechCorp for your software development needs.',
'marks' => [
[
'type' => 'strong'
]
]
]
]
],
[
'type' => 'paragraph',
'content' => [
[
'type' => 'text',
'text' => 'This deal covers the development work completed in June 2024.'
]
]
]
]
],
'bottomBlock' => [
'type' => 'doc',
'content' => [
[
'type' => 'paragraph',
'content' => [
[
'type' => 'text',
'text' => 'Terms & Conditions:',
'marks' => [
[
'type' => 'strong'
]
]
]
]
],
[
'type' => 'bulletList',
'content' => [
[
'type' => 'listItem',
'content' => [
[
'type' => 'paragraph',
'content' => [
[
'type' => 'text',
'text' => 'Payment is due within 30 days of deal date'
]
]
]
]
],
[
'type' => 'listItem',
'content' => [
[
'type' => 'paragraph',
'content' => [
[
'type' => 'text',
'text' => 'Late payments may incur a 1.5% monthly service charge'
]
]
]
]
],
[
'type' => 'listItem',
'content' => [
[
'type' => 'paragraph',
'content' => [
[
'type' => 'text',
'text' => 'All work is subject to our standard terms of service'
]
]
]
]
]
]
],
[
'type' => 'paragraph',
'content' => [
[
'type' => 'text',
'text' => 'Questions? Contact us at billing@techcorp.com or (555) 123-4567',
'marks' => [
[
'type' => 'italic'
]
]
]
]
]
]
],
'amount' => 1085,
'lineItems' => [
[
'name' => [
'type' => 'doc',
'content' => [
[
'type' => 'paragraph',
'content' => [
[
'type' => 'text',
'text' => 'Web Development Services',
'marks' => [
[
'type' => 'strong'
]
]
]
]
],
[
'type' => 'paragraph',
'content' => [
[
'type' => 'text',
'text' => 'Custom React application with TypeScript',
'marks' => [
[
'type' => 'italic'
]
]
]
]
]
]
],
'quantity' => 40,
'price' => 75
],
[
'name' => [
'type' => 'doc',
'content' => [
[
'type' => 'paragraph',
'content' => [
[
'type' => 'text',
'text' => 'UI/UX Design',
'marks' => [
[
'type' => 'strong'
]
]
]
]
],
[
'type' => 'paragraph',
'content' => [
[
'type' => 'text',
'text' => 'User interface design and user experience optimization',
'marks' => [
[
'type' => 'italic'
]
]
]
]
]
]
],
'quantity' => 20,
'price' => 50
]
],
'deliveryType' => 'create',
'scheduledAt' => '2024-07-01T09:00:00.000Z'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.abacuslabs.co/deals"
payload := strings.NewReader("{\n \"template\": {\n \"title\": \"Deal\",\n \"customerLabel\": \"Bill To\",\n \"fromLabel\": \"From\",\n \"dealNoLabel\": \"Deal #\",\n \"issueDateLabel\": \"Issue Date\",\n \"dueDateLabel\": \"Due Date\",\n \"descriptionLabel\": \"Description\",\n \"priceLabel\": \"Rate\",\n \"quantityLabel\": \"Qty\",\n \"totalLabel\": \"Amount\",\n \"totalSummaryLabel\": \"Total\",\n \"paymentLabel\": \"Payment Information\",\n \"noteLabel\": \"Notes\",\n \"logoUrl\": \"https://example.com/logo.png\",\n \"currency\": \"USD\",\n \"paymentDetails\": {\n \"type\": \"doc\",\n \"content\": [\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Wire Transfer: Chase Bank, Account: 1234567890, Routing: 021000021\"\n }\n ]\n }\n ]\n },\n \"fromDetails\": {\n \"type\": \"doc\",\n \"content\": [\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"TechCorp Inc, 123 Business Ave, San Francisco, CA 94105\"\n }\n ]\n }\n ]\n },\n \"size\": \"letter\",\n \"discountLabel\": \"Discount\",\n \"includeDiscount\": false,\n \"includeUnits\": true,\n \"includeDecimals\": true,\n \"includePdf\": true,\n \"sendCopy\": true,\n \"includeQr\": false,\n \"dateFormat\": \"MM/dd/yyyy\",\n \"deliveryType\": \"create\",\n \"timezone\": \"America/Los_Angeles\",\n \"locale\": \"en-US\"\n },\n \"fromDetails\": {\n \"type\": \"doc\",\n \"content\": [\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"TechCorp Inc\",\n \"marks\": [\n {\n \"type\": \"strong\"\n }\n ]\n }\n ]\n },\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"123 Business Ave\"\n }\n ]\n },\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"San Francisco, CA 94105\"\n }\n ]\n }\n ]\n },\n \"merchantId\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\",\n \"paymentDetails\": {\n \"type\": \"doc\",\n \"content\": [\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Wire Transfer:\",\n \"marks\": [\n {\n \"type\": \"strong\"\n }\n ]\n }\n ]\n },\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Chase Bank, Account: 1234567890\"\n }\n ]\n },\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Routing: 021000021\"\n }\n ]\n }\n ]\n },\n \"noteDetails\": {\n \"type\": \"doc\",\n \"content\": [\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Payment is due within 30 days of deal date.\"\n }\n ]\n },\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Thank you for your business!\",\n \"marks\": [\n {\n \"type\": \"italic\"\n }\n ]\n }\n ]\n }\n ]\n },\n \"dueDate\": \"2024-07-15T23:59:59.000Z\",\n \"issueDate\": \"2024-06-15T00:00:00.000Z\",\n \"dealNumber\": \"D-0001\",\n \"logoUrl\": \"https://example.com/logo.png\",\n \"topBlock\": {\n \"type\": \"doc\",\n \"content\": [\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Thank you for choosing TechCorp for your software development needs.\",\n \"marks\": [\n {\n \"type\": \"strong\"\n }\n ]\n }\n ]\n },\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"This deal covers the development work completed in June 2024.\"\n }\n ]\n }\n ]\n },\n \"bottomBlock\": {\n \"type\": \"doc\",\n \"content\": [\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Terms & Conditions:\",\n \"marks\": [\n {\n \"type\": \"strong\"\n }\n ]\n }\n ]\n },\n {\n \"type\": \"bulletList\",\n \"content\": [\n {\n \"type\": \"listItem\",\n \"content\": [\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Payment is due within 30 days of deal date\"\n }\n ]\n }\n ]\n },\n {\n \"type\": \"listItem\",\n \"content\": [\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Late payments may incur a 1.5% monthly service charge\"\n }\n ]\n }\n ]\n },\n {\n \"type\": \"listItem\",\n \"content\": [\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"All work is subject to our standard terms of service\"\n }\n ]\n }\n ]\n }\n ]\n },\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Questions? Contact us at billing@techcorp.com or (555) 123-4567\",\n \"marks\": [\n {\n \"type\": \"italic\"\n }\n ]\n }\n ]\n }\n ]\n },\n \"amount\": 1085,\n \"lineItems\": [\n {\n \"name\": {\n \"type\": \"doc\",\n \"content\": [\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Web Development Services\",\n \"marks\": [\n {\n \"type\": \"strong\"\n }\n ]\n }\n ]\n },\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Custom React application with TypeScript\",\n \"marks\": [\n {\n \"type\": \"italic\"\n }\n ]\n }\n ]\n }\n ]\n },\n \"quantity\": 40,\n \"price\": 75\n },\n {\n \"name\": {\n \"type\": \"doc\",\n \"content\": [\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"UI/UX Design\",\n \"marks\": [\n {\n \"type\": \"strong\"\n }\n ]\n }\n ]\n },\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"User interface design and user experience optimization\",\n \"marks\": [\n {\n \"type\": \"italic\"\n }\n ]\n }\n ]\n }\n ]\n },\n \"quantity\": 20,\n \"price\": 50\n }\n ],\n \"deliveryType\": \"create\",\n \"scheduledAt\": \"2024-07-01T09:00:00.000Z\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.abacuslabs.co/deals")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"template\": {\n \"title\": \"Deal\",\n \"customerLabel\": \"Bill To\",\n \"fromLabel\": \"From\",\n \"dealNoLabel\": \"Deal #\",\n \"issueDateLabel\": \"Issue Date\",\n \"dueDateLabel\": \"Due Date\",\n \"descriptionLabel\": \"Description\",\n \"priceLabel\": \"Rate\",\n \"quantityLabel\": \"Qty\",\n \"totalLabel\": \"Amount\",\n \"totalSummaryLabel\": \"Total\",\n \"paymentLabel\": \"Payment Information\",\n \"noteLabel\": \"Notes\",\n \"logoUrl\": \"https://example.com/logo.png\",\n \"currency\": \"USD\",\n \"paymentDetails\": {\n \"type\": \"doc\",\n \"content\": [\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Wire Transfer: Chase Bank, Account: 1234567890, Routing: 021000021\"\n }\n ]\n }\n ]\n },\n \"fromDetails\": {\n \"type\": \"doc\",\n \"content\": [\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"TechCorp Inc, 123 Business Ave, San Francisco, CA 94105\"\n }\n ]\n }\n ]\n },\n \"size\": \"letter\",\n \"discountLabel\": \"Discount\",\n \"includeDiscount\": false,\n \"includeUnits\": true,\n \"includeDecimals\": true,\n \"includePdf\": true,\n \"sendCopy\": true,\n \"includeQr\": false,\n \"dateFormat\": \"MM/dd/yyyy\",\n \"deliveryType\": \"create\",\n \"timezone\": \"America/Los_Angeles\",\n \"locale\": \"en-US\"\n },\n \"fromDetails\": {\n \"type\": \"doc\",\n \"content\": [\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"TechCorp Inc\",\n \"marks\": [\n {\n \"type\": \"strong\"\n }\n ]\n }\n ]\n },\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"123 Business Ave\"\n }\n ]\n },\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"San Francisco, CA 94105\"\n }\n ]\n }\n ]\n },\n \"merchantId\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\",\n \"paymentDetails\": {\n \"type\": \"doc\",\n \"content\": [\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Wire Transfer:\",\n \"marks\": [\n {\n \"type\": \"strong\"\n }\n ]\n }\n ]\n },\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Chase Bank, Account: 1234567890\"\n }\n ]\n },\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Routing: 021000021\"\n }\n ]\n }\n ]\n },\n \"noteDetails\": {\n \"type\": \"doc\",\n \"content\": [\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Payment is due within 30 days of deal date.\"\n }\n ]\n },\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Thank you for your business!\",\n \"marks\": [\n {\n \"type\": \"italic\"\n }\n ]\n }\n ]\n }\n ]\n },\n \"dueDate\": \"2024-07-15T23:59:59.000Z\",\n \"issueDate\": \"2024-06-15T00:00:00.000Z\",\n \"dealNumber\": \"D-0001\",\n \"logoUrl\": \"https://example.com/logo.png\",\n \"topBlock\": {\n \"type\": \"doc\",\n \"content\": [\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Thank you for choosing TechCorp for your software development needs.\",\n \"marks\": [\n {\n \"type\": \"strong\"\n }\n ]\n }\n ]\n },\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"This deal covers the development work completed in June 2024.\"\n }\n ]\n }\n ]\n },\n \"bottomBlock\": {\n \"type\": \"doc\",\n \"content\": [\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Terms & Conditions:\",\n \"marks\": [\n {\n \"type\": \"strong\"\n }\n ]\n }\n ]\n },\n {\n \"type\": \"bulletList\",\n \"content\": [\n {\n \"type\": \"listItem\",\n \"content\": [\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Payment is due within 30 days of deal date\"\n }\n ]\n }\n ]\n },\n {\n \"type\": \"listItem\",\n \"content\": [\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Late payments may incur a 1.5% monthly service charge\"\n }\n ]\n }\n ]\n },\n {\n \"type\": \"listItem\",\n \"content\": [\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"All work is subject to our standard terms of service\"\n }\n ]\n }\n ]\n }\n ]\n },\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Questions? Contact us at billing@techcorp.com or (555) 123-4567\",\n \"marks\": [\n {\n \"type\": \"italic\"\n }\n ]\n }\n ]\n }\n ]\n },\n \"amount\": 1085,\n \"lineItems\": [\n {\n \"name\": {\n \"type\": \"doc\",\n \"content\": [\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Web Development Services\",\n \"marks\": [\n {\n \"type\": \"strong\"\n }\n ]\n }\n ]\n },\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Custom React application with TypeScript\",\n \"marks\": [\n {\n \"type\": \"italic\"\n }\n ]\n }\n ]\n }\n ]\n },\n \"quantity\": 40,\n \"price\": 75\n },\n {\n \"name\": {\n \"type\": \"doc\",\n \"content\": [\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"UI/UX Design\",\n \"marks\": [\n {\n \"type\": \"strong\"\n }\n ]\n }\n ]\n },\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"User interface design and user experience optimization\",\n \"marks\": [\n {\n \"type\": \"italic\"\n }\n ]\n }\n ]\n }\n ]\n },\n \"quantity\": 20,\n \"price\": 50\n }\n ],\n \"deliveryType\": \"create\",\n \"scheduledAt\": \"2024-07-01T09:00:00.000Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.abacuslabs.co/deals")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"template\": {\n \"title\": \"Deal\",\n \"customerLabel\": \"Bill To\",\n \"fromLabel\": \"From\",\n \"dealNoLabel\": \"Deal #\",\n \"issueDateLabel\": \"Issue Date\",\n \"dueDateLabel\": \"Due Date\",\n \"descriptionLabel\": \"Description\",\n \"priceLabel\": \"Rate\",\n \"quantityLabel\": \"Qty\",\n \"totalLabel\": \"Amount\",\n \"totalSummaryLabel\": \"Total\",\n \"paymentLabel\": \"Payment Information\",\n \"noteLabel\": \"Notes\",\n \"logoUrl\": \"https://example.com/logo.png\",\n \"currency\": \"USD\",\n \"paymentDetails\": {\n \"type\": \"doc\",\n \"content\": [\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Wire Transfer: Chase Bank, Account: 1234567890, Routing: 021000021\"\n }\n ]\n }\n ]\n },\n \"fromDetails\": {\n \"type\": \"doc\",\n \"content\": [\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"TechCorp Inc, 123 Business Ave, San Francisco, CA 94105\"\n }\n ]\n }\n ]\n },\n \"size\": \"letter\",\n \"discountLabel\": \"Discount\",\n \"includeDiscount\": false,\n \"includeUnits\": true,\n \"includeDecimals\": true,\n \"includePdf\": true,\n \"sendCopy\": true,\n \"includeQr\": false,\n \"dateFormat\": \"MM/dd/yyyy\",\n \"deliveryType\": \"create\",\n \"timezone\": \"America/Los_Angeles\",\n \"locale\": \"en-US\"\n },\n \"fromDetails\": {\n \"type\": \"doc\",\n \"content\": [\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"TechCorp Inc\",\n \"marks\": [\n {\n \"type\": \"strong\"\n }\n ]\n }\n ]\n },\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"123 Business Ave\"\n }\n ]\n },\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"San Francisco, CA 94105\"\n }\n ]\n }\n ]\n },\n \"merchantId\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\",\n \"paymentDetails\": {\n \"type\": \"doc\",\n \"content\": [\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Wire Transfer:\",\n \"marks\": [\n {\n \"type\": \"strong\"\n }\n ]\n }\n ]\n },\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Chase Bank, Account: 1234567890\"\n }\n ]\n },\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Routing: 021000021\"\n }\n ]\n }\n ]\n },\n \"noteDetails\": {\n \"type\": \"doc\",\n \"content\": [\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Payment is due within 30 days of deal date.\"\n }\n ]\n },\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Thank you for your business!\",\n \"marks\": [\n {\n \"type\": \"italic\"\n }\n ]\n }\n ]\n }\n ]\n },\n \"dueDate\": \"2024-07-15T23:59:59.000Z\",\n \"issueDate\": \"2024-06-15T00:00:00.000Z\",\n \"dealNumber\": \"D-0001\",\n \"logoUrl\": \"https://example.com/logo.png\",\n \"topBlock\": {\n \"type\": \"doc\",\n \"content\": [\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Thank you for choosing TechCorp for your software development needs.\",\n \"marks\": [\n {\n \"type\": \"strong\"\n }\n ]\n }\n ]\n },\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"This deal covers the development work completed in June 2024.\"\n }\n ]\n }\n ]\n },\n \"bottomBlock\": {\n \"type\": \"doc\",\n \"content\": [\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Terms & Conditions:\",\n \"marks\": [\n {\n \"type\": \"strong\"\n }\n ]\n }\n ]\n },\n {\n \"type\": \"bulletList\",\n \"content\": [\n {\n \"type\": \"listItem\",\n \"content\": [\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Payment is due within 30 days of deal date\"\n }\n ]\n }\n ]\n },\n {\n \"type\": \"listItem\",\n \"content\": [\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Late payments may incur a 1.5% monthly service charge\"\n }\n ]\n }\n ]\n },\n {\n \"type\": \"listItem\",\n \"content\": [\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"All work is subject to our standard terms of service\"\n }\n ]\n }\n ]\n }\n ]\n },\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Questions? Contact us at billing@techcorp.com or (555) 123-4567\",\n \"marks\": [\n {\n \"type\": \"italic\"\n }\n ]\n }\n ]\n }\n ]\n },\n \"amount\": 1085,\n \"lineItems\": [\n {\n \"name\": {\n \"type\": \"doc\",\n \"content\": [\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Web Development Services\",\n \"marks\": [\n {\n \"type\": \"strong\"\n }\n ]\n }\n ]\n },\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Custom React application with TypeScript\",\n \"marks\": [\n {\n \"type\": \"italic\"\n }\n ]\n }\n ]\n }\n ]\n },\n \"quantity\": 40,\n \"price\": 75\n },\n {\n \"name\": {\n \"type\": \"doc\",\n \"content\": [\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"UI/UX Design\",\n \"marks\": [\n {\n \"type\": \"strong\"\n }\n ]\n }\n ]\n },\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"User interface design and user experience optimization\",\n \"marks\": [\n {\n \"type\": \"italic\"\n }\n ]\n }\n ]\n }\n ]\n },\n \"quantity\": 20,\n \"price\": 50\n }\n ],\n \"deliveryType\": \"create\",\n \"scheduledAt\": \"2024-07-01T09:00:00.000Z\"\n}"
response = http.request(request)
puts response.read_body{
"id": "b3b7e6e2-8c2a-4e2a-9b1a-2e4b5c6d7f8a",
"status": "draft",
"createdAt": "2024-06-01T07:00:00.000Z",
"updatedAt": "2024-06-01T07:00:00.000Z",
"pdfUrl": "https://app.abacuslabs.co/api/download/deal?token=eyJ...",
"previewUrl": "https://app.abacuslabs.co/i/eyJ..."
}{
"message": "scheduledAt is required for scheduled delivery"
}{
"message": "Merchant not found"
}{
"message": "Deal number 'D-0001' is already used. Please provide a different deal number or omit it to auto-generate one."
}{
"message": "Failed to create deal"
}Deals
Create an deal
Create an deal for the authenticated team. The behavior depends on deliveryType: ‘create’ generates and finalizes the deal immediately, ‘create_and_send’ also sends it to the merchant, ‘scheduled’ schedules the deal for automatic processing at the specified date.
POST
/
deals
Create an deal
curl --request POST \
--url https://api.abacuslabs.co/deals \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"template": {
"title": "Deal",
"customerLabel": "Bill To",
"fromLabel": "From",
"dealNoLabel": "Deal #",
"issueDateLabel": "Issue Date",
"dueDateLabel": "Due Date",
"descriptionLabel": "Description",
"priceLabel": "Rate",
"quantityLabel": "Qty",
"totalLabel": "Amount",
"totalSummaryLabel": "Total",
"paymentLabel": "Payment Information",
"noteLabel": "Notes",
"logoUrl": "https://example.com/logo.png",
"currency": "USD",
"paymentDetails": {
"type": "doc",
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Wire Transfer: Chase Bank, Account: 1234567890, Routing: 021000021"
}
]
}
]
},
"fromDetails": {
"type": "doc",
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "TechCorp Inc, 123 Business Ave, San Francisco, CA 94105"
}
]
}
]
},
"size": "letter",
"discountLabel": "Discount",
"includeDiscount": false,
"includeUnits": true,
"includeDecimals": true,
"includePdf": true,
"sendCopy": true,
"includeQr": false,
"dateFormat": "MM/dd/yyyy",
"deliveryType": "create",
"timezone": "America/Los_Angeles",
"locale": "en-US"
},
"fromDetails": {
"type": "doc",
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "TechCorp Inc",
"marks": [
{
"type": "strong"
}
]
}
]
},
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "123 Business Ave"
}
]
},
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "San Francisco, CA 94105"
}
]
}
]
},
"merchantId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"paymentDetails": {
"type": "doc",
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Wire Transfer:",
"marks": [
{
"type": "strong"
}
]
}
]
},
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Chase Bank, Account: 1234567890"
}
]
},
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Routing: 021000021"
}
]
}
]
},
"noteDetails": {
"type": "doc",
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Payment is due within 30 days of deal date."
}
]
},
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Thank you for your business!",
"marks": [
{
"type": "italic"
}
]
}
]
}
]
},
"dueDate": "2024-07-15T23:59:59.000Z",
"issueDate": "2024-06-15T00:00:00.000Z",
"dealNumber": "D-0001",
"logoUrl": "https://example.com/logo.png",
"topBlock": {
"type": "doc",
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Thank you for choosing TechCorp for your software development needs.",
"marks": [
{
"type": "strong"
}
]
}
]
},
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "This deal covers the development work completed in June 2024."
}
]
}
]
},
"bottomBlock": {
"type": "doc",
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Terms & Conditions:",
"marks": [
{
"type": "strong"
}
]
}
]
},
{
"type": "bulletList",
"content": [
{
"type": "listItem",
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Payment is due within 30 days of deal date"
}
]
}
]
},
{
"type": "listItem",
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Late payments may incur a 1.5% monthly service charge"
}
]
}
]
},
{
"type": "listItem",
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "All work is subject to our standard terms of service"
}
]
}
]
}
]
},
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Questions? Contact us at billing@techcorp.com or (555) 123-4567",
"marks": [
{
"type": "italic"
}
]
}
]
}
]
},
"amount": 1085,
"lineItems": [
{
"name": {
"type": "doc",
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Web Development Services",
"marks": [
{
"type": "strong"
}
]
}
]
},
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Custom React application with TypeScript",
"marks": [
{
"type": "italic"
}
]
}
]
}
]
},
"quantity": 40,
"price": 75
},
{
"name": {
"type": "doc",
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "UI/UX Design",
"marks": [
{
"type": "strong"
}
]
}
]
},
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "User interface design and user experience optimization",
"marks": [
{
"type": "italic"
}
]
}
]
}
]
},
"quantity": 20,
"price": 50
}
],
"deliveryType": "create",
"scheduledAt": "2024-07-01T09:00:00.000Z"
}
'import requests
url = "https://api.abacuslabs.co/deals"
payload = {
"template": {
"title": "Deal",
"customerLabel": "Bill To",
"fromLabel": "From",
"dealNoLabel": "Deal #",
"issueDateLabel": "Issue Date",
"dueDateLabel": "Due Date",
"descriptionLabel": "Description",
"priceLabel": "Rate",
"quantityLabel": "Qty",
"totalLabel": "Amount",
"totalSummaryLabel": "Total",
"paymentLabel": "Payment Information",
"noteLabel": "Notes",
"logoUrl": "https://example.com/logo.png",
"currency": "USD",
"paymentDetails": {
"type": "doc",
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Wire Transfer: Chase Bank, Account: 1234567890, Routing: 021000021"
}
]
}
]
},
"fromDetails": {
"type": "doc",
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "TechCorp Inc, 123 Business Ave, San Francisco, CA 94105"
}
]
}
]
},
"size": "letter",
"discountLabel": "Discount",
"includeDiscount": False,
"includeUnits": True,
"includeDecimals": True,
"includePdf": True,
"sendCopy": True,
"includeQr": False,
"dateFormat": "MM/dd/yyyy",
"deliveryType": "create",
"timezone": "America/Los_Angeles",
"locale": "en-US"
},
"fromDetails": {
"type": "doc",
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "TechCorp Inc",
"marks": [{ "type": "strong" }]
}
]
},
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "123 Business Ave"
}
]
},
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "San Francisco, CA 94105"
}
]
}
]
},
"merchantId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"paymentDetails": {
"type": "doc",
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Wire Transfer:",
"marks": [{ "type": "strong" }]
}
]
},
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Chase Bank, Account: 1234567890"
}
]
},
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Routing: 021000021"
}
]
}
]
},
"noteDetails": {
"type": "doc",
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Payment is due within 30 days of deal date."
}
]
},
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Thank you for your business!",
"marks": [{ "type": "italic" }]
}
]
}
]
},
"dueDate": "2024-07-15T23:59:59.000Z",
"issueDate": "2024-06-15T00:00:00.000Z",
"dealNumber": "D-0001",
"logoUrl": "https://example.com/logo.png",
"topBlock": {
"type": "doc",
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Thank you for choosing TechCorp for your software development needs.",
"marks": [{ "type": "strong" }]
}
]
},
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "This deal covers the development work completed in June 2024."
}
]
}
]
},
"bottomBlock": {
"type": "doc",
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Terms & Conditions:",
"marks": [{ "type": "strong" }]
}
]
},
{
"type": "bulletList",
"content": [
{
"type": "listItem",
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Payment is due within 30 days of deal date"
}
]
}
]
},
{
"type": "listItem",
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Late payments may incur a 1.5% monthly service charge"
}
]
}
]
},
{
"type": "listItem",
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "All work is subject to our standard terms of service"
}
]
}
]
}
]
},
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Questions? Contact us at billing@techcorp.com or (555) 123-4567",
"marks": [{ "type": "italic" }]
}
]
}
]
},
"amount": 1085,
"lineItems": [
{
"name": {
"type": "doc",
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Web Development Services",
"marks": [{ "type": "strong" }]
}
]
},
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Custom React application with TypeScript",
"marks": [{ "type": "italic" }]
}
]
}
]
},
"quantity": 40,
"price": 75
},
{
"name": {
"type": "doc",
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "UI/UX Design",
"marks": [{ "type": "strong" }]
}
]
},
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "User interface design and user experience optimization",
"marks": [{ "type": "italic" }]
}
]
}
]
},
"quantity": 20,
"price": 50
}
],
"deliveryType": "create",
"scheduledAt": "2024-07-01T09:00:00.000Z"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
template: {
title: 'Deal',
customerLabel: 'Bill To',
fromLabel: 'From',
dealNoLabel: 'Deal #',
issueDateLabel: 'Issue Date',
dueDateLabel: 'Due Date',
descriptionLabel: 'Description',
priceLabel: 'Rate',
quantityLabel: 'Qty',
totalLabel: 'Amount',
totalSummaryLabel: 'Total',
paymentLabel: 'Payment Information',
noteLabel: 'Notes',
logoUrl: 'https://example.com/logo.png',
currency: 'USD',
paymentDetails: {
type: 'doc',
content: [
{
type: 'paragraph',
content: [
{
type: 'text',
text: 'Wire Transfer: Chase Bank, Account: 1234567890, Routing: 021000021'
}
]
}
]
},
fromDetails: {
type: 'doc',
content: [
{
type: 'paragraph',
content: [
{type: 'text', text: 'TechCorp Inc, 123 Business Ave, San Francisco, CA 94105'}
]
}
]
},
size: 'letter',
discountLabel: 'Discount',
includeDiscount: false,
includeUnits: true,
includeDecimals: true,
includePdf: true,
sendCopy: true,
includeQr: false,
dateFormat: 'MM/dd/yyyy',
deliveryType: 'create',
timezone: 'America/Los_Angeles',
locale: 'en-US'
},
fromDetails: {
type: 'doc',
content: [
{
type: 'paragraph',
content: [{type: 'text', text: 'TechCorp Inc', marks: [{type: 'strong'}]}]
},
{type: 'paragraph', content: [{type: 'text', text: '123 Business Ave'}]},
{type: 'paragraph', content: [{type: 'text', text: 'San Francisco, CA 94105'}]}
]
},
merchantId: 'a1b2c3d4-e5f6-7890-abcd-ef1234567890',
paymentDetails: {
type: 'doc',
content: [
{
type: 'paragraph',
content: [{type: 'text', text: 'Wire Transfer:', marks: [{type: 'strong'}]}]
},
{
type: 'paragraph',
content: [{type: 'text', text: 'Chase Bank, Account: 1234567890'}]
},
{type: 'paragraph', content: [{type: 'text', text: 'Routing: 021000021'}]}
]
},
noteDetails: {
type: 'doc',
content: [
{
type: 'paragraph',
content: [{type: 'text', text: 'Payment is due within 30 days of deal date.'}]
},
{
type: 'paragraph',
content: [
{type: 'text', text: 'Thank you for your business!', marks: [{type: 'italic'}]}
]
}
]
},
dueDate: '2024-07-15T23:59:59.000Z',
issueDate: '2024-06-15T00:00:00.000Z',
dealNumber: 'D-0001',
logoUrl: 'https://example.com/logo.png',
topBlock: {
type: 'doc',
content: [
{
type: 'paragraph',
content: [
{
type: 'text',
text: 'Thank you for choosing TechCorp for your software development needs.',
marks: [{type: 'strong'}]
}
]
},
{
type: 'paragraph',
content: [
{
type: 'text',
text: 'This deal covers the development work completed in June 2024.'
}
]
}
]
},
bottomBlock: {
type: 'doc',
content: [
{
type: 'paragraph',
content: [{type: 'text', text: 'Terms & Conditions:', marks: [{type: 'strong'}]}]
},
{
type: 'bulletList',
content: [
{
type: 'listItem',
content: [
{
type: 'paragraph',
content: [{type: 'text', text: 'Payment is due within 30 days of deal date'}]
}
]
},
{
type: 'listItem',
content: [
{
type: 'paragraph',
content: [{type: 'text', text: 'Late payments may incur a 1.5% monthly service charge'}]
}
]
},
{
type: 'listItem',
content: [
{
type: 'paragraph',
content: [{type: 'text', text: 'All work is subject to our standard terms of service'}]
}
]
}
]
},
{
type: 'paragraph',
content: [
{
type: 'text',
text: 'Questions? Contact us at billing@techcorp.com or (555) 123-4567',
marks: [{type: 'italic'}]
}
]
}
]
},
amount: 1085,
lineItems: [
{
name: {
type: 'doc',
content: [
{
type: 'paragraph',
content: [{type: 'text', text: 'Web Development Services', marks: [{type: 'strong'}]}]
},
{
type: 'paragraph',
content: [
{
type: 'text',
text: 'Custom React application with TypeScript',
marks: [{type: 'italic'}]
}
]
}
]
},
quantity: 40,
price: 75
},
{
name: {
type: 'doc',
content: [
{
type: 'paragraph',
content: [{type: 'text', text: 'UI/UX Design', marks: [{type: 'strong'}]}]
},
{
type: 'paragraph',
content: [
{
type: 'text',
text: 'User interface design and user experience optimization',
marks: [{type: 'italic'}]
}
]
}
]
},
quantity: 20,
price: 50
}
],
deliveryType: 'create',
scheduledAt: '2024-07-01T09:00:00.000Z'
})
};
fetch('https://api.abacuslabs.co/deals', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.abacuslabs.co/deals",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'template' => [
'title' => 'Deal',
'customerLabel' => 'Bill To',
'fromLabel' => 'From',
'dealNoLabel' => 'Deal #',
'issueDateLabel' => 'Issue Date',
'dueDateLabel' => 'Due Date',
'descriptionLabel' => 'Description',
'priceLabel' => 'Rate',
'quantityLabel' => 'Qty',
'totalLabel' => 'Amount',
'totalSummaryLabel' => 'Total',
'paymentLabel' => 'Payment Information',
'noteLabel' => 'Notes',
'logoUrl' => 'https://example.com/logo.png',
'currency' => 'USD',
'paymentDetails' => [
'type' => 'doc',
'content' => [
[
'type' => 'paragraph',
'content' => [
[
'type' => 'text',
'text' => 'Wire Transfer: Chase Bank, Account: 1234567890, Routing: 021000021'
]
]
]
]
],
'fromDetails' => [
'type' => 'doc',
'content' => [
[
'type' => 'paragraph',
'content' => [
[
'type' => 'text',
'text' => 'TechCorp Inc, 123 Business Ave, San Francisco, CA 94105'
]
]
]
]
],
'size' => 'letter',
'discountLabel' => 'Discount',
'includeDiscount' => false,
'includeUnits' => true,
'includeDecimals' => true,
'includePdf' => true,
'sendCopy' => true,
'includeQr' => false,
'dateFormat' => 'MM/dd/yyyy',
'deliveryType' => 'create',
'timezone' => 'America/Los_Angeles',
'locale' => 'en-US'
],
'fromDetails' => [
'type' => 'doc',
'content' => [
[
'type' => 'paragraph',
'content' => [
[
'type' => 'text',
'text' => 'TechCorp Inc',
'marks' => [
[
'type' => 'strong'
]
]
]
]
],
[
'type' => 'paragraph',
'content' => [
[
'type' => 'text',
'text' => '123 Business Ave'
]
]
],
[
'type' => 'paragraph',
'content' => [
[
'type' => 'text',
'text' => 'San Francisco, CA 94105'
]
]
]
]
],
'merchantId' => 'a1b2c3d4-e5f6-7890-abcd-ef1234567890',
'paymentDetails' => [
'type' => 'doc',
'content' => [
[
'type' => 'paragraph',
'content' => [
[
'type' => 'text',
'text' => 'Wire Transfer:',
'marks' => [
[
'type' => 'strong'
]
]
]
]
],
[
'type' => 'paragraph',
'content' => [
[
'type' => 'text',
'text' => 'Chase Bank, Account: 1234567890'
]
]
],
[
'type' => 'paragraph',
'content' => [
[
'type' => 'text',
'text' => 'Routing: 021000021'
]
]
]
]
],
'noteDetails' => [
'type' => 'doc',
'content' => [
[
'type' => 'paragraph',
'content' => [
[
'type' => 'text',
'text' => 'Payment is due within 30 days of deal date.'
]
]
],
[
'type' => 'paragraph',
'content' => [
[
'type' => 'text',
'text' => 'Thank you for your business!',
'marks' => [
[
'type' => 'italic'
]
]
]
]
]
]
],
'dueDate' => '2024-07-15T23:59:59.000Z',
'issueDate' => '2024-06-15T00:00:00.000Z',
'dealNumber' => 'D-0001',
'logoUrl' => 'https://example.com/logo.png',
'topBlock' => [
'type' => 'doc',
'content' => [
[
'type' => 'paragraph',
'content' => [
[
'type' => 'text',
'text' => 'Thank you for choosing TechCorp for your software development needs.',
'marks' => [
[
'type' => 'strong'
]
]
]
]
],
[
'type' => 'paragraph',
'content' => [
[
'type' => 'text',
'text' => 'This deal covers the development work completed in June 2024.'
]
]
]
]
],
'bottomBlock' => [
'type' => 'doc',
'content' => [
[
'type' => 'paragraph',
'content' => [
[
'type' => 'text',
'text' => 'Terms & Conditions:',
'marks' => [
[
'type' => 'strong'
]
]
]
]
],
[
'type' => 'bulletList',
'content' => [
[
'type' => 'listItem',
'content' => [
[
'type' => 'paragraph',
'content' => [
[
'type' => 'text',
'text' => 'Payment is due within 30 days of deal date'
]
]
]
]
],
[
'type' => 'listItem',
'content' => [
[
'type' => 'paragraph',
'content' => [
[
'type' => 'text',
'text' => 'Late payments may incur a 1.5% monthly service charge'
]
]
]
]
],
[
'type' => 'listItem',
'content' => [
[
'type' => 'paragraph',
'content' => [
[
'type' => 'text',
'text' => 'All work is subject to our standard terms of service'
]
]
]
]
]
]
],
[
'type' => 'paragraph',
'content' => [
[
'type' => 'text',
'text' => 'Questions? Contact us at billing@techcorp.com or (555) 123-4567',
'marks' => [
[
'type' => 'italic'
]
]
]
]
]
]
],
'amount' => 1085,
'lineItems' => [
[
'name' => [
'type' => 'doc',
'content' => [
[
'type' => 'paragraph',
'content' => [
[
'type' => 'text',
'text' => 'Web Development Services',
'marks' => [
[
'type' => 'strong'
]
]
]
]
],
[
'type' => 'paragraph',
'content' => [
[
'type' => 'text',
'text' => 'Custom React application with TypeScript',
'marks' => [
[
'type' => 'italic'
]
]
]
]
]
]
],
'quantity' => 40,
'price' => 75
],
[
'name' => [
'type' => 'doc',
'content' => [
[
'type' => 'paragraph',
'content' => [
[
'type' => 'text',
'text' => 'UI/UX Design',
'marks' => [
[
'type' => 'strong'
]
]
]
]
],
[
'type' => 'paragraph',
'content' => [
[
'type' => 'text',
'text' => 'User interface design and user experience optimization',
'marks' => [
[
'type' => 'italic'
]
]
]
]
]
]
],
'quantity' => 20,
'price' => 50
]
],
'deliveryType' => 'create',
'scheduledAt' => '2024-07-01T09:00:00.000Z'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.abacuslabs.co/deals"
payload := strings.NewReader("{\n \"template\": {\n \"title\": \"Deal\",\n \"customerLabel\": \"Bill To\",\n \"fromLabel\": \"From\",\n \"dealNoLabel\": \"Deal #\",\n \"issueDateLabel\": \"Issue Date\",\n \"dueDateLabel\": \"Due Date\",\n \"descriptionLabel\": \"Description\",\n \"priceLabel\": \"Rate\",\n \"quantityLabel\": \"Qty\",\n \"totalLabel\": \"Amount\",\n \"totalSummaryLabel\": \"Total\",\n \"paymentLabel\": \"Payment Information\",\n \"noteLabel\": \"Notes\",\n \"logoUrl\": \"https://example.com/logo.png\",\n \"currency\": \"USD\",\n \"paymentDetails\": {\n \"type\": \"doc\",\n \"content\": [\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Wire Transfer: Chase Bank, Account: 1234567890, Routing: 021000021\"\n }\n ]\n }\n ]\n },\n \"fromDetails\": {\n \"type\": \"doc\",\n \"content\": [\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"TechCorp Inc, 123 Business Ave, San Francisco, CA 94105\"\n }\n ]\n }\n ]\n },\n \"size\": \"letter\",\n \"discountLabel\": \"Discount\",\n \"includeDiscount\": false,\n \"includeUnits\": true,\n \"includeDecimals\": true,\n \"includePdf\": true,\n \"sendCopy\": true,\n \"includeQr\": false,\n \"dateFormat\": \"MM/dd/yyyy\",\n \"deliveryType\": \"create\",\n \"timezone\": \"America/Los_Angeles\",\n \"locale\": \"en-US\"\n },\n \"fromDetails\": {\n \"type\": \"doc\",\n \"content\": [\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"TechCorp Inc\",\n \"marks\": [\n {\n \"type\": \"strong\"\n }\n ]\n }\n ]\n },\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"123 Business Ave\"\n }\n ]\n },\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"San Francisco, CA 94105\"\n }\n ]\n }\n ]\n },\n \"merchantId\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\",\n \"paymentDetails\": {\n \"type\": \"doc\",\n \"content\": [\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Wire Transfer:\",\n \"marks\": [\n {\n \"type\": \"strong\"\n }\n ]\n }\n ]\n },\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Chase Bank, Account: 1234567890\"\n }\n ]\n },\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Routing: 021000021\"\n }\n ]\n }\n ]\n },\n \"noteDetails\": {\n \"type\": \"doc\",\n \"content\": [\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Payment is due within 30 days of deal date.\"\n }\n ]\n },\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Thank you for your business!\",\n \"marks\": [\n {\n \"type\": \"italic\"\n }\n ]\n }\n ]\n }\n ]\n },\n \"dueDate\": \"2024-07-15T23:59:59.000Z\",\n \"issueDate\": \"2024-06-15T00:00:00.000Z\",\n \"dealNumber\": \"D-0001\",\n \"logoUrl\": \"https://example.com/logo.png\",\n \"topBlock\": {\n \"type\": \"doc\",\n \"content\": [\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Thank you for choosing TechCorp for your software development needs.\",\n \"marks\": [\n {\n \"type\": \"strong\"\n }\n ]\n }\n ]\n },\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"This deal covers the development work completed in June 2024.\"\n }\n ]\n }\n ]\n },\n \"bottomBlock\": {\n \"type\": \"doc\",\n \"content\": [\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Terms & Conditions:\",\n \"marks\": [\n {\n \"type\": \"strong\"\n }\n ]\n }\n ]\n },\n {\n \"type\": \"bulletList\",\n \"content\": [\n {\n \"type\": \"listItem\",\n \"content\": [\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Payment is due within 30 days of deal date\"\n }\n ]\n }\n ]\n },\n {\n \"type\": \"listItem\",\n \"content\": [\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Late payments may incur a 1.5% monthly service charge\"\n }\n ]\n }\n ]\n },\n {\n \"type\": \"listItem\",\n \"content\": [\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"All work is subject to our standard terms of service\"\n }\n ]\n }\n ]\n }\n ]\n },\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Questions? Contact us at billing@techcorp.com or (555) 123-4567\",\n \"marks\": [\n {\n \"type\": \"italic\"\n }\n ]\n }\n ]\n }\n ]\n },\n \"amount\": 1085,\n \"lineItems\": [\n {\n \"name\": {\n \"type\": \"doc\",\n \"content\": [\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Web Development Services\",\n \"marks\": [\n {\n \"type\": \"strong\"\n }\n ]\n }\n ]\n },\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Custom React application with TypeScript\",\n \"marks\": [\n {\n \"type\": \"italic\"\n }\n ]\n }\n ]\n }\n ]\n },\n \"quantity\": 40,\n \"price\": 75\n },\n {\n \"name\": {\n \"type\": \"doc\",\n \"content\": [\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"UI/UX Design\",\n \"marks\": [\n {\n \"type\": \"strong\"\n }\n ]\n }\n ]\n },\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"User interface design and user experience optimization\",\n \"marks\": [\n {\n \"type\": \"italic\"\n }\n ]\n }\n ]\n }\n ]\n },\n \"quantity\": 20,\n \"price\": 50\n }\n ],\n \"deliveryType\": \"create\",\n \"scheduledAt\": \"2024-07-01T09:00:00.000Z\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.abacuslabs.co/deals")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"template\": {\n \"title\": \"Deal\",\n \"customerLabel\": \"Bill To\",\n \"fromLabel\": \"From\",\n \"dealNoLabel\": \"Deal #\",\n \"issueDateLabel\": \"Issue Date\",\n \"dueDateLabel\": \"Due Date\",\n \"descriptionLabel\": \"Description\",\n \"priceLabel\": \"Rate\",\n \"quantityLabel\": \"Qty\",\n \"totalLabel\": \"Amount\",\n \"totalSummaryLabel\": \"Total\",\n \"paymentLabel\": \"Payment Information\",\n \"noteLabel\": \"Notes\",\n \"logoUrl\": \"https://example.com/logo.png\",\n \"currency\": \"USD\",\n \"paymentDetails\": {\n \"type\": \"doc\",\n \"content\": [\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Wire Transfer: Chase Bank, Account: 1234567890, Routing: 021000021\"\n }\n ]\n }\n ]\n },\n \"fromDetails\": {\n \"type\": \"doc\",\n \"content\": [\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"TechCorp Inc, 123 Business Ave, San Francisco, CA 94105\"\n }\n ]\n }\n ]\n },\n \"size\": \"letter\",\n \"discountLabel\": \"Discount\",\n \"includeDiscount\": false,\n \"includeUnits\": true,\n \"includeDecimals\": true,\n \"includePdf\": true,\n \"sendCopy\": true,\n \"includeQr\": false,\n \"dateFormat\": \"MM/dd/yyyy\",\n \"deliveryType\": \"create\",\n \"timezone\": \"America/Los_Angeles\",\n \"locale\": \"en-US\"\n },\n \"fromDetails\": {\n \"type\": \"doc\",\n \"content\": [\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"TechCorp Inc\",\n \"marks\": [\n {\n \"type\": \"strong\"\n }\n ]\n }\n ]\n },\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"123 Business Ave\"\n }\n ]\n },\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"San Francisco, CA 94105\"\n }\n ]\n }\n ]\n },\n \"merchantId\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\",\n \"paymentDetails\": {\n \"type\": \"doc\",\n \"content\": [\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Wire Transfer:\",\n \"marks\": [\n {\n \"type\": \"strong\"\n }\n ]\n }\n ]\n },\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Chase Bank, Account: 1234567890\"\n }\n ]\n },\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Routing: 021000021\"\n }\n ]\n }\n ]\n },\n \"noteDetails\": {\n \"type\": \"doc\",\n \"content\": [\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Payment is due within 30 days of deal date.\"\n }\n ]\n },\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Thank you for your business!\",\n \"marks\": [\n {\n \"type\": \"italic\"\n }\n ]\n }\n ]\n }\n ]\n },\n \"dueDate\": \"2024-07-15T23:59:59.000Z\",\n \"issueDate\": \"2024-06-15T00:00:00.000Z\",\n \"dealNumber\": \"D-0001\",\n \"logoUrl\": \"https://example.com/logo.png\",\n \"topBlock\": {\n \"type\": \"doc\",\n \"content\": [\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Thank you for choosing TechCorp for your software development needs.\",\n \"marks\": [\n {\n \"type\": \"strong\"\n }\n ]\n }\n ]\n },\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"This deal covers the development work completed in June 2024.\"\n }\n ]\n }\n ]\n },\n \"bottomBlock\": {\n \"type\": \"doc\",\n \"content\": [\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Terms & Conditions:\",\n \"marks\": [\n {\n \"type\": \"strong\"\n }\n ]\n }\n ]\n },\n {\n \"type\": \"bulletList\",\n \"content\": [\n {\n \"type\": \"listItem\",\n \"content\": [\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Payment is due within 30 days of deal date\"\n }\n ]\n }\n ]\n },\n {\n \"type\": \"listItem\",\n \"content\": [\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Late payments may incur a 1.5% monthly service charge\"\n }\n ]\n }\n ]\n },\n {\n \"type\": \"listItem\",\n \"content\": [\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"All work is subject to our standard terms of service\"\n }\n ]\n }\n ]\n }\n ]\n },\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Questions? Contact us at billing@techcorp.com or (555) 123-4567\",\n \"marks\": [\n {\n \"type\": \"italic\"\n }\n ]\n }\n ]\n }\n ]\n },\n \"amount\": 1085,\n \"lineItems\": [\n {\n \"name\": {\n \"type\": \"doc\",\n \"content\": [\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Web Development Services\",\n \"marks\": [\n {\n \"type\": \"strong\"\n }\n ]\n }\n ]\n },\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Custom React application with TypeScript\",\n \"marks\": [\n {\n \"type\": \"italic\"\n }\n ]\n }\n ]\n }\n ]\n },\n \"quantity\": 40,\n \"price\": 75\n },\n {\n \"name\": {\n \"type\": \"doc\",\n \"content\": [\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"UI/UX Design\",\n \"marks\": [\n {\n \"type\": \"strong\"\n }\n ]\n }\n ]\n },\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"User interface design and user experience optimization\",\n \"marks\": [\n {\n \"type\": \"italic\"\n }\n ]\n }\n ]\n }\n ]\n },\n \"quantity\": 20,\n \"price\": 50\n }\n ],\n \"deliveryType\": \"create\",\n \"scheduledAt\": \"2024-07-01T09:00:00.000Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.abacuslabs.co/deals")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"template\": {\n \"title\": \"Deal\",\n \"customerLabel\": \"Bill To\",\n \"fromLabel\": \"From\",\n \"dealNoLabel\": \"Deal #\",\n \"issueDateLabel\": \"Issue Date\",\n \"dueDateLabel\": \"Due Date\",\n \"descriptionLabel\": \"Description\",\n \"priceLabel\": \"Rate\",\n \"quantityLabel\": \"Qty\",\n \"totalLabel\": \"Amount\",\n \"totalSummaryLabel\": \"Total\",\n \"paymentLabel\": \"Payment Information\",\n \"noteLabel\": \"Notes\",\n \"logoUrl\": \"https://example.com/logo.png\",\n \"currency\": \"USD\",\n \"paymentDetails\": {\n \"type\": \"doc\",\n \"content\": [\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Wire Transfer: Chase Bank, Account: 1234567890, Routing: 021000021\"\n }\n ]\n }\n ]\n },\n \"fromDetails\": {\n \"type\": \"doc\",\n \"content\": [\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"TechCorp Inc, 123 Business Ave, San Francisco, CA 94105\"\n }\n ]\n }\n ]\n },\n \"size\": \"letter\",\n \"discountLabel\": \"Discount\",\n \"includeDiscount\": false,\n \"includeUnits\": true,\n \"includeDecimals\": true,\n \"includePdf\": true,\n \"sendCopy\": true,\n \"includeQr\": false,\n \"dateFormat\": \"MM/dd/yyyy\",\n \"deliveryType\": \"create\",\n \"timezone\": \"America/Los_Angeles\",\n \"locale\": \"en-US\"\n },\n \"fromDetails\": {\n \"type\": \"doc\",\n \"content\": [\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"TechCorp Inc\",\n \"marks\": [\n {\n \"type\": \"strong\"\n }\n ]\n }\n ]\n },\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"123 Business Ave\"\n }\n ]\n },\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"San Francisco, CA 94105\"\n }\n ]\n }\n ]\n },\n \"merchantId\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\",\n \"paymentDetails\": {\n \"type\": \"doc\",\n \"content\": [\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Wire Transfer:\",\n \"marks\": [\n {\n \"type\": \"strong\"\n }\n ]\n }\n ]\n },\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Chase Bank, Account: 1234567890\"\n }\n ]\n },\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Routing: 021000021\"\n }\n ]\n }\n ]\n },\n \"noteDetails\": {\n \"type\": \"doc\",\n \"content\": [\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Payment is due within 30 days of deal date.\"\n }\n ]\n },\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Thank you for your business!\",\n \"marks\": [\n {\n \"type\": \"italic\"\n }\n ]\n }\n ]\n }\n ]\n },\n \"dueDate\": \"2024-07-15T23:59:59.000Z\",\n \"issueDate\": \"2024-06-15T00:00:00.000Z\",\n \"dealNumber\": \"D-0001\",\n \"logoUrl\": \"https://example.com/logo.png\",\n \"topBlock\": {\n \"type\": \"doc\",\n \"content\": [\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Thank you for choosing TechCorp for your software development needs.\",\n \"marks\": [\n {\n \"type\": \"strong\"\n }\n ]\n }\n ]\n },\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"This deal covers the development work completed in June 2024.\"\n }\n ]\n }\n ]\n },\n \"bottomBlock\": {\n \"type\": \"doc\",\n \"content\": [\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Terms & Conditions:\",\n \"marks\": [\n {\n \"type\": \"strong\"\n }\n ]\n }\n ]\n },\n {\n \"type\": \"bulletList\",\n \"content\": [\n {\n \"type\": \"listItem\",\n \"content\": [\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Payment is due within 30 days of deal date\"\n }\n ]\n }\n ]\n },\n {\n \"type\": \"listItem\",\n \"content\": [\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Late payments may incur a 1.5% monthly service charge\"\n }\n ]\n }\n ]\n },\n {\n \"type\": \"listItem\",\n \"content\": [\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"All work is subject to our standard terms of service\"\n }\n ]\n }\n ]\n }\n ]\n },\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Questions? Contact us at billing@techcorp.com or (555) 123-4567\",\n \"marks\": [\n {\n \"type\": \"italic\"\n }\n ]\n }\n ]\n }\n ]\n },\n \"amount\": 1085,\n \"lineItems\": [\n {\n \"name\": {\n \"type\": \"doc\",\n \"content\": [\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Web Development Services\",\n \"marks\": [\n {\n \"type\": \"strong\"\n }\n ]\n }\n ]\n },\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Custom React application with TypeScript\",\n \"marks\": [\n {\n \"type\": \"italic\"\n }\n ]\n }\n ]\n }\n ]\n },\n \"quantity\": 40,\n \"price\": 75\n },\n {\n \"name\": {\n \"type\": \"doc\",\n \"content\": [\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"UI/UX Design\",\n \"marks\": [\n {\n \"type\": \"strong\"\n }\n ]\n }\n ]\n },\n {\n \"type\": \"paragraph\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"User interface design and user experience optimization\",\n \"marks\": [\n {\n \"type\": \"italic\"\n }\n ]\n }\n ]\n }\n ]\n },\n \"quantity\": 20,\n \"price\": 50\n }\n ],\n \"deliveryType\": \"create\",\n \"scheduledAt\": \"2024-07-01T09:00:00.000Z\"\n}"
response = http.request(request)
puts response.read_body{
"id": "b3b7e6e2-8c2a-4e2a-9b1a-2e4b5c6d7f8a",
"status": "draft",
"createdAt": "2024-06-01T07:00:00.000Z",
"updatedAt": "2024-06-01T07:00:00.000Z",
"pdfUrl": "https://app.abacuslabs.co/api/download/deal?token=eyJ...",
"previewUrl": "https://app.abacuslabs.co/i/eyJ..."
}{
"message": "scheduledAt is required for scheduled delivery"
}{
"message": "Merchant not found"
}{
"message": "Deal number 'D-0001' is already used. Please provide a different deal number or omit it to auto-generate one."
}{
"message": "Failed to create deal"
}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.
Custom content block to display at the top of the deal in TipTap JSONContent format
Example:
{
"type": "doc",
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Acme Inc",
"marks": [{ "type": "bold" }]
}
]
},
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "123 Main St, City, Country"
}
]
},
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Visit our website: "
},
{
"type": "text",
"text": "https://acme.com",
"marks": [
{
"type": "link",
"attrs": { "href": "https://acme.com" }
}
]
}
]
}
]
}
Custom content block to display at the bottom of the deal in TipTap JSONContent format
Example:
{
"type": "doc",
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Acme Inc",
"marks": [{ "type": "bold" }]
}
]
},
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "123 Main St, City, Country"
}
]
},
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Visit our website: "
},
{
"type": "text",
"text": "https://acme.com",
"marks": [
{
"type": "link",
"attrs": { "href": "https://acme.com" }
}
]
}
]
}
]
}
Response
Deal created successfully. Status depends on deliveryType: 'scheduled' for scheduled deals, 'unpaid' for create/create_and_send.
Response after creating a draft deal