API ReferenceCommerce

Invoices

Payment methods, invoices, their transactions, and the refund calculator.

Invoices in Postman

About invoices

An invoice is what is owed, and a transaction is money moving at the payment provider; the order holds no money itself. A purchase makes both. An invoice starts as a draft, is issued, then paid, voided or refunded, and only a draft can be deleted. Transactions cannot be written through the API: they record what the payment calls did.

Payment methods are set up in the admin and only read here; the list is public, so a checkout can show it before anyone signs in. The routes the payment providers and the PayPal script call, the webhook and the PayPal order routes, are left out.

Statuses Draft to paid

draft, open, paid, void, refunded. Issuing moves a draft to open.

Orders, invoices and fulfilment
Deleting Drafts only

An issued invoice cannot be deleted.

Orders, invoices and fulfilment
Payment methods Read-only

Stripe, PayPal, PayPal Donate and Mock Pay are set up in the admin.

Payments

List payment methods#

GET /cdna-api/invoices/payment-methods

Lists the payment methods. Public, so a checkout can show them before anyone signs in; add active=1 for the ones in use. The list covers every site on the account, so keep the entries whose site is yours or null.

Access
Anyone. The route takes no credentials, by design.

Parameters

propertiesquery
selector
The fields and relations to return, such as {id,name,testMode,active}.
filtersquery
name=value
Any stored field, or a relation with a dot, such as parent.id=12. Prefix the name with !, >, <, % or |. Use stored field names exactly as in the model, and compare totalCount with the unfiltered list's to confirm a filter applied.
orderByquery
string
field:ASC or field:DESC, comma-separated. Stored fields only.
limitquery
integer
Records per response. There is no default.
offsetquery
integer
Records to skip.

Example

List payment methods
GET /cdna-api/invoices/payment-methods?active=1 HTTP/1.1
Host: hub.coredna.com
Accept: application/json
Response 200 OK
{
  "result": "success",
  "totalCount": 2,
  "data": {
    "paymentMethods": [
      {
        "publishableKey": "pk_test_ABCD",
        "accountId": "acct_H3GN35",
        "paymentServiceProviderName": "Stripe",
        "paymentServiceProviderType": "stripe",
        "paymentService": {},
        "id": 1,
        "name": "Stripe",
        "position": 1,
        "testMode": true,
        "created": "2025-07-24T06:46:34+00:00"
      },
      {
        "failureRate": "never",
        "authorizationSupported": false,
        "partialCaptureSupported": false,
        "paymentServiceProviderName": "Mock Pay",
        "paymentServiceProviderType": "mock-pay",
        "paymentService": {},
        "id": 2,
        "name": "Mock Pay",
        "position": 2,
        "testMode": false
      }
    ]
  }
}
Open in Postman docs Saved response from the Postman collection, shortened

Show a payment method#

GET /cdna-api/invoices/payment-method/{id}

Reads one payment method. Public, like the list.

Access
Anyone. The route takes no credentials, by design.

Parameters

idpathrequired
integer
The payment method id.

Example

Show a payment method
GET /cdna-api/invoices/payment-method/2 HTTP/1.1
Host: hub.coredna.com
Accept: application/json

List invoices#

GET /cdna-api/invoices/invoices

Lists invoices. Without limit every match comes back.

Access
Admin users and integrations, with an OAuth access token or an API key.
Model
Invoice, in the Reference

Parameters

propertiesquery
selector
The fields and relations to return, such as {id,status,total,currency{shortName}}.
filtersquery
name=value
Any stored field, or a relation with a dot, such as parent.id=12. Prefix the name with !, >, <, % or |. Use stored field names exactly as in the model, and compare totalCount with the unfiltered list's to confirm a filter applied.
orderByquery
string
field:ASC or field:DESC, comma-separated. Stored fields only.
limitquery
integer
Records per response. There is no default.
offsetquery
integer
Records to skip.

Example

List invoices
GET /cdna-api/invoices/invoices?limit=2&properties={id,status,total,currency{shortName}} HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json
Response 200 OK
{
  "result": "success",
  "totalCount": 1,
  "data": [
    {
      "id": 1,
      "status": "draft",
      "total": "0.0000",
      "currency": {
        "shortName": "USD"
      }
    }
  ]
}
Real response from this documentation site

Show an invoice#

GET /cdna-api/invoices/invoice/{id}

Reads one invoice by its id.

Access
Admin users and integrations, with an OAuth access token or an API key.
Model
Invoice, in the Reference

Parameters

idpathrequired
integer
The invoice id.
propertiesquery
selector
The fields and relations to return, such as {id,status,total,currency{shortName},billingAddress{firstName,lastName,postcode}}.

Example

Show an invoice
GET /cdna-api/invoices/invoice/1?properties={id,status,total,currency{shortName},billingAddress{firstName,lastName,postcode}} HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json
Response 200 OK
{
  "result": "success",
  "data": {
    "id": 1,
    "status": "draft",
    "total": "0.0000",
    "currency": {
      "shortName": "USD"
    },
    "billingAddress": {
      "firstName": "Alex",
      "lastName": "Example",
      "postcode": "3000"
    }
  }
}
Real response from this documentation site

Create an invoice#

POST /cdna-api/invoices/invoice

Creates a draft invoice. Most invoices are made by a purchase; this is for invoicing outside the checkout.

Access
Admin users and integrations, with an OAuth access token or an API key.
Returns
The new invoice, in the fields properties asks for, and a message.

Parameters

billingAddressbodyrequired
object
The address billed.
currencybody
integer
The currency, by id.
personbody
integer
The person billed, by id.
itemsbody
list
The invoice’s lines.

Example

Create an invoice
POST /cdna-api/invoices/invoice?properties={id,status,total,currency{shortName},billingAddress{firstName,lastName,postcode}} HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json
Content-Type: application/json

{
  "currency": 142,
  "billingAddress": {
    "firstName": "Alex",
    "lastName": "Example",
    "addressLine1": "1 Example Street",
    "suburb": "Melbourne",
    "stateName": "VIC",
    "postcode": "3000",
    "countryName": "Australia"
  }
}
Response 200 OK
{
  "result": "success",
  "data": {
    "id": 1,
    "status": "draft",
    "total": "0.00",
    "currency": {
      "shortName": "USD"
    },
    "billingAddress": {
      "firstName": "Alex",
      "lastName": "Example",
      "postcode": "3000"
    }
  },
  "message": "The Invoice has been added successfully."
}
Real response from this documentation site, shortened

Edit an invoice#

PUT /cdna-api/invoices/invoice/{id}

Changes an invoice. Fields left out keep their values.

Access
Admin users and integrations, with an OAuth access token or an API key.
Returns
The saved invoice under data.invoice, and a message.

Parameters

idpathrequired
integer
The invoice id.
billingAddress, person, itemsbody
As for Create an invoice.

Example

Edit an invoice
PUT /cdna-api/invoices/invoice/9 HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json
Content-Type: application/json

{
  "billingAddress": {
    "firstName": "Alex",
    "lastName": "Example",
    "addressLine1": "1 Example Street",
    "suburb": "Melbourne",
    "stateName": "VIC",
    "postcode": "3000",
    "countryName": "Australia"
  }
}

Issue an invoice#

PUT /cdna-api/invoices/invoice/{id}/issue

Moves a draft invoice to open. There is no body. Any other status is a 400, and an issued invoice can no longer be deleted.

Access
Admin users and integrations, with an OAuth access token or an API key.
Returns
The invoice under data.invoice, and a message.

Parameters

idpathrequired
integer
The invoice id.

Example

Issue an invoice
PUT /cdna-api/invoices/invoice/9/issue HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json

Delete an invoice#

DELETE /cdna-api/invoices/invoice/{id}

Deletes a draft invoice. An issued one is refused with “Issued invoices cannot be deleted”.

Access
Admin users and integrations, with an OAuth access token or an API key.

Parameters

idpathrequired
integer
The invoice id.

Example

Delete an invoice
DELETE /cdna-api/invoices/invoice/9 HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json

List transactions#

GET /cdna-api/invoices/transactions

Lists transactions: authorisations, captures, voids and refunds at the payment provider. Read-only. This site has none.

Access
Admin users and integrations, with an OAuth access token or an API key.
Model
Transaction, in the Reference

Parameters

propertiesquery
selector
The fields and relations to return, such as {id,type,status,amount}.
filtersquery
name=value
Any stored field, or a relation with a dot, such as parent.id=12. Prefix the name with !, >, <, % or |. Use stored field names exactly as in the model, and compare totalCount with the unfiltered list's to confirm a filter applied.
orderByquery
string
field:ASC or field:DESC, comma-separated. Stored fields only.
limitquery
integer
Records per response. There is no default.
offsetquery
integer
Records to skip.

Example

List transactions
GET /cdna-api/invoices/transactions?limit=2&properties={id,type,status,amount} HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json
Response 200 OK
{
  "result": "success",
  "totalCount": 0,
  "data": []
}
Real response from this documentation site

Calculate a refund#

POST /cdna-api/invoices/invoice/{invoice.id}/calculate-refund

Works out a refund without making it: nothing is saved. Refunds themselves are issued in the admin.

Access
Admin users and integrations, with an OAuth access token or an API key.
Returns
The calculated refund, with its items and totals.

Parameters

invoice.idpathrequired
integer
The invoice id.
refundItemsbody
list
The lines refunded: invoiceItem and quantity.
adjustmentTotalbody
string
Added to the refund; negative for a fee such as restocking.
reasonbody
string
Why.

Example

Calculate a refund
POST /cdna-api/invoices/invoice/9/calculate-refund HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json
Content-Type: application/json

{
  "refundItems": [
    {
      "invoiceItem": 31,
      "quantity": 1
    }
  ],
  "adjustmentTotal": "-5.00",
  "reason": "Returned, restocking fee"
}