Skip to content

API reference

Keep or dismiss a likely duplicate

Invoices API

POST/v1/invoices/{id}/duplicate

An invoice with the same seller, number, issue date, currency and amount as another invoice of this company and direction is filed as usual and held as a likely duplicate: its duplicate names the earlier invoice and its history says api:duplicate-suspected. It is never refused, and it is not emailed by itself while held. This decides it, once. keep writes api:duplicate-kept, and an invoice whose plan sends it by itself is queued then. dismiss writes api:duplicate-dismissed. A signed-in person or an API key may decide.

Path parameters

  • idstring (uuid)Required

Request body

application/json, required

  • decisionstringRequired
    One of keep, dismiss.

Response

A 200 answer carries these fields.

  • duplicateobjectRequired
    Show 2 child fields
    • ofstring (uuid)Required

      The earlier invoice this one repeats.

    • decisionstring or nullRequired
      One of kept, dismissed, null.

Status codes

Status Meaning
200 The decision was kept.
400 The body is not { "decision": "keep" | "dismiss" } (invalid_duplicate_decision).
401 No usable credential was sent (invalid_credentials).
404 This company has no such invoice (unknown_invoice).
409 The invoice was not held as a likely duplicate (not_a_likely_duplicate), or it was already decided (duplicate_already_decided).
503 No database is configured (store_unavailable).
POST/v1/invoices/{id}/duplicate
Example
curl -X POST https://api.certinvo.com/v1/invoices/$INVOICE_ID/duplicate \
  -H "Authorization: Bearer $CERTINVO_API_KEY" \
  -H "Content-Type: application/json" \
  --data-binary @body.json
import { readFile } from 'node:fs/promises'

const invoiceId = '3f0c2a5e-8d1b-4c7a-9e2f-6b5d4a3c2b1a'

const response = await fetch(`https://api.certinvo.com/v1/invoices/${invoiceId}/duplicate`, {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.CERTINVO_API_KEY}`,
    'Content-Type': 'application/json',
  },
  body: await readFile('body.json'),
})
console.log(response.status, await response.json())
import os

import requests

invoice_id = "3f0c2a5e-8d1b-4c7a-9e2f-6b5d4a3c2b1a"

response = requests.post(
    f"https://api.certinvo.com/v1/invoices/{invoice_id}/duplicate",
    headers={"Authorization": f"Bearer {os.environ['CERTINVO_API_KEY']}", "Content-Type": "application/json"},
    data=open("body.json", "rb"),
)
print(response.status_code, response.text)
200
application/json
{
  "duplicate": {
    "of": "3f0c2a5e-8d1b-4c7a-9e2f-6b5d4a3c2b1a",
    "decision": "kept"
  }
}
Success response
POST
/v1/invoices/{id}/duplicate
Keep or dismiss a likely duplicate
All
›AuthenticationRequiredBearerAuth

Provide your API key in the Authorization: Bearer <key> header. Keys are stored locally in your browser.

›Variables1
›Headers2
›Bodyapplication/json
›Code Snippet
curl -X POST "https://api.certinvo.com/v1/invoices/{id}/duplicate" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "decision": "keep"
}...'
Response

No request sent yet

Configure parameters and click Send to view the response.

Navigation

Type to search…

↑↓ navigate↵ selectEsc close