Estimate API Reference

This guide covers everything from creating estimates and managing their lifecycle to retrieving and updating estimate information. Learn how to leverage the power of our Estimate model to seamlessly handle estimates within your system. Explore the comprehensive API endpoints and data structures available, and start building robust estimate management functionality.

The Estimate model

Estimates are formal documents that outline the cost of goods or services a business proposes to deliver. They include itemized details, quantities, prices, and total amounts, providing clarity on expected expenses. Customers can review, approve, or reject estimates, fostering transparent communication before finalizing transactions.

Properties

  • Name
    id
    Type
    string
    Description

    Unique identifier for the estimate.

  • Name
    estimate_date
    Type
    timestamp
    Description

    Date of the estimate.

  • Name
    expiry_date
    Type
    timestamp
    Description

    Expiry Date of estimate.

  • Name
    estimate_number
    Type
    string
    Description

    Estimate Number.

  • Name
    sequence_number
    Type
    integer
    Description

    Sequence Number.

  • Name
    status
    Type
    string
    Description

    Status of the estimate.

  • Name
    notes
    Type
    string
    Description

    Estimate Notes.

  • Name
    discount
    Type
    integer
    Description

    Discount value.

  • Name
    discount_type
    Type
    string
    Description

    Type of discount: fixed or percentage.

  • Name
    discount_val
    Type
    integer
    Description

    Discount value in cents.

  • Name
    tax
    Type
    integer
    Description

    Tax value in cents.

  • Name
    sub_total
    Type
    integer
    Description

    Subtotal value in cents.

  • Name
    total
    Type
    integer
    Description

    Total value in cents.

  • Name
    template_name
    Type
    string
    Description

    Name of the template to be used for the Estimate PDF.

  • Name
    customer_id
    Type
    string
    Description

    Customer ID.

  • Name
    estimate_pdf_url
    Type
    string
    Description

    URL of the Estimate PDF.

  • Name
    attachments
    Type
    array
    Description

    Array of attachments.

  • Name
    estimate_type
    Type
    string
    Description

    Type of estimate: incoming or outgoing.

  • Name
    reject_reason
    Type
    string
    Description

    Reason for rejecting the estimate.

  • Name
    customer
    Type
    object
    Description

    Customer object.

  • Name
    tax_per_item_enabled
    Type
    boolean
    Description

    Indicates whether tax is applied per item.


GETapi/v2/estimates/templates

List all estimate templates

This endpoint returns a list of all available estimate templates.

Request

GET
api/v2/estimates/templates
curl --request GET \
  --get "https://payments.your-domain.com/api/v2/estimates/templates" \
  --header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
  --header "Content-Type: application/json" \
  --header "Accept: application/json" \
  --header "business: 995c98ce-cdd9-4ef6-b018-9c696cb07e9d"

Response

{
  "estimateTemplates": [
    {
      "name": "estimate1",
      "path": "/templates/estimate1.png"
    },
    {
      "name": "estimate2",
      "path": "/templates/estimate2.png"
    },
    {
      "name": "estimate3",
      "path": "/templates/estimate3.png"
    }
  ]
}

GETapi/v2/estimates

List all estimates

This endpoint allows you to retrieve a paginated list of all your estimates.

Parameters

  • Name
    limit
    Type
    integer
    Description

    Limit the number of estimates to be returned.

  • Name
    page
    Type
    integer
    Description

    Page number (for pagination).

  • Name
    status
    Type
    string
    Description

    Filter records by status.

  • Name
    customer_id
    Type
    string
    Description

    Filter records by customer_id.

  • Name
    estimate_number
    Type
    integer
    Description

    Filter records by estimate_number.

  • Name
    from_date
    Type
    string
    Description

    Filter records by from_date.

  • Name
    to_date
    Type
    string
    Description

    Filter records by to_date.

  • Name
    type
    Type
    incoming
    Description

    By default, this endpoint returns a list of outgoing estimates, but you can also fetch incoming estimates of a business using this param.

Request

GET
api/v2/estimates
curl --request GET \
  --get "https://payments.your-domain.com/api/v2/estimates" \
  --header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
  --header "Content-Type: application/json" \
  --header "Accept: application/json" \
  --header "business: 995c98ce-cdd9-4ef6-b018-9c696cb07e9d"

Response

{
  "data":[
    {
      "id": "99745a4e-7a6b-4be4-a87e-2826e457ae06",
      "estimate_date": 1017705600,
      "expiry_date": 1594944000,
      "estimate_number": "EST-000001",
      "sequence_number": 1,
      "status": "DRAFT",
      "notes": "<p>The total amount of the attached estimate EST-000001 is $190.00</p>",
      "notes_raw": "<p>The total amount of the attached estimate {ESTIMATE_NUMBER} is {TOTAL_AMOUNT}</p>",
      "discount": 5,
      "discount_type": "percentage",
      "discount_val": 1000,
      "tax": 0,
      "sub_total": 20000,
      "total": 19000,
      "template_name": "estimate1",
      "customer_id": "98ed68ce-6964-4c2a-9430-8a849e373c52",
      "estimate_pdf_url": "https://payments.your-domain.com/estimates/pdf/99745a4e-7a6b-4be4-a87e-2826e457ae06",
      "attachments": [],
      "estimate_type" : "outgoing",
      "reject_reason": null,
      "customer": {},
      "business": {},
      "tax_per_item_enabled": false,
      "discount_per_item_enabled": false,
      "created_at": 1667663245
    }
  ]
}

POSTapi/v2/estimates

Create a estimate

This endpoint allows you to create an estimate.

  • An Estimate must have at least one line item.
  • An Estimate must have a reference to a customer.
  • If shipping address and billing address are not provided, the address from the referenced Customer is used.

Parameters

  • Name
    customer_id
    Type
    string
    Description

    Customer ID.

  • Name
    estimate_date
    Type
    timestamp
    Description

    Date of the estimate.

  • Name
    expiry_date
    Type
    timestamp
    Description

    Due Date.

  • Name
    tax_type_ids
    Type
    array
    Description

    Array of Tax type IDs.

  • Name
    estimate_number
    Type
    string
    Description

    Estimate Number.

  • Name
    discount_type
    Type
    string
    Description

    Type of discount: fixed or percentage.

  • Name
    discount
    Type
    integer
    Description

    Discount value. Pass percentage of the discount or the amount if the discount is fixed in cents. Example: 10 (percentage) or 1000(fixed).

  • Name
    notes
    Type
    string
    Description

    Estimate Notes.

  • Name
    template_name
    Type
    string
    Description

    Name of the template to be used for the Estimate PDF.

  • Name
    items[].name
    Type
    string
    Description

    Name of Item.

  • Name
    items[].quantity
    Type
    string
    Description

    Item Quantity.

  • Name
    items[].price
    Type
    string
    Description

    Item Price in cents.

  • Name
    items[].description
    Type
    string
    Description

    Item Description.

  • Name
    items[].item_id
    Type
    string
    Description

    Item ID. (optional)

  • Name
    items[].unit_name
    Type
    string
    Description

    Item Unit Name. (optional)

  • Name
    items[].discount
    Type
    integer
    Description

    Actual discount value that appears on the PDF. Pass percentage of the discount or the amount if the discount is fixed.

  • Name
    items[].discount_type
    Type
    string
    Description

    Type of discount: fixed or percentage.

  • Name
    items[].tax_type_ids
    Type
    array
    Description

    Array of Tax type IDs.

Request

POST
api/v2/estimates

curl --request POST \
  "https://payments.your-domain.com/api/v2/estimates" \
  --header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
  --header "Content-Type: application/json" \
  --header "Accept: application/json" \
  --header "business: 995c98ce-cdd9-4ef6-b018-9c696cb07e9d" \
  --data "{
    \"estimate_date\": \"357177600\",
    \"expiry_date\": \"1651795200\",
    \"customer_id\": \"98ed68ce-6964-4c2a-9430-8a849e373c52\",
    \"estimate_number\": \"EST-000001\",
    \"discount_type\": \"percentage\",
    \"discount\": \"5\",
    \"notes\": \"<p>The total amount of the attached estimate {ESTIMATE_NUMBER} is {TOTAL_AMOUNT}</p>\",
    \"template_name\": \"estimate1\",
    \"items\": [
      {
        \"name\": \"Laptop\",
        \"quantity\": \"2\",
        \"price\": \"10000\",
        \"description\": \"New Laptop with latest features\",
        \"item_id\": \"9911d6af-02ee-40dd-b8da-95df7301bd18\",
        \"unit_name\": \"box\",
        \"discount\": \"0\",
        \"discount_type\": \"fixed\"
      }
    ]
  }"

Response

{
  "data": {
    "id": "99745a4e-7a6b-4be4-a87e-2826e457ae06",
    "estimate_date": 1017705600,
    "expiry_date": 1594944000,
    "estimate_number": "EST-000001",
    "sequence_number": 1,
    "status": "DRAFT",
    "notes": "<p>The total amount of the attached estimate EST-000001 is $190.00</p>",
    "notes_raw": "<p>The total amount of the attached estimate {ESTIMATE_NUMBER} is {TOTAL_AMOUNT}</p>",
    "discount": 5,
    "discount_type": "percentage",
    "discount_val": 1000,
    "tax": 0,
    "sub_total": 20000,
    "total": 19000,
    "template_name": "estimate1",
    "customer_id": "98ed68ce-6964-4c2a-9430-8a849e373c52",
    "estimate_pdf_url": "https://payments.your-domain.com/estimates/pdf/99745a4e-7a6b-4be4-a87e-2826e457ae06",
    "attachments": [],
    "reject_reason": null,
    "converted_to_invoice": null,
    "estimate_type" : "outgoing",
    "items" : [
      {
        "id" : "99745a4e-7d35-4766-974d-1a225e2258ac",
        "name" : "Laptop",
        "description" : "New Laptop with latest features",
        "discount_type" : null,
        "quantity" : 2,
        "unit_name" : "box",
        "discount" : 0,
        "discount_val" : 0,
        "price" : 10000,
        "tax" : 0,
        "total" : 20000,
        "item_id" : "9911d6af-02ee-40dd-b8da-95df7301bd18",
        "estimate_id" : "99745a4e-7a6b-4be4-a87e-2826e457ae06",
        "business_id" : "995c98ce-cdd9-4ef6-b018-9c696cb07e9d",
      }
    ],
    "customer": {},
    "business": {},
    "estimate_status_allowed_states": [
      "SENT"
    ],
    "tax_per_item_enabled": false,
    "discount_per_item_enabled": false,
    "created_at": 1667663245
  }
}

GETapi/v2/estimates/{id}

Retrieve an estimate

This endpoint allows you to retrieve an estimate.

Parameters

  • Name
    id
    Type
    integer
    Description

    The ID of the estimate.

Request

GET
api/v2/estimates/{id}
curl --request GET \
  --get "https://payments.your-domain.com/api/v2/estimates/99745a4e-7a6b-4be4-a87e-2826e457ae06" \
  --header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
  --header "Content-Type: application/json" \
  --header "Accept: application/json" \
  --header "business: 995c98ce-cdd9-4ef6-b018-9c696cb07e9d"

Response

{
  "data": {
    "id": "99745a4e-7a6b-4be4-a87e-2826e457ae06",
    "estimate_date": 1017705600,
    "expiry_date": 1594944000,
    "estimate_number": "EST-000001",
    "sequence_number": 1,
    "status": "DRAFT",
    "notes": "<p>The total amount of the attached estimate EST-000001 is $190.00</p>",
    "notes_raw": "<p>The total amount of the attached estimate {ESTIMATE_NUMBER} is {TOTAL_AMOUNT}</p>",
    "discount": 5,
    "discount_type": "percentage",
    "discount_val": 1000,
    "tax": 0,
    "sub_total": 20000,
    "total": 19000,
    "template_name": "estimate1",
    "customer_id": "98ed68ce-6964-4c2a-9430-8a849e373c52",
    "estimate_pdf_url": "https://payments.your-domain.com/estimates/pdf/99745a4e-7a6b-4be4-a87e-2826e457ae06",
    "attachments": [],
    "reject_reason": null,
    "converted_to_invoice": null,
    "estimate_type" : "outgoing",
    "items" : [
      {
        "id" : "99745a4e-7d35-4766-974d-1a225e2258ac",
        "name" : "Laptop",
        "description" : "New Laptop with latest features",
        "discount_type" : null,
        "quantity" : 2,
        "unit_name" : "box",
        "discount" : 0,
        "discount_val" : 0,
        "price" : 10000,
        "tax" : 0,
        "total" : 20000,
        "item_id" : "9911d6af-02ee-40dd-b8da-95df7301bd18",
        "estimate_id" : "99745a4e-7a6b-4be4-a87e-2826e457ae06",
        "business_id" : "995c98ce-cdd9-4ef6-b018-9c696cb07e9d",
      }
    ],
    "customer": {},
    "estimate_status_allowed_states": [
      "SENT"
    ],
    "tax_per_item_enabled": false,
    "discount_per_item_enabled": false,
    "created_at": 1667663245
  }
}

PUTapi/v2/estimates/{id}

Update an estimate

This endpoint allows you to perform an update on estimate.

Parameters

  • Name
    id
    Type
    string
    Description

    The ID of the estimate.

Parameters

  • Name
    customer_id
    Type
    string
    Description

    Customer ID.

  • Name
    estimate_date
    Type
    timestamp
    Description

    Date of the estimate.

  • Name
    expiry_date
    Type
    timestamp
    Description

    Due Date.

  • Name
    tax_type_ids
    Type
    array
    Description

    Array of Tax type IDs.

  • Name
    estimate_number
    Type
    string
    Description

    Estimate Number.

  • Name
    discount_type
    Type
    string
    Description

    Type of discount: fixed or percentage.

  • Name
    discount
    Type
    integer
    Description

    Discount value. Pass percentage of the discount or the amount if the discount is fixed in cents. Example: 10 (percentage) or 1000(fixed).

  • Name
    notes
    Type
    string
    Description

    Estimate Notes.

  • Name
    template_name
    Type
    string
    Description

    Name of the template to be used for the Estimate PDF.

  • Name
    items[].name
    Type
    string
    Description

    Name of Item.

  • Name
    items[].quantity
    Type
    string
    Description

    Item Quantity.

  • Name
    items[].price
    Type
    string
    Description

    Item Price in cents.

  • Name
    items[].description
    Type
    string
    Description

    Item Description.

  • Name
    items[].item_id
    Type
    string
    Description

    Item ID. (optional)

  • Name
    items[].unit_name
    Type
    string
    Description

    Item Unit Name. (optional)

  • Name
    items[].discount
    Type
    integer
    Description

    Actual discount value that appears on the PDF. Pass percentage of the discount or the amount if the discount is fixed.

  • Name
    items[].discount_type
    Type
    string
    Description

    Type of discount: fixed or percentage.

  • Name
    items[].tax_type_ids
    Type
    array
    Description

    Array of Tax type IDs.

Request

PUT
api/v2/estimates/{id}
curl --request PUT \
  "https://payments.your-domain.com/api/v2/estimates/99745a4e-7a6b-4be4-a87e-2826e457ae06" \
  --header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
  --header "Content-Type: application/json" \
  --header "Accept: application/json" \
  --header "business: 995c98ce-cdd9-4ef6-b018-9c696cb07e9d" \
  --data "{
    \"estimate_date\": \"357177600\",
    \"expiry_date\": \"1651795200\",
    \"customer_id\": \"98ed68ce-6964-4c2a-9430-8a849e373c52\",
    \"estimate_number\": \"EST-000001\",
    \"discount_type\": \"percentage\",
    \"discount\": \"5\",
    \"notes\": \"<p>The total amount of the attached estimate {ESTIMATE_NUMBER} is {TOTAL_AMOUNT}</p>\",
    \"template_name\": \"estimate1\",
    \"items\": [
      {
        \"name\": \"Apple Macbook\",
        \"quantity\": \"2\",
        \"price\": \"10000\",
        \"description\": \"Light and powerful laptop\",
        \"item_id\": \"9911d6af-02ee-40dd-b8da-95df7301bd18\",
        \"unit_name\": \"box\",
        \"discount\": \"0\",
        \"discount_type\": \"fixed\"
      }
    ]
  }"

Response

{
  "data": {
    "id": "99745a4e-7a6b-4be4-a87e-2826e457ae06",
    "estimate_date": 1017705600,
    "expiry_date": 1594944000,
    "estimate_number": "EST-000001",
    "sequence_number": 1,
    "status": "DRAFT",
    "notes": "<p>The total amount of the attached estimate EST-000001 is $190.00</p>",
    "notes_raw": "<p>The total amount of the attached estimate {ESTIMATE_NUMBER} is {TOTAL_AMOUNT}</p>",
    "discount": 5,
    "discount_type": "percentage",
    "discount_val": 1000,
    "tax": 0,
    "sub_total": 20000,
    "total": 19000,
    "template_name": "estimate1",
    "customer_id": "98ed68ce-6964-4c2a-9430-8a849e373c52",
    "estimate_pdf_url": "https://payments.your-domain.com/estimates/pdf/99745a4e-7a6b-4be4-a87e-2826e457ae06",
    "attachments": [],
    "reject_reason": null,
    "converted_to_invoice": false,
    "estimate_type" : "outgoing",
    "items" : [
      {
        "id" : "99745a4e-7d35-4766-974d-1a225e2258ac",
        "name" : "Apple Macbook",
        "description" : "Light and powerful laptop",
        "discount_type" : "fixed",
        "quantity" : 2,
        "unit_name": "box",
        "discount" : 0,
        "discount_val" : 0,
        "price" : 10000,
        "tax" : 0,
        "total" : 20000,
        "item_id" : "9911d6af-02ee-40dd-b8da-95df7301bd18",
        "estimate_id" : "99745a4e-7a6b-4be4-a87e-2826e457ae06",
        "business_id" : "995c98ce-cdd9-4ef6-b018-9c696cb07e9d",
      }
    ],
    "customer": {},
    "estimate_status_allowed_states": [
      "SENT"
    ],
    "tax_per_item_enabled": false,
    "discount_per_item_enabled": false,
    "created_at": 1667663245
  }
}

DELETEapi/v2/estimates/{id}

Delete estimate

This endpoint allows you to delete a specific Estimate

Parameters

  • Name
    id
    Type
    integer
    Description

    The ID of the estimate.

Request

DELETE
api/v2/estimates/{id}
curl --request DELETE \
  "https://payments.your-domain.com/api/v2/estimates/99745a4e-7a6b-4be4-a87e-2826e457ae06" \
  --header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
  --header "Content-Type: application/json" \
  --header "Accept: application/json" \
  --header "business: 995c98ce-cdd9-4ef6-b018-9c696cb07e9d"

Response

{
  "id": "99745a4e-7a6b-4be4-a87e-2826e457ae06",
  "object": "Estimate",
  "deleted": true
}

POSTapi/v2/estimates/{id}/send-email

Send an estimate

This endpoint allows you to send the estimate link to the corresponding customer's email address.

Parameters

  • Name
    estimate_id
    Type
    integer
    Description

    The ID of the estimate.

Parameters

  • Name
    subject
    Type
    string
    Description
  • Name
    body
    Type
    string
    Description
  • Name
    reply_to
    Type
    string
    Description
  • Name
    to
    Type
    string
    Description

Request

POST
api/v2/estimates/{id}/send-email
curl --request POST \
  "https://payments.your-domain.com/api/v2/estimates/99745a4e-7a6b-4be4-a87e-2826e457ae06/send-email" \
  --header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
  --header "Content-Type: application/json" \
  --header "Accept: application/json" \
  --header "business: 995c98ce-cdd9-4ef6-b018-9c696cb07e9d" \
  --data "{
    \"subject\": \"You have received a new estimate from {VENDOR_BUSINESS_NAME}\",
    \"body\": \"<p>You have received a new estimate from {BUSINESS_NAME}.</p><p>Please view the estimate and approve it within 7 days of receiving this email.</p>\",
    \"reply_to\": \"business_email@example.com\",
    \"to\": \"customer_email@example.com\"
  }"

POSTapi/v2/estimates/{id}/approve

Approve an estimate

This endpoint allows you mark an estimate as APPROVED.

Parameters

  • Name
    estimate_id
    Type
    integer
    Description

    The ID of the estimate.

Request

POST
api/v2/estimates/{id}/approve
curl --request POST \
  "https://payments.your-domain.com/api/v2/estimates/9972ba71-7508-4fb0-955a-4f83be3461fc/approve" \
  --header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
  --header "Content-Type: application/json" \
  --header "Accept: application/json" \
  --header "business: 98ed68ce-6964-4c2a-9430-8a849e373c52"

POSTapi/v2/estimates/{id}/reject

Reject an incoming estimate.

This endpoint allows you to mark the given estimate as REJECTED.

Parameters

  • Name
    estimate_id
    Type
    integer
    Description

    The ID of the estimate.

Parameters

  • Name
    reason
    Type
    string
    Description

    Reason for rejection.

Request

POST
api/v2/estimates/{id}/reject
curl --request POST \
  "https://payments.your-domain.com/api/v2/estimates/99745a4e-7a6b-4be4-a87e-2826e457ae06/reject" \
  --header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
  --header "Content-Type: application/json" \
  --header "Accept: application/json" \
  --header "business: 98ed68ce-6964-4c2a-9430-8a849e373c52" \
  --data "{
    \"reason\": \"Price too high\"
  }"

POSTapi/v2/estimates/{id}/convert-to-invoice

Convert into invoice

This endpoint allows you to convert the given estimate into an invoice.

Parameters

  • Name
    estimate_id
    Type
    integer
    Description

    The ID of the estimate.

Request

POST
api/v2/estimates/{id}/convert-to-invoice
curl --request POST \
  "https://payments.your-domain.com/api/v2/estimates/99745a4e-7a6b-4be4-a87e-2826e457ae06/convert-to-invoice" \
  --header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
  --header "Content-Type: application/json" \
  --header "Accept: application/json" \
  --header "business: 995c98ce-cdd9-4ef6-b018-9c696cb07e9d"

Response

{
  "data": {
    "id": "9aae0110-a4d6-4552-99de-4b4d3e3432f8",
    "estimate_id": "99745a4e-7a6b-4be4-a87e-2826e457ae06",
    "invoice_date": 1017705600,
    "due_date": 1594944000,
    "invoice_number": "INV-000001",
    "status": "DRAFT",
    "paid_status": "UNPAID",
    "reject_reason": null,
    "notes": "<p>The total amount of the attached estimate EST-000001 is $190.00</p>",
    "notes_raw": "<p>The total amount of the attached estimate {ESTIMATE_NUMBER} is {TOTAL_AMOUNT}</p>",
    "discount_type": "percentage",
    "discount": 5,
    "discount_val": 1000,
    "sub_total": 20000,
    "tax": 0,
    "total": 19000,
    "due_amount": 19000,
    "sent_at": null,
    "viewed_at": null,
    "overdue_at": null,
    "template_name": "invoice1",
    "sequence_number": 1,
    "customer_id": "98ed68ce-6964-4c2a-9430-8a849e373c52",
    "invoice_pdf_url": "https://payments.your-domain.com/invoices/pdf/9aae0110-a4d6-4552-99de-4b4d3e3432f8",
    "attachments": [],
    "invoice_type" : "outgoing",
    "items" : [
      {
        "id" : "99745a4e-7d35-4766-974d-1a225e2258ac",
        "name" : "Apple Macbook",
        "description" : "Light and powerful laptop",
        "discount_type" : "fixed",
        "quantity" : 2,
        "unit_name" : "box",
        "discount" : 0,
        "discount_val" : 0,
        "price" : 10000,
        "tax" : 0,
        "total" : 20000,
        "item_id" : "9911d6af-02ee-40dd-b8da-95df7301bd18",
        "invoice_id" : "9aae0110-a4d6-4552-99de-4b4d3e3432f8",
        "business_id" : "995c98ce-cdd9-4ef6-b018-9c696cb07e9d",
      }
    ],
    "tax_per_item_enabled": false,
    "discount_per_item_enabled": false,
    "created_at": 1667663245
  }
}

GETapi/v2/estimates/{id}/attachments

List all attachment of an estimate

This endpoint is used to get all attachments of an estimate.

Parameters

  • Name
    estimate_id
    Type
    integer
    Description

    The ID of the estimate.

Request

GET
api/v2/estimates/{id}/attachments
curl --request GET \
  "https://payments.your-domain.com/api/v2/estimates/99745a4e-7a6b-4be4-a87e-2826e457ae06/attachments" \
  --header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
  --header "Content-Type: application/json" \
  --header "Accept: application/json" \
  --header "business: 995c98ce-cdd9-4ef6-b018-9c696cb07e9d"

Response

{
  "data": [
    {
      "id": 17,
      "estimate_id": "99745a4e-7a6b-4be4-a87e-2826e457ae06",
      "name": "logo-dark",
      "path": null,
      "url": null,
      "size": 151922,
      "mime_type": "image/png"
    }
  ]
}

POSTapi/v2/estimates/{id}/attachments

Add attachment to an estimate

This endpoint is used to upload attachments to an estimate.

Parameters

  • Name
    estimate_id
    Type
    integer
    Description

    The ID of the estimate.

Request

POST
api/v2/estimates/{id}/attachments
curl --request POST \
  "https://payments.your-domain.com/api/v2/estimates/99745a4e-7a6b-4be4-a87e-2826e457ae06/attachments" \
  --header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
  --header "Accept: application/json" \
  --header "Content-Type: multipart/form-data" \
  --header "business: 995c98ce-cdd9-4ef6-b018-9c696cb07e9d" \
  --form 'file=@"/path_to_attachment/crater_attachment.png"'

Response

{
  "data": [
    {
      "id": 17,
      "estimate_id": "99745a4e-7a6b-4be4-a87e-2826e457ae06",
      "name": "crater_attachment.png",
      "path": null,
      "url": null,
      "size": 151922,
      "mime_type": "image/png"
    }
  ]
}

GETapi/v2/estimates/{id}/attachments/{attachment_id}

Retrieve attachment of an estimate

This endpoint is used to get all attachments of an estimate.

Parameters

  • Name
    estimate_id
    Type
    integer
    Description

    The ID of the estimate.

  • Name
    attachment_id
    Type
    integer
    Description

    The ID of the attachment.

Request

GET
api/v2/estimates/{id}/attachments/{attachment_id}
curl --request GET \
  "https://payments.your-domain.com/api/v2/estimates/99745a4e-7a6b-4be4-a87e-2826e457ae06/attachments/17" \
  --header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
  --header "Content-Type: application/json" \
  --header "Accept: application/json" \
  --header "business: 995c98ce-cdd9-4ef6-b018-9c696cb07e9d"

Response

{
  "data": [
    {
      "id": 17,
      "estimate_id": "99745a4e-7a6b-4be4-a87e-2826e457ae06",
      "name": "logo-dark",
      "path": null,
      "url": null,
      "size": 151922,
      "mime_type": "image/png"
    }
  ]
}

DELETEapi/v2/estimates/{id}/attachments/{attachment_id}

Remove attachment from an estimate

This endpoint is used to remove attachment from an estimate.

Parameters

  • Name
    estimate_id
    Type
    integer
    Description

    The ID of the estimate.

  • Name
    attachment_id
    Type
    integer
    Description

    The ID of the attachment.

Request

DELETE
api/v2/estimates/{id}/attachments/{attachment_id}
curl --request DELETE \
  "https://payments.your-domain.com/api/v2/estimates/99745a4e-7a6b-4be4-a87e-2826e457ae06/attachments/17" \
  --header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
  --header "Content-Type: application/json" \
  --header "Accept: application/json" \
  --header "business: 995c98ce-cdd9-4ef6-b018-9c696cb07e9d"

Response

{
  "id" : 17,
  "object": "Attachment",
  "deleted" : true,
}