NAV
cURL Node.js PHP Ruby Python Go C# Java

Introduction

To use the Blixo API in different languages, follow these general steps:

1. Construct the URL for the API endpoint you want to access. For example, to access the invoices endpoint, the URL is https://api.blixo.com/v1/invoices.

2. Set up your HTTP request. The type of request (GET, POST, etc.) will depend on what action you want to perform.

3. Include your API key in the 'Authorization' header of the request. The format should be 'Basic ' followed by your API key and a colon, all encoded in base64. For example, in JavaScript you can use 'Basic ' + Buffer.from('{API_KEY}:').toString('base64').

4. Send the request and handle the response. The response will contain the data you requested, or an error message if something went wrong.

Welcome to Blixo's API documentation!

Blixo isn't just any regular billing API—it's your comprehensive solution for automating the entire order to cash (O2C) cycle and efficiently managing your accounts receivables (AR). We designed our robust API with your business in mind, automating complex financial operations and business workflows.

Whether you're looking to offer Buy Now, Pay Later (BNPL) to your customers, automate invoicing, manage subscriptions, charge for usage-based billing, reconcile invoices with bank transactions, chase customers for payment, generate quotes, or facilitate payments and orders, Blixo has you covered.

API Design

The Blixo API follows REST design principles, ensuring intuitive and predictable interactions. Here's what you can expect:

API Endpoint

For your integration, direct all API requests to:
https://api.blixo.com/v1/

Need Assistance?

We're here to help. For any queries, feedback, or sensitive discussions regarding the API, feel free to drop us a line at support@blixo.com.

Authentication

The Blixo API employs a method known as HTTP Basic Authentication to verify the identity of users. This is a simple, yet effective, security measure that requires a valid API key to be included with all requests. Think of the API key as your digital passport, granting you access to the wonderful world of Blixo's services. Without it, you won't be able to make any requests, so keep it safe!

Obtaining an API Key

Getting your hands on an API key is as easy as pie! Just follow these simple steps:

  1. Sign in to your account on blixo.com.
  2. Navigate to the 'Settings' section.
  3. From there, head over to the 'Developers' subsection.
  4. Click on API Keys.

Voila! You now have your API key. Remember, each business on Blixo has its own unique set of API keys. To keep things organized and secure, we suggest creating a separate API key for each application that will be making calls on your behalf.

Usage

curl "https://api.blixo.com/v1/customers" \
-u {API_KEY}:
const fetch = require('node-fetch');

const url = 'https://api.blixo.com/v1/customers';
const options = {
  method: 'GET',
  headers: {
    'Authorization': 'Basic {API_KEY}'
  }
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error('error:' + err));
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.blixo.com/v1/customers",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => array(
    "Authorization: Basic {API_KEY}"
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

?>
require 'uri'
require 'net/http'

url = URI("https://api.blixo.com/v1/customers")

https = Net::HTTP.new(url.host, url.port);
https.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = "Basic {API_KEY}"

response = https.request(request)
puts response.read_body
import requests

url = "https://api.blixo.com/v1/customers"

headers = {
  'Authorization': 'Basic {API_KEY}'
}

response = requests.request("GET", url, headers=headers)

print(response.text)
package main

import (
    "fmt"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://api.blixo.com/v1/customers"
    method := "GET"

    client := &http.Client {
    }
    req, err := http.NewRequest(method, url, nil)

    if err != nil {
        fmt.Println(err)
        return
    }
    req.Header.Add("Authorization", "Basic {API_KEY}")

    res, err := client.Do(req)
    defer res.Body.Close()
    body, err := ioutil.ReadAll(res.Body)

    fmt.Println(string(body))
}
var client = new RestClient("https://api.blixo.com/v1/customers");
client.Timeout = -1;
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Basic {API_KEY}");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
import java.util.Base64;

public class Main {
    public static void main(String[] args) throws Exception {
        OkHttpClient client = new OkHttpClient();

        String userCredentials = "{API_KEY}:";
        String basicAuth = "Basic " + Base64.getEncoder().encodeToString(userCredentials.getBytes());

        Request request = new Request.Builder()
                .url("https://api.blixo.com/v1/customers")
                .get()
                .addHeader("Authorization", basicAuth)
                .build();

        Response response = client.newCall(request).execute();

        System.out.println("Response Code : " + response.code());
        System.out.println(response.body().string());
    }
}

The API key must be passed in through the username with the password left blank. The right sidebar has an example request with authorization

Errors

Each API call returns an HTTP status code that reflects the nature of the response. We have done our best to follow the HTTP status code conventions.

Any request that did not succeed will return a 4xx or 5xx error. The 4xx range means there was a problem with the request, like a missing parameter. The 5xx range means that something went wrong on our end.

The Blixo API uses the following error codes:

Error Code Meaning
400 Bad Request -- Your request is invalid.
401 Unauthorized -- Your API key is wrong.
403 Forbidden -- The kitten requested is hidden for administrators only.
404 Not Found -- The specified kitten could not be found.
405 Method Not Allowed -- You tried to access a kitten with an invalid method.
406 Not Acceptable -- You requested a format that isn't json.
410 Gone -- The kitten requested has been removed from our servers.
429 Too Many Requests -- You're requesting too many kittens! Slow down!
500 Internal Server Error -- We had a problem with our server. Try again later.
503 Service Unavailable -- We're temporarily offline for maintenance. Please try again later.

Pagination

Link: "<https://api.blixo.com/v1/customers?page=3&perPage=10>; rel="self",
      <https://api.blixo.com/v1/customers?page=1&perPage=10>; rel="first",
      <https://api.blixo.com/v1/customers?page=2&perPage=10>; rel="previous",
      <https://api.blixo.com/v1/customers?page=4&perPage=10>; rel="next",
      <https://api.blixo.com/v1/customers?page=5&perPage=10>; rel="last""

All list operations will be paginated in similar fashion as the GitHub API. In most cases we will paginate requests returning more than 100 results. You can control pagination with the page and perPage parameters. Pages start at 1 and the first page will be returned if no page is specified.

When traversing the pages, we recommend using the Link and X-Total-Count headers. The Link header will return URLs that you can use to traverse the API without having to write your own. It’s preferred to use the links from the API because it protects against future updates.

Customers

Customer object

Attribute Type Description
id ObjectId The ID of the customer.
customerNo String The customer number.
name String The name of the customer.
customerType String The type of the customer, either COMPANY or INDIVIDUAL.
email String The email of the customer.
address Object The customer's address. It includes the following sub-attributes:
attn: String - The attention line in the customer's address.
phones: Array - The phone numbers associated with the customer's address.
address1: String - The primary address line of the customer's address.
address2: String - The secondary address line of the customer's address.
city: String - The city of the customer's address.
state: String - The state of the customer's address.
zipCode: String - The zip code of the customer's address.
country: String - The country of the customer's address.
integrations: Object - The integrations associated with the customer's address.
parentCustomerId ObjectId The ID of the parent customer.
billToParent Boolean Whether to bill to the parent customer.
language String The language of the customer.
taxable Boolean Whether the customer is taxable.
taxIds Array The tax IDs of the customer.
creditHold Boolean Whether the customer is on credit hold.
creditLimit Object The credit limit of the customer. It includes the following attributes:
value: Number - The value of the credit limit.
unit: String - The unit of the credit limit.
currency: String - The currency of the credit limit. Default is USD.
balanceAmount Object The balance amount of the customer. It includes the following attributes:
value: Number - The value of the balance amount.
unit: String - The unit of the balance amount.
currency: String - The currency of the balance amount. Default is USD.
contacts Array The contacts of the customer.
primaryContactId ObjectId The ID of the primary contact of the customer.
autopay Boolean Whether autopay is enabled for the customer.
autoConvertInvoice Boolean Whether to auto convert invoice for the customer.
paymentTerms String The payment terms for the customer.
paymentSource Object The source of the payment. It includes the following attributes:
id: ObjectId - The ID of the payment source
paymentGatewayType: String - The type of the payment gateway. It is required and can be patched, posted, and fetched.
paymentGatewayId: ObjectId - The ID of the payment gateway. It can be patched, posted, and fetched.
paymentMethodDetails: Object - The details of the payment method. It can be patched, posted, and fetched.
billingAddress: Object - The billing address. It includes the following sub-attributes: firstName, lastName, phone, company, address1, address2, city, state, zipCode, country, and countryCode. All of these sub-attributes are of type String, have a default value of an empty string, and can be patched, posted, and fetched.
paymentSourceRefs Array The IDs of the payment sources for the customer.
paymentDate Number The payment date of the customer.
disabledPaymentMethods Array The disabled payment methods for the customer.
managerId ObjectId The ID of the manager of the customer.
userId ObjectId The ID of the user of the customer.
notes String Any notes regarding the customer.
isChasingPaused Boolean Whether chasing is paused for the customer.
chasingEnabled Boolean Whether chasing is enabled for the customer.
chasingId ObjectId The ID of the chasing of the customer.
nextChasingStepId ObjectId The ID of the next chasing step of the customer.
companyId ObjectId The ID of the company of the customer.
enabled Boolean Whether the customer is enabled.
braintree Object The braintree information of the customer.
stripe Object The stripe information of the customer.
isDeleted Boolean Whether the customer is deleted.
createdBy ObjectId The ID of the user who created the customer.
updatedBy ObjectId The ID of the user who last updated the customer.
createdAt Date The date when the customer was created.
updatedAt Date The date when the customer was last updated.
deletedBy ObjectId The ID of the user who deleted the customer.
deletedAt Date The date when the customer was deleted.
signUpPageId ObjectId The ID of the sign up page of the customer.
source String The source of the customer.
integrations Object The integrations of the customer.

List all customers

curl "https://api.blixo.com/v1/customers" \
-u {API_KEY}:
const fetch = require('node-fetch');
const url = 'https://api.blixo.com/v1/customers';
const options = {
  method: 'GET',
  headers: {
    'Authorization': 'Basic ' + Buffer.from('{API_KEY}:').toString('base64')
  }
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error('error:' + err));
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.blixo.com/v1/customers",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => array(
    "Authorization: Basic " . base64_encode("{API_KEY}:")
  ),
));
$response = curl_exec($curl);
curl_close($curl);
?>
require 'net/http'
require 'uri'
require 'base64'

uri = URI.parse("https://api.blixo.com/v1/customers")
request = Net::HTTP::Get.new(uri)
request["Authorization"] = "Basic " + Base64.strict_encode64("{API_KEY}:")

req_options = {
  use_ssl: uri.scheme == "https",
}

response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|
  http.request(request)
end
import requests
from requests.structures import CaseInsensitiveDict
import base64

url = "https://api.blixo.com/v1/customers"

headers = CaseInsensitiveDict()
headers["Authorization"] = "Basic " + base64.b64encode("{API_KEY}:".encode()).decode()

resp = requests.get(url, headers=headers)
package main
import (
    "fmt"
    "net/http"
    "io/ioutil"
    "encoding/base64"
)
func main() {
    url := "https://api.blixo.com/v1/customers"
    req, _ := http.NewRequest("GET", url, nil)
    req.Header.Add("Authorization", "Basic " + base64.StdEncoding.EncodeToString([]byte("{API_KEY}:")))
    res, _ := http.DefaultClient.Do(req)
    defer res.Body.Close()
}
using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;

class Program
{
    static void Main()
    {
        var task = Task.Run(() => SendRequest());
        task.Wait();
    }

    static async Task SendRequest()
    {
        var client = new HttpClient();
        var request = new HttpRequestMessage
        {
            Method = HttpMethod.Get,
            RequestUri = new Uri("https://api.blixo.com/v1/customers"),
        };
        var byteArray = Encoding.ASCII.GetBytes("{API_KEY}:");
        request.Headers.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", Convert.ToBase64String(byteArray));
        var response = await client.SendAsync(request);
        Console.WriteLine(await response.Content.ReadAsStringAsync());
    }
}
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
import java.util.Base64;

public class Main {
    public static void main(String[] args) throws Exception {
        OkHttpClient client = new OkHttpClient();

        String userCredentials = "{API_KEY}:";
        String basicAuth = "Basic " + Base64.getEncoder().encodeToString(userCredentials.getBytes());

        Request request = new Request.Builder()
                .url("https://api.blixo.com/v1/customers")
                .get()
                .addHeader("Authorization", basicAuth)
                .build();

        Response response = client.newCall(request).execute();

        System.out.println("Response Code : " + response.code());
        System.out.println(response.body().string());
    }
}

The above command returns JSON structured like this:

[
  {
            "id": "6359246217320f015d7b90e9",
            "customerNo": "CUS-0408",
            "name": "Blixo Customer",
            "customerType": "COMPANY",
            "email": "customer@blixo.com",
            "parentCustomerId": "65281bfa9713c6c0aabcbfc0",
            "billToParent": true,
            "language": "English",
            "taxable": true,
            "taxIds": ["5f47e0c9b54764421b716f1c"],
            "creditHold": true,
            "contacts": [
                {
                    "billingContact": true,
                    "phone": "123-456-7890",
                    "address1": "123 Main St",
                    "address2": "Apt 4B",
                    "city": "Boston",
                    "state": "MA",
                    "zipCode": "02110",
                    "country": "USA",
                    "_id": "6359246217320f015d7b90ea",
                    "name": "Blixo Customer",
                    "email": "customer@blixo.com",
                    "title": "Manager",
                    "department": "Sales"
                }
            ],
            "primaryContactId": "6359246217320f015d7b90ea",
            "autopay": true,
            "autoConvertInvoice": true,
            "paymentSources": [
                {
                    "_id": "60d5ecb44b93ba2a46ecb4bb",
                    "paymentGatewayType": "STRIPE",
                    "paymentGatewayId": "60d5ecb44b93ba2a46ecb4ba",
                    "paymentMethodDetails": {
                        "cardNumber": "1234-5678-9012-3456",
                        "expiryDate": "12/24",
                        "cvv": "123"
                    },
                    "billingAddress": {
                        "firstName": "John",
                        "lastName": "Doe",
                        "phone": "123-456-7890",
                        "company": "Blixo",
                        "address1": "123 Main St",
                        "address2": "Apt 4B",
                        "city": "Boston",
                        "state": "MA",
                        "zipCode": "02110",
                        "country": "USA",
                        "countryCode": "US"
                    },
                    "deleted": false,
                    "marked": false,
                    "createdAt": "2022-10-26T12:13:22.878Z"
                }
            ],
            "paymentSourceRefs": ["60d5ecb44b93ba2a46ecb4bb"],
            "paymentDate": 30,
            "disabledPaymentMethods": ["CASH", "CHECK", "WIRE", "ACH"],
            "notes": "This is a randomly generated note for testing purposes.",
            "isChasingPaused": false,
            "chasingEnabled": true,
            "chasingId": "60d5ecb44b93ba2a46ecb4b8",
            "nextChasingStepId": "60d5ecb44b93ba2a46ecb4b9",
            "companyId": "622294998bec060152bcad9c",
            "enabled": true,
            "createdAt": "2022-10-26T12:13:22.878Z",
            "updatedAt": "2022-10-26T12:13:22.938Z",
            "source": "BLIXO",
            "address": {
                "attn": "Blixo Customer",
                "phones": ["123-456-7890"],
                "address1": "123 Main St",
                "address2": "Apt 4B",
                "city": "Boston",
                "state": "MA",
                "zipCode": "02110",
                "country": "USA"
            },
            "signInToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"
  }
]

This API endpoint allows you to retrieve a list of all customers in the database. It's as simple as sending a GET request to https://api.blixo.com/v1/customers. Think of it as asking the server, "Hey, can I get a list of all your customers?" And the server responds with the information you asked for!

HTTP Request

GET https://api.blixo.com/v1/customers

Headers

Key Value
Authorization Basic {API_KEY}

Parameters

Parameter Type Description
page Integer The page number to retrieve. Default is 1.
perPage Integer The number of customers to retrieve per page. Default is 100.

Example

To list all customers, you would send a GET request to https://api.blixo.com/v1/customers. Remember to replace {API_KEY} with your actual API key.

If you want to retrieve the third page of customers, with 50 customers per page, you would send a GET request to https://api.blixo.com/v1/customers?page=3&perPage=50.

Response

The response will be a JSON object with a data key containing an array of customers. Each customer will be an object with the following keys:

If the request is successful, you will receive a 200 OK status code. If something goes wrong, you will receive a 4xx or 5xx status code, with a JSON object containing more information about the error.

Create a customer

curl "https://api.blixo.com/v1/customers" \
-u {API_KEY}: \
-d name="Blixo Customer" \
-d email="customer@blixo.com" \
-d paymentTerms="NET_30" \
-d address[attn]="Sale Manager" \
-d address[address1]="2232 Stiles Street" \
-d address[city]="Bridgeville" \
-d address[state]="PA" \
-d address[zipCode]="15017" \
-d address[country]="US" \
-d address[phones][0]="412-603-3268" \
-d address[phones][1]="412-292-0048" \
-X POST
const fetch = require('node-fetch');

const url = 'https://api.blixo.com/v1/customers';
const options = {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': 'Basic ' + Buffer.from('{API_KEY}:').toString('base64')
  },
  body: JSON.stringify({
    "name": "Blixo Customer",
    "email": "customer@blixo.com",
    "paymentTerms": "NET_30",
    "address": {
      "attn": "Sale Manager",
      "address1": "2232 Stiles Street",
      "city": "Bridgeville",
      "state": "PA",
      "zipCode": "15017",
      "country": "US",
      "phones": ["412-603-3268", "412-292-0048"]
    }
  })
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error('error:' + err));
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.blixo.com/v1/customers',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => json_encode(array(
    "name" => "Blixo Customer",
    "email" => "customer@blixo.com",
    "paymentTerms" => "NET_30",
    "address" => array(
      "attn" => "Sale Manager",
      "address1" => "2232 Stiles Street",
      "city" => "Bridgeville",
      "state" => "PA",
      "zipCode" => "15017",
      "country" => "US",
      "phones" => array("412-603-3268", "412-292-0048")
    )
  )),
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'Authorization: Basic '. base64_encode('{API_KEY}:')
  ),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
?>
require 'uri'
require 'net/http'
require 'openssl'

url = URI("https://api.blixo.com/v1/customers")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request["Authorization"] = 'Basic ' + Base64.strict_encode64('{API_KEY}:')
request.body = {
  "name": "Blixo Customer",
  "email": "customer@blixo.com",
  "paymentTerms": "NET_30",
  "address": {
    "attn": "Sale Manager",
    "address1": "2232 Stiles Street",
    "city": "Bridgeville",
    "state": "PA",
    "zipCode": "15017",
    "country": "US",
    "phones": ["412-603-3268", "412-292-0048"]
  }
}.to_json

response = http.request(request)
puts response.read_body
import requests
import base64

url = "https://api.blixo.com/v1/customers"

payload = {
  "name": "Blixo Customer",
  "email": "customer@blixo.com",
  "paymentTerms": "NET_30",
  "address": {
    "attn": "Sale Manager",
    "address1": "2232 Stiles Street",
    "city": "Bridgeville",
    "state": "PA",
    "zipCode": "15017",
    "country": "US",
    "phones": ["412-603-3268", "412-292-0048"]
  }
}
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Basic ' + base64.b64encode('{API_KEY}:'.encode()).decode()
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
package main

import (
    "bytes"
    "encoding/base64"
    "encoding/json"
    "fmt"
    "net/http"
)

func main() {
    url := "https://api.blixo.com/v1/customers"
    var jsonStr = []byte(`{
        "name": "Blixo Customer",
        "email": "customer@blixo.com",
        "paymentTerms": "NET_30",
        "address": {
            "attn": "Sale Manager",
            "address1": "2232 Stiles Street",
            "city": "Bridgeville",
            "state": "PA",
            "zipCode": "15017",
            "country": "US",
            "phones": ["412-603-3268", "412-292-0048"]
        }
    }`)
    req, _ := http.NewRequest("POST", url, bytes.NewBuffer(jsonStr))
    req.Header.Set("Content-Type", "application/json")
    req.Header.Set("Authorization", "Basic "+base64.StdEncoding.EncodeToString([]byte("{API_KEY}:")))

    client := &http.Client{}
    resp, err := client.Do(req)
    if err != nil {
        panic(err)
    }
    defer resp.Body.Close()

    fmt.Println("response Status:", resp.Status)
}
using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;

class Program
{
    static async Task Main(string[] args)
    {
        var client = new HttpClient();
        var request = new HttpRequestMessage
        {
            Method = HttpMethod.Post,
            RequestUri = new Uri("https://api.blixo.com/v1/customers"),
            Headers =
            {
                { "Content-Type", "application/json" },
                { "Authorization", "Basic " + Convert.ToBase64String(Encoding.ASCII.GetBytes("{API_KEY}:")) },
            },
            Content = new StringContent(
                @"{
                    ""name"": ""Blixo Customer"",
                    ""email"": ""customer@blixo.com"",
                    ""paymentTerms"": ""NET_30"",
                    ""address"": {
                        ""attn"": ""Sale Manager"",
                        ""address1"": ""2232 Stiles Street"",
                        ""city"": ""Bridgeville"",
                        ""state"": ""PA"",
                        ""zipCode"": ""15017"",
                        ""country"": ""US"",
                        ""phones"": [""412-603-3268"", ""412-292-0048""]
                    }
                }", Encoding.UTF8, "application/json")
        };
        var response = await client.SendAsync(request);
        response.EnsureSuccessStatusCode();
        var body = await response.Content.ReadAsStringAsync();
        Console.WriteLine(body);
    }
}
import okhttp3.OkHttpClient;
import okhttp3.MediaType;
import okhttp3.RequestBody;
import okhttp3.Request;
import okhttp3.Response;

public class Main {
    public static void main(String[] args) throws Exception {
        OkHttpClient client = new OkHttpClient.Builder().build();
        MediaType mediaType = MediaType.parse("application/json");
        RequestBody body = RequestBody.create(mediaType, `{
            "name": "Blixo Customer",
            "email": "customer@blixo.com",
            "paymentTerms": "NET_30",
            "address": {
                "attn": "Sale Manager",
                "address1": "2232 Stiles Street",
                "city": "Bridgeville",
                "state": "PA",
                "zipCode": "15017",
                "country": "US",
                "phones": ["412-603-3268", "412-292-0048"]
            }
        }`);
        Request request = new Request.Builder()
            .url("https://api.blixo.com/v1/customers")
            .method("POST", body)
            .addHeader("Content-Type", "application/json")
            .addHeader("Authorization", "Basic {API_KEY}")
            .build();
        Response response = client.newCall(request).execute();
        System.out.println(response.body().string());
    }
}

The above command returns JSON structured like this:

  {
    "id": "65281d2ca5f929c842db0299",
    "customerNo": "888234223",
    "name": "Blixo Customer",
    "customerType": "COMPANY",
    "email": "customer@blixo.com",
    "parentCustomerId": "65281d2ca5f929c842db0298",
    "billToParent": false,
    "language": "EN",
    "taxable": false,
    "taxIds": ["123456789"],
    "creditHold": false,
    "contacts": [
        {
            "id": "65281d2ca5f929c842db0297",
            "name": "John Doe",
            "billingContact": false,
            "title": "Sales Manager",
            "department": "Sales",
            "email": "johndoe@blixo.com",
            "phone": "123-456-7890",
            "address1": "123 Main St",
            "address2": "Apt 4B",
            "city": "Boston",
            "state": "MA",
            "zipCode": "02110",
            "country": "US"
        }
    ],
    "primaryContactId": "65281d2ca5f929c842db0297",
    "autopay": false,
    "autoConvertInvoice": true,
    "paymentTerms": "DUE_ON_RECEIPT",
    "paymentSources": [
        {
            "_id": "60d5ecb44b93ba2a46ecb4bb",
            "paymentGatewayType": "STRIPE",
            "paymentGatewayId": "60d5ecb44b93ba2a46ecb4ba",
            "paymentMethodDetails": {
                "cardNumber": "1234-5678-9012-3456",
                "expiryDate": "12/24",
                "cvv": "123"
            },
            "billingAddress": {
                "firstName": "John",
                "lastName": "Doe",
                "phone": "123-456-7890",
                "company": "Blixo",
                "address1": "123 Main St",
                "address2": "Apt 4B",
                "city": "Boston",
                "state": "MA",
                "zipCode": "02110",
                "country": "USA",
                "countryCode": "US"
            },
            "deleted": false,
            "marked": false,
            "createdAt": "2022-10-26T12:13:22.878Z"
        }
    ],
    "paymentSourceRefs": ["60d5ecb44b93ba2a46ecb4bb"],
    "paymentDate": "2022-02-01T00:00:00.000Z",
    "disabledPaymentMethods": ["CASH"],
    "notes": "Customer prefers communication via email.",
    "isChasingPaused": true,
    "chasingEnabled": true,
    "chasingId": "65281d2ca5f929c842db0295",
    "nextChasingStepId": "65281d2ca5f929c842db0294",
    "companyId": "622294998bec060152bcad9c",
    "enabled": true,
    "createdBy": "6222930b8bec060152bcad67",
    "updatedBy": "6222930b8bec060152bcad67",
    "createdAt": "2022-10-27T07:38:00.319Z",
    "updatedAt": "2022-10-27T07:38:00.319Z",
    "source": "BLIXO",
    "address": {
        "attn": "John Doe",
        "phones": [
            "123-456-7890"
        ],
        "address1": "123 Main St",
        "address2": "Apt 4B",
        "city": "New York",
        "state": "NY",
        "zipCode": "10001",
        "country": "US"
    }
}

This API endpoint allows you to create a new customer in the database. It requires a POST request to https://api.blixo.com/v1/customers with the customer's details in the request body. The customer's details should be in JSON format as shown above.

HTTP Request

POST https://api.blixo.com/v1/customers

Headers

Key Value
Authorization Basic {API_KEY}

Example

To create a new customer, you would send a POST request to https://api.blixo.com/v1/customers. Remember to replace {API_KEY} with your actual API key.

Parameters

Parameter Type Description
name string (required) Customer's name
email string Customer's email
customerNo string Customer's number. It will be generated automatically if not specified.
customerType string Organization type, Company or Individual. Defaults to Company.
paymentTerms string Customer's Payment Terms. It's one of the values DUE_ON_RECEIPT, CUSTOM, NET_7, NET_10, NET_15, NET_30, NET_60, NET_90
disabledPaymentMethods array List of payment methods to disable for this customer. Example: credit_card, ach, check, wire, cash, other
creditHold boolean When true, customer is on credit hold. Default: false
autopay boolean Auto pay. Default: false
autoConvertInvoice boolean Auto Convert Invoice. Default: true
billToParent boolean Bill To Parent. Default: false
chasingEnabled boolean Enable Chasing. Default: true
language string Two-letter ISO code
notes string Customer notes
paymentDate datetime Selected payment date
paymentSourceRefs array List of payment source refs
paymentSources array List of payment source
source string Source
signInToken string Sign-in token for customer portal
taxIds array List tax IDs
taxable boolean default: false
address object Address object includes address1, address2, attn, city, country, phones, state, zipCode

Response

If the request is successful, you will receive a 200 OK status code along with the JSON object of the created customer. If something goes wrong, you will receive a 4xx or 5xx status code, with a JSON object containing more information about the error.

Update a customer

curl "https://api.blixo.com/v1/customers/:customerId" \
-u {API_KEY}: \
-d name="Blixo Customer" \
-d email="customer@blixo.com" \
-d paymentTerms="NET_30" \
-d address[attn]="Sale Manager" \
-d address[address1]="2232 Stiles Street" \
-d address[city]="Bridgeville" \
-d address[state]="PA" \
-d address[zipCode]="15017" \
-d address[country]="US" \
-d address[phones][0]="412-603-3268" \
-d address[phones][1]="412-292-0048" \
-X PATCH
const fetch = require('node-fetch');

const url = 'https://api.blixo.com/v1/customers/:customerId';
const options = {
  method: 'PATCH',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': 'Basic ' + Buffer.from('{API_KEY}:').toString('base64')
  },
  body: JSON.stringify({
    "name": "Blixo Customer",
    "email": "customer@blixo.com",
    "paymentTerms": "NET_30",
    "address": {
      "attn": "Sale Manager",
      "address1": "2232 Stiles Street",
      "city": "Bridgeville",
      "state": "PA",
      "zipCode": "15017",
      "country": "US",
      "phones": ["412-603-3268", "412-292-0048"]
    }
  })
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error('error:' + err));
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.blixo.com/v1/customers/:customerId',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'PATCH',
  CURLOPT_POSTFIELDS =>'{
    "name": "Blixo Customer",
    "email": "customer@blixo.com",
    "paymentTerms": "NET_30",
    "address": {
      "attn": "Sale Manager",
      "address1": "2232 Stiles Street",
      "city": "Bridgeville",
      "state": "PA",
      "zipCode": "15017",
      "country": "US",
      "phones": ["412-603-3268", "412-292-0048"]
    }
  }',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'Authorization: Basic {API_KEY}'
  ),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
?>
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api.blixo.com/v1/customers/:customerId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Content-Type"] = 'application/json'
request["Authorization"] = 'Basic {API_KEY}'
request.body = '{
  "name": "Blixo Customer",
  "email": "customer@blixo.com",
  "paymentTerms": "NET_30",
  "address": {
    "attn": "Sale Manager",
    "address1": "2232 Stiles Street",
    "city": "Bridgeville",
    "state": "PA",
    "zipCode": "15017",
    "country": "US",
    "phones": ["412-603-3268", "412-292-0048"]
  }
}'
response = http.request(request)
puts response.read_body
import requests
url = "https://api.blixo.com/v1/customers/:customerId"
payload = {
  "name": "Blixo Customer",
  "email": "customer@blixo.com",
  "paymentTerms": "NET_30",
  "address": {
    "attn": "Sale Manager",
    "address1": "2232 Stiles Street",
    "city": "Bridgeville",
    "state": "PA",
    "zipCode": "15017",
    "country": "US",
    "phones": ["412-603-3268", "412-292-0048"]
  }
}
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Basic {API_KEY}'
}
response = requests.request("PATCH", url, headers=headers, data=payload)
print(response.text)
package main
import (
    "fmt"
    "strings"
    "net/http"
    "io/ioutil"
)
func main() {
    url := "https://api.blixo.com/v1/customers/:customerId"
    method := "PATCH"
    payload := strings.NewReader(`{
        "name": "Blixo Customer",
        "email": "customer@blixo.com",
        "paymentTerms": "NET_30",
        "address": {
            "attn": "Sale Manager",
            "address1": "2232 Stiles Street",
            "city": "Bridgeville",
            "state": "PA",
            "zipCode": "15017",
            "country": "US",
            "phones": ["412-603-3268", "412-292-0048"]
        }
    }`)
    client := &http.Client {}
    req, err := http.NewRequest(method, url, payload)
    if err != nil {
        fmt.Println(err)
        return
    }
    req.Header.Add("Content-Type", "application/json")
    req.Header.Add("Authorization", "Basic {API_KEY}")
    res, err := client.Do(req)
    if err != nil {
        fmt.Println(err)
        return
    }
    defer res.Body.Close()
    body, err := ioutil.ReadAll(res.Body)
    if err != nil {
        fmt.Println(err)
        return
    }
    fmt.Println(string(body))
}
var client = new RestClient("https://api.blixo.com/v1/customers/:customerId");
client.Timeout = -1;
var request = new RestRequest(Method.PATCH);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Basic {API_KEY}");
request.AddParameter("application/json", `{
    "name": "Blixo Customer",
    "email": "customer@blixo.com",
    "paymentTerms": "NET_30",
    "address": {
        "attn": "Sale Manager",
        "address1": "2232 Stiles Street",
        "city": "Bridgeville",
        "state": "PA",
        "zipCode": "15017",
        "country": "US",
        "phones": ["412-603-3268", "412-292-0048"]
    }
}`,  ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
import okhttp3.OkHttpClient;
import okhttp3.MediaType;
import okhttp3.RequestBody;
import okhttp3.Request;
import okhttp3.Response;

public class Main {
    public static void main(String[] args) throws Exception {
        OkHttpClient client = new OkHttpClient().newBuilder().build();
        MediaType mediaType = MediaType.parse("application/json");
        RequestBody body = RequestBody.create(mediaType, `{
            "name": "Blixo Customer",
            "email": "customer@blixo.com",
            "paymentTerms": "NET_30",
            "address": {
                "attn": "Sale Manager",
                "address1": "2232 Stiles Street",
                "city": "Bridgeville",
                "state": "PA",
                "zipCode": "15017",
                "country": "US",
                "phones": ["412-603-3268", "412-292-0048"]
            }
        }`);
        Request request = new Request.Builder()
            .url("https://api.blixo.com/v1/customers/:customerId")
            .method("PATCH", body)
            .addHeader("Content-Type", "application/json")
            .addHeader("Authorization", "Basic {API_KEY}")
            .build();
        Response response = client.newCall(request).execute();
        System.out.println(response.body().string());
    }
}

The above command returns JSON structured like this:

  {
    "id": "65281d2ca5f929c842db0299",
    "customerNo": "888234223",
    "name": "Blixo Customer",
    "customerType": "COMPANY",
    "email": "customer@blixo.com",
    "parentCustomerId": "65281d2ca5f929c842db0298",
    "billToParent": false,
    "language": "EN",
    "taxable": false,
    "taxIds": ["123456789"],
    "creditHold": false,
    "contacts": [
        {
            "id": "65281d2ca5f929c842db0297",
            "name": "John Doe",
            "billingContact": false,
            "title": "Sales Manager",
            "department": "Sales",
            "email": "johndoe@blixo.com",
            "phone": "123-456-7890",
            "address1": "123 Main St",
            "address2": "Apt 4B",
            "city": "Boston",
            "state": "MA",
            "zipCode": "02110",
            "country": "US"
        }
    ],
    "primaryContactId": "65281d2ca5f929c842db0297",
    "autopay": false,
    "autoConvertInvoice": true,
    "paymentTerms": "DUE_ON_RECEIPT",
    "paymentSources": [
        {
            "_id": "60d5ecb44b93ba2a46ecb4bb",
            "paymentGatewayType": "STRIPE",
            "paymentGatewayId": "60d5ecb44b93ba2a46ecb4ba",
            "paymentMethodDetails": {
                "cardNumber": "1234-5678-9012-3456",
                "expiryDate": "12/24",
                "cvv": "123"
            },
            "billingAddress": {
                "firstName": "John",
                "lastName": "Doe",
                "phone": "123-456-7890",
                "company": "Blixo",
                "address1": "123 Main St",
                "address2": "Apt 4B",
                "city": "Boston",
                "state": "MA",
                "zipCode": "02110",
                "country": "USA",
                "countryCode": "US"
            },
            "deleted": false,
            "marked": false,
            "createdAt": "2022-10-26T12:13:22.878Z"
        }
    ],
    "paymentSourceRefs": ["60d5ecb44b93ba2a46ecb4bb"],
    "paymentDate": "2022-02-01T00:00:00.000Z",
    "disabledPaymentMethods": ["CASH"],
    "notes": "Customer prefers communication via email.",
    "isChasingPaused": true,
    "chasingEnabled": true,
    "chasingId": "65281d2ca5f929c842db0295",
    "nextChasingStepId": "65281d2ca5f929c842db0294",
    "companyId": "622294998bec060152bcad9c",
    "enabled": true,
    "createdBy": "6222930b8bec060152bcad67",
    "updatedBy": "6222930b8bec060152bcad67",
    "createdAt": "2022-10-27T07:38:00.319Z",
    "updatedAt": "2022-10-27T07:38:00.319Z",
    "source": "BLIXO",
    "address": {
        "attn": "John Doe",
        "phones": [
            "123-456-7890"
        ],
        "address1": "123 Main St",
        "address2": "Apt 4B",
        "city": "New York",
        "state": "NY",
        "zipCode": "10001",
        "country": "US"
    }
}

This API endpoint allows you to update an existing customer's details in the database. It requires a PATCH request to https://api.blixo.com/v1/customers/:customerId with the updated customer's details in the request body. The customer's details should be in JSON format.

HTTP Request

PATCH https://api.blixo.com/v1/customers/:customerId

Headers

Key Value
Authorization Basic {API_KEY}

Parameters

Parameter Type Description
name string The new name of the customer
email string The new email of the customer
paymentTerms string The new payment terms for the customer
address object The new address of the customer. This includes attn, address1, city, state, zipCode, country, and phones.
customerType string The new type of the customer, either Company or Individual.
disabledPaymentMethods array The new list of payment methods to disable for this customer. Example: credit_card, ach, check, wire, cash, other.
creditHold boolean When set to true, the customer is on credit hold.
autopay boolean The new auto pay status. Default: false.
autoConvertInvoice boolean The new auto convert invoice status. Default: true.
billToParent boolean The new bill to parent status. Default: false.
chasingEnabled boolean The new chasing enabled status. Default: true.
language string The new two-letter ISO code for the customer's language.
notes string The new customer notes.
paymentDate datetime The new selected payment date.
paymentSourceRefs array The new list of payment source refs.
paymentSources array The new list of payment sources.
source string The new source.
signInToken string The new sign-in token for customer portal.
taxIds array The new list of tax IDs.
taxable boolean The new taxable status. Default: false.

Example

To update a customer's information, you would send a PATCH request to https://api.blixo.com/v1/customers/:customerId. Remember to replace :customerId with the actual ID of the customer you want to update, and {API_KEY} with your actual API key.

Response

If the request is successful, you will receive a 200 OK status code along with the JSON object of the updated customer. If something goes wrong, you will receive a 4xx or 5xx status code, with a JSON object containing more information about the error.

Delete a customer

curl "https://api.blixo.com/v1/customers/:customerId" \
-u {API_KEY}: \
-X DELETE
const fetch = require('node-fetch');

const url = 'https://api.blixo.com/v1/customers/:customerId';
const options = {
  method: 'DELETE',
  headers: {
    'Authorization': 'Basic ' + Buffer.from('{API_KEY}:').toString('base64')
  }
};

fetch(url, options)
  .then(res => res.text())
  .then(body => console.log(body))
  .catch(error => console.error(error));
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.blixo.com/v1/customers/:customerId",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => "DELETE",
  CURLOPT_HTTPHEADER => array(
    "Authorization: Basic " . base64_encode("{API_KEY}:")
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
?>
require 'uri'
require 'net/http'

url = URI("https://api.blixo.com/v1/customers/:customerId")

http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Basic ' + Base64.strict_encode64('{API_KEY}:')

response = http.request(request)
puts response.read_body
import requests
from requests.structures import CaseInsensitiveDict

url = "https://api.blixo.com/v1/customers/:customerId"

headers = CaseInsensitiveDict()
headers["Authorization"] = "Basic " + base64.b64encode('{API_KEY}:'.encode()).decode()

resp = requests.delete(url, headers=headers)

print(resp.text)
package main

import (
    "fmt"
    "net/http"
    "encoding/base64"
)

func main() {

    client := &http.Client{}
    req, _ := http.NewRequest("DELETE", "https://api.blixo.com/v1/customers/:customerId", nil)
    req.Header.Add("Authorization", "Basic " + base64.StdEncoding.EncodeToString([]byte("{API_KEY}:")))
    resp, _ := client.Do(req)
    fmt.Println(resp)
}
using System;
using System.Net.Http;
using System.Text;

class Program
{
    static void Main()
    {
        var client = new HttpClient();
        var request = new HttpRequestMessage
        {
            Method = HttpMethod.Delete,
            RequestUri = new Uri("https://api.blixo.com/v1/customers/:customerId"),
        };
        var byteArray = Encoding.ASCII.GetBytes("{API_KEY}:");
        request.Headers.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", Convert.ToBase64String(byteArray));
        var response = client.SendAsync(request).Result;
        Console.WriteLine(response.Content.ReadAsStringAsync().Result);
    }
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
import java.io.IOException;
import java.util.Base64;

public class Main {
    public static void main(String[] args) throws IOException {
        OkHttpClient client = new OkHttpClient().newBuilder()
                .build();
        String apiKey = "{API_KEY}";
        String authHeaderValue = "Basic " + Base64.getEncoder().encodeToString((apiKey + ":").getBytes());
        Request request = new Request.Builder()
                .url("https://api.blixo.com/v1/customers/:customerId")
                .method("DELETE", null)
                .addHeader("Authorization", authHeaderValue)
                .build();
        Response response = client.newCall(request).execute();
        System.out.println(response.body().string());
    }
}

The above command returns JSON structured like this:

{
  "data": "611d4216a747250146ade2cf"
}

This API endpoint allows you to remove a customer's details from the database. It requires a DELETE request to https://api.blixo.com/v1/customers/:customerId. Remember to replace :customerId with the actual ID of the customer you want to delete.

HTTP Request

DELETE https://api.blixo.com/v1/customers/:customerId

Headers

Key Value
Authorization Basic {API_KEY}

Example

To delete a customer's information, you would send a DELETE request to https://api.blixo.com/v1/customers/:customerId. Remember to replace :customerId with the actual ID of the customer you want to delete, and {API_KEY} with your actual API key.

Response

If the request is successful, you will receive a 200 OK status code. If something goes wrong, you will receive a 4xx or 5xx status code, with a JSON object containing more information about the error.

Invoices

Invoice object

Attribute Type Description
id ObjectId The ID of the invoice.
invoiceNo String The invoice number.
managerId ObjectId The ID of the manager of the invoice.
issueDate Date The date when the invoice was issued.
dueDate Date The due date of the invoice.
paymentDate Date The next scheduled charge attempt, when in automatic collection.
paidDate Date The date when the invoice was paid.
expectedDate Date The expected date of the invoice.
source String The source of the invoice.
integrations Object The integrations of the invoice.
isPaymentPlan Boolean Whether the invoice is a payment plan.
paymentPlanAutoPay Boolean Whether autopay is enabled for the payment plan.
requireApprove Boolean Whether the invoice requires approval.
approvalDetail Object The approval details of the invoice.
billTo Object The billing address of the invoice. It includes the following sub-attributes:
firstName: String - The first name of the person to whom the bill is addressed.
lastName: String - The last name of the person to whom the bill is addressed.
phone: String - The phone number of the person to whom the bill is addressed.
company: String - The company of the person to whom the bill is addressed.
address1: String - The primary address line of the billing address.
address2: String - The secondary address line of the billing address.
city: String - The city of the billing address.
state: String - The state of the billing address.
zipCode: String - The zip code of the billing address.
country: String - The country of the billing address.
countryCode: String - The country code of the billing address.
shipTo Object The shipping address of the invoice. It includes the following sub-attributes:
firstName: String - The first name of the person to whom the shipment is addressed.
lastName: String - The last name of the person to whom the shipment is addressed.
phone: String - The phone number of the person to whom the shipment is addressed.
company: String - The company of the person to whom the shipment is addressed.
address1: String - The primary address line of the shipping address.
address2: String - The secondary address line of the shipping address.
city: String - The city of the shipping address.
state: String - The state of the shipping address.
zipCode: String - The zip code of the shipping address.
country: String - The country of the shipping address.
countryCode: String - The country code of the shipping address.
notes String Any notes regarding the invoice.
attachments Array The attachments of the invoice.
subTotalAmount Object The subtotal amount of the invoice. It includes the following attributes:
value: Number - The value of the amount.
unit: String - The unit of the amount.
currency: String - The currency of the amount. Default is USD.
totalAmount Object The total amount of the invoice. It includes the following attributes:
value: Number - The value of the amount.
unit: String - The unit of the amount.
currency: String - The currency of the amount. Default is USD.
taxAmount Object The tax amount of the invoice. It includes the following attributes:
value: Number - The value of the amount.
unit: String - The unit of the amount.
currency: String - The currency of the amount. Default is USD.
shippingLines Array The shipping lines of the invoice.
shippingAmount Object The shipping amount of the invoice. It includes the following attributes:
value: Number - The value of the amount.
unit: String - The unit of the amount.
currency: String - The currency of the amount. Default is USD.
creditAmount Object The credit amount of the invoice. It includes the following attributes:
value: Number - The value of the amount.
unit: String - The unit of the amount.
currency: String - The currency of the amount. Default is USD.
paidAmount Object The paid amount of the invoice. It includes the following attributes:
value: Number - The value of the amount.
unit: String - The unit of the amount.
currency: String - The currency of the amount. Default is USD.
companyId ObjectId The ID of the company of the invoice.
createdAt Date The date when the invoice was created.
updatedAt Date The date when the invoice was last updated.
deletedBy ObjectId The ID of the user who deleted the invoice.
deletedAt Date The date when the invoice was deleted.
isDeleted Boolean Whether the invoice is deleted.

List all invoices

curl "https://api.blixo.com/v1/invoices" \
-u {API_KEY}:
const fetch = require('node-fetch');

const url = 'https://api.blixo.com/v1/invoices';
const options = {
  method: 'GET',
  headers: {
    'Authorization': 'Basic ' + Buffer.from('{API_KEY}:').toString('base64')
  }
};

fetch(url, options)
  .then(res => res.text())
  .then(body => console.log(body))
  .catch(error => console.error(error));
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.blixo.com/v1/invoices",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => array(
    "Authorization: Basic " . base64_encode("{API_KEY}:")
  ),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
?>
require 'uri'
require 'net/http'
require 'base64'

url = URI("https://api.blixo.com/v1/invoices")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Basic ' + Base64.strict_encode64('{API_KEY}:')
response = http.request(request)
puts response.read_body
import requests
import base64

url = "https://api.blixo.com/v1/invoices"
api_key = "{API_KEY}"
headers = {
    "Authorization": "Basic " + base64.b64encode((api_key + ":").encode()).decode()
}
response = requests.get(url, headers=headers)
print(response.text)
package main
import (
    "fmt"
    "net/http"
    "io/ioutil"
    "encoding/base64"
)
func main() {
    url := "https://api.blixo.com/v1/invoices"
    req, _ := http.NewRequest("GET", url, nil)
    req.Header.Add("Authorization", "Basic " + base64.StdEncoding.EncodeToString([]byte("{API_KEY}:")))
    res, _ := http.DefaultClient.Do(req)
    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)
    fmt.Println(string(body))
}
using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;

class Program
{
    static void Main()
    {
        var task = Task.Run(() => SendRequest());
        task.Wait();
    }

    static async Task SendRequest()
    {
        var client = new HttpClient();
        var request = new HttpRequestMessage
        {
            Method = HttpMethod.Get,
            RequestUri = new Uri("https://api.blixo.com/v1/invoices"),
        };
        var byteArray = Encoding.ASCII.GetBytes("{API_KEY}:");
        request.Headers.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", Convert.ToBase64String(byteArray));
        var response = await client.SendAsync(request);
        Console.WriteLine(await response.Content.ReadAsStringAsync());
    }
}
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
import java.util.Base64;

public class Main {
    public static void main(String[] args) {
        OkHttpClient client = new OkHttpClient();

        String url = "https://api.blixo.com/v1/invoices";
        String encoding = Base64.getEncoder().encodeToString(("{API_KEY}:".getBytes()));

        Request request = new Request.Builder()
            .url(url)
            .addHeader("Authorization", "Basic " + encoding)
            .build();

        try (Response response = client.newCall(request).execute()) {
            System.out.println(response.body().string());
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

The above command returns JSON structured like this:

{
  "data": [
    {
      "id": "610c0d55aeafb90145d8cb5b",
      "invoiceNo": "INV-0003",
      "managerId": "610c0d55aeafb90145d8cb5c",
      "issueDate": "2021-08-05T16:09:46.680Z",
      "dueDate": "2021-09-04T16:09:46.680Z",
      "billTo": {
        "attn": "Barbara",
        "phones": [
          "252-602-2731"
        ],
        "address1": "847 Rockwell Lane",
        "address2": "Suite 5",
        "city": "Rocky Mount",
        "state": "North Carolina",
        "zipCode": "27801",
        "country": "US",
        "name": "Barbara J Thompson"
      },
      "notes": "Invoice for August 2021",
      "attachments": ["invoice_august_2021.pdf"],
      "subTotalAmount": {
        "currency": "USD",
        "_id": "6110fdaa95c80501473b3b3e",
        "value": 100,
        "unit": "$"
      },
      "totalAmount": {
        "currency": "USD",
        "value": 100,
        "unit": "$"
      },
      "balanceAmount": {
        "currency": "USD",
        "value": 100,
        "unit": "$"
      },
      "paymentStatus": [
        "OUTSTANDING"
      ],
      "paymentTerms": "NET_30",
      "invoiceStatus": [
        "DRAFT"
      ],
      "sentStatus": "NOT_SENT",
      "itemLines": [
        {
          "detail": "Monthly subscription fee",
          "_id": "610c0d4a18d80318a12c11b6",
          "title": "Subscription",
          "description": "Monthly subscription for August 2021",
          "quantity": 1,
          "rate": {
            "currency": "USD",
            "_id": "610c0d55aeafb90145d8cb5d",
            "value": 100,
            "unit": "$"
          },
          "amount": {
            "currency": "USD",
            "_id": "6110fdaa95c80501473b3b3a",
            "value": 100,
            "unit": "$"
          },
          "taxLines": [],
          "discountLines": [],
          "discountAmount": {
            "currency": "USD",
            "_id": "6110fdaa95c80501473b3b38",
            "value": 0,
            "unit": "$"
          },
          "discountedAmount": {
            "currency": "USD",
            "_id": "6110fdaa95c80501473b3b39",
            "value": 100,
            "unit": "$"
          }
        }
      ],
      "discountLines": [],
      "discountAmount": {
        "currency": "USD",
        "_id": "6110fdaa95c80501473b3b3b",
        "value": 0,
        "unit": "$"
      },
      "discountedAmount": {
        "currency": "USD",
        "_id": "6110fdaa95c80501473b3b3c",
        "value": 100,
        "unit": "$"
      },
      "taxLines": [],
      "taxAmount": {
        "currency": "USD",
        "_id": "6110fdaa95c80501473b3b3d",
        "value": 0,
        "unit": "$"
      },
      "creditAmount": {
        "currency": "USD",
        "_id": "6110fdaa95c80501473b3b40",
        "value": 0,
        "unit": "$"
      },
      "paidAmount": {
        "currency": "USD",
        "_id": "6110fdaa95c80501473b3b3f",
        "value": 0,
        "unit": "$"
      },
      "companyId": "60a7749e1f30710141d858cc",
      "customerId": "60a775021f30710141d85946",
      "createdBy": "60a7745d1f30710141d858c5",
      "updatedBy": "60a7745d1f30710141d858c5",
      "createdAt": "2021-08-05T16:09:57.617Z",
      "updatedAt": "2021-08-09T10:04:26.806Z",
      "expectedDate": "2022-10-28T04:17:09.000Z",
      "payments": [],
      "creditNotes": [],
      "chasingSchedules":[],
      "disableChasing": true
    }
  ],
  "pagination": {
    "total": 1
  }
}

This API endpoint allows you to retrieve all invoices from the database. It requires a GET request to https://api.blixo.com/v1/invoices.

HTTP Request

GET https://api.blixo.com/v1/invoices

Headers

Key Value
Authorization Basic {API_KEY}

Parameters

Parameter Type Description
invoiceStatus array Filter by multiple invoice status, e.g. invoiceStatus[0]=DRAFT
paymentStatus array Filter by multiple payment status drafts, outstanding, pastdue, paid, all e.g. paymentStatus[0]=OUTSTANDING
sort array Sort by field name and its ordering, e.g. sort[0]=invoiceNo&sort[1]=-1
page integer Current page
perPage integer Number of items per pages

Example

To retrieve all invoices, you would send a GET request to https://api.blixo.com/v1/invoices. Remember to replace {API_KEY} with your actual API key.

Response

If the request is successful, you will receive a 200 OK status code along with a JSON object containing all invoices. If something goes wrong, you will receive a 4xx or 5xx status code, with a JSON object containing more information about the error.

Create an invoice

curl "https://api.blixo.com/v1/invoices" \
-u {API_KEY}: \
-d paymentTerms="NET_30" \
-d paymentStatus[0]="OUTSTANDING" \
-d invoiceStatus[0]="ISSUED" \
-d issueDate="2021-08-22T17:05:58.112Z" \
-d dueDate="2021-09-21T17:05:58.112Z" \
-d companyId="60e1b7f0c6ef4219ff51824c" \
-d customerId="612283bafd4e6319d487fa8f" \
-d billTo[name]="Blixo Customer" \
-d billTo[attn]="Sale Manager" \
-d billTo[address1]="2232 Stiles Street" \
-d address[city]="Bridgeville" \
-d address[state]="PA" \
-d address[zipCode]="15017" \
-d address[country]="US" \
-d address[phones][0]="412-603-3268" \
-d address[phones][1]="412-292-0048" \
-d discountLines[0][name]="Discount 10%" \
-d discountLines[0][amount][unit]="%" \
-d discountLines[0][amount][value]=10 \
-d taxLines[0][name]="Tax 10%" \
-d taxLines[0][priceInclude]=false \
-d taxLines[0][amount][unit]="%" \
-d taxLines[0][amount][value]=10 \
-X POST
const fetch = require('node-fetch');

const url = 'https://api.blixo.com/v1/invoices';
const options = {
  method: 'POST',
  headers: {
    'Authorization': 'Basic ' + Buffer.from('your_api_key' + ':').toString('base64'),
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    'paymentTerms': 'NET_30',
    'paymentStatus': ['OUTSTANDING'],
    'invoiceStatus': ['ISSUED'],
    'issueDate': '2021-08-22T17:05:58.112Z',
    'dueDate': '2021-09-21T17:05:58.112Z',
    'companyId': '60e1b7f0c6ef4219ff51824c',
    'customerId': '612283bafd4e6319d487fa8f',
    'billTo': {
      'name': 'Blixo Customer',
      'attn': 'Sale Manager',
      'address1': '2232 Stiles Street',
      'address': {
        'city': 'Bridgeville',
        'state': 'PA',
        'zipCode': '15017',
        'country': 'US',
        'phones': ['412-603-3268', '412-292-0048'],
      },
    },
    'discountLines': [
      {
        'name': 'Discount 10%',
        'amount': {
          'unit': '%',
          'value': 10,
        },
      },
    ],
    'taxLines': [
      {
        'name': 'Tax 10%',
        'priceInclude': false,
        'amount': {
          'unit': '%',
          'value': 10,
        },
      },
    ],
  })
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error('error:' + err));
<?php

$apiKey = 'your_api_key';

$data = [
    'paymentTerms' => 'NET_30',
    'paymentStatus' => ['OUTSTANDING'],
    'invoiceStatus' => ['ISSUED'],
    'issueDate' => '2021-08-22T17:05:58.112Z',
    'dueDate' => '2021-09-21T17:05:58.112Z',
    'companyId' => '60e1b7f0c6ef4219ff51824c',
    'customerId' => '612283bafd4e6319d487fa8f',
    'billTo' => [
        'name' => 'Blixo Customer',
        'attn' => 'Sale Manager',
        'address1' => '2232 Stiles Street',
        'address' => [
            'city' => 'Bridgeville',
            'state' => 'PA',
            'zipCode' => '15017',
            'country' => 'US',
            'phones' => ['412-603-3268', '412-292-0048'],
        ],
    ],
    'discountLines' => [
        [
            'name' => 'Discount 10%',
            'amount' => [
                'unit' => '%',
                'value' => 10,
            ],
        ],
    ],
    'taxLines' => [
        [
            'name' => 'Tax 10%',
            'priceInclude' => false,
            'amount' => [
                'unit' => '%',
                'value' => 10,
            ],
        ],
    ],
];

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, 'https://api.blixo.com/v1/invoices');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Content-Type: application/json',
    'Authorization: Basic ' . base64_encode($apiKey . ':'),
]);

$response = curl_exec($ch);

curl_close($ch);

echo $response;
require 'net/http'
require 'uri'
require 'json'

uri = URI.parse("https://api.blixo.com/v1/invoices")
request = Net::HTTP::Post.new(uri)
request.content_type = "application/json"
request["Authorization"] = "Basic " + Base64.strict_encode64("{API_KEY}:")
request.body = JSON.dump({
  'paymentTerms' => 'NET_30',
  'paymentStatus' => ['OUTSTANDING'],
  'invoiceStatus' => ['ISSUED'],
  'discountLines' => [
    {
      'name' => 'Discount 10%',
      'amount' => {
        'unit' => '%',
        'value' => 10
      }
    }
  ],
  'taxLines' => [
    {
      'name' => 'Tax 10%',
      'priceInclude' => false,
      'amount' => {
        'unit' => '%',
        'value' => 10
      }
    }
  ]
})

req_options = {
  use_ssl: uri.scheme == "https",
}

response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|
  http.request(request)
end

puts response.body

import requests
import json
import base64

url = "https://api.blixo.com/v1/invoices"
api_key = "{API_KEY}"
headers = {
    "Authorization": "Basic " + base64.b64encode(api_key.encode()).decode(),
    "Content-Type": "application/json"
}
data = {
    'paymentTerms': 'NET_30',
    'paymentStatus': ['OUTSTANDING'],
    'invoiceStatus': ['ISSUED'],
    'discountLines': [
        {
            'name': 'Discount 10%',
            'amount': {
                'unit': '%',
                'value': 10
            }
        }
    ],
    'taxLines': [
        {
            'name': 'Tax 10%',
            'priceInclude': False,
            'amount': {
                'unit': '%',
                'value': 10
            }
        }
    ]
}
response = requests.post(url, headers=headers, data=json.dumps(data))
print(response.json())

package main

import (
    "bytes"
    "encoding/base64"
    "encoding/json"
    "fmt"
    "net/http"
)

func main() {
    url := "https://api.blixo.com/v1/invoices"
    apiKey := "{API_KEY}"
    auth := "Basic " + base64.StdEncoding.EncodeToString([]byte(apiKey))

    headers := map[string]string{
        "Authorization": auth,
        "Content-Type":  "application/json",
    }

    data := map[string]interface{}{
        'paymentTerms': 'NET_30',
        'paymentStatus': ['OUTSTANDING'],
        'invoiceStatus': ['ISSUED'],
        'discountLines': [
            {
                'name': 'Discount 10%',
                'amount': {
                    'unit': '%',
                    'value': 10
                }
            }
        ],
        'taxLines': [
            {
                'name': 'Tax 10%',
                'priceInclude': False,
                'amount': {
                    'unit': '%',
                    'value': 10
                }
            }
        ]
    }

    body, _ := json.Marshal(data)
    req, _ := http.NewRequest("POST", url, bytes.NewBuffer(body))

    for key, value := range headers {
        req.Header.Add(key, value)
    }

    client := &http.Client{}
    resp, _ := client.Do(req)

    defer resp.Body.Close()

    fmt.Println("response Status:", resp.Status)
}

using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;

class Program
{
    static async Task Main(string[] args)
    {
        var apiKey = "{API_KEY}";
        var auth = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey));

        using (var client = new HttpClient())
        {
            client.DefaultRequestHeaders.Add("Authorization", $"Basic {auth}");
            client.DefaultRequestHeaders.Add("Content-Type", "application/json");

            var data = new
            {
                paymentTerms = "NET_30",
                paymentStatus = new[] { "OUTSTANDING" },
                invoiceStatus = new[] { "ISSUED" },
                discountLines = new[]
                {
                    new
                    {
                        name = "Discount 10%",
                        amount = new { unit = "%", value = 10 }
                    }
                },
                taxLines = new[]
                {
                    new
                    {
                        name = "Tax 10%",
                        priceInclude = false,
                        amount = new { unit = "%", value = 10 }
                    }
                }
            };

            var content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(data), Encoding.UTF8, "application/json");
            var response = await client.PostAsync("https://api.blixo.com/v1/invoices", content);

            var responseString = await response.Content.ReadAsStringAsync();
            Console.WriteLine("Response Status: " + response.StatusCode);
            Console.WriteLine("Response Body: " + responseString);
        }
    }
}
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.RequestBody;
import okhttp3.Response;
import okhttp3.MediaType;
import java.nio.charset.StandardCharsets;
import java.util.Base64;

public class Main {
    public static void main(String[] args) throws Exception {
        String apiKey = "{API_KEY}";
        String auth = Base64.getEncoder().encodeToString(apiKey.getBytes(StandardCharsets.UTF_8));

        OkHttpClient client = new OkHttpClient();

        MediaType mediaType = MediaType.parse("application/json");
        RequestBody body = RequestBody.create(mediaType, "{\\\"paymentTerms\\\":\\\"NET_30\\\",\\\"paymentStatus\\\":[\\\"OUTSTANDING\\\"],\\\"invoiceStatus\\\":[\\\"ISSUED\\\"],\\\"discountLines\\\":[{\\\"name\\\":\\\"Discount 10%\\\",\\\"amount\\\":{\\\"unit\\\":\\\"%\\\",\\\"value\\\":10}}],\\\"taxLines\\\":[{\\\"name\\\":\\\"Tax 10%\\\",\\\"priceInclude\\\":false,\\\"amount\\\":{\\\"unit\\\":\\\"%\\\",\\\"value\\\":10}}]}");
        Request request = new Request.Builder()
          .url("https://api.blixo.com/v1/invoices")
          .post(body)
          .addHeader("Authorization", "Basic " + auth)
          .addHeader("Content-Type", "application/json")
          .build();

        Response response = client.newCall(request).execute();
        System.out.println("Response Status: " + response.code());
        System.out.println("Response Body: " + response.body().string());
    }
}

The above command returns JSON structured like this:

{
  "data": {
    "id": "611e9a42b946440146b166b2",
    "invoiceNo": "INV-0005",
    "managerId": "65289eb09d9571a357f09a5c",
    "issueDate": "2021-08-19T17:51:37.402Z",
    "dueDate": "2021-09-18T17:51:37.402Z",
    "paidDate": null,
    "notes": "",
    "subTotalAmount": {
      "currency": "USD",
      "_id": "611e9a43b946440146b166c4",
      "value": 100,
      "unit": "$"
    },
    "totalAmount": {
      "currency": "USD",
      "value": 100,
      "unit": "$"
    },
    "balanceAmount": {
      "currency": "USD",
      "value": 100,
      "unit": "$"
    },
    "paymentStatus": [
      "OUTSTANDING"
    ],
    "paymentTerms": "NET_30",
    "invoiceStatus": [
      "ISSUED"
    ],
    "sentStatus": "NOT_SENT",
    "discountLines": [],
    "discountAmount": {
      "currency": "USD",
      "_id": "611e9a43b946440146b166c1",
      "value": 0,
      "unit": "$"
    },
    "discountedAmount": {
      "currency": "USD",
      "_id": "611e9a43b946440146b166c2",
      "value": 100,
      "unit": "$"
    },
    "taxLines": [],
    "taxAmount": {
      "currency": "USD",
      "_id": "611e9a43b946440146b166c3",
      "value": 0,
      "unit": "$"
    },
    "creditAmount": {
      "currency": "USD",
      "_id": "611e9a43b946440146b166c7",
      "value": 0,
      "unit": "$"
    },
    "paidAmount": {
      "currency": "USD",
      "_id": "611e9a43b946440146b166c6",
      "value": 0,
      "unit": "$"
    },
    "companyId": "60a7749e1f30710141d858cc",
    "customerId": "60a775021f30710141d85946",
    "createdBy": "60a7745d1f30710141d858c5",
    "updatedBy": "60a7745d1f30710141d858c5",
    "createdAt": "2021-08-19T17:52:02.829Z",
    "updatedAt": "2021-08-19T17:52:04.234Z",
    "chasingSchedules": [],
    "installments": [],
    "invoiceEmail":"",
    "isPaymentPlan":false,
    "paymentDate": "2022-10-28T05:26:12.938Z",
    "paymentPlanAutoPay":false,
    "requireApprove":false,
    "shippingAmount":{
      "currency": "USD",
      "_id": "635b688b9e467f015ea06b2e",
      "value": 0,
      "unit": "$"
    },
    "shippingLines": [],
    "useCustomerEmail":true,
    "approvalDetail": null
  }
}

This API endpoint allows you to create a new invoice in the database. It's as simple as sending a POST request to https://api.blixo.com/v1/invoices. Think of it as telling the server, "Hey, I want to create a new invoice!" And the server responds with the information about the newly created invoice!

HTTP Request

POST https://api.blixo.com/v1/invoices

Headers

Key Value
Authorization Basic {API_KEY}

Body Parameters

Parameter Type Description
paymentTerms string Payment terms for the invoice, e.g. NET_30
paymentStatus array Payment status for the invoice, e.g. paymentStatus[0]="OUTSTANDING"
invoiceStatus array Invoice status, e.g. invoiceStatus[0]="ISSUED"
issueDate string The date when the invoice was issued, e.g. issueDate="2021-08-22T17:05:58.112Z"
dueDate string The date when the payment is due, e.g. dueDate="2021-09-21T17:05:58.112Z"
companyId string The ID of the company issuing the invoice, e.g. companyId="60e1b7f0c6ef4219ff51824c"
customerId string The ID of the customer to whom the invoice is issued, e.g. customerId="612283bafd4e6319d487fa8f"
invoiceNo string Invoice number, e.g. invoiceNo="INV-001"
paymentDate datetime Payment date, e.g. paymentDate="2022-10-28T05:26:12.938Z"
itemLines array An array of items. Each item is an object that includes title, description, quantity, rate, taxLines,integrations, amount, rate
taxLines array An array of tax items. Each item is an object that includes amount, name, priceInclude
discountLines array An array of discount items. Each item is an object that includes amount, name, _id
autopay boolean Auto pay. Default: true
billTo object Address object includes address1, address2, attn, city, country, phones, state, zipCode, integrations, name
shipTo object Address object includes address1, address2, attn, city, country, phones, state, zipCode

Example

To create a new invoice, you would send a POST request to https://api.blixo.com/v1/invoices. Remember to replace {API_KEY} with your actual API key.

Response

If the request is successful, you will receive a 201 Created status code along with a JSON object containing the newly created invoice. If something goes wrong, you will receive a 4xx or 5xx status code, with a JSON object containing more information about the error.

Update an invoice

curl "https://api.blixo.com/v1/invoices/:invoiceId" \
-u {API_KEY}: \
-d notes="lorem ipsum" \
-d paymentTerms="NET_90" \
-d sentStatus="SENT" \
-X PATCH
const fetch = require('node-fetch');

const url = 'https://api.blixo.com/v1/invoices/:invoiceId';
const options = {
  method: 'PATCH',
  headers: {
    'Authorization': 'Basic ' + Buffer.from('{API_KEY}' + ':').toString('base64'),
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    'notes': 'lorem ipsum',
    'paymentTerms': 'NET_90',
    'sentStatus': 'SENT'
  })
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error('error:' + err));
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.blixo.com/v1/invoices/:invoiceId',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'PATCH',
  CURLOPT_POSTFIELDS => array('notes' => 'lorem ipsum','paymentTerms' => 'NET_90','sentStatus' => 'SENT'),
  CURLOPT_HTTPHEADER => array(
    'Authorization: Basic {API_KEY}',
    'Content-Type: application/json'
  ),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
?>
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api.blixo.com/v1/invoices/:invoiceId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Basic {API_KEY}'
request["Content-Type"] = 'application/json'
request.body = "{\n\t\"notes\": \"lorem ipsum\",\n\t\"paymentTerms\": \"NET_90\",\n\t\"sentStatus\": \"SENT\"\n}"
response = http.request(request)
puts response.read_body
import requests
url = "https://api.blixo.com/v1/invoices/:invoiceId"
payload = "{\n\t\"notes\": \"lorem ipsum\",\n\t\"paymentTerms\": \"NET_90\",\n\t\"sentStatus\": \"SENT\"\n}"
headers = {
  'Authorization': 'Basic {API_KEY}',
  'Content-Type': 'application/json'
}
response = requests.request("PATCH", url, headers=headers, data=payload)
print(response.text)
package main
import (
    "fmt"
    "strings"
    "net/http"
    "io/ioutil"
)
func main() {
    url := "https://api.blixo.com/v1/invoices/:invoiceId"
    method := "PATCH"
    payload := strings.NewReader("{\n\t\"notes\": \"lorem ipsum\",\n\t\"paymentTerms\": \"NET_90\",\n\t\"sentStatus\": \"SENT\"\n}")
    client := &http.Client {}
    req, err := http.NewRequest(method, url, payload)
    if err != nil {
        fmt.Println(err)
        return
    }
    req.Header.Add("Authorization", "Basic {API_KEY}")
    req.Header.Add("Content-Type", "application/json")
    res, err := client.Do(req)
    if err != nil {
        fmt.Println(err)
        return
    }
    defer res.Body.Close()
    body, err := ioutil.ReadAll(res.Body)
    if err != nil {
        fmt.Println(err)
        return
    }
    fmt.Println(string(body))
}
var client = new RestClient("https://api.blixo.com/v1/invoices/:invoiceId");
client.Timeout = -1;
var request = new RestRequest(Method.PATCH);
request.AddHeader("Authorization", "Basic {API_KEY}");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n\t\"notes\": \"lorem ipsum\",\n\t\"paymentTerms\": \"NET_90\",\n\t\"sentStatus\": \"SENT\"\n}",  ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
import okhttp3.OkHttpClient;
import okhttp3.MediaType;
import okhttp3.RequestBody;
import okhttp3.Request;
import okhttp3.Response;

public class Main {
    public static void main(String[] args) {
        OkHttpClient client = new OkHttpClient().newBuilder()
            .build();
        MediaType mediaType = MediaType.parse("application/json");
        RequestBody body = RequestBody.create(mediaType, "{\n\t\"notes\": \"lorem ipsum\",\n\t\"paymentTerms\": \"NET_90\",\n\t\"sentStatus\": \"SENT\"\n}");
        Request request = new Request.Builder()
            .url("https://api.blixo.com/v1/invoices/:invoiceId")
            .method("PATCH", body)
            .addHeader("Authorization", "Basic {API_KEY}")
            .addHeader("Content-Type", "application/json")
            .build();
        try {
            Response response = client.newCall(request).execute();
            System.out.println(response.body().string());
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

The above command returns JSON structured like this:

{
  "data": {
    "id": "611e9a42b946440146b166b2",
    "invoiceNo": "INV-0005",
    "managerId": "65289eb09d9571a357f09a5c",
    "issueDate": "2021-08-19T17:51:37.402Z",
    "dueDate": "2021-09-18T17:51:37.402Z",
    "paidDate": null,
    "notes": "",
    "subTotalAmount": {
      "currency": "USD",
      "_id": "611e9a43b946440146b166c4",
      "value": 100,
      "unit": "$"
    },
    "totalAmount": {
      "currency": "USD",
      "value": 100,
      "unit": "$"
    },
    "balanceAmount": {
      "currency": "USD",
      "value": 100,
      "unit": "$"
    },
    "paymentStatus": [
      "OUTSTANDING"
    ],
    "paymentTerms": "NET_30",
    "invoiceStatus": [
      "ISSUED"
    ],
    "sentStatus": "NOT_SENT",
    "discountLines": [],
    "discountAmount": {
      "currency": "USD",
      "_id": "611e9a43b946440146b166c1",
      "value": 0,
      "unit": "$"
    },
    "discountedAmount": {
      "currency": "USD",
      "_id": "611e9a43b946440146b166c2",
      "value": 100,
      "unit": "$"
    },
    "taxLines": [],
    "taxAmount": {
      "currency": "USD",
      "_id": "611e9a43b946440146b166c3",
      "value": 0,
      "unit": "$"
    },
    "creditAmount": {
      "currency": "USD",
      "_id": "611e9a43b946440146b166c7",
      "value": 0,
      "unit": "$"
    },
    "paidAmount": {
      "currency": "USD",
      "_id": "611e9a43b946440146b166c6",
      "value": 0,
      "unit": "$"
    },
    "companyId": "60a7749e1f30710141d858cc",
    "customerId": "60a775021f30710141d85946",
    "createdBy": "60a7745d1f30710141d858c5",
    "updatedBy": "60a7745d1f30710141d858c5",
    "createdAt": "2021-08-19T17:52:02.829Z",
    "updatedAt": "2021-08-19T17:52:04.234Z",
     "chasingSchedules": [],
     "useCustomerEmail":true,
  }
}

This API endpoint allows you to update an existing invoice in the database. Think of it as telling the server, "Hey, I have some changes to make to this invoice!" And the server responds by updating the invoice with the information you provided!

HTTP Request

PATCH https://api.blixo.com/v1/invoices/:invoiceId

Headers

Key Value
Authorization Basic {API_KEY}

Body Parameters

Parameter Type Description
paymentTerms string Updated payment terms for the invoice, e.g. NET_30
paymentStatus array Updated payment status for the invoice, e.g. paymentStatus[0]="OUTSTANDING"
invoiceStatus array Updated invoice status, e.g. invoiceStatus[0]="ISSUED"
issueDate string The updated date when the invoice was issued, e.g. issueDate="2021-08-22T17:05:58.112Z"
dueDate string The updated date when the payment is due, e.g. dueDate="2021-09-21T17:05:58.112Z"
companyId string The ID of the company issuing the invoice, e.g. companyId="60e1b7f0c6ef4219ff51824c"
customerId string The ID of the customer to whom the invoice is issued, e.g. customerId="612283bafd4e6319d487fa8f"
billTo object Updated address object includes address1, address2, attn, city, country, phones, state, zipCode, integrations, name
shipTo object Updated address object includes address1, address2, attn, city, country, phones, state, zipCode
itemLines array An updated array of items. Each item is an object that includes title, description, quantity, rate, taxLines,integrations, amount, rate
taxLines array An updated array of tax items. Each item is an object that includes amount, name, priceInclude
discountLines array An updated array of discount items. Each item is an object that includes amount, name, _id
autopay boolean Updated auto pay status. Default: true
useCustomerEmail boolean Updated use customer email status. Default: true
source string Updated source

Example

To update an invoice, you would send a PATCH request to https://api.blixo.com/v1/invoices/:invoiceId. Remember to replace {API_KEY} with your actual API key and :invoiceId with the ID of the invoice you want to update.

Response

If the request is successful, you will receive a 200 OK status code along with a JSON object containing the updated invoice. If something goes wrong, you will receive a 4xx or 5xx status code, with a JSON object containing more information about the error.

Delete an invoice

curl "https://api.blixo.com/v1/invoices/:invoiceId" \
-u {API_KEY}: \
-X DELETE
const fetch = require('node-fetch');

const url = 'https://api.blixo.com/v1/invoices/:invoiceId';
const options = {
  method: 'DELETE',
  headers: {
    'Authorization': 'Basic {API_KEY}'
  }
};

fetch(url, options)
  .then(res => res.text())
  .then(body => console.log(body))
  .catch(error => console.error(error));
<?php

$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.blixo.com/v1/invoices/:invoiceId',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'DELETE',
  CURLOPT_HTTPHEADER => array(
    'Authorization: Basic {API_KEY}'
  ),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
?>
require 'uri'
require 'net/http'

url = URI("https://api.blixo.com/v1/invoices/:invoiceId")

http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Basic {API_KEY}'

response = http.request(request)
puts response.read_body
import requests

url = "https://api.blixo.com/v1/invoices/:invoiceId"
headers = {
  'Authorization': 'Basic {API_KEY}'
}

response = requests.request("DELETE", url, headers=headers)

print(response.text)
package main

import (
    "fmt"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://api.blixo.com/v1/invoices/:invoiceId"
    req, _ := http.NewRequest("DELETE", url, nil)
    req.Header.Add("Authorization", "Basic {API_KEY}")

    res, _ := http.DefaultClient.Do(req)

    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)

    fmt.Println(string(body))
}
var client = new RestClient("https://api.blixo.com/v1/invoices/:invoiceId");
var request = new RestRequest(Method.DELETE);
request.AddHeader("Authorization", "Basic {API_KEY}");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
import java.util.Base64;

public class Main {
    public static void main(String[] args) throws Exception {
        String url = "https://api.blixo.com/v1/invoices/:invoiceId";
        String apiKey = "{API_KEY}:";
        String encodedApiKey = Base64.getEncoder().encodeToString(apiKey.getBytes());

        OkHttpClient client = new OkHttpClient();

        Request request = new Request.Builder()
            .url(url)
            .delete()
            .addHeader("Authorization", "Basic " + encodedApiKey)
            .build();

        Response response = client.newCall(request).execute();
        System.out.println(response.body().string());
    }
}

The above command returns JSON structured like this:

{
  "data": "611d4216a747250146ade2cf"
}

This API endpoint allows you to delete an existing invoice in the database. Think of it as telling the server, "Hey, I don't need this invoice anymore!" And the server responds by removing the invoice from the database!

HTTP Request

DELETE https://api.blixo.com/v1/invoices/:invoiceId

Headers

Key Value
Authorization Basic {API_KEY}

Example

To delete an invoice, you would send a DELETE request to https://api.blixo.com/v1/invoices/:invoiceId. Remember to replace {API_KEY} with your actual API key and :invoiceId with the ID of the invoice you want to delete.

Response

If the request is successful, you will receive a 200 OK status code along with a JSON object containing the ID of the deleted invoice. If something goes wrong, you will receive a 4xx or 5xx status code, with a JSON object containing more information about the error.

Close an invoice

curl "https://api.blixo.com/v1/invoices/:invoiceId/actions/close" \
-u {API_KEY}: \
-X POST
const fetch = require('node-fetch');

const url = 'https://api.blixo.com/v1/invoices/:invoiceId/actions/close';
const options = {
  method: 'POST',
  headers: {
    'Authorization': 'Basic {API_KEY}'
  }
};

fetch(url, options)
  .then(res => res.text())
  .then(body => console.log(body))
  .catch(error => console.error(error));
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.blixo.com/v1/invoices/:invoiceId/actions/close',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_HTTPHEADER => array(
    'Authorization: Basic {API_KEY}'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

?>
require 'uri'
require 'net/http'

url = URI("https://api.blixo.com/v1/invoices/:invoiceId/actions/close")

http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic {API_KEY}'

response = http.request(request)
puts response.read_body
import http.client

conn = http.client.HTTPSConnection("api.blixo.com")

headers = { 'Authorization': 'Basic {API_KEY}' }

conn.request("POST", "/v1/invoices/:invoiceId/actions/close", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
package main

import (
    "fmt"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://api.blixo.com/v1/invoices/:invoiceId/actions/close"
    req, _ := http.NewRequest("POST", url, nil)
    req.Header.Add("Authorization", "Basic {API_KEY}")

    res, _ := http.DefaultClient.Do(req)

    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)

    fmt.Println(string(body))
}
var client = new RestClient("https://api.blixo.com/v1/invoices/:invoiceId/actions/close");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Basic {API_KEY}");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;

public class Main {
    public static void main(String[] args) {
        OkHttpClient client = new OkHttpClient();

        Request request = new Request.Builder()
            .url("https://api.blixo.com/v1/invoices/:invoiceId/actions/close")
            .addHeader("Authorization", "Basic {API_KEY}")
            .build();

        try (Response response = client.newCall(request).execute()) {
            System.out.println(response.body().string());
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

The above command returns JSON structured like this:

{
  "data" : {
    "id": "635cce72a34c63015d3e01bc",
    "invoiceNo": "4355454",
    "managerId": "65289eb09d9571a357f09a5c",
    "issueDate": "2022-10-29T06:54:59.491Z",
    "paymentDate": "2022-10-29T06:55:05.809Z",
    "paidDate": null,
    "billTo": {
        "attn": "Customer",
        "phones": [],
        "address1": "",
        "address2": "",
        "city": "",
        "state": "",
        "zipCode": "",
        "country": "DE",
        "integrations": {
            "shopify": {
                "addressId": "7571863634084"
            }
        },
        "name": "Customer"
    },
    "shipTo": {
        "name": "Customer",
        "attn": "Customer",
        "address1": "",
        "address2": "",
        "country": "DE",
        "city": "",
        "state": "",
        "zipCode": ""
    },
    "notes": "note",
    "attachments": [
        ""
    ],
    "subTotalAmount": {
        "currency": "USD",
        "_id": "635cce72a34c63015d3e01f6",
        "value": 34,
        "unit": "$"
    },
    "totalAmount": {
        "currency": "USD",
        "value": 34,
        "unit": "$"
    },
    "balanceAmount": {
        "currency": "USD",
        "value": 34,
        "unit": "$"
    },
    "paymentStatus": [
        "OUTSTANDING",
        "BADDEBT"
    ],
    "paymentTerms": "AUTO_PAY",
    "invoiceStatus": [
        "ISSUED",
        "CLOSED"
    ],
    "sentStatus": "NOT_SENT",
    "itemLines": [
        {
            "detail": {
                "description": "",
                "notTaxed": true,
                "notDiscounted": true,
                "productType": "PRODUCT"
            },
            "_id": "635cce5cd2ef2c5e752edacc",
            "title": "Custom Bundle Auto renew",
            "description": "",
            "quantity": 1,
            "rate": {
                "currency": "USD",
                "_id": "635cce72a34c63015d3e01be",
                "value": 34,
                "unit": "$"
            },
            "taxLines": [],
            "integrations": {
                "qbo": {
                    "qboId": "0",
                    "itemRefId": "0",
                    "qboSyncToken": "0"
                }
            },
            "amount": {
                "currency": "USD",
                "_id": "635cce72a34c63015d3e01e9",
                "value": 34,
                "unit": "$"
            },
            "discountLines": [],
            "discountAmount": {
                "currency": "USD",
                "_id": "635cce72a34c63015d3e01e7",
                "value": 0,
                "unit": "$"
            },
            "discountedAmount": {
                "currency": "USD",
                "_id": "635cce72a34c63015d3e01e8",
                "value": 34,
                "unit": "$"
            }
        }
    ],
    "discountLines": [],
    "discountAmount": {
        "currency": "USD",
        "_id": "635cce72a34c63015d3e01f3",
        "value": 0,
        "unit": "$"
    },
    "discountedAmount": {
        "currency": "USD",
        "_id": "635cce72a34c63015d3e01f4",
        "value": 34,
        "unit": "$"
    },
    "taxLines": [],
    "taxAmount": {
        "currency": "USD",
        "_id": "635cce72a34c63015d3e01f5",
        "value": 0,
        "unit": "$"
    },
    "shippingLines": [],
    "shippingAmount": {
        "currency": "USD",
        "_id": "635cce72a34c63015d3e01f7",
        "value": 0,
        "unit": "$"
    },
    "creditAmount": {
        "currency": "USD",
        "_id": "635cce72a34c63015d3e01fb",
        "value": 0,
        "unit": "$"
    },
    "paidAmount": {
        "currency": "USD",
        "_id": "635cce72a34c63015d3e01fa",
        "value": 0,
        "unit": "$"
    },
    "companyId": "622294998bec060152bcad9c",
    "customerId": "6331629360eea3015e855e40",
    "disableChasing": true,
    "useCustomerEmail": true,
    "invoiceEmail": "",
    "chasingSchedules": [],
    "createdBy": "6222930b8bec060152bcad67",
    "updatedBy": "6222930b8bec060152bcad67",
    "createdAt": "2022-10-29T06:55:46.045Z",
    "updatedAt": "2022-10-30T01:41:16.689Z",
    "source": "BLIXO",
    "isPaymentPlan": false,
    "paymentPlanAutoPay": false,
    "requireApprove": false,
    "approvalDetail": null,
    "installments": [],
    "attemptCount": 0,
    "payments": [],
    "creditNotes": []
}
}

This API endpoint allows you to close an existing invoice in the database. Think of it as telling the server, "Hey, I'm done with this invoice!" And the server responds by closing the invoice in the database!

HTTP Request

POST https://api.blixo.com/v1/invoices/:invoiceId/actions/close

Headers

Key Value
Authorization Basic {API_KEY}

Example

To close an invoice, you would send a POST request to https://api.blixo.com/v1/invoices/:invoiceId/actions/close. Remember to replace {API_KEY} with your actual API key and :invoiceId with the ID of the invoice you want to close.

Response

If the request is successful, you will receive a 200 OK status code along with a JSON object containing the ID of the closed invoice. If something goes wrong, you will receive a 4xx or 5xx status code, with a JSON object containing more information about the error.

Reopen an invoice

curl "https://api.blixo.com/v1/invoices/:invoiceId/actions/reopen" \
-u {API_KEY}: \
-X POST
const fetch = require('node-fetch');

const url = 'https://api.blixo.com/v1/invoices/:invoiceId/actions/reopen';
const options = {
  method: 'POST',
  headers: {
    'Authorization': 'Basic {API_KEY}'
  }
};

fetch(url, options)
  .then(res => res.text())
  .then(body => console.log(body))
  .catch(error => console.error(error));
$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.blixo.com/v1/invoices/:invoiceId/actions/reopen',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_HTTPHEADER => array(
    'Authorization: Basic {API_KEY}'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
require 'uri'
require 'net/http'

url = URI("https://api.blixo.com/v1/invoices/:invoiceId/actions/reopen")

https = Net::HTTP.new(url.host, url.port);
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic {API_KEY}'

response = https.request(request)
puts response.read_body
import requests

url = "https://api.blixo.com/v1/invoices/:invoiceId/actions/reopen"

headers = {
  'Authorization': 'Basic {API_KEY}'
}

response = requests.request("POST", url, headers=headers)

print(response.text)
package main

import (
    "fmt"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://api.blixo.com/v1/invoices/:invoiceId/actions/reopen"
    method := "POST"

    client := &http.Client {
    }
    req, err := http.NewRequest(method, url, nil)

    if err != nil {
        fmt.Println(err)
        return
    }
    req.Header.Add("Authorization", "Basic {API_KEY}")

    res, err := client.Do(req)
    defer res.Body.Close()
    body, err := ioutil.ReadAll(res.Body)

    fmt.Println(string(body))
}
var client = new RestClient("https://api.blixo.com/v1/invoices/:invoiceId/actions/reopen");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Basic {API_KEY}");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;

public class Main {
    public static void main(String[] args) {
        OkHttpClient client = new OkHttpClient();

        Request request = new Request.Builder()
            .url("https://api.blixo.com/v1/invoices/:invoiceId/actions/reopen")
            .addHeader("Authorization", "Basic {API_KEY}")
            .build();

        try (Response response = client.newCall(request).execute()) {
            System.out.println(response.body().string());
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

The above command returns JSON structured like this:

{
    "data": {
        "id": "635cce72a34c63015d3e01bc",
        "invoiceNo": "4355454",
        "managerId": "65289eb09d9571a357f09a5c",
        "issueDate": "2022-10-29T06:54:59.491Z",
        "paymentDate": "2022-10-29T06:55:05.809Z",
        "paidDate": null,
        "billTo": {
            "attn": "Customer",
            "phones": [],
            "address1": "",
            "address2": "",
            "city": "",
            "state": "",
            "zipCode": "",
            "country": "DE",
            "integrations": {
                "shopify": {
                    "addressId": "7571863634084"
                }
            },
            "name": "Customer"
        },
        "shipTo": {
            "name": "Customer",
            "attn": "Customer",
            "address1": "",
            "address2": "",
            "country": "DE",
            "city": "",
            "state": "",
            "zipCode": ""
        },
        "notes": "note",
        "attachments": [
            ""
        ],
        "subTotalAmount": {
            "currency": "USD",
            "_id": "635cce72a34c63015d3e01f6",
            "value": 34,
            "unit": "$"
        },
        "totalAmount": {
            "currency": "USD",
            "value": 34,
            "unit": "$"
        },
        "balanceAmount": {
            "currency": "USD",
            "value": 34,
            "unit": "$"
        },
        "paymentStatus": [
            "OUTSTANDING"
        ],
        "paymentTerms": "AUTO_PAY",
        "invoiceStatus": [
            "ISSUED"
        ],
        "sentStatus": "NOT_SENT",
        "itemLines": [
            {
                "detail": {
                    "description": "",
                    "notTaxed": true,
                    "notDiscounted": true,
                    "productType": "PRODUCT"
                },
                "_id": "635cce5cd2ef2c5e752edacc",
                "title": "Custom Bundle Auto renew",
                "description": "",
                "quantity": 1,
                "rate": {
                    "currency": "USD",
                    "_id": "635cce72a34c63015d3e01be",
                    "value": 34,
                    "unit": "$"
                },
                "taxLines": [],
                "integrations": {
                    "qbo": {
                        "qboId": "0",
                        "itemRefId": "0",
                        "qboSyncToken": "0"
                    }
                },
                "amount": {
                    "currency": "USD",
                    "_id": "635cce72a34c63015d3e01e9",
                    "value": 34,
                    "unit": "$"
                },
                "discountLines": [],
                "discountAmount": {
                    "currency": "USD",
                    "_id": "635cce72a34c63015d3e01e7",
                    "value": 0,
                    "unit": "$"
                },
                "discountedAmount": {
                    "currency": "USD",
                    "_id": "635cce72a34c63015d3e01e8",
                    "value": 34,
                    "unit": "$"
                }
            }
        ],
        "discountLines": [],
        "discountAmount": {
            "currency": "USD",
            "_id": "635cce72a34c63015d3e01f3",
            "value": 0,
            "unit": "$"
        },
        "discountedAmount": {
            "currency": "USD",
            "_id": "635cce72a34c63015d3e01f4",
            "value": 34,
            "unit": "$"
        },
        "taxLines": [],
        "taxAmount": {
            "currency": "USD",
            "_id": "635cce72a34c63015d3e01f5",
            "value": 0,
            "unit": "$"
        },
        "shippingLines": [],
        "shippingAmount": {
            "currency": "USD",
            "_id": "635cce72a34c63015d3e01f7",
            "value": 0,
            "unit": "$"
        },
        "creditAmount": {
            "currency": "USD",
            "_id": "635cce72a34c63015d3e01fb",
            "value": 0,
            "unit": "$"
        },
        "paidAmount": {
            "currency": "USD",
            "_id": "635cce72a34c63015d3e01fa",
            "value": 0,
            "unit": "$"
        },
        "companyId": "622294998bec060152bcad9c",
        "customerId": "6331629360eea3015e855e40",
        "disableChasing": true,
        "useCustomerEmail": true,
        "invoiceEmail": "",
        "chasingSchedules": [],
        "createdBy": "6222930b8bec060152bcad67",
        "updatedBy": "6222930b8bec060152bcad67",
        "createdAt": "2022-10-29T06:55:46.045Z",
        "updatedAt": "2022-10-30T01:49:59.828Z",
        "source": "BLIXO",
        "isPaymentPlan": false,
        "paymentPlanAutoPay": false,
        "requireApprove": false,
        "approvalDetail": null,
        "installments": [],
        "attemptCount": 0,
        "creditNotes": [],
        "payments": []
    }
}

This API endpoint allows you to reopen a previously closed invoice in the database. It's like saying to the server, "Hey, I need to work on this invoice again!" And the server responds by reopening the invoice in the database!

HTTP Request

POST https://api.blixo.com/v1/invoices/:invoiceId/actions/reopen

Headers

Key Value
Authorization Basic {API_KEY}

Example

To reopen an invoice, you would send a POST request to https://api.blixo.com/v1/invoices/:invoiceId/actions/reopen. Remember to replace {API_KEY} with your actual API key and :invoiceId with the ID of the invoice you want to reopen.

Response

If the request is successful, you will receive a 200 OK status code along with a JSON object containing the ID of the reopened invoice. If something goes wrong, you will receive a 4xx or 5xx status code, with a JSON object containing more information about the error.

Mark an invoice as sent

curl "https://api.blixo.com/v1/invoices/:invoiceId/actions/marksent" \
-u {API_KEY}: \
-X POST
const fetch = require('node-fetch');

const url = 'https://api.blixo.com/v1/invoices/:invoiceId/actions/marksent';
const options = {
  method: 'POST',
  headers: {
    'Authorization': 'Basic {API_KEY}'
  }
};

fetch(url, options)
  .then(res => res.text())
  .then(body => console.log(body))
  .catch(error => console.error(error));
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.blixo.com/v1/invoices/:invoiceId/actions/marksent',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_HTTPHEADER => array(
    'Authorization: Basic {API_KEY}'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

?>
require 'uri'
require 'net/http'

url = URI("https://api.blixo.com/v1/invoices/:invoiceId/actions/marksent")

http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic {API_KEY}'

response = http.request(request)
puts response.read_body
import requests

url = "https://api.blixo.com/v1/invoices/:invoiceId/actions/marksent"

headers = {
  'Authorization': 'Basic {API_KEY}'
}

response = requests.request("POST", url, headers=headers)

print(response.text)
package main

import (
    "fmt"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://api.blixo.com/v1/invoices/:invoiceId/actions/marksent"
    method := "POST"

    client := &http.Client {
    }
    req, err := http.NewRequest(method, url, nil)

    if err != nil {
        fmt.Println(err)
        return
    }
    req.Header.Add("Authorization", "Basic {API_KEY}")

    res, err := client.Do(req)
    defer res.Body.Close()
    body, err := ioutil.ReadAll(res.Body)

    fmt.Println(string(body))
}
var client = new RestClient("https://api.blixo.com/v1/invoices/:invoiceId/actions/marksent");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Basic {API_KEY}");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;

public class Main {
    public static void main(String[] args) throws Exception {
        OkHttpClient client = new OkHttpClient().newBuilder()
          .build();
        Request request = new Request.Builder()
          .url("https://api.blixo.com/v1/invoices/:invoiceId/actions/marksent")
          .method("POST", null)
          .addHeader("Authorization", "Basic {API_KEY}")
          .build();
        Response response = client.newCall(request).execute();
        System.out.println(response.body().string());
    }
}

The above command returns JSON structured like this:

{
    "id": "630179145a32a40160513a84",
    "invoiceNo": "INV-0241",
    "managerId": "65289eb09d9571a357f09a5c",
    "paidDate": null,
    "billTo": {
        "name": " ",
        "address1": "",
        "address2": "",
        "city": "",
        "state": "",
        "zipCode": "",
        "country": "",
        "phones": [
            ""
        ]
    },
    "shipTo": {
        "name": " ",
        "address1": "",
        "address2": "",
        "city": "",
        "state": "",
        "zipCode": "",
        "country": "",
        "phones": [
            ""
        ]
    },
    "notes": null,
    "attachments": [
        ""
    ],
    "subTotalAmount": {
        "currency": "EUR",
        "_id": "630179145a32a40160513aa7",
        "value": 56,
        "unit": "$"
    },
    "totalAmount": {
        "currency": "EUR",
        "value": 56,
        "unit": "$"
    },
    "balanceAmount": {
        "currency": "EUR",
        "value": 56,
        "unit": "$"
    },
    "paymentStatus": [
        "OUTSTANDING"
    ],
    "invoiceStatus": [
        "ISSUED"
    ],
    "sentStatus": "SENT",
    "itemLines": [
        {
            "detail": {
                "description": "Custom Bundle - 16 Meals. ",
                "notDiscounted": true,
                "notTaxed": false,
                "productType": "PRODUCT"
            },
            "_id": "630179145a32a40160513a85",
            "title": "Custom Bundle  - 16 Meals",
            "description": "Custom Bundle - 16 Meals.",
            "quantity": 1,
            "rate": {
                "currency": "EUR",
                "_id": "630179145a32a40160513a86",
                "value": 56,
                "unit": "$"
            },
            "amount": {
                "currency": "EUR",
                "_id": "630179145a32a40160513aa0",
                "value": 56,
                "unit": "$"
            },
            "taxLines": [],
            "discountLines": [],
            "integrations": {
                "shopify": {
                    "customerId": "6244557389988",
                    "orderId": "4728254726308",
                    "productId": "7101589749924",
                    "variantId": "41448600043684",
                    "variantTitle": "16 Meals",
                    "sku": "SUB-CUSTOM160",
                    "isOneTime": true
                }
            },
            "discountAmount": {
                "currency": "USD",
                "_id": "630179145a32a40160513a9e",
                "value": 0,
                "unit": "$"
            },
            "discountedAmount": {
                "currency": "EUR",
                "_id": "630179145a32a40160513a9f",
                "value": 56,
                "unit": "$"
            }
        }
    ],
    "discountLines": [],
    "discountAmount": {
        "currency": "EUR",
        "_id": "630179145a32a40160513aa4",
        "value": 0,
        "unit": "$"
    },
    "discountedAmount": {
        "currency": "EUR",
        "_id": "630179145a32a40160513aa5",
        "value": 56,
        "unit": "$"
    },
    "taxLines": [],
    "taxAmount": {
        "currency": "EUR",
        "_id": "630179145a32a40160513aa6",
        "value": 0,
        "unit": "$"
    },
    "shippingLines": [],
    "shippingAmount": {
        "currency": "USD",
        "_id": "630179145a32a40160513aa8",
        "value": 0,
        "unit": "$"
    },
    "creditAmount": {
        "currency": "USD",
        "_id": "630179145a32a40160513aac",
        "value": 0,
        "unit": "$"
    },
    "paidAmount": {
        "currency": "USD",
        "_id": "630179145a32a40160513aab",
        "value": 0,
        "unit": "$"
    },
    "companyId": "622294998bec060152bcad9c",
    "customerId": "62f135085ff37c016a57f0eb",
    "disableChasing": true,
    "useCustomerEmail": true,
    "invoiceEmail": "",
    "chasingSchedules": [],
    "updatedBy": "6222930b8bec060152bcad67",
    "createdAt": "2022-08-21T00:15:16.522Z",
    "updatedAt": "2022-10-30T14:45:40.593Z",
    "source": "SHOPIFY",
    "integrations": {
        "shopify": {
            "orderId": "4728254726308",
            "customerId": "6244557389988",
            "orderUrl": "https://..",
            "lastSynced": 1661040916516
        },
        "bigquery": {}
    },
    "isPaymentPlan": false,
    "paymentPlanAutoPay": false,
    "requireApprove": false,
    "approvalDetail": null,
    "installments": [],
    "attemptCount": 0,
    "payments": [],
    "creditNotes": []
}

This API endpoint allows you to mark an invoice as sent in the database. It's like telling the server, "Hey, I've sent this invoice!" And the server responds by marking the invoice as sent in the database!

HTTP Request

POST https://api.blixo.com/v1/invoices/:invoiceId/actions/marksent

Headers

Key Value
Authorization Basic {API_KEY}

Example

To mark an invoice as sent, you would send a POST request to https://api.blixo.com/v1/invoices/:invoiceId/actions/marksent. Remember to replace {API_KEY} with your actual API key and :invoiceId with the ID of the invoice you have sent.

Response

If the request is successful, you will receive a 200 OK status code along with a JSON object containing the ID of the sent invoice. If something goes wrong, you will receive a 4xx or 5xx status code, with a JSON object containing more information about the error.

Download an invoice

curl "https://api.blixo.com/v1/invoices/:invoiceId/actions/download" \
-u {API_KEY}: \
-X GET \
-o invoice.pdf
const fetch = require('node-fetch');

const url = 'https://api.blixo.com/v1/invoices/:invoiceId/actions/download';
const options = {
  method: 'GET',
  headers: {
    'Authorization': 'Basic {API_KEY}'
  }
};

fetch(url, options)
  .then(res => res.text())
  .then(body => console.log(body))
  .catch(error => console.error(error));
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.blixo.com/v1/invoices/:invoiceId/actions/download',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => array(
    'Authorization: Basic {API_KEY}'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

?>
require 'uri'
require 'net/http'

url = URI("https://api.blixo.com/v1/invoices/:invoiceId/actions/download")

https = Net::HTTP.new(url.host, url.port);
https.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Basic {API_KEY}'

response = https.request(request)
puts response.read_body
import requests

url = "https://api.blixo.com/v1/invoices/:invoiceId/actions/download"

headers = {
  'Authorization': 'Basic {API_KEY}'
}

response = requests.request("GET", url, headers=headers)

print(response.text)
package main

import (
    "fmt"
    "io/ioutil"
    "net/http"
)

func main() {

    url := "https://api.blixo.com/v1/invoices/:invoiceId/actions/download"
    method := "GET"

    client := &http.Client {
    }
    req, err := http.NewRequest(method, url, nil)

    if err != nil {
        fmt.Println(err)
        return
    }
    req.Header.Add("Authorization", "Basic {API_KEY}")

    res, err := client.Do(req)
    defer res.Body.Close()
    body, err := ioutil.ReadAll(res.Body)

    fmt.Println(string(body))
}
var client = new RestClient("https://api.blixo.com/v1/invoices/:invoiceId/actions/download");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Basic {API_KEY}");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
import java.io.IOException;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;

public class Main {

    public static void main(String[] args) {
        OkHttpClient client = new OkHttpClient().newBuilder()
          .build();
        Request request = new Request.Builder()
          .url("https://api.blixo.com/v1/invoices/:invoiceId/actions/download")
          .method("GET", null)
          .addHeader("Authorization", "Basic {API_KEY}")
          .build();
        try {
            Response response = client.newCall(request).execute();
            System.out.println(response.body().string());
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}

This API endpoint allows you to download an invoice. It's as simple as sending a GET request to https://api.blixo.com/v1/invoices/:invoiceId/actions/download. Think of it as asking the server, "Hey, can I get a copy of this invoice?" And the server responds by providing you with a downloadable PDF of the invoice!

HTTP Request

GET https://api.blixo.com/v1/invoices/:invoiceId/actions/download

Headers

Key Value
Authorization Basic {API_KEY}

Example

To download an invoice, you would send a GET request to https://api.blixo.com/v1/invoices/:invoiceId/actions/download. Remember to replace {API_KEY} with your actual API key and :invoiceId with the ID of the invoice you want to download.

Response

If the request is successful, you will receive a 200 OK status code and the invoice will be downloaded as a PDF. If something goes wrong, you will receive a 4xx or 5xx status code, with a JSON object containing more information about the error.

Void an invoice

curl "https://api.blixo.com/v1/invoices/:invoiceId/actions/void" \
-u {API_KEY}: \
-X POST
const fetch = require('node-fetch');

const url = 'https://api.blixo.com/v1/invoices/:invoiceId/actions/void';
const options = {
  method: 'POST',
  headers: {
    'Authorization': 'Basic {API_KEY}'
  }
};

fetch(url, options)
  .then(res => res.text())
  .then(body => console.log(body))
  .catch(error => console.error(error));
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.blixo.com/v1/invoices/:invoiceId/actions/void",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_HTTPHEADER => array(
    "Authorization: Basic {API_KEY}"
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

?>
require 'uri'
require 'net/http'

url = URI("https://api.blixo.com/v1/invoices/:invoiceId/actions/void")

http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic {API_KEY}'

response = http.request(request)
puts response.read_body
import requests

url = "https://api.blixo.com/v1/invoices/:invoiceId/actions/void"

payload={}
headers = {
  'Authorization': 'Basic {API_KEY}'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
package main

import (
    "fmt"
    "io/ioutil"
    "net/http"
)

func main() {

    url := "https://api.blixo.com/v1/invoices/:invoiceId/actions/void"
    method := "POST"

    client := &http.Client {
    }
    req, err := http.NewRequest(method, url, nil)

    if err != nil {
        fmt.Println(err)
        return
    }
    req.Header.Add("Authorization", "Basic {API_KEY}")

    res, err := client.Do(req)
    defer res.Body.Close()
    body, err := ioutil.ReadAll(res.Body)

    fmt.Println(string(body))
}
var client = new RestClient("https://api.blixo.com/v1/invoices/:invoiceId/actions/void");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Basic {API_KEY}");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
import java.io.IOException;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;

public class Main {

    public static void main(String[] args) {
        OkHttpClient client = new OkHttpClient().newBuilder()
            .build();
        Request request = new Request.Builder()
            .url("https://api.blixo.com/v1/invoices/:invoiceId/actions/void")
            .method("POST", null)
            .addHeader("Authorization", "Basic {API_KEY}")
            .build();
        try {
            Response response = client.newCall(request).execute();
            System.out.println(response.body().string());
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}

The above command returns JSON structured like this:

{
    "data": {
        "id": "635cce72a34c63015d3e01bc",
        "invoiceNo": "4355454",
        "managerId": "65289eb09d9571a357f09a5c",
        "issueDate": "2022-10-29T06:54:59.491Z",
        "paymentDate": "2022-10-29T06:55:05.809Z",
        "paidDate": null,
        "billTo": {
            "attn": "Customer",
            "phones": [],
            "address1": "",
            "address2": "",
            "city": "",
            "state": "",
            "zipCode": "",
            "country": "DE",
            "integrations": {
                "shopify": {
                    "addressId": "7571863634084"
                }
            },
            "name": "Customer"
        },
        "shipTo": {
            "name": "Customer",
            "attn": "Customer",
            "address1": "",
            "address2": "",
            "country": "DE",
            "city": "",
            "state": "",
            "zipCode": ""
        },
        "notes": "note",
        "attachments": [
            ""
        ],
        "subTotalAmount": {
            "currency": "USD",
            "_id": "635cce72a34c63015d3e01f6",
            "value": 34,
            "unit": "$"
        },
        "totalAmount": {
            "currency": "USD",
            "value": 34,
            "unit": "$"
        },
        "balanceAmount": {
            "currency": "USD",
            "value": 0,
            "unit": "$"
        },
        "paymentStatus": [
            "VOIDED"
        ],
        "paymentTerms": "AUTO_PAY",
        "invoiceStatus": [
            "ISSUED"
        ],
        "sentStatus": "NOT_SENT",
        "itemLines": [
            {
                "detail": {
                    "description": "",
                    "notTaxed": true,
                    "notDiscounted": true,
                    "productType": "PRODUCT"
                },
                "_id": "635cce5cd2ef2c5e752edacc",
                "title": "Custom Bundle Auto renew",
                "description": "",
                "quantity": 1,
                "rate": {
                    "currency": "USD",
                    "_id": "635cce72a34c63015d3e01be",
                    "value": 34,
                    "unit": "$"
                },
                "taxLines": [],
                "integrations": {
                    "qbo": {
                        "qboId": "0",
                        "itemRefId": "0",
                        "qboSyncToken": "0"
                    }
                },
                "amount": {
                    "currency": "USD",
                    "_id": "635cce72a34c63015d3e01e9",
                    "value": 34,
                    "unit": "$"
                },
                "discountLines": [],
                "discountAmount": {
                    "currency": "USD",
                    "_id": "635cce72a34c63015d3e01e7",
                    "value": 0,
                    "unit": "$"
                },
                "discountedAmount": {
                    "currency": "USD",
                    "_id": "635cce72a34c63015d3e01e8",
                    "value": 34,
                    "unit": "$"
                }
            }
        ],
        "discountLines": [],
        "discountAmount": {
            "currency": "USD",
            "_id": "635cce72a34c63015d3e01f3",
            "value": 0,
            "unit": "$"
        },
        "discountedAmount": {
            "currency": "USD",
            "_id": "635cce72a34c63015d3e01f4",
            "value": 34,
            "unit": "$"
        },
        "taxLines": [],
        "taxAmount": {
            "currency": "USD",
            "_id": "635cce72a34c63015d3e01f5",
            "value": 0,
            "unit": "$"
        },
        "shippingLines": [],
        "shippingAmount": {
            "currency": "USD",
            "_id": "635cce72a34c63015d3e01f7",
            "value": 0,
            "unit": "$"
        },
        "creditAmount": {
            "currency": "USD",
            "_id": "635cce72a34c63015d3e01fb",
            "value": 0,
            "unit": "$"
        },
        "paidAmount": {
            "currency": "USD",
            "_id": "635dd969a34c63015d1a2ba3",
            "value": 34,
            "unit": "$"
        },
        "companyId": "622294998bec060152bcad9c",
        "customerId": "6331629360eea3015e855e40",
        "disableChasing": true,
        "useCustomerEmail": true,
        "invoiceEmail": "",
        "chasingSchedules": [],
        "createdBy": "6222930b8bec060152bcad67",
        "updatedBy": "6222930b8bec060152bcad67",
        "createdAt": "2022-10-29T06:55:46.045Z",
        "updatedAt": "2022-10-30T01:54:49.530Z",
        "source": "BLIXO",
        "isPaymentPlan": false,
        "paymentPlanAutoPay": false,
        "requireApprove": false,
        "approvalDetail": null,
        "installments": [],
        "attemptCount": 0,
        "payments": [],
        "creditNotes": []
    }
}

This API endpoint allows you to void an invoice. It's as simple as sending a POST request to https://api.blixo.com/v1/invoices/:invoiceId/actions/void. Think of it as telling the server, "Hey, I want to void this invoice!" And the server responds by voiding the invoice in the database!

HTTP Request

POST https://api.blixo.com/v1/invoices/:invoiceId/actions/void

Headers

Key Value
Authorization Basic {API_KEY}

Example

To void an invoice, you would send a POST request to https://api.blixo.com/v1/invoices/:invoiceId/actions/void. Remember to replace {API_KEY} with your actual API key and :invoiceId with the ID of the invoice you want to void.

Response

If the request is successful, you will receive a 200 OK status code and the invoice will be voided in the database. If something goes wrong, you will receive a 4xx or 5xx status code, with a JSON object containing more information about the error.

Remove an expected payment

curl "https://api.blixo.com/v1/invoices/:invoiceId/actions/removeExpectedPayment" \
-u {API_KEY}: \
-X PATCH
const fetch = require('node-fetch');

const url = 'https://api.blixo.com/v1/invoices/:invoiceId/actions/removeExpectedPayment';
const options = {
  method: 'PATCH',
  headers: {
    'Authorization': 'Basic {API_KEY}'
  }
};

fetch(url, options)
  .then(res => res.text())
  .then(body => console.log(body))
  .catch(error => console.error(error));
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.blixo.com/v1/invoices/:invoiceId/actions/removeExpectedPayment',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'PATCH',
  CURLOPT_HTTPHEADER => array(
    'Authorization: Basic {API_KEY}'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
require 'uri'
require 'net/http'

url = URI("https://api.blixo.com/v1/invoices/:invoiceId/actions/removeExpectedPayment")

http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Basic {API_KEY}'

response = http.request(request)
puts response.read_body
import requests

url = "https://api.blixo.com/v1/invoices/:invoiceId/actions/removeExpectedPayment"

headers = {
  'Authorization': 'Basic {API_KEY}'
}

response = requests.request("PATCH", url, headers=headers)

print(response.text)
package main

import (
    "fmt"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://api.blixo.com/v1/invoices/:invoiceId/actions/removeExpectedPayment"
    method := "PATCH"

    client := &http.Client {
    }
    req, err := http.NewRequest(method, url, nil)

    if err != nil {
        fmt.Println(err)
        return
    }
    req.Header.Add("Authorization", "Basic {API_KEY}")

    res, err := client.Do(req)
    defer res.Body.Close()
    body, err := ioutil.ReadAll(res.Body)

    fmt.Println(string(body))
}
var client = new RestClient("https://api.blixo.com/v1/invoices/:invoiceId/actions/removeExpectedPayment");
var request = new RestRequest(Method.PATCH);
request.AddHeader("Authorization", "Basic {API_KEY}");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
import okhttp3.OkHttpClient;
import okhttp3.MediaType;
import okhttp3.RequestBody;
import okhttp3.Request;
import okhttp3.Response;

public class Main {
    public static void main(String[] args) {
        OkHttpClient client = new OkHttpClient().newBuilder()
            .build();
        MediaType mediaType = MediaType.parse("application/json");
        RequestBody body = RequestBody.create(mediaType, "");
        Request request = new Request.Builder()
            .url("https://api.blixo.com/v1/invoices/:invoiceId/actions/removeExpectedPayment")
            .method("PATCH", body)
            .addHeader("Authorization", "Basic {API_KEY}")
            .addHeader("Content-Type", "application/json")
            .build();
        try {
            Response response = client.newCall(request).execute();
            System.out.println(response.body().string());
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}

The above command returns JSON structured like this:

{
  "data": {
    "id": "610d695a1fb214594f7a4e19",
    "invoiceNo": "INV-0036",
    "managerId": "65289eb09d9571a357f09a5c",
    "issueDate": "2021-08-06T16:54:30.656Z",
    "dueDate": "2021-08-21T16:54:30.656Z",
    "expectedDate": null,
    "billTo": {
      "attn": "Antonio",
      "phones": ["1234567890"],
      "address1": "4157 Taylor Street 123",
      "address2": "Suite 1",
      "city": "New York",
      "state": "NY",
      "zipCode": "10001",
      "country": "USA",
      "name": "Antonio L Krach"
    },
    "notes": "Payment due within 15 days",
    "attachments": [
      "invoice_0036.pdf"
    ],
    "subTotalAmount": {
      "currency": "USD",
      "_id": "61266fb50f86842a80b491a7",
      "value": 30,
      "unit": "$"
    },
    "totalAmount": {
      "currency": "USD",
      "value": 27,
      "unit": "$"
    },
    "balanceAmount": {
      "currency": "USD",
      "value": 27,
      "unit": "$"
    },
    "paymentStatus": [
      "VOIDED"
    ],
    "paymentTerms": "NET_15",
    "invoiceStatus": [],
    "sentStatus": "SENT",
    "itemLines": [
      {
        "detail": {
          "description": "Lorem ipsum",
          "productType": "PRODUCT"
        },
        "_id": "610d69461a60a3f83544f758",
        "title": "test",
        "description": "Test product",
        "quantity": 1,
        "rate": {
          "currency": "USD",
          "_id": "610d695a1fb214594f7a4e1b",
          "value": 30,
          "unit": "$"
        },
        "amount": {
          "currency": "USD",
          "_id": "61266fb50f86842a80b491a3",
          "value": 30,
          "unit": "$"
        },
        "discountLines": [
          {
            "_id": "610cd3ff6caa26134c947edf",
            "name": "Discount 10%",
            "amount": {
              "currency": "USD",
              "_id": "610cd3ff6caa26134c947ee0",
              "value": 10,
              "unit": "%"
            }
          }
        ],
        "taxLines": [],
        "discountAmount": {
          "currency": "USD",
          "_id": "61266fb50f86842a80b491a1",
          "value": 3,
          "unit": "$"
        },
        "discountedAmount": {
          "currency": "USD",
          "_id": "61266fb50f86842a80b491a2",
          "value": 27,
          "unit": "$"
        }
      }
    ],
    "discountLines": [],
    "discountAmount": {
      "currency": "USD",
      "_id": "61266fb50f86842a80b491a4",
      "value": 0,
      "unit": "$"
    },
    "discountedAmount": {
      "currency": "USD",
      "_id": "61266fb50f86842a80b491a5",
      "value": 27,
      "unit": "$"
    },
    "taxLines": [],
    "taxAmount": {
      "currency": "USD",
      "_id": "61266fb50f86842a80b491a6",
      "value": 0,
      "unit": "$"
    },
    "creditAmount": {
      "currency": "USD",
      "_id": "61266fb50f86842a80b491a9",
      "value": 0,
      "unit": "$"
    },
    "paidAmount": {
      "currency": "USD",
      "_id": "61266fb50f86842a80b491a8",
      "value": 0,
      "unit": "$"
    },
    "companyId": "60e1b7f0c6ef4219ff51824c",
    "customerId": "61039770b733d94e98645c62",
    "createdBy": "60df577403bfb318db1bbac7",
    "updatedBy": "60df577403bfb318db1bbac7",
    "createdAt": "2021-08-06T16:54:50.549Z",
    "updatedAt": "2021-08-25T16:34:19.719Z",
    "payments": [],
    "creditNotes": []
  }
}

This API endpoint allows you to remove an expected payment from an invoice. It's as simple as sending a PATCH request to https://api.blixo.com/v1/invoices/:invoiceId/actions/removeExpectedPayment. Think of it as telling the server, "Hey, I want to remove the expected payment from this invoice!" And the server responds by removing the expected payment from the invoice in the database!

HTTP Request

PATCH https://api.blixo.com/v1/invoices/:invoiceId/actions/removeExpectedPayment

Headers

Key Value
Authorization Basic {API_KEY}

Example

To remove an expected payment from an invoice, you would send a PATCH request to https://api.blixo.com/v1/invoices/:invoiceId/actions/removeExpectedPayment. Remember to replace {API_KEY} with your actual API key and :invoiceId with the ID of the invoice from which you want to remove the expected payment.

Response

If the request is successful, you will receive a 200 OK status code and the expected payment will be removed from the invoice in the database. If something goes wrong, you will receive a 4xx or 5xx status code, with a JSON object containing more information about the error.

Send an invoice

curl "https://api.blixo.com/v1/invoices/:invoiceId/send" \
-d to="customer@blixo.com" \
-d bcc="bcc_customer@blixo.com" \
-d subject="{{company_name}} Invoice {{invoice_number}} for {{customer_name}}" \
-d message="Hi {{customer_contact_name}},\n\nYour most recent {{company_name}} invoice is attached as Invoice {{invoice_number}}.pdf \nThe balance of {{balance}} is due by {{due_date}}.\n\nRemember that each payment method takes a few days to process so please remit payment at least one week before the due date to ensure it arrives on time.\n\nIf you have questions about your invoice, please contact us at {{company_email}} or reply to this email.\n\nWe appreciate your business and thank you for choosing {{company_name}}.\n\n{{view_invoice_button}}" \
-X POST
const fetch = require('node-fetch');

const url = 'https://api.blixo.com/v1/invoices/:invoiceId/send';
const options = {
  method: 'POST',
  headers: {
    'Authorization': 'Basic {API_KEY}',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    "to": "customer@blixo.com",
    "bcc": "bcc_customer@blixo.com",
    "subject": "{{company_name}} Invoice {{invoice_number}} for {{customer_name}}",
    "message": "Hi {{customer_contact_name}},\n\nYour most recent {{company_name}} invoice is attached as Invoice {{invoice_number}}.pdf \nThe balance of {{balance}} is due by {{due_date}}.\n\nRemember that each payment method takes a few days to process so please remit payment at least one week before the due date to ensure it arrives on time.\n\nIf you have questions about your invoice, please contact us at {{company_email}} or reply to this email.\n\nWe appreciate your business and thank you for choosing {{company_name}}.\n\n{{view_invoice_button}}"
  })
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error('error:' + err));
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.blixo.com/v1/invoices/:invoiceId/send",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => array(
    "to" => "customer@blixo.com",
    "bcc" => "bcc_customer@blixo.com",
    "subject" => "{{company_name}} Invoice {{invoice_number}} for {{customer_name}}",
    "message" => "Hi {{customer_contact_name}},\n\nYour most recent {{company_name}} invoice is attached as Invoice {{invoice_number}}.pdf \nThe balance of {{balance}} is due by {{due_date}}.\n\nRemember that each payment method takes a few days to process so please remit payment at least one week before the due date to ensure it arrives on time.\n\nIf you have questions about your invoice, please contact us at {{company_email}} or reply to this email.\n\nWe appreciate your business and thank you for choosing {{company_name}}.\n\n{{view_invoice_button}}"
  ),
  CURLOPT_HTTPHEADER => array(
    "Authorization: Basic {API_KEY}",
    "Content-Type: application/json"
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

?>
require 'uri'
require 'net/http'

url = URI("https://api.blixo.com/v1/invoices/:invoiceId/send")

https = Net::HTTP.new(url.host, url.port);
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic {API_KEY}'
request["Content-Type"] = 'application/json'
request.body = JSON.generate({
  "to" => "customer@blixo.com",
  "bcc" => "bcc_customer@blixo.com",
  "subject" => "{{company_name}} Invoice {{invoice_number}} for {{customer_name}}",
  "message" => "Hi {{customer_contact_name}},\n\nYour most recent {{company_name}} invoice is attached as Invoice {{invoice_number}}.pdf \nThe balance of {{balance}} is due by {{due_date}}.\n\nRemember that each payment method takes a few days to process so please remit payment at least one week before the due date to ensure it arrives on time.\n\nIf you have questions about your invoice, please contact us at {{company_email}} or reply to this email.\n\nWe appreciate your business and thank you for choosing {{company_name}}.\n\n{{view_invoice_button}}"
})

response = https.request(request)
puts response.read_body
import requests
import json

url = "https://api.blixo.com/v1/invoices/:invoiceId/send"

payload = json.dumps({
  "to": "customer@blixo.com",
  "bcc": "bcc_customer@blixo.com",
  "subject": "{{company_name}} Invoice {{invoice_number}} for {{customer_name}}",
  "message": "Hi {{customer_contact_name}},\n\nYour most recent {{company_name}} invoice is attached as Invoice {{invoice_number}}.pdf \nThe balance of {{balance}} is due by {{due_date}}.\n\nRemember that each payment method takes a few days to process so please remit payment at least one week before the due date to ensure it arrives on time.\n\nIf you have questions about your invoice, please contact us at {{company_email}} or reply to this email.\n\nWe appreciate your business and thank you for choosing {{company_name}}.\n\n{{view_invoice_button}}"
})
headers = {
  'Authorization': 'Basic {API_KEY}',
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
package main

import (
    "fmt"
    "strings"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://api.blixo.com/v1/invoices/:invoiceId/send"
    method := "POST"

    payload := strings.NewReader(`{
        "to": "customer@blixo.com",
        "bcc": "bcc_customer@blixo.com",
        "subject": "{{company_name}} Invoice {{invoice_number}} for {{customer_name}}",
        "message": "Hi {{customer_contact_name}},\n\nYour most recent {{company_name}} invoice is attached as Invoice {{invoice_number}}.pdf \nThe balance of {{balance}} is due by {{due_date}}.\n\nRemember that each payment method takes a few days to process so please remit payment at least one week before the due date to ensure it arrives on time.\n\nIf you have questions about your invoice, please contact us at {{company_email}} or reply to this email.\n\nWe appreciate your business and thank you for choosing {{company_name}}.\n\n{{view_invoice_button}}"
    }`)

    client := &http.Client {
    }
    req, err := http.NewRequest(method, url, payload)

    if err != nil {
        fmt.Println(err)
        return
    }
    req.Header.Add("Authorization", "Basic {API_KEY}")
    req.Header.Add("Content-Type", "application/json")

    res, err := client.Do(req)
    if err != nil {
        fmt.Println(err)
        return
    }
    defer res.Body.Close()

    body, err := ioutil.ReadAll(res.Body)
    if err != nil {
        fmt.Println(err)
        return
    }
    fmt.Println(string(body))
}
var client = new RestClient("https://api.blixo.com/v1/invoices/:invoiceId/send");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Basic {API_KEY}");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n\t\"to\": \"customer@blixo.com\",\n\t\"bcc\": \"bcc_customer@blixo.com\",\n\t\"subject\": \"{{company_name}} Invoice {{invoice_number}} for {{customer_name}}\",\n\t\"message\": \"Hi {{customer_contact_name}},\\n\\nYour most recent {{company_name}} invoice is attached as Invoice {{invoice_number}}.pdf \\nThe balance of {{balance}} is due by {{due_date}}.\\n\\nRemember that each payment method takes a few days to process so please remit payment at least one week before the due date to ensure it arrives on time.\\n\\nIf you have questions about your invoice, please contact us at {{company_email}} or reply to this email.\\n\\nWe appreciate your business and thank you for choosing {{company_name}}.\\n\\n{{view_invoice_button}}\"\n}",  ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
import okhttp3.OkHttpClient;
import okhttp3.MediaType;
import okhttp3.RequestBody;
import okhttp3.Request;
import okhttp3.Response;

public class Main {
    public static void main(String[] args) {
        OkHttpClient client = new OkHttpClient().newBuilder()
            .build();
        MediaType mediaType = MediaType.parse("application/json");
        RequestBody body = RequestBody.create(mediaType, "{\n\t\"to\": \"customer@blixo.com\",\n\t\"bcc\": \"bcc_customer@blixo.com\",\n\t\"subject\": \"{{company_name}} Invoice {{invoice_number}} for {{customer_name}}\",\n\t\"message\": \"Hi {{customer_contact_name}},\\n\\nYour most recent {{company_name}} invoice is attached as Invoice {{invoice_number}}.pdf \\nThe balance of {{balance}} is due by {{due_date}}.\\n\\nRemember that each payment method takes a few days to process so please remit payment at least one week before the due date to ensure it arrives on time.\\n\\nIf you have questions about your invoice, please contact us at {{company_email}} or reply to this email.\\n\\nWe appreciate your business and thank you for choosing {{company_name}}.\\n\\n{{view_invoice_button}}\"\n}");
        Request request = new Request.Builder()
            .url("https://api.blixo.com/v1/invoices/:invoiceId/send")
            .method("POST", body)
            .addHeader("Authorization", "Basic {API_KEY}")
            .addHeader("Content-Type", "application/json")
            .build();
        try {
            Response response = client.newCall(request).execute();
            System.out.println(response.body().string());
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}

This API endpoint allows you to send an invoice to a customer. It's as easy as sending a POST request to https://api.blixo.com/v1/invoices/:invoiceId/send. Think of it as telling the server, "Hey, I want to send this invoice to the customer!" And the server responds by sending the invoice to the customer's email!

HTTP Request

POST https://api.blixo.com/v1/invoices/:invoiceId/send

Headers

Key Value
Authorization Basic {API_KEY}

Parameters

Parameter Type Required Description
to string Yes The email address of the customer.
bcc string No The email address to which a blind carbon copy of the invoice is sent.
subject string Yes The subject of the email.
message string Yes The body of the email.

Example

To send an invoice, you would send a POST request to https://api.blixo.com/v1/invoices/:invoiceId/send. Remember to replace {API_KEY} with your actual API key and :invoiceId with the ID of the invoice you want to send.

Response

If the request is successful, you will receive a 200 OK status code and the invoice will be sent to the customer's email. If something goes wrong, you will receive a 4xx or 5xx status code, with a JSON object containing more information about the error.

Credit Notes

Credit Note object

Attribute Type Description
id ObjectId The ID of the credit note.
creditNoteNo String The credit note number.
managerId ObjectId The ID of the manager.
issueDate Date The issue date of the credit note.
dueDate Date The due date of the credit note.
paidDate Date The paid date of the credit note.
billTo Object The billing address of the credit note. It includes the following sub-attributes:
firstName: String - The first name of the person to whom the bill is addressed.
lastName: String - The last name of the person to whom the bill is addressed.
phone: String - The phone number of the person to whom the bill is addressed.
company: String - The company of the person to whom the bill is addressed.
address1: String - The primary address line of the billing address.
address2: String - The secondary address line of the billing address.
city: String - The city of the billing address.
state: String - The state of the billing address.
zipCode: String - The zip code of the billing address.
country: String - The country of the billing address.
countryCode: String - The country code of the billing address.
shipTo Object The shipping address of the credit note. It includes the following sub-attributes:
firstName: String - The first name of the person to whom the shipment is addressed.
lastName: String - The last name of the person to whom the shipment is addressed.
phone: String - The phone number of the person to whom the shipment is addressed.
company: String - The company of the person to whom the shipment is addressed.
address1: String - The primary address line of the shipping address.
address2: String - The secondary address line of the shipping address.
city: String - The city of the shipping address.
state: String - The state of the shipping address.
zipCode: String - The zip code of the shipping address.
country: String - The country of the shipping address.
countryCode: String - The country code of the shipping address.
notes String Any notes regarding the credit note.
attachments Array The attachments of the credit note.
subTotalAmount Object The subtotal amount of the credit note. It includes the following attributes:
value: Number - The value of the amount.
unit: String - The unit of the amount.
currency: String - The currency of the amount. Default is USD.
totalAmount Object The total amount of the credit note. It includes the following attributes:
value: Number - The value of the amount.
unit: String - The unit of the amount.
currency: String - The currency of the amount. Default is USD.
balanceAmount Object The balance amount of the credit note. It includes the following attributes:
value: Number - The value of the amount.
unit: String - The unit of the amount.
currency: String - The currency of the amount. Default is USD.
paymentStatus Array The payment status of the credit note.
paymentTerms String The payment terms for the credit note.
creditNoteStatus Array The status of the credit note.
sentStatus String The sent status of the credit note.
itemLines Array The item lines of the credit note.
discountLines Array The discount lines of the credit note.
discountAmount Object The discount amount of the credit note. It includes the following attributes:
value: Number - The value of the amount.
unit: String - The unit of the amount.
currency: String - The currency of the amount. Default is USD.
taxLines Array The tax lines of the credit note.
taxAmount Object The tax amount of the credit note. It includes the following attributes:
value: Number - The value of the amount.
unit: String - The unit of the amount.
currency: String - The currency of the amount. Default is USD.
paidAmount Object The paid amount of the credit note. It includes the following attributes:
value: Number - The value of the amount.
unit: String - The unit of the amount.
currency: String - The currency of the amount. Default is USD.
companyId ObjectId The ID of the company.
customerId ObjectId The ID of the customer.
invoiceId ObjectId The ID of the invoice.
shippingLines Array The shipping lines of the credit note.
shippingAmount Object The shipping amount of the credit note. It includes the following attributes:
value: Number - The value of the amount.
unit: String - The unit of the amount.
currency: String - The currency of the amount. Default is USD.
createdBy ObjectId The ID of the user who created the credit note.
updatedBy ObjectId The ID of the user who last updated the credit note.
createdAt Date The date when the credit note was created.
updatedAt Date The date when the credit note was last updated.
deletedBy ObjectId The ID of the user who deleted the credit note.
deletedAt Date The date when the credit note was deleted.
isDeleted Boolean Whether the credit note is deleted.
source String The source of the credit note.
integrations Object The integrations of the credit note.

List all credit notes

curl "https://api.blixo.com/v1/creditNotes" \
-u {API_KEY}:
const fetch = require('node-fetch');

const url = "https://api.blixo.com/v1/creditNotes";
const options = {
  method: 'GET',
  headers: {
    'Authorization': 'Basic {API_KEY}'
  }
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error('error:' + err));
$ch = curl_init();

$url = "https://api.blixo.com/v1/creditNotes";
$headers = array(
    'Authorization: Basic '. base64_encode('{API_KEY}:')
);

curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);

if($response === false)
    echo 'Error: ' . curl_error($ch);
else
    print_r(json_decode($response, true));

curl_close($ch);
require 'net/http'
require 'uri'
require 'base64'

uri = URI.parse("https://api.blixo.com/v1/creditNotes")
request = Net::HTTP::Get.new(uri)
request["Authorization"] = "Basic " + Base64.encode64('{API_KEY}:').chomp

req_options = {
  use_ssl: uri.scheme == "https",
}

response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|
  http.request(request)
end

puts response.body
import requests
from base64 import b64encode

url = "https://api.blixo.com/v1/creditNotes"
headers = {
    'Authorization': 'Basic ' + b64encode('{API_KEY}:'.encode()).decode()
}

response = requests.get(url, headers=headers)

print(response.json())
package main

import (
    "encoding/base64"
    "fmt"
    "io/ioutil"
    "net/http"
)

func main() {
    url := "https://api.blixo.com/v1/creditNotes"
    req, _ := http.NewRequest("GET", url, nil)

    apiKey := "{API_KEY}:"
    basicAuth := "Basic " + base64.StdEncoding.EncodeToString([]byte(apiKey))
    req.Header.Add("Authorization", basicAuth)

    res, _ := http.DefaultClient.Do(req)
    defer res.Body.Close()

    body, _ := ioutil.ReadAll(res.Body)
    fmt.Println(string(body))
}
using System;
using System.Net;
using System.Text;

class Program
{
    static void Main()
    {
        string url = "https://api.blixo.com/v1/creditNotes";
        string apiKey = "{API_KEY}:";
        string encodedApiKey = Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey));

        WebClient client = new WebClient();
        client.Headers.Add("Authorization", "Basic " + encodedApiKey);

        string response = client.DownloadString(url);
        Console.WriteLine(response);
    }
}
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
import java.util.Base64;

public class Main {
    public static void main(String[] args) throws Exception {
        String url = "https://api.blixo.com/v1/creditNotes";
        String apiKey = "{API_KEY}:";
        String encodedApiKey = Base64.getEncoder().encodeToString(apiKey.getBytes());

        OkHttpClient client = new OkHttpClient();

        Request request = new Request.Builder()
            .url(url)
            .addHeader("Authorization", "Basic " + encodedApiKey)
            .build();

        Response response = client.newCall(request).execute();
        System.out.println(response.body().string());
    }
}

The above command returns JSON structured like this:

{
    "id": "630f97bcab6f32015e3a8b7f",
    "creditNoteNo": "CN-0024",
    "managerId": "65289eb09d9571a357f09a5c",
    "issueDate": "2022-08-31T17:17:48.000Z",
    "paidDate": "2022-08-31T17:18:19.292Z",
    "billTo": {
        "name": "John Doe",
        "address1": "123 Main St",
        "address2": "Apt 4B",
        "city": "New York",
        "state": "NY",
        "zipCode": "10001",
        "country": "USA",
        "phones": [
            "123-456-7890"
        ]
    },
    "shipTo": {
        "name": "Natasha Test",
        "address1": "456 Broadway",
        "address2": null,
        "city": "Los Angeles",
        "state": "California",
        "zipCode": "90011",
        "country": "United States",
        "phones": [
            "098-765-4321"
        ]
    },
    "notes": "This is a test note.",
    "attachments": [
        "http://example.com/attachment1"
    ],
    "subTotalAmount": {
        "_id": "630f97dbab6f32015e3a8cab",
        "value": 50,
        "unit": "$"
    },
    "totalAmount": {
        "value": 50,
        "unit": "$"
    },
    "balanceAmount": {
        "value": 0,
        "unit": "$"
    },
    "paymentStatus": [
        "PENDING",
        "PAID"
    ],
    "paymentTerms": "DUE_ON_RECEIPT",
    "creditNoteStatus": [
        "CLOSED"
    ],
    "sentStatus": "NOT_SENT",
    "itemLines": [
        {
            "_id": "630c99084c4c44015ebd8e44",
            "title": "Chai Latte ",
            "description": "Chai Latte ",
            "quantity": 16,
            "rate": {
                "_id": "630c99084c4c44015ebd8e45",
                "value": 3.12,
                "unit": "$"
            },
            "amount": {
                "_id": "630f97dbab6f32015e3a8ca8",
                "value": 50,
                "unit": "$"
            },
            "taxLines": [],
            "discountLines": [],
            "integrations": {
                "shopify": {
                    "customerId": "6270841913508",
                    "orderId": "4746555064484",
                    "productId": "7101592338596",
                    "variantId": "41448612069540",
                    "variantTitle": "Chai Latte",
                    "sku": "40-009",
                    "isOneTime": true
                }
            }
        }
    ],
    "discountLines": [],
    "discountAmount": {
        "_id": "630f97dbab6f32015e3a8caa",
        "value": 0,
        "unit": "$"
    },
    "taxLines": [],
    "taxAmount": {
        "_id": "630c99084c4c44015ebd8ee7",
        "value": 0,
        "unit": "$"
    },
    "paidAmount": {
        "_id": "630f97dbab6f32015e3a8caf",
        "value": 50,
        "unit": "$"
    },
    "companyId": "622294998bec060152bcad9c",
    "customerId": "630c90464c4c44015ebd7664",
    "invoiceId": "630c99084c4c44015ebd8e43",
    "shippingLines": [],
    "shippingAmount": {
        "_id": "630f97dbab6f32015e3a8cac",
        "value": 0,
        "unit": "$"
    },
    "createdBy": "6222930b8bec060152bcad67",
    "updatedBy": "6222930b8bec060152bcad67",
    "createdAt": "2022-08-31T17:17:48.989Z",
    "updatedAt": "2022-08-31T17:18:19.295Z",
    "integrations": {
        "shopify": {
            "orderId": "4746555064484",
            "customerId": "6270841913508",
            "orderUrl": "https://example.com/order/4746555064484",
            "lastSynced": 1661769992085
        },
        "bigquery": {
            "lastOneTimeItemSynced": "2022-08-31T15:56:36.447Z"
        }
    },
    "payments": [],
    "transactions": [
        {
            "paymentMethod": "OTHER",
            "paymentType": "CREDIT_BALANCE",
            "paymentStatus": "SUCCEEDED",
            "source": "BLIXO",
            "_id": "630f97dbab6f32015e3a8c66",
            "amount": {
                "value": 50,
                "unit": "$",
                "currency": "USD"
            },
            "companyId": "622294998bec060152bcad9c",
            "customerId": "630c90464c4c44015ebd7664",
            "parentPayment": "630f97dbab6f32015e3a8c5d",
            "creditNoteId": "630f97bcab6f32015e3a8b7f",
            "invoiceId": "630c93f94c4c44015ebd7b93",
            "createdAt": "2022-08-31T17:18:19.213Z",
            "updatedAt": "2022-08-31T17:18:19.213Z",
            "__v": 0
        }
    ]
}

This API endpoint allows you to retrieve a list of all credit notes in the database. It's as simple as sending a GET request to https://api.blixo.com/v1/creditNotes. Think of it as asking the server, "Hey, can I get a list of all your credit notes?" And the server responds with the information you asked for!

HTTP Request

GET https://api.blixo.com/v1/creditNotes

Headers

Key Value
Authorization Basic {API_KEY}

Parameters

Parameter Type Description
page Integer The page number to retrieve. Default is 1.
perPage Integer The number of credit notes to retrieve per page. Default is 100.
creditNoteStatus Array Filter by multiple credit note status drafts, open, paid, all, e.g.creditNoteStatus[0]=DRAFT.
paymentStatus Array Filter by multiple payment status drafts, outstanding, pastdue, paid, all e.g. paymentStatus[0]=OUTSTANDING.
sort Array Sort by field name and its ordering, e.g. sort[0]=creditNoteNo&sort[1]=-1.

Example

To list all credit notes, you would send a GET request to https://api.blixo.com/v1/creditNotes. Remember to replace {API_KEY} with your actual API key.

If you want to retrieve the third page of credit notes, with 50 credit notes per page, you would send a GET request to https://api.blixo.com/v1/creditNotes?page=3&perPage=50.

Response

The response will be a JSON object with a data key containing an array of credit notes. Each credit note will be an object with the following keys:

If the request is successful, you will receive a 200 OK status code. If something goes wrong, you will receive a 4xx or 5xx status code, with a JSON object containing more information about the error.

Create a credit note

curl "https://api.blixo.com/v1/creditNotes" \
-u {API_KEY}: \
-d companyId="60e1b7f0c6ef4219ff51824c" \
-d customerId="612283bafd4e6319d487fa8f" \
-d creditNoteNo="" \
-d creditNoteStatus[0]="OPEN" \
-d paymentStatus[0]="PENDING" \
-d sentStatus="NOT_SENT" \
-d issueDate="2021-08-22T17:18:17.182Z" \
-d itemLines[0][title]="item 1" \
-d itemLines[0][description]="" \
-d itemLines[0][isPlaceholder]=false \
-d itemLines[0][quantity]=1 \
-d itemLines[0][rate][unit]="$" \
-d itemLines[0][rate][value]=30 \
-d itemLines[0][amount][unit]="$" \
-d itemLines[0][amount][value]=30 \
-X POST
const fetch = require('node-fetch');

const body = {
  companyId: "60e1b7f0c6ef4219ff51824c",
  customerId: "612283bafd4e6319d487fa8f",
  creditNoteNo: "",
  creditNoteStatus: ["OPEN"],
  paymentStatus: ["PENDING"],
  sentStatus: "NOT_SENT",
  issueDate: "2021-08-22T17:18:17.182Z",
  itemLines: [
    {
      title: "item 1",
      description: "",
      isPlaceholder: false,
      quantity: 1,
      rate: {
        unit: "$",
        value: 30
      },
      amount: {
        unit: "$",
        value: 30
      }
    }
  ]
};

fetch('https://api.blixo.com/v1/creditNotes', {
  method: 'POST',
  body: JSON.stringify(body),
  headers: {'Content-Type': 'application/json', 'Authorization': 'Basic {API_KEY}'}
})
.then(res => res.json())
.then(json => console.log(json));
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.blixo.com/v1/creditNotes',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => array(
    'companyId' => '60e1b7f0c6ef4219ff51824c',
    'customerId' => '612283bafd4e6319d487fa8f',
    'creditNoteNo' => '',
    'creditNoteStatus[0]' => 'OPEN',
    'paymentStatus[0]' => 'PENDING',
    'sentStatus' => 'NOT_SENT',
    'issueDate' => '2021-08-22T17:18:17.182Z',
    'itemLines[0][title]' => 'item 1',
    'itemLines[0][description]' => '',
    'itemLines[0][isPlaceholder]' => 'false',
    'itemLines[0][quantity]' => '1',
    'itemLines[0][rate][unit]' => '$',
    'itemLines[0][rate][value]' => '30',
    'itemLines[0][amount][unit]' => '$',
    'itemLines[0][amount][value]' => '30'
  ),
  CURLOPT_HTTPHEADER => array(
    'Authorization: Basic {API_KEY}'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
require 'uri'
require 'net/http'
require 'openssl'

url = URI("https://api.blixo.com/v1/creditNotes")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic {API_KEY}'
request["Content-Type"] = 'application/json'
request.body = {
  'companyId' => '60e1b7f0c6ef4219ff51824c',
  'customerId' => '612283bafd4e6319d487fa8f',
  'creditNoteNo' => '',
  'creditNoteStatus[0]' => 'OPEN',
  'paymentStatus[0]' => 'PENDING',
  'sentStatus' => 'NOT_SENT',
  'issueDate' => '2021-08-22T17:18:17.182Z',
  'itemLines[0][title]' => 'item 1',
  'itemLines[0][description]' => '',
  'itemLines[0][isPlaceholder]' => 'false',
  'itemLines[0][quantity]' => '1',
  'itemLines[0][rate][unit]' => '$',
  'itemLines[0][rate][value]' => '30',
  'itemLines[0][amount][unit]' => '$',
  'itemLines[0][amount][value]' => '30'
}

response = http.request(request)
puts response.read_body
import requests

url = "https://api.blixo.com/v1/creditNotes"

payload = {
  'companyId': '60e1b7f0c6ef4219ff51824c',
  'customerId': '612283bafd4e6319d487fa8f',
  'creditNoteNo': '',
  'creditNoteStatus[0]': 'OPEN',
  'paymentStatus[0]': 'PENDING',
  'sentStatus': 'NOT_SENT',
  'issueDate': '2021-08-22T17:18:17.182Z',
  'itemLines[0][title]': 'item 1',
  'itemLines[0][description]': '',
  'itemLines[0][isPlaceholder]': 'false',
  'itemLines[0][quantity]': '1',
  'itemLines[0][rate][unit]': '$',
  'itemLines[0][rate][value]': '30',
  'itemLines[0][amount][unit]': '$',
  'itemLines[0][amount][value]': '30'
}
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Basic {API_KEY}'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
package main

import (
    "fmt"
    "strings"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://api.blixo.com/v1/creditNotes"
    method := "POST"

    payload := strings.NewReader(`{
        "companyId": "60e1b7f0c6ef4219ff51824c",
        "customerId": "612283bafd4e6319d487fa8f",
        "creditNoteNo": "",
        "creditNoteStatus": ["OPEN"],
        "paymentStatus": ["PENDING"],
        "sentStatus": "NOT_SENT",
        "issueDate": "2021-08-22T17:18:17.182Z",
        "itemLines": [
            {
                "title": "item 1",
                "description": "",
                "isPlaceholder": false,
                "quantity": 1,
                "rate": {
                    "unit": "$",
                    "value": 30
                },
                "amount": {
                    "unit": "$",
                    "value": 30
                }
            }
        ]
    }`)

    client := &http.Client {}
    req, err := http.NewRequest(method, url, payload)

    if err != nil {
        fmt.Println(err)
        return
    }
    req.Header.Add("Authorization", "Basic {API_KEY}")

    res, err := client.Do(req)
    if err != nil {
        fmt.Println(err)
        return
    }
    defer res.Body.Close()

    body, err := ioutil.ReadAll(res.Body)
    if err != nil {
        fmt.Println(err)
        return
    }
    fmt.Println(string(body))
}
public class Program
{
    public static void Main(string[] args)
    {
        HttpClient client = new HttpClient();
        var request = new HttpRequestMessage
        {
            Method = HttpMethod.Post,
            RequestUri = new Uri("https://api.blixo.com/v1/creditNotes"),
            Headers = 
            {
                { HttpRequestHeader.Authorization.ToString(), "Basic {API_KEY}" },
            },
            Content = new FormUrlEncodedContent(new Dictionary<string, string>
            {
                { "companyId", "60e1b7f0c6ef4219ff51824c" },
                { "customerId", "612283bafd4e6319d487fa8f" },
                { "creditNoteNo", "" },
                { "creditNoteStatus[0]", "OPEN" },
                { "paymentStatus[0]", "PENDING" },
                { "sentStatus", "NOT_SENT" },
                { "issueDate", "2021-08-22T17:18:17.182Z" },
                { "itemLines[0][title]", "item 1" },
                { "itemLines[0][description]", "" },
                { "itemLines[0][isPlaceholder]", "false" },
                { "itemLines[0][quantity]", "1" },
                { "itemLines[0][rate][unit]", "$" },
                { "itemLines[0][rate][value]", "30" },
                { "itemLines[0][amount][unit]", "$" },
                { "itemLines[0][amount][value]", "30" },
            })
        };
        var response = client.SendAsync(request).Result;
        var responseContent = response.Content.ReadAsStringAsync().Result;
        Console.WriteLine(responseContent);
    }
}
import okhttp3.OkHttpClient;
import okhttp3.MediaType;
import okhttp3.RequestBody;
import okhttp3.Request;
import okhttp3.Response;

public class Main {
    public static void main(String[] args) throws Exception {
        OkHttpClient client = new OkHttpClient.Builder().build();
        MediaType mediaType = MediaType.parse("application/json");
        String jsonBody = "{" +
            "\"companyId\": \"60e1b7f0c6ef4219ff51824c\"," +
            "\"customerId\": \"612283bafd4e6319d487fa8f\"," +
            "\"creditNoteNo\": \"\"," +
            "\"creditNoteStatus[0]\": \"OPEN\"," +
            "\"paymentStatus[0]\": \"PENDING\"," +
            "\"sentStatus\": \"NOT_SENT\"," +
            "\"issueDate\": \"2021-08-22T17:18:17.182Z\"," +
            "\"itemLines[0][title]\": \"item 1\"," +
            "\"itemLines[0][description]\": \"\"," +
            "\"itemLines[0][isPlaceholder]\": \"false\"," +
            "\"itemLines[0][quantity]\": \"1\"," +
            "\"itemLines[0][rate][unit]\": \"$\"," +
            "\"itemLines[0][rate][value]\": \"30\"," +
            "\"itemLines[0][amount][unit]\": \"$\"," +
            "\"itemLines[0][amount][value]\": \"30\"" +
        "}";
        RequestBody body = RequestBody.create(jsonBody, mediaType);
        Request request = new Request.Builder()
            .url("https://api.blixo.com/v1/creditNotes")
            .method("POST", body)
            .addHeader("Content-Type", "application/json")
            .addHeader("Authorization", "Basic {API_KEY}")
            .build();
        Response response = client.newCall(request).execute();
        System.out.println(response.body().string());
    }
}

The above command returns JSON structured like this:

{
    "id": "635ea4dea34c63015dd9732c",
    "creditNoteNo": "CN-76541",
    "managerId": "65289eb09d9571a357f09a5c",
    "issueDate": "2022-10-12T16:22:09.983Z",
    "paidDate": "2022-10-12T16:22:09.983Z",
    "notes": "45324634453536353941433339384332:c22951fea330493f49a72d85e01f037c",
    "subTotalAmount": {
        "_id": "635ea4dea34c63015dd97349",
        "value": 5589,
        "unit": "$"
    },
    "totalAmount": {
        "value": 5589,
        "unit": "$"
    },
    "balanceAmount": {
        "value": 5589,
        "unit": "$"
    },
    "paymentStatus": [
        "PAID"
    ],
    "paymentTerms": "DUE_ON_RECEIPT",
    "creditNoteStatus": [
        "CLOSED"
    ],
    "sentStatus": "SENT",
    "discountLines": [],
    "discountAmount": {
        "_id": "635ea4dea34c63015dd97347",
        "value": 0,
        "unit": "$"
    },
    "taxLines": [],
    "taxAmount": {
        "_id": "635ea4dea34c63015dd97348",
        "value": 0,
        "unit": "$"
    },
    "paidAmount": {
        "_id": "635ea4dea34c63015dd9734d",
        "value": 5589,
        "unit": "$"
    },
    "companyId": "622294998bec060152bcad9c",
    "customerId": "6331629360eea3015e855e40",
    "shippingLines": [],
    "shippingAmount": {
        "_id": "635ea4dea34c63015dd9734a",
        "value": 0,
        "unit": "$"
    },
    "createdBy": "6222930b8bec060152bcad67",
    "updatedBy": "6222930b8bec060152bcad67",
    "createdAt": "2022-10-30T16:22:54.031Z",
    "updatedAt": "2022-10-30T16:22:54.069Z",
    "transactions": [
        {
            "_id": "6528a1b6f9cf30a2d8622044",
            "paymentMethod": "CREDIT_CARD",
            "paymentType": "PAYMENT",
            "paymentStatus": "SUCCEEDED",
            "amount": {
                "value": 5589,
                "unit": "$"
            },
            "companyId": "622294998bec060152bcad9c",
            "customerId": "6331629360eea3015e855e40",
            "createdAt": "2022-10-30T16:22:54.031Z",
            "updatedAt": "2022-10-30T16:22:54.069Z"
        },
    ],
}

This API endpoint allows you to create a new credit note in the database. It's as simple as sending a POST request to https://api.blixo.com/v1/creditNotes. Think of it as telling the server, "Hey, I want to create a new credit note!" And the server responds by creating the credit note for you!

HTTP Request

POST https://api.blixo.com/v1/creditNotes

Headers

Key Value
Authorization Basic {API_KEY}

Parameters

Parameter Type Description
companyId String (required) The ID of the company.
customerId String (required) The ID of the customer.
creditNoteNo String The credit note number.
creditNoteStatus String (required) The status of the credit note, e.g. OPEN.
paymentStatus String (required) The payment status, e.g. PENDING.
sentStatus String (required) The sent status, e.g. NOT_SENT.
issueDate Date (required) The issue date of the credit note.
itemLines Array (required) The item lines of the credit note.
notes String Any notes regarding the credit note.
billTo Object Address object includes address1, address2, attn, city, country, phones, state, zipCode, integrations, name.

Example

To create a new credit note, you would send a POST request to https://api.blixo.com/v1/creditNotes. Remember to replace {API_KEY} with your actual API key.

Response

The response will be a JSON object with a data key containing the newly created credit note. The credit note will be an object with the following keys:

If the request is successful, you will receive a 201 Created status code. If something goes wrong, you will receive a 4xx or 5xx status code, with a JSON object containing more information about the error.

Update a credit note

curl "https://api.blixo.com/v1/creditNotes/:creditNoteId" \
-u {API_KEY}: \
-d companyId="60e1b7f0c6ef4219ff51824c" \
-d customerId="612283bafd4e6319d487fa8f" \
-d creditNoteNo="" \
-d creditNoteStatus[0]="OPEN" \
-d paymentStatus[0]="PENDING" \
-d sentStatus="NOT_SENT" \
-d issueDate="2021-08-22T17:18:17.182Z" \
-d itemLines[0][title]="item 1" \
-d itemLines[0][description]="" \
-d itemLines[0][isPlaceholder]=false \
-d itemLines[0][quantity]=1 \
-d itemLines[0][rate][unit]="$" \
-d itemLines[0][rate][value]=30 \
-d itemLines[0][amount][unit]="$" \
-d itemLines[0][amount][value]=30 \
-X PATCH
const fetch = require('node-fetch');

const url = "https://api.blixo.com/v1/creditNotes/:creditNoteId";
const data = {
  'companyId': '60e1b7f0c6ef4219ff51824c',
  'customerId': '612283bafd4e6319d487fa8f',
  'creditNoteNo': '',
  'creditNoteStatus': ['OPEN'],
  'paymentStatus': ['PENDING'],
  'sentStatus': 'NOT_SENT',
  'issueDate': '2021-08-22T17:18:17.182Z',
  'itemLines': [
    {
      'title': 'item 1',
      'description': '',
      'isPlaceholder': false,
      'quantity': 1,
      'rate': {'unit': '$', 'value': 30},
      'amount': {'unit': '$', 'value': 30}
    }
  ]
};

const options = {
  method: 'PATCH',
  body: JSON.stringify(data),
  headers: {
    'Content-Type': 'application/json',
    'Authorization': 'Basic {API_KEY}'
  }
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error('error:' + err));
<?php

$url = "https://api.blixo.com/v1/creditNotes/:creditNoteId";
$data = array(
  'companyId' => '60e1b7f0c6ef4219ff51824c',
  'customerId' => '612283bafd4e6319d487fa8f',
  'creditNoteNo' => '',
  'creditNoteStatus' => array('OPEN'),
  'paymentStatus' => array('PENDING'),
  'sentStatus' => 'NOT_SENT',
  'issueDate' => '2021-08-22T17:18:17.182Z',
  'itemLines' => array(
    array(
      'title' => 'item 1',
      'description' => '',
      'isPlaceholder' => false,
      'quantity' => 1,
      'rate' => array('unit' => '$', 'value' => 30),
      'amount' => array('unit' => '$', 'value' => 30)
    )
  )
);

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PATCH');
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));

$headers = array();
$headers[] = 'Content-Type: application/json';
$headers[] = 'Authorization: Basic {API_KEY}';
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$result = curl_exec($ch);
if (!$result) {
    die('Error: "' . curl_error($ch) . '" - Code: ' . curl_errno($ch));
}

curl_close($ch);

var_dump($result);
?>
require 'net/http'
require 'uri'
require 'json'

uri = URI.parse("https://api.blixo.com/v1/creditNotes/:creditNoteId")
header = {'Content-Type': 'application/json', 'Authorization': 'Basic {API_KEY}'}
data = {
  :companyId => '60e1b7f0c6ef4219ff51824c',
  :customerId => '612283bafd4e6319d487fa8f',
  :creditNoteNo => '',
  :creditNoteStatus => ['OPEN'],
  :paymentStatus => ['PENDING'],
  :sentStatus => 'NOT_SENT',
  :issueDate => '2021-08-22T17:18:17.182Z',
  :itemLines => [
    {
      :title => 'item 1',
      :description => '',
      :isPlaceholder => false,
      :quantity => 1,
      :rate => {:unit => '$', :value => 30},
      :amount => {:unit => '$', :value => 30}
    }
  ]
}

http = Net::HTTP.new(uri.host, uri.port)
request = Net::HTTP::Patch.new(uri.request_uri, header)
request.body = data.to_json

response = http.request(request)
puts response.body
import requests
import json

url = "https://api.blixo.com/v1/creditNotes/:creditNoteId"
data = {
  'companyId': '60e1b7f0c6ef4219ff51824c',
  'customerId': '612283bafd4e6319d487fa8f',
  'creditNoteNo': '',
  'creditNoteStatus': ['OPEN'],
  'paymentStatus': ['PENDING'],
  'sentStatus': 'NOT_SENT',
  'issueDate': '2021-08-22T17:18:17.182Z',
  'itemLines': [
    {
      'title': 'item 1',
      'description': '',
      'isPlaceholder': False,
      'quantity': 1,
      'rate': {'unit': '$', 'value': 30},
      'amount': {'unit': '$', 'value': 30}
    }
  ]
}
headers = {'Content-Type': 'application/json', 'Authorization': 'Basic {API_KEY}'}

response = requests.patch(url, data=json.dumps(data), headers=headers)
print(response.text)
package main

import (
    "bytes"
    "encoding/json"
    "fmt"
    "net/http"
)

func main() {
    url := "https://api.blixo.com/v1/creditNotes/:creditNoteId"
    data := map[string]interface{}{
        "companyId":       "60e1b7f0c6ef4219ff51824c",
        "customerId":      "612283bafd4e6319d487fa8f",
        "creditNoteNo":    "",
        "creditNoteStatus": []string{"OPEN"},
        "paymentStatus":   []string{"PENDING"},
        "sentStatus":      "NOT_SENT",
        "issueDate":       "2021-08-22T17:18:17.182Z",
        "itemLines": []map[string]interface{}{
            {
                "title":         "item 1",
                "description":   "",
                "isPlaceholder": false,
                "quantity":      1,
                "rate":          map[string]interface{}{"unit": "$", "value": 30},
                "amount":        map[string]interface{}{"unit": "$", "value": 30},
            },
        },
    }
    jsonData, err := json.Marshal(data)
    if err != nil {
        panic(err)
    }
    req, err := http.NewRequest("PATCH", url, bytes.NewBuffer(jsonData))
    req.Header.Set("Content-Type", "application/json")
    req.Header.Set("Authorization", "Basic {API_KEY}")
    client := &http.Client{}
    resp, err := client.Do(req)
    if err != nil {
        panic(err)
    }
    defer resp.Body.Close()
    fmt.Println("response Status:", resp.Status)
}
using System;
using System.Net.Http;
using System.Text;
using Newtonsoft.Json;

class Program
{
    static void Main()
    {
        var client = new HttpClient();
        var url = "https://api.blixo.com/v1/creditNotes/:creditNoteId";
        var data = new
        {
            companyId = "60e1b7f0c6ef4219ff51824c",
            customerId = "612283bafd4e6319d487fa8f",
            creditNoteNo = "",
            creditNoteStatus = new[] { "OPEN" },
            paymentStatus = new[] { "PENDING" },
            sentStatus = "NOT_SENT",
            issueDate = "2021-08-22T17:18:17.182Z",
            itemLines = new[]
            {
                new
                {
                    title = "item 1",
                    description = "",
                    isPlaceholder = false,
                    quantity = 1,
                    rate = new { unit = "$", value = 30 },
                    amount = new { unit = "$", value = 30 }
                }
            }
        };
        var content = new StringContent(JsonConvert.SerializeObject(data), Encoding.UTF8, "application/json");
        client.DefaultRequestHeaders.Add("Authorization", "Basic {API_KEY}");
        var response = client.PatchAsync(url, content).Result;
        Console.WriteLine(response.Content.ReadAsStringAsync().Result);
    }
}
import okhttp3.OkHttpClient;
import okhttp3.MediaType;
import okhttp3.RequestBody;
import okhttp3.Request;
import okhttp3.Response;
import org.json.JSONObject;
import org.json.JSONArray;

public class Main {
    public static void main(String[] args) {
        OkHttpClient client = new OkHttpClient().newBuilder().build();
        MediaType mediaType = MediaType.parse("application/json");
        JSONObject itemLines = new JSONObject();
        itemLines.put("title", "item 1");
        itemLines.put("description", "");
        itemLines.put("isPlaceholder", false);
        itemLines.put("quantity", 1);
        itemLines.put("rate", new JSONObject().put("unit", "$").put("value", 30));
        itemLines.put("amount", new JSONObject().put("unit", "$").put("value", 30));
        JSONArray itemLinesArray = new JSONArray().put(itemLines);
        JSONObject bodyContent = new JSONObject();
        bodyContent.put("companyId", "60e1b7f0c6ef4219ff51824c");
        bodyContent.put("customerId", "612283bafd4e6319d487fa8f");
        bodyContent.put("creditNoteNo", "");
        bodyContent.put("creditNoteStatus", new JSONArray().put("OPEN"));
        bodyContent.put("paymentStatus", new JSONArray().put("PENDING"));
        bodyContent.put("sentStatus", "NOT_SENT");
        bodyContent.put("issueDate", "2021-08-22T17:18:17.182Z");
        bodyContent.put("itemLines", itemLinesArray);
        RequestBody body = RequestBody.create(mediaType, bodyContent.toString());
        Request request = new Request.Builder()
          .url("https://api.blixo.com/v1/creditNotes/:creditNoteId")
          .method("PATCH", body)
          .addHeader("Content-Type", "application/json")
          .addHeader("Authorization", "Basic {API_KEY}")
          .build();
        try {
            Response response = client.newCall(request).execute();
            System.out.println(response.body().string());
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

The above command returns JSON structured like this:

{
    "data": {
        "id": "635ea4dea34c63015dd9732c",
        "creditNoteNo": "CN-76541",
        "managerId": "65289eb09d9571a357f09a5c",
        "issueDate": "2022-11-01T16:22:09.983Z",
        "paidDate": "2022-11-01T16:22:09.983Z",
        "notes": "45324634453536353941433339384332:9bc2996cba0ed6ef213480e305c88053",
        "subTotalAmount": {
            "_id": "635f7e3f966c9a015e03b478",
            "value": 34,
            "unit": "$"
        },
        "totalAmount": {
            "value": 29,
            "unit": "$"
        },
        "balanceAmount": {
            "value": 29,
            "unit": "$"
        },
        "paymentStatus": [
            "PENDING"
        ],
        "paymentTerms": "DUE_ON_RECEIPT",
        "creditNoteStatus": [
            "OPEN"
        ],
        "sentStatus": "NOT_SENT",
        "discountLines": [
            {
                "_id": "6307e9bffabacc015dd87bc3",
                "name": "Test  coupon 2",
                "amount": {
                    "_id": "6307e9bffabacc015dd87bc4",
                    "value": 5,
                    "unit": "$"
                }
            }
        ],
        "discountAmount": {
            "_id": "635f7e3f966c9a015e03b477",
            "value": 5,
            "unit": "$"
        },
        "taxLines": [],
        "taxAmount": {
            "_id": "635ea4dea34c63015dd97348",
            "value": 0,
            "unit": "$"
        },
        "paidAmount": {
            "_id": "635f7e3f966c9a015e03b47c",
            "value": 0,
            "unit": "$"
        },
        "companyId": "622294998bec060152bcad9c",
        "customerId": "6331629360eea3015e855e40",
        "shippingLines": [],
        "shippingAmount": {
            "_id": "635f7e3f966c9a015e03b479",
            "value": 0,
            "unit": "$"
        },
        "createdBy": "6222930b8bec060152bcad67",
        "updatedBy": "6222930b8bec060152bcad67",
        "createdAt": "2022-10-30T16:22:54.031Z",
        "updatedAt": "2022-10-31T07:50:23.865Z"
    }
}

This API endpoint allows you to update a credit note in the database. It's as simple as sending a PATCH request to https://api.blixo.com/v1/creditNotes/:creditNoteId. Remember to replace :creditNoteId with the ID of the credit note you want to update. Think of it as asking the server, "Hey, can I update this credit note?" And the server responds with the updated information you asked for!

HTTP Request

PATCH https://api.blixo.com/v1/creditNotes/:creditNoteId

Headers

Key Value
Authorization Basic {API_KEY}

Parameters

Parameter Type Description
creditNoteId String (required) The ID of the credit note.
companyId String (required) The ID of the company.
customerId String (required) The ID of the customer.
creditNoteNo String The credit note number.
creditNoteStatus String (required) The status of the credit note, e.g. OPEN.
paymentStatus String (required) The payment status, e.g. PENDING.
sentStatus String (required) The sent status, e.g. NOT_SENT.
issueDate Date (required) The issue date of the credit note.
itemLines Array (required) The item lines of the credit note.
notes String Any notes regarding the credit note.
billTo Object Address object includes address1, address2, attn, city, country, phones, state, zipCode, integrations, name.
discountLines Array An array of discount items. Each item is an object includes amount, name, _id.
discountAmount Object Discount amount object includes _id, unit, value.
taxLines Array Tax line items.
taxAmount Object Tax amount object includes _id, unit, value.
subTotalAmount Object Sub total amount object includes _id, unit, value.
totalAmount Object Total amount object includes unit, value.
balanceAmount Object Balance amount object includes unit, value.
paidAmount Object Paid amount object includes _id, unit, value.
attachments Array An array of link attachment.
paidDate Date Paid date.
updatedAt Date Updated date.
updatedBy String Updated by id.
createdBy String Created by id.
createdAt Date Created date.

Example

To update a credit note, you would send a PATCH request to https://api.blixo.com/v1/creditNotes/:creditNoteId. Remember to replace {API_KEY} and :creditNoteId with your actual API key and the ID of the credit note you want to update.

Response

The response will be a JSON object with a data key containing the updated credit note. The credit note will be an object with the following keys:

If the request is successful, you will receive a 200 OK status code. If something goes wrong, you will receive a 4xx or 5xx status code, with a JSON object containing more information about the error.

Delete a credit note

curl "https://api.blixo.com/v1/creditNotes/:creditNoteId" \
-u {API_KEY}: \
-X DELETE
const fetch = require('node-fetch');

const url = "https://api.blixo.com/v1/creditNotes/:creditNoteId";
const options = {
  method: 'DELETE',
  headers: {
    'Authorization': 'Basic {API_KEY}'
  }
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error('error:' + err));
<?php

$url = "https://api.blixo.com/v1/creditNotes/:creditNoteId";
$apiKey = "{API_KEY}";

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE');

$headers = array();
$headers[] = 'Authorization: Basic ' . $apiKey;
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$result = curl_exec($ch);
if (!$result) {
    die('Error: "' . curl_error($ch) . '" - Code: ' . curl_errno($ch));
}
curl_close($ch);

echo $result;
?>
require 'net/http'
require 'uri'

uri = URI.parse("https://api.blixo.com/v1/creditNotes/:creditNoteId")
http = Net::HTTP.new(uri.host, uri.port)
request = Net::HTTP::Delete.new(uri.request_uri)
request.basic_auth('{API_KEY}', '')

response = http.request(request)
puts response.body
import requests

url = "https://api.blixo.com/v1/creditNotes/:creditNoteId"
headers = {
  'Authorization': 'Basic {API_KEY}'
}

response = requests.request("DELETE", url, headers=headers)

print(response.text)
package main

import (
    "fmt"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://api.blixo.com/v1/creditNotes/:creditNoteId"
    req, _ := http.NewRequest("DELETE", url, nil)
    req.Header.Add("Authorization", "Basic {API_KEY}")

    res, _ := http.DefaultClient.Do(req)

    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)

    fmt.Println(res)
    fmt.Println(string(body))

}
using System;
using System.Net.Http;
using System.Threading.Tasks;

public class Program
{
    public static async Task Main(string[] args)
    {
        var client = new HttpClient();
        var request = new HttpRequestMessage(HttpMethod.Delete, "https://api.blixo.com/v1/creditNotes/:creditNoteId");
        request.Headers.Add("Authorization", "Basic {API_KEY}");
        HttpResponseMessage response = await client.SendAsync(request);
    }
}
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;

public class Main {

    public static void main(String[] args) {
        OkHttpClient client = new OkHttpClient().newBuilder()
            .build();
        Request request = new Request.Builder()
            .url("https://api.blixo.com/v1/creditNotes/:creditNoteId")
            .method("DELETE", null)
            .addHeader("Authorization", "Basic {API_KEY}")
            .build();
        Response response = null;
        try {
            response = client.newCall(request).execute();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

The above command returns JSON structured like this:

{
  "data": "611d4216a747250146ade2cf"
}

This API endpoint allows you to delete a credit note. It's as simple as sending a DELETE request to https://api.blixo.com/v1/creditNotes/:creditNoteId. Think of it as telling the server, "Hey, I don't need this credit note anymore. Can you please remove it?" And the server responds by deleting the credit note!

HTTP Request

DELETE https://api.blixo.com/v1/creditNotes/:creditNoteId

Headers

Key Value
Authorization Basic {API_KEY}

Parameters

Parameter Type Description
creditNoteId String (required) The ID of the credit note you want to delete.

Example

To delete a credit note, you would send a DELETE request to https://api.blixo.com/v1/creditNotes/:creditNoteId. Remember to replace {API_KEY} and :creditNoteId with your actual API key and the ID of the credit note you want to delete.

Response

If the request is successful, you will receive a 200 OK status code. If something goes wrong, you will receive a 4xx or 5xx status code, with a JSON object containing more information about the error.

Apply to invoice

curl "https://api.blixo.com/v1/creditNotes/:creditNoteId/actions/applyInvoice" \
-u {API_KEY}: \
-X POST
const fetch = require('node-fetch');

const url = 'https://api.blixo.com/v1/creditNotes/:creditNoteId/actions/applyInvoice';
const options = {
  method: 'POST',
  headers: { 
    'Authorization': 'Basic {API_KEY}', 
  }
};

fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error('error:' + err));
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.blixo.com/v1/creditNotes/:creditNoteId/actions/applyInvoice',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_HTTPHEADER => array(
    'Authorization: Basic {API_KEY}'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
require "uri"
require "net/http"

url = URI("https://api.blixo.com/v1/creditNotes/:creditNoteId/actions/applyInvoice")

https = Net::HTTP.new(url.host, url.port);
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = "Basic {API_KEY}"

response = https.request(request)
puts response.read_body
import requests

url = "https://api.blixo.com/v1/creditNotes/:creditNoteId/actions/applyInvoice"

payload={}
headers = {
  'Authorization': 'Basic {API_KEY}'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
package main

import (
    "fmt"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://api.blixo.com/v1/creditNotes/:creditNoteId/actions/applyInvoice"
    method := "POST"

    client := &http.Client {
    }
    req, err := http.NewRequest(method, url, nil)

    if err != nil {
        fmt.Println(err)
        return
    }
    req.Header.Add("Authorization", "Basic {API_KEY}")

    res, err := client.Do(req)
    defer res.Body.Close()
    body, err := ioutil.ReadAll(res.Body)

    fmt.Println(string(body))
}
using System;
using System.Net.Http;
using System.Threading.Tasks;

public class Program
{
    public static async Task Main(string[] args)
    {
        var client = new HttpClient();
        var request = new HttpRequestMessage(HttpMethod.Post, "https://api.blixo.com/v1/creditNotes/:creditNoteId/actions/applyInvoice");
        request.Headers.Add("Authorization", "Basic {API_KEY}");
        HttpResponseMessage response = await client.SendAsync(request);
        Console.WriteLine(await response.Content.ReadAsStringAsync());
    }
}
import okhttp3.OkHttpClient;
import okhttp3.MediaType;
import okhttp3.RequestBody;
import okhttp3.Request;
import okhttp3.Response;

public class Main {

  public static void main(String[] args) throws Exception {
    OkHttpClient client = new OkHttpClient().newBuilder()
      .build();
    MediaType mediaType = MediaType.parse("text/plain");
    RequestBody body = RequestBody.create(mediaType, "");
    Request request = new Request.Builder()
      .url("https://api.blixo.com/v1/creditNotes/:creditNoteId/actions/applyInvoice")
      .method("POST", body)
      .addHeader("Authorization", "Basic {API_KEY}")
      .build();
    Response response = client.newCall(request).execute();
  }
}

The above command returns JSON structured like this:

{
    "data": {
        "id": "635f57f0a34c63015d23a980",
        "creditNoteNo": "CN-09876543456781",
        "managerId": "65289eb09d9571a357f09a5c",
        "issueDate": "2022-11-09T05:06:23.001Z",
        "paidDate": "2022-10-31T09:06:31.253Z",
        "notes": "45324634453536353941433339384332:0a30a6b59f01a267e4cb2fdd9b6f7eb9",
        "subTotalAmount": {
            "_id": "635f9017966c9a015e09eec1",
            "value": 16,
            "unit": "$"
        },
        "totalAmount": {
            "value": 16,
            "unit": "$"
        },
        "balanceAmount": {
            "value": 0,
            "unit": "$"
        },
        "paymentStatus": [
            "PENDING",
            "PAID"
        ],
        "paymentTerms": "DUE_ON_RECEIPT",
        "creditNoteStatus": [
            "CLOSED"
        ],
        "sentStatus": "NOT_SENT",
        "discountLines": [],
        "discountAmount": {
            "_id": "635f9017966c9a015e09eec0",
            "value": 0,
            "unit": "$"
        },
        "taxLines": [],
        "taxAmount": {
            "_id": "635f57f0a34c63015d23a99c",
            "value": 0,
            "unit": "$"
        },
        "paidAmount": {
            "_id": "635f9017966c9a015e09eec5",
            "value": 16,
            "unit": "$"
        },
        "companyId": "622294998bec060152bcad9c",
        "customerId": "6331629360eea3015e855e40",
        "shippingLines": [],
        "shippingAmount": {
            "_id": "635f9017966c9a015e09eec2",
            "value": 0,
            "unit": "$"
        },
        "createdBy": "6222930b8bec060152bcad67",
        "updatedBy": "6222930b8bec060152bcad67",
        "createdAt": "2022-10-31T05:06:56.081Z",
        "updatedAt": "2022-10-31T09:06:31.255Z",
        "payments": []
    }
}

This API endpoint allows you to apply a credit note to an invoice. It's as simple as sending a POST request to https://api.blixo.com/v1/creditNotes/:creditNoteId/actions/applyInvoice. Think of it as telling the server, "Hey, I have this credit note and I want to apply it to an invoice." And the server responds by applying the credit note to the invoice!

HTTP Request

POST https://api.blixo.com/v1/creditNotes/:creditNoteId/actions/applyInvoice

Headers

Key Value
Authorization Basic {API_KEY}

Parameters

Parameter Type Description
creditNoteId String (required) The ID of the credit note you want to apply.
invoiceId String (required) The ID of the invoice to which you want to apply the credit note.
amount Object (required) The amount to be applied from the credit note to the invoice. This object includes unit, value, currency.
note String (optional) Any additional notes or comments about the application of the credit note.

Example

To apply a credit note to an invoice, you would send a POST request to https://api.blixo.com/v1/creditNotes/:creditNoteId/actions/applyInvoice. Remember to replace {API_KEY} and :creditNoteId with your actual API key and the ID of the credit note you want to apply.

Response

If the request is successful, you will receive a 200 OK status code. If something goes wrong, you will receive a 4xx or 5xx status code, with a JSON object containing more information about the error.

Issue credit

curl "https://api.blixo.com/v1/creditNotes/:creditNoteId/actions/issue" \
-u {API_KEY}: \
-X POST
const fetch = require('node-fetch');

const url = 'https://api.blixo.com/v1/creditNotes/:creditNoteId/actions/issue';
const options = {
  method: 'POST',
  headers: { 
    'Authorization': 'Basic {API_KEY}', 
  }
};

fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error('error:' + err));
$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, 'https://api.blixo.com/v1/creditNotes/:creditNoteId/actions/issue');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Authorization: Basic {API_KEY}'));

$result = curl_exec($ch);
if (curl_errno($ch)) {
    echo 'Error:' . curl_error($ch);
}
curl_close($ch);

var_dump($result);
require 'net/http'
require 'uri'

uri = URI.parse("https://api.blixo.com/v1/creditNotes/:creditNoteId/actions/issue")
request = Net::HTTP::Post.new(uri)
request.basic_auth("{API_KEY}", "")

req_options = {
  use_ssl: uri.scheme == "https",
}

response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|
  http.request(request)
end

puts response.body
import requests

url = "https://api.blixo.com/v1/creditNotes/:creditNoteId/actions/issue"
headers = {
  'Authorization': 'Basic {API_KEY}'
}

response = requests.request("POST", url, headers=headers)

print(response.text)
package main

import (
    "fmt"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://api.blixo.com/v1/creditNotes/:creditNoteId/actions/issue"
    req, _ := http.NewRequest("POST", url, nil)
    req.Header.Add("Authorization", "Basic {API_KEY}")

    res, _ := http.DefaultClient.Do(req)

    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)

    fmt.Println(res)
    fmt.Println(string(body))

}
using System;
using System.Net;
using System.Net.Http;
using System.Threading.Tasks;

public class Program
{
    public static async Task Main(string[] args)
    {
        var client = new HttpClient();
        var request = new HttpRequestMessage
        {
            Method = HttpMethod.Post,
            RequestUri = new Uri("https://api.blixo.com/v1/creditNotes/:creditNoteId/actions/issue"),
            Headers = 
            {
                { HttpRequestHeader.Authorization.ToString(), "Basic {API_KEY}" },
            },
        };

        var response = await client.SendAsync(request);

        if (response.IsSuccessStatusCode)
        {
            var responseContent = await response.Content.ReadAsStringAsync();
            Console.WriteLine(responseContent);
        }
        else
        {
            Console.WriteLine($"Request failed with status code: {response.StatusCode}");
        }
    }
}
import okhttp3.MediaType;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.RequestBody;
import okhttp3.Response;

public class Main {
    public static void main(String[] args) throws Exception {
        OkHttpClient client = new OkHttpClient().newBuilder()
            .build();
        MediaType mediaType = MediaType.parse("text/plain");
        RequestBody body = RequestBody.create(mediaType, "");
        Request request = new Request.Builder()
            .url("https://api.blixo.com/v1/creditNotes/:creditNoteId/actions/issue")
            .method("POST", body)
            .addHeader("Authorization", "Basic {API_KEY}")
            .build();
        Response response = client.newCall(request).execute();
        System.out.println(response.body().string());
    }
}

The above command returns JSON structured like this:

{
    "data": {
        "id": "635ea42fa34c63015dd79220",
        "creditNoteNo": "CN-5656565651",
        "managerId": "65289eb09d9571a357f09a5c",
        "issueDate": "2022-10-05T16:17:31.022Z",
        "paidDate": "2022-10-31T08:40:41.061Z",
        "notes": "45324634453536353941433339384332:c22951fea330493f49a72d85e01f037c",
        "subTotalAmount": {
            "_id": "635f8a09966c9a015e07f9ff",
            "value": 6063030,
            "unit": "$"
        },
        "totalAmount": {
            "value": 6063030,
            "unit": "$"
        },
        "balanceAmount": {
            "value": 0,
            "unit": "$"
        },
        "paymentStatus": [
            "PENDING",
            "PAID"
        ],
        "paymentTerms": "DUE_ON_RECEIPT",
        "creditNoteStatus": [
            "CLOSED"
        ],
        "sentStatus": "NOT_SENT",
        "discountLines": [],
        "discountAmount": {
            "_id": "635f8a09966c9a015e07f9fe",
            "value": 0,
            "unit": "$"
        },
        "taxLines": [],
        "taxAmount": {
            "_id": "635ea42fa34c63015dd79257",
            "value": 0,
            "unit": "$"
        },
        "paidAmount": {
            "_id": "635f8a09966c9a015e07fa19",
            "value": 6063030,
            "unit": "$"
        },
        "companyId": "622294998bec060152bcad9c",
        "customerId": "62f135085ff37c016a57f0eb",
        "shippingLines": [],
        "shippingAmount": {
            "_id": "635f8a09966c9a015e07fa00",
            "value": 0,
            "unit": "$"
        },
        "createdBy": "6222930b8bec060152bcad67",
        "updatedBy": "6222930b8bec060152bcad67",
        "createdAt": "2022-10-30T16:19:59.342Z",
        "updatedAt": "2022-10-31T08:40:41.063Z",
        "payments": []
    }
}

This API endpoint allows you to issue a credit note. It's as simple as sending a POST request to https://api.blixo.com/v1/creditNotes/:creditNoteId/actions/issue. Think of it as telling the server, "Hey, I have this credit note and I want to issue it." And the server responds by issuing the credit note!

HTTP Request

POST https://api.blixo.com/v1/creditNotes/:creditNoteId/actions/issue

Headers

Key Value
Authorization Basic {API_KEY}

Parameters

Parameter Type Description
creditNoteId String (required) The ID of the credit note you want to issue.
companyId String (required) The ID of the company issuing the credit note.
customerId String (required) The ID of the customer to whom the credit note is issued.
paymentMethod String The payment method used for the credit note.
paymentType String The type of payment for the credit note.
amount Object (required) The amount object includes unit, value for the credit note.

Example

To issue a credit note, you would send a POST request to https://api.blixo.com/v1/creditNotes/:creditNoteId/actions/issue. Remember to replace {API_KEY} and :creditNoteId with your actual API key and the ID of the credit note you want to issue.

Response

If the request is successful, you will receive a 200 OK status code. If something goes wrong, you will receive a 4xx or 5xx status code, with a JSON object containing more information about the error.

Download a credit note

curl "https://api.blixo.com/v1/creditNotes/:creditNoteId/actions/download" \
-u {API_KEY}: \
-X GET
-o creditnote.pdf
const fetch = require('node-fetch');

fetch('https://api.blixo.com/v1/creditNotes/:creditNoteId/actions/download', {
  headers: {
    'Authorization': 'Basic {API_KEY}'
  }
})
.then(response => response.text())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.blixo.com/v1/creditNotes/:creditNoteId/actions/download",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => array(
    "Authorization: Basic {API_KEY}"
  ),
));

$response = curl_exec($curl);
curl_close($curl);
echo $response;
?>
require 'net/http'
require 'uri'

uri = URI.parse("https://api.blixo.com/v1/creditNotes/:creditNoteId/actions/download")
request = Net::HTTP::Get.new(uri)
request.basic_auth("{API_KEY}", "")

req_options = {
  use_ssl: uri.scheme == "https",
}

response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|
  http.request(request)
end

puts response.body
import requests
from requests.auth import HTTPBasicAuth

response = requests.get(
    'https://api.blixo.com/v1/creditNotes/:creditNoteId/actions/download',
    auth=HTTPBasicAuth('{API_KEY}', '')
)
print(response.text)
package main

import (
    "fmt"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://api.blixo.com/v1/creditNotes/:creditNoteId/actions/download"
    req, _ := http.NewRequest("GET", url, nil)
    req.Header.Add("Authorization", "Basic {API_KEY}")

    res, _ := http.DefaultClient.Do(req)

    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)

    fmt.Println(string(body))
}
using System;
using System.Net.Http;
using System.Threading.Tasks;

public class Program
{
    public static async Task Main(string[] args)
    {
        var client = new HttpClient();
        var request = new HttpRequestMessage(HttpMethod.Get, "https://api.blixo.com/v1/creditNotes/:creditNoteId/actions/download");
        request.Headers.Add("Authorization", "Basic {API_KEY}");
        HttpResponseMessage response = await client.SendAsync(request);
        Console.WriteLine(await response.Content.ReadAsStringAsync());
    }
}
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;

public class Main {

  public static void main(String[] args) throws Exception {
    OkHttpClient client = new OkHttpClient().newBuilder()
      .build();
    Request request = new Request.Builder()
      .url("https://api.blixo.com/v1/creditNotes/:creditNoteId/actions/download")
      .addHeader("Authorization", "Basic {API_KEY}")
      .build();
    Response response = client.newCall(request).execute();
    System.out.println(response.body().string());
  }
}

This API endpoint allows you to download a credit note. It's as simple as sending a GET request to https://api.blixo.com/v1/creditNotes/:creditNoteId/actions/download. Think of it as telling the server, "Hey, I have this credit note and I want to download it." And the server responds by providing the download link for the credit note!

HTTP Request

GET https://api.blixo.com/v1/creditNotes/:creditNoteId/actions/download

Headers

Key Value
Authorization Basic {API_KEY}

Parameters

Parameter Type Description
creditNoteId String (required) The ID of the credit note you want to download.

Example

To download a credit note, you would send a GET request to https://api.blixo.com/v1/creditNotes/:creditNoteId/actions/download. Remember to replace {API_KEY} and :creditNoteId with your actual API key and the ID of the credit note you want to download.

Response

If the request is successful, you will receive a 200 OK status code and the credit note will be downloaded. If something goes wrong, you will receive a 4xx or 5xx status code, with a JSON object containing more information about the error.

Send a credit note

curl "https://api.blixo.com/v1/creditNotes/:creditNoteId/send" \
-d to="customer@blixo.com" \
-d bcc="bcc_customer@blixo.com" \
-d subject="{{company_name}} Credit Note {{credit_note_number}} for {{customer_name}}" \
-d message="Hi {{customer_contact_name}},
We prepared Credit Note #{{credit_note_number}} for you. We kindly ask that you review the credit note as soon as you can.
If you have questions about this credit note, please contact us at {{company_email}} or reply to this email.
We appreciate your business and thank you for choosing Blixo.
{{view_credit_note_button}}" \
-X POST
const fetch = require('node-fetch');

const data = {
  "to": "customer@blixo.com",
  "bcc": "bcc_customer@blixo.com",
  "subject": "{{company_name}} Credit Note {{credit_note_number}} for {{customer_name}}",
  "message": "Hi {{customer_contact_name}},\nWe prepared Credit Note #{{credit_note_number}} for you. We kindly ask that you review the credit note as soon as you can.\nIf you have questions about this credit note, please contact us at {{company_email}} or reply to this email.\nWe appreciate your business and thank you for choosing Blixo.\n{{view_credit_note_button}}"
};

fetch('https://api.blixo.com/v1/creditNotes/:creditNoteId/send', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json'
  },
  body: JSON.stringify(data)
})
.then(response => response.text())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.blixo.com/v1/creditNotes/:creditNoteId/send",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS =>'{
    "to": "customer@blixo.com",
    "bcc": "bcc_customer@blixo.com",
    "subject": "{{company_name}} Credit Note {{credit_note_number}} for {{customer_name}}",
    "message": "Hi {{customer_contact_name}},\nWe prepared Credit Note #{{credit_note_number}} for you. We kindly ask that you review the credit note as soon as you can.\nIf you have questions about this credit note, please contact us at {{company_email}} or reply to this email.\nWe appreciate your business and thank you for choosing Blixo.\n{{view_credit_note_button}}"
  }',
  CURLOPT_HTTPHEADER => array(
    "Content-Type: application/json"
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
require 'uri'
require 'net/http'
require 'openssl'

url = URI("https://api.blixo.com/v1/creditNotes/:creditNoteId/send")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{
  \"to\": \"customer@blixo.com\",
  \"bcc\": \"bcc_customer@blixo.com\",
  \"subject\": \"{{company_name}} Credit Note {{credit_note_number}} for {{customer_name}}\",
  \"message\": \"Hi {{customer_contact_name}},\\nWe prepared Credit Note #{{credit_note_number}} for you. We kindly ask that you review the credit note as soon as you can.\\nIf you have questions about this credit note, please contact us at {{company_email}} or reply to this email.\\nWe appreciate your business and thank you for choosing Blixo.\\n{{view_credit_note_button}}\"
}"

response = http.request(request)
puts response.read_body
import http.client
import json

conn = http.client.HTTPSConnection("api.blixo.com")

payload = json.dumps({
  "to": "customer@blixo.com",
  "bcc": "bcc_customer@blixo.com",
  "subject": "{{company_name}} Credit Note {{credit_note_number}} for {{customer_name}}",
  "message": "Hi {{customer_contact_name}},\nWe prepared Credit Note #{{credit_note_number}} for you. We kindly ask that you review the credit note as soon as you can.\nIf you have questions about this credit note, please contact us at {{company_email}} or reply to this email.\nWe appreciate your business and thank you for choosing Blixo.\n{{view_credit_note_button}}"
})

headers = { 'Content-Type': 'application/json' }

conn.request("POST", "/v1/creditNotes/:creditNoteId/send", payload, headers)
res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
package main

import (
    "fmt"
    "strings"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://api.blixo.com/v1/creditNotes/:creditNoteId/send"
    method := "POST"

    payload := strings.NewReader("{\n  \"to\": \"customer@blixo.com\",\n  \"bcc\": \"bcc_customer@blixo.com\",\n  \"subject\": \"{{company_name}} Credit Note {{credit_note_number}} for {{customer_name}}\",\n  \"message\": \"Hi {{customer_contact_name}},\\nWe prepared Credit Note #{{credit_note_number}} for you. We kindly ask that you review the credit note as soon as you can.\\nIf you have questions about this credit note, please contact us at {{company_email}} or reply to this email.\\nWe appreciate your business and thank you for choosing Blixo.\\n{{view_credit_note_button}}\"\n}")

    client := &http.Client {
    }
    req, err := http.NewRequest(method, url, payload)

    if err != nil {
        fmt.Println(err)
        return
    }
    req.Header.Add("Content-Type", "application/json")

    res, err := client.Do(req)
    if err != nil {
        fmt.Println(err)
        return
    }
    defer res.Body.Close()

    body, err := ioutil.ReadAll(res.Body)
    if err != nil {
        fmt.Println(err)
        return
    }
    fmt.Println(string(body))
}
using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;

class Program
{
    static async Task Main(string[] args)
    {
        var client = new HttpClient();
        var request = new HttpRequestMessage(HttpMethod.Post, "https://api.blixo.com/v1/creditNotes/:creditNoteId/send");
        request.Headers.Add("Content-Type", "application/json");
        var json = "{\n  \"to\": \"customer@blixo.com\",\n  \"bcc\": \"bcc_customer@blixo.com\",\n  \"subject\": \"{{company_name}} Credit Note {{credit_note_number}} for {{customer_name}}\",\n  \"message\": \"Hi {{customer_contact_name}},\\nWe prepared Credit Note #{{credit_note_number}} for you. We kindly ask that you review the credit note as soon as you can.\\nIf you have questions about this credit note, please contact us at {{company_email}} or reply to this email.\\nWe appreciate your business and thank you for choosing Blixo.\\n{{view_credit_note_button}}\"\n}";
        request.Content = new StringContent(json, Encoding.UTF8, "application/json");
        var response = await client.SendAsync(request);
        var responseContent = await response.Content.ReadAsStringAsync();
        Console.WriteLine(responseContent);
    }
}
import okhttp3.OkHttpClient;
import okhttp3.MediaType;
import okhttp3.RequestBody;
import okhttp3.Request;
import okhttp3.Response;

public class Main {
    public static void main(String[] args) {
        OkHttpClient client = new OkHttpClient().newBuilder()
            .build();
        MediaType mediaType = MediaType.parse("application/json");
        RequestBody body = RequestBody.create(mediaType, "{\n  \"to\": \"customer@blixo.com\",\n  \"bcc\": \"bcc_customer@blixo.com\",\n  \"subject\": \"{{company_name}} Credit Note {{credit_note_number}} for {{customer_name}}\",\n  \"message\": \"Hi {{customer_contact_name}},\\nWe prepared Credit Note #{{credit_note_number}} for you. We kindly ask that you review the credit note as soon as you can.\\nIf you have questions about this credit note, please contact us at {{company_email}} or reply to this email.\\nWe appreciate your business and thank you for choosing Blixo.\\n{{view_credit_note_button}}\"\n}");
        Request request = new Request.Builder()
            .url("https://api.blixo.com/v1/creditNotes/:creditNoteId/send")
            .method("POST", body)
            .addHeader("Content-Type", "application/json")
            .build();
        try {
            Response response = client.newCall(request).execute();
            System.out.println(response.body().string());
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

This API endpoint allows you to send a credit note. It's as simple as sending a POST request to https://api.blixo.com/v1/creditNotes/:creditNoteId/send. Think of it as telling the server, "Hey, I have this credit note and I want to send it." And the server responds by sending the credit note!

HTTP Request

POST https://api.blixo.com/v1/creditNotes/:creditNoteId/send

Headers

Key Value
Authorization Basic {API_KEY}

Parameters

Parameter Type Description
creditNoteId String (required) The ID of the credit note you want to send.
to String (required) The email address to which the credit note will be sent.
bcc String The email address that will receive a blind carbon copy of the credit note.
subject String The subject of the email.
message String The body of the email.

Example

To send a credit note, you would send a POST request to https://api.blixo.com/v1/creditNotes/:creditNoteId/send. Remember to replace {API_KEY} and :creditNoteId with your actual API key and the ID of the credit note you want to send.

Response

If the request is successful, you will receive a 200 OK status code and the credit note will be sent. If something goes wrong, you will receive a 4xx or 5xx status code, with a JSON object containing more information about the error.

Reopen a credit note

curl "https://api.blixo.com/v1/creditNotes/:creditNoteId/actions/reopen" \
-u {API_KEY}: \
-X POST
const fetch = require('node-fetch');

const url = 'https://api.blixo.com/v1/creditNotes/:creditNoteId/actions/reopen';
const options = {
  method: 'POST',
  headers: { 'Authorization': 'Bearer {API_KEY}' }
};

fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.blixo.com/v1/creditNotes/:creditNoteId/actions/reopen',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_HTTPHEADER => array(
    'Authorization: Bearer {API_KEY}'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
?>
require "uri"
require "net/http"

url = URI("https://api.blixo.com/v1/creditNotes/:creditNoteId/actions/reopen")

https = Net::HTTP.new(url.host, url.port);
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = "Bearer {API_KEY}"

response = https.request(request)
puts response.read_body
import requests

url = "https://api.blixo.com/v1/creditNotes/:creditNoteId/actions/reopen"

payload={}
headers = {
  'Authorization': 'Bearer {API_KEY}'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
package main

import (
    "fmt"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://api.blixo.com/v1/creditNotes/:creditNoteId/actions/reopen"
    method := "POST"

    client := &http.Client {
    }
    req, err := http.NewRequest(method, url, nil)

    if err != nil {
        fmt.Println(err)
        return
    }
    req.Header.Add("Authorization", "Bearer {API_KEY}")

    res, err := client.Do(req)
    defer res.Body.Close()
    body, err := ioutil.ReadAll(res.Body)

    fmt.Println(string(body))
}
var client = new RestClient("https://api.blixo.com/v1/creditNotes/:creditNoteId/actions/reopen");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer {API_KEY}");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "");
Request request = new Request.Builder()
  .url("https://api.blixo.com/v1/creditNotes/:creditNoteId/actions/reopen")
  .method("POST", body)
  .addHeader("Authorization", "Bearer {API_KEY}")
  .build();
Response response = client.newCall(request).execute();

The above command returns JSON structured like this:

{
    "data": {
        "id": "632886b3861797016039ab18",
        "creditNoteNo": "CN-0027",
        "managerId": "65289eb09d9571a357f09a5c",
        "issueDate": "2022-09-19T15:09:47.983Z",
        "dueDate": "2022-09-19T15:09:47.983Z",
        "paidDate": null,
        "billTo": {
            "name": "",
            "address1": "",
            "address2": "",
            "city": "",
            "state": "",
            "zipCode": "",
            "country": "",
            "phones": []
        },
        "shipTo": "",
        "notes": "",
        "attachments": [
            ""
        ],
        "subTotalAmount": {
            "_id": "632886b3861797016039ab44",
            "value": 45,
            "unit": "$"
        },
        "totalAmount": {
            "value": 45,
            "unit": "$"
        },
        "balanceAmount": {
            "value": 45,
            "unit": "$"
        },
        "paymentStatus": [
            "PENDING"
        ],
        "paymentTerms": "DUE_ON_RECEIPT",
        "creditNoteStatus": [
            "OPEN"
        ],
        "sentStatus": "SENT",
        "itemLines": [
            {
                "_id": "6328863c861797016039a939",
                "title": "16 Meals",
                "description": "",
                "quantity": 1,
                "rate": {
                    "_id": "6328863c861797016039a93a",
                    "unit": "$",
                    "value": 45
                },
                "taxLines": [],
                "discountLines": [],
                "amount": {
                    "_id": "632886b3861797016039ab42",
                    "value": 45,
                    "unit": "$"
                }
            }
        ],
        "discountLines": [],
        "discountAmount": {
            "_id": "632886b3861797016039ab43",
            "value": 0,
            "unit": "$"
        },
        "taxLines": [],
        "taxAmount": {
            "_id": "6328863c861797016039a99a",
            "value": 0,
            "unit": "$"
        },
        "paidAmount": {
            "_id": "632886b3861797016039ab48",
            "value": 0,
            "unit": "$"
        },
        "companyId": "622294998bec060152bcad9c",
        "customerId": "6327e430cbd87e015e2ccfe1",
        "invoiceId": "6328863c861797016039a938",
        "shippingLines": [],
        "shippingAmount": {
            "_id": "632886b3861797016039ab45",
            "value": 0,
            "unit": "$"
        },
        "createdBy": "6222930b8bec060152bcad67",
        "updatedBy": "6222930b8bec060152bcad67",
        "createdAt": "2022-09-19T15:11:47.055Z",
        "updatedAt": "2022-10-31T14:26:19.895Z",
        "payments": []
    }
}

This API endpoint allows you to reopen a credit note. It's as simple as sending a POST request to https://api.blixo.com/v1/creditNotes/:creditNoteId/actions/reopen. Think of it as telling the server, "Hey, I have this credit note and I want to reopen it." And the server responds by reopening the credit note!

HTTP Request

POST https://api.blixo.com/v1/creditNotes/:creditNoteId/actions/reopen

Headers

Key Value
Authorization Basic {API_KEY}

Parameters

Parameter Type Description
creditNoteId String (required) The ID of the credit note you want to reopen.

Example

To reopen a credit note, you would send a POST request to https://api.blixo.com/v1/creditNotes/:creditNoteId/actions/reopen. Remember to replace {API_KEY} and :creditNoteId with your actual API key and the ID of the credit note you want to reopen.

Response

If the request is successful, you will receive a 200 OK status code and the credit note will be reopened. If something goes wrong, you will receive a 4xx or 5xx status code, with a JSON object containing more information about the error.

Close a credit note

curl "https://api.blixo.com/v1/creditNotes/:creditNoteId/actions/close" \
-u {API_KEY}: \
-X POST
const fetch = require('node-fetch');

const url = 'https://api.blixo.com/v1/creditNotes/:creditNoteId/actions/close';
const options = {
  method: 'POST',
  headers: { 'Authorization': 'Bearer {API_KEY}' }
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error('error:' + err));
$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.blixo.com/v1/creditNotes/:creditNoteId/actions/close",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_HTTPHEADER => array(
    "Authorization: Bearer {API_KEY}"
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
require 'net/http'
require 'uri'

uri = URI.parse("https://api.blixo.com/v1/creditNotes/:creditNoteId/actions/close")
request = Net::HTTP::Post.new(uri)
request["Authorization"] = "Bearer {API_KEY}"

req_options = {
  use_ssl: uri.scheme == "https",
}

response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|
  http.request(request)
end

puts response.body
import requests

url = "https://api.blixo.com/v1/creditNotes/:creditNoteId/actions/close"
headers = {"Authorization": "Bearer {API_KEY}"}

response = requests.post(url, headers=headers)

print(response.json())
package main

import (
    "fmt"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://api.blixo.com/v1/creditNotes/:creditNoteId/actions/close"
    method := "POST"

    client := &http.Client {
    }
    req, err := http.NewRequest(method, url, nil)

    if err != nil {
        fmt.Println(err)
        return
    }
    req.Header.Add("Authorization", "Bearer {API_KEY}")

    res, err := client.Do(req)
    defer res.Body.Close()
    body, err := ioutil.ReadAll(res.Body)

    fmt.Println(string(body))
}
var client = new RestClient("https://api.blixo.com/v1/creditNotes/:creditNoteId/actions/close");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer {API_KEY}");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
Request request = new Request.Builder()
  .url("https://api.blixo.com/v1/creditNotes/:creditNoteId/actions/close")
  .method("POST", null)
  .addHeader("Authorization", "Bearer {API_KEY}")
  .build();
Response response = client.newCall(request).execute();
System.out.println(response.body().string());

The above command returns JSON structured like this:

{
    "data": {
        "id": "630f9cd0ab6f32015e3a8fde",
        "creditNoteNo": "CN-0025",
        "managerId": "65289eb09d9571a357f09a5c",
        "issueDate": "2022-08-31T17:39:24.577Z",
        "paidDate": null,
        "billTo": {
            "attn": "Nguyen24 Nguyen24",
            "phones": [
                null
            ],
            "address1": "mb",
            "address2": null,
            "city": "mb",
            "state": "California",
            "zipCode": "90011",
            "country": "United States",
            "name": "Nguyen24 Nguyen24"
        },
        "notes": "",
        "attachments": [
            ""
        ],
        "subTotalAmount": {
            "_id": "630f9cd0ab6f32015e3a8ff5",
            "value": 10,
            "unit": "$"
        },
        "totalAmount": {
            "value": 10,
            "unit": "$"
        },
        "balanceAmount": {
            "value": 10,
            "unit": "$"
        },
        "paymentStatus": [
            "PENDING"
        ],
        "paymentTerms": "DUE_ON_RECEIPT",
        "creditNoteStatus": [
            "OPEN",
            "CLOSED"
        ],
        "sentStatus": "NOT_SENT",
        "itemLines": [
            {
                "_id": "630f9c863ba3512a43cf6fd3",
                "title": "",
                "description": "",
                "quantity": 1,
                "rate": {
                    "_id": "630f9cd0ab6f32015e3a8fe0",
                    "unit": "$",
                    "value": 10
                },
                "amount": {
                    "_id": "630f9cd0ab6f32015e3a8ff2",
                    "value": 10,
                    "unit": "$"
                },
                "taxLines": [],
                "discountLines": []
            }
        ],
        "discountLines": [],
        "discountAmount": {
            "_id": "630f9cd0ab6f32015e3a8ff3",
            "value": 0,
            "unit": "$"
        },
        "taxLines": [],
        "taxAmount": {
            "_id": "630f9cd0ab6f32015e3a8ff4",
            "value": 0,
            "unit": "$"
        },
        "paidAmount": {
            "_id": "630f9cd0ab6f32015e3a8ff9",
            "value": 0,
            "unit": "$"
        },
        "companyId": "622294998bec060152bcad9c",
        "customerId": "630dde11c755b0015e9d7642",
        "shippingLines": [],
        "shippingAmount": {
            "_id": "630f9cd0ab6f32015e3a8ff6",
            "value": 0,
            "unit": "$"
        },
        "createdBy": "6222930b8bec060152bcad67",
        "updatedBy": "6222930b8bec060152bcad67",
        "createdAt": "2022-08-31T17:39:28.893Z",
        "updatedAt": "2022-10-31T15:12:23.766Z",
        "payments": []
    }
}

This API endpoint allows you to close a credit note. It's as simple as sending a POST request to https://api.blixo.com/v1/creditNotes/:creditNoteId/actions/close. Think of it as telling the server, "Hey, I have this credit note and I want to close it." And the server responds by closing the credit note!

HTTP Request

POST https://api.blixo.com/v1/creditNotes/:creditNoteId/actions/close

Headers

Key Value
Authorization Basic {API_KEY}

Parameters

Parameter Type Description
creditNoteId String (required) The ID of the credit note you want to close.

Example

To close a credit note, you would send a POST request to https://api.blixo.com/v1/creditNotes/:creditNoteId/actions/close. Remember to replace {API_KEY} and :creditNoteId with your actual API key and the ID of the credit note you want to close.

Response

If the request is successful, you will receive a 200 OK status code and the credit note will be closed. If something goes wrong, you will receive a 4xx or 5xx status code, with a JSON object containing more information about the error.

Void a credit note

curl "https://api.blixo.com/v1/creditNotes/:creditNoteId/actions/void" \
-u {API_KEY}: \
-X POST
const fetch = require('node-fetch');

const url = 'https://api.blixo.com/v1/creditNotes/:creditNoteId/actions/void';
const options = {
  method: 'POST',
  headers: { 'Authorization': 'Bearer {API_KEY}' }
};

fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.blixo.com/v1/creditNotes/:creditNoteId/actions/void',
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_HTTPHEADER => array(
    'Authorization: Bearer {API_KEY}'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
?>
require 'uri'
require 'net/http'

url = URI("https://api.blixo.com/v1/creditNotes/:creditNoteId/actions/void")

http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer {API_KEY}'

response = http.request(request)
puts response.read_body
import requests

url = "https://api.blixo.com/v1/creditNotes/:creditNoteId/actions/void"
headers = {
  'Authorization': 'Bearer {API_KEY}'
}

response = requests.request("POST", url, headers=headers)

print(response.text)
package main

import (
    "fmt"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://api.blixo.com/v1/creditNotes/:creditNoteId/actions/void"
    method := "POST"

    client := &http.Client {
    }
    req, err := http.NewRequest(method, url, nil)

    if err != nil {
        fmt.Println(err)
        return
    }
    req.Header.Add("Authorization", "Bearer {API_KEY}")

    res, err := client.Do(req)
    defer res.Body.Close()
    body, err := ioutil.ReadAll(res.Body)

    fmt.Println(string(body))
}
var client = new RestClient("https://api.blixo.com/v1/creditNotes/:creditNoteId/actions/void");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer {API_KEY}");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "");
Request request = new Request.Builder()
  .url("https://api.blixo.com/v1/creditNotes/:creditNoteId/actions/void")
  .method("POST", body)
  .addHeader("Authorization", "Bearer {API_KEY}")
  .build();
Response response = client.newCall(request).execute();

The above command returns JSON structured like this:

{
    "data": {
        "creditNoteNo": "CN-0025",
        "managerId": "65289eb09d9571a357f09a5c",
        "notes": "",
        "attachments": [
            ""
        ],
        "paymentStatus": [
            "VOIDED"
        ],
        "paymentTerms": "DUE_ON_RECEIPT",
        "creditNoteStatus": [
            "OPEN",
            "CLOSED"
        ],
        "sentStatus": "NOT_SENT",
        "_id": "630f9cd0ab6f32015e3a8fde",
        "discountLines": [],
        "taxLines": [],
        "shippingLines": [],
        "issueDate": "2022-08-31T17:39:24.577Z",
        "companyId": "622294998bec060152bcad9c",
        "customerId": "630dde11c755b0015e9d7642",
        "createdBy": "6222930b8bec060152bcad67",
        "updatedBy": "6222930b8bec060152bcad67",
        "createdAt": "2022-08-31T17:39:28.893Z",
        "updatedAt": "2022-10-31T15:20:18.252Z",
        "__enc_billTo_d": "",
        "__enc_billTo": false,
        "__enc_attachments_d": "",
        "__enc_attachments": false,
        "__enc_itemLines_d": "",
        "__enc_itemLines": false,
        "__v": 3,
        "balanceAmount": {
            "value": 0,
            "unit": "$"
        },
        "discountAmount": {
            "_id": "630f9cd0ab6f32015e3a8ff3",
            "value": 0,
            "unit": "$"
        },
        "paidAmount": {
            "_id": "635fe7b2966c9a015e325ce4",
            "value": 10,
            "unit": "$"
        },
        "paidDate": null,
        "shippingAmount": {
            "_id": "630f9cd0ab6f32015e3a8ff6",
            "value": 0,
            "unit": "$"
        },
        "subTotalAmount": {
            "_id": "630f9cd0ab6f32015e3a8ff5",
            "value": 10,
            "unit": "$"
        },
        "taxAmount": {
            "_id": "630f9cd0ab6f32015e3a8ff4",
            "value": 0,
            "unit": "$"
        },
        "totalAmount": {
            "value": 10,
            "unit": "$"
        },
        "itemLines": [
            {
                "_id": "630f9c863ba3512a43cf6fd3",
                "title": "",
                "description": "",
                "quantity": 1,
                "rate": {
                    "_id": "630f9cd0ab6f32015e3a8fe0",
                    "unit": "$",
                    "value": 10
                },
                "amount": {
                    "_id": "630f9cd0ab6f32015e3a8ff2",
                    "value": 10,
                    "unit": "$"
                },
                "taxLines": [],
                "discountLines": []
            }
        ],
        "billTo": {
            "attn": "Nguyen24 Nguyen24",
            "phones": [
                null
            ],
            "address1": "mb",
            "address2": null,
            "city": "mb",
            "state": "California",
            "zipCode": "90011",
            "country": "United States",
            "name": "Nguyen24 Nguyen24"
        }
    }
}

This API endpoint allows you to void a credit note. It's as simple as sending a POST request to https://api.blixo.com/v1/creditNotes/:creditNoteId/actions/void. Think of it as telling the server, "Hey, I have this credit note and I want to void it." And the server responds by voiding the credit note!

HTTP Request

POST https://api.blixo.com/v1/creditNotes/:creditNoteId/actions/void

Headers

Key Value
Authorization Basic {API_KEY}

Parameters

Parameter Type Description
creditNoteId String (required) The ID of the credit note you want to void.

Example

To void a credit note, you would send a POST request to https://api.blixo.com/v1/creditNotes/:creditNoteId/actions/void. Remember to replace {API_KEY} and :creditNoteId with your actual API key and the ID of the credit note you want to void.

Response

If the request is successful, you will receive a 200 OK status code and the credit note will be voided. If something goes wrong, you will receive a 4xx or 5xx status code, with a JSON object containing more information about the error.

Payments

Payment object

Attribute Type Description
id ObjectId The ID of the payment.
paymentMethod String The method of payment.
paymentSource Object The source of the payment. It includes the following attributes:
id: ObjectId - The ID of the payment source
paymentGatewayType: String - The type of the payment gateway. It is required and can be patched, posted, and fetched.
paymentGatewayId: ObjectId - The ID of the payment gateway. It can be patched, posted, and fetched.
paymentMethodDetails: Object - The details of the payment method. It can be patched, posted, and fetched.
billingAddress: Object - The billing address. It includes the following sub-attributes: firstName, lastName, phone, company, address1, address2, city, state, zipCode, country, and countryCode. All of these sub-attributes are of type String, have a default value of an empty string, and can be patched, posted, and fetched.
paymentSourceRef ObjectId The ID reference to the payment source.
paymentType String The type of the payment.
paymentStatus String The status of the payment.
parentPayment ObjectId The ID of the parent payment.
appliedTo Array The array of objects the payment is applied to.
paymentGatewayType String The type of the payment gateway.
paymentGatewayId ObjectId The ID of the payment gateway.
reference String The reference of the payment.
note String The note of the payment.
amount Object The amount of the payment. It includes the following attributes:
value: Number - The value of the amount.
unit: String - The unit of the amount.
currency: String - The currency of the amount. Default is USD.
refundAmount Object The refund amount of the payment. It includes the following attributes:
value: Number - The value of the amount.
unit: String - The unit of the amount.
currency: String - The currency of the amount. Default is USD.
balance Object The balance of the payment. It includes the following attributes:
value: Number - The value of the balance.
unit: String - The unit of the balance.
currency: String - The currency of the balance. Default is USD.
invoiceId ObjectId The ID of the invoice.
creditNoteId ObjectId The ID of the credit note.
quoteId ObjectId The ID of the quote.
companyId ObjectId The ID of the company.
customerId ObjectId The ID of the customer.
receiveDate Date The date the payment was received.
braintree Object The braintree information of the payment.
stripe Object The stripe information of the payment.
document String The document of the payment.
transactionIds Array The array of transaction IDs.
createdBy ObjectId The ID of the user who created the payment.
updatedBy ObjectId The ID of the user who last updated the payment.
deletedBy ObjectId The ID of the user who deleted the payment.
deletedAt Date The date when the payment was deleted.
isDeleted Boolean Whether the payment is deleted.
createdAt Date The date when the payment was created.
updatedAt Date The date when the payment was last updated.
source String The source of the payment.
integrations Object The integrations of the payment.

List all payments

curl "https://api.blixo.com/v1/payments" \
-u {API_KEY}:
const fetch = require('node-fetch');

const url = 'https://api.blixo.com/v1/payments';
const options = {
  method: 'GET',
  headers: { 'Authorization': 'Bearer {API_KEY}' }
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error('error:' + err));
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.blixo.com/v1/payments",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => array(
    "Authorization: Bearer {API_KEY}"
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

?>
require 'uri'
require 'net/http'

url = URI("https://api.blixo.com/v1/payments")

http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer {API_KEY}'

response = http.request(request)
puts response.read_body
import requests

url = "https://api.blixo.com/v1/payments"
headers = {
  'Authorization': 'Bearer {API_KEY}'
}

response = requests.request("GET", url, headers=headers)

print(response.text)
package main

import (
    "fmt"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://api.blixo.com/v1/payments"
    req, _ := http.NewRequest("GET", url, nil)
    req.Header.Add("Authorization", "Bearer {API_KEY}")

    res, _ := http.DefaultClient.Do(req)

    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)

    fmt.Println(string(body))
}
var client = new RestClient("https://api.blixo.com/v1/payments");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer {API_KEY}");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
Request request = new Request.Builder()
  .url("https://api.blixo.com/v1/payments")
  .method("GET", null)
  .addHeader("Authorization", "Bearer {API_KEY}")
  .build();
Response response = client.newCall(request).execute();
System.out.println(response.body().string());

The above command returns JSON structured like this:

{
    "data": [
        {
            "id": "6361edc7673363015d37bc51",
            "paymentMethod": "OTHER",
            "paymentSourceRef": {
                "refId": ""
            },
            "paymentType": "CHARGE",
            "paymentStatus": "APPLIED",
            "appliedTo": [
                {
                    "_id": "6361edc7673363015d37bc52",
                    "type": "invoice",
                    "invoiceId": "6361edc7673363015d37bbe0",
                    "amount": {
                        "value": 32,
                        "unit": "$",
                        "currency": "USD"
                    }
                }
            ],
            "note": "",
            "amount": {
                "value": 32,
                "unit": "$",
                "currency": "USD"
            },
            "companyId": "622294998bec060152bcad9c",
            "customerId": "62bfc64ed978bc016b84f870",
            "receiveDate": "2022-11-02T00:10:46.000Z",
            "createdAt": "2022-11-02T04:10:47.958Z",
            "updatedAt": "2022-11-02T06:28:39.629Z",
            "source": "..",
            "integrations": {
                "shopify": {
                    "orderId": "4815745581220",
                    "customerId": "6153466577060",
                    "orderUrl": "",
                    "lastSynced": "2022-11-02T04:10:47+00:00"
                },
                "bigquery": {
                    "lastSynced": "2022-11-02T06:28:39.629Z"
                }
            },
            "transactions": [
                {
                    "paymentMethod": "OTHER",
                    "paymentType": "CHARGE",
                    "paymentStatus": "SUCCEEDED",
                    "source": "..",
                    "_id": "6361edc7673363015d37bc5b",
                    "amount": {
                        "value": 32,
                        "unit": "$",
                        "currency": "USD"
                    },
                    "companyId": "622294998bec060152bcad9c",
                    "customerId": "62bfc64ed978bc016b84f870",
                    "receiveDate": "2022-11-02T00:10:46.000Z",
                    "parentPayment": "6361edc7673363015d37bc51",
                    "invoiceId": "6361edc7673363015d37bbe0",
                    "createdAt": "2022-11-02T04:10:47.986Z",
                    "updatedAt": "2022-11-02T04:10:47.986Z",
                    "__v": 0
                }
            ],
            "braintree": {},
            "stripe": {
                "paymentIntentId": "ch_3LzYHmEuHLA2PI560Bxd4pyg"
            }
        }
    ]
}

This API endpoint allows you to retrieve a list of all payments made. It's as simple as sending a GET request to https://api.blixo.com/v1/payments. Think of it as asking the server, "Hey, can I get a list of all your payments?" And the server responds with the information you asked for!

HTTP Request

GET https://api.blixo.com/v1/payments

Headers

Key Value
Authorization Basic {API_KEY}

Parameters

Parameter Type Description
page Integer The page number to retrieve. Default is 1.
perPage Integer The number of payments to retrieve per page. Default is 100.
companyId objectId (required) Company ID
sort array Sort by field name and its ordering, e.g. sort[0]=creditNoteNo&sort[1]=-1
paymentStatus array Payment status, e.g. NOT_APPLIED, APPLIED

Example

To list all payments, you would send a GET request to https://api.blixo.com/v1/payments. Remember to replace {API_KEY} with your actual API key.

If you want to retrieve the third page of payments, with 50 payments per page, you would send a GET request to https://api.blixo.com/v1/payments?page=3&perPage=50.

Response

The response will be a JSON object with a data key containing an array of payments. Each payment will be an object with the following keys:

If the request is successful, you will receive a 200 OK status code. If something goes wrong, you will receive a 4xx or 5xx status code, with a JSON object containing more information about the error.

Create a payment

curl "https://api.blixo.com/v1/payments" \
-u {API_KEY}: \
const fetch = require('node-fetch');

const url = 'https://api.blixo.com/v1/payments';
const options = {
  method: 'POST',
  headers: {
    'Authorization': 'Basic ' + Buffer.from('{API_KEY}:').toString('base64')
  }
};

fetch(url, options)
  .then(res => res.text())
  .then(body => console.log(body))
  .catch(error => console.error(error));
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.blixo.com/v1/payments",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => array(
    "Authorization: Basic " . base64_encode("{API_KEY}:")
  ),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
?>
require 'uri'
require 'net/http'
require 'base64'

url = URI("https://api.blixo.com/v1/payments")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic ' + Base64.strict_encode64('{API_KEY}:')
response = http.request(request)
puts response.read_body
import requests
import base64

url = "https://api.blixo.com/v1/payments"
api_key = "{API_KEY}"
headers = {
    "Authorization": "Basic " + base64.b64encode((api_key + ":").encode()).decode()
}
response = requests.post(url, headers=headers)
print(response.text)
package main
import (
    "fmt"
    "net/http"
    "io/ioutil"
    "encoding/base64"
)
func main() {
    url := "https://api.blixo.com/v1/payments"
    req, _ := http.NewRequest("POST", url, nil)
    req.Header.Add("Authorization", "Basic " + base64.StdEncoding.EncodeToString([]byte("{API_KEY}:")))
    res, _ := http.DefaultClient.Do(req)
    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)
    fmt.Println(string(body))
}
using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;

class Program
{
    static void Main()
    {
        var task = Task.Run(() => SendRequest());
        task.Wait();
    }

    static async Task SendRequest()
    {
        var client = new HttpClient();
        var request = new HttpRequestMessage
        {
            Method = HttpMethod.Post,
            RequestUri = new Uri("https://api.blixo.com/v1/payments"),
        };
        var byteArray = Encoding.ASCII.GetBytes("{API_KEY}:");
        request.Headers.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", Convert.ToBase64String(byteArray));
        var response = await client.SendAsync(request);
        Console.WriteLine(await response.Content.ReadAsStringAsync());
    }
}
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
import java.util.Base64;

public class Main {
    public static void main(String[] args) {
        OkHttpClient client = new OkHttpClient();

        String url = "https://api.blixo.com/v1/payments";
        String encoding = Base64.getEncoder().encodeToString(("{API_KEY}:".getBytes()));

        Request request = new Request.Builder()
            .url(url)
            .post(okhttp3.RequestBody.create(null, new byte[0]))
            .addHeader("Authorization", "Basic " + encoding)
            .build();

        try (Response response = client.newCall(request).execute()) {
            System.out.println(response.body().string());
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

The above command returns JSON structured like this:

{
    "data": {
        "id": "63633c74bc92e4015cc7a9cc",
        "paymentMethod": "CASH",
        "paymentType": "PAYMENT",
        "paymentStatus": "APPLIED",
        "appliedTo": [
            {
                "_id": "63633c74bc92e4015cc7a9cd",
                "invoiceId": "635e9126a34c63015da3873a",
                "amount": {
                    "value": 76.85,
                    "unit": "$",
                    "currency": "USD"
                },
                "type": "invoice"
            },
            {
                "_id": "63633c74bc92e4015cc7a9ce",
                "type": "credit",
                "amount": {
                    "value": 23155.15,
                    "unit": "$",
                    "currency": "USD"
                }
            }
        ],
        "reference": "2345678",
        "note": "45324634453536353941433339384332:c22951fea330493f49a72d85e01f037c",
        "amount": {
            "value": 23232,
            "unit": "$",
            "currency": "USD"
        },
        "companyId": "622294998bec060152bcad9c",
        "customerId": "6331629360eea3015e855e40",
        "receiveDate": "2022-11-03T03:52:35.022Z",
        "document": "INV-4226",
        "createdAt": "2022-11-03T03:58:44.450Z",
        "updatedAt": "2022-11-03T03:58:44.742Z",
        "source": "BLIXO",
        "transactions": [
            {
                "paymentMethod": "CASH",
                "paymentType": "PAYMENT",
                "paymentStatus": "SUCCEEDED",
                "source": "BLIXO",
                "_id": "63633c74bc92e4015cc7a9d7",
                "amount": {
                    "value": 76.85,
                    "unit": "$",
                    "currency": "USD"
                },
                "companyId": "622294998bec060152bcad9c",
                "customerId": "6331629360eea3015e855e40",
                "reference": "2345678",
                "receiveDate": "2022-11-03T03:52:35.022Z",
                "parentPayment": "63633c74bc92e4015cc7a9cc",