CloudOverture

Quickstart

This creates an account and an invoice with two lines, sends the invoice without an email, and reads its customer page link. Run each step in a terminal, against your sandbox, with a co_test_ key.

1. Create a key

In your sandbox, go to Settings → Developers and click Create key. Give it Read and write on accounts and invoices, and check Send invoices. Copy the key when it is shown: this is the only time you see the whole key. Keep it in a shell variable:

export CO_API_KEY=co_test_...

2. Call GET /v1/key

curl https://api.cloudoverture.com/v1/key \
  -H "Authorization: Bearer $CO_API_KEY"

The answer names the key, its company, its scopes, and the version that answered. A test key answers "livemode": false.

3. Create an account

curl https://api.cloudoverture.com/v1/accounts \
  -H "Authorization: Bearer $CO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "Maple Street Landscaping", "is_customer": true}'

Keep the account's id:

export ACCOUNT_ID=acct_...

4. Create an invoice with two lines

curl https://api.cloudoverture.com/v1/invoices \
  -H "Authorization: Bearer $CO_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: quickstart-invoice-1" \
  --data @- <<EOF
{
  "account": "$ACCOUNT_ID",
  "currency": "usd",
  "lines": [
    {"line_type": "custom", "name": "Spring cleanup", "quantity": "1", "unit_price": "400.00"},
    {"line_type": "custom", "name": "Mulch, per yard", "quantity": "2", "unit_price": "40.00"}
  ]
}
EOF

The invoice is a draft: nothing posts and nobody is emailed. The server computes the totals, so grand_total reads "480.00". Keep the invoice's id:

export INVOICE_ID=inv_...

5. Send it with delivery: "none"

curl https://api.cloudoverture.com/v1/invoices/$INVOICE_ID/send \
  -H "Authorization: Bearer $CO_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: quickstart-send-1" \
  -d '{"delivery": "none"}'

"none" numbers the invoice, posts it, and makes its customer page link. It emails nobody and turns reminders off.

6. Read its hosted_url

curl https://api.cloudoverture.com/v1/invoices/$INVOICE_ID \
  -H "Authorization: Bearer $CO_API_KEY"

hosted_url is the customer's page for the invoice. Open it to see the result.

Next, read the API reference and the errors a correct integration still sees.