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 ishttps://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:
- Resource-Oriented URLs: A structured and logical approach to accessing resources.
- Request & Response Format: While we return responses in JSON format, the API can accept both form-encoded and JSON-encoded request bodies. For JSON requests, ensure your Content-Type header is set to application/json.
- HTTP Standards: We adopt common HTTP response codes, authentication methods, and verbs to make integration familiar and straightforward.
- Date Representation: All dates within the API are represented as UNIX timestamps. Each entity, be it a customer or an invoice, carries a distinct integer ID.
- PDF Support: Some endpoints provide the flexibility of returning PDF responses. Just set the Accept header to application/pdf. Such endpoints are clearly marked within our documentation.
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:
- Sign in to your account on blixo.com.
- Navigate to the 'Settings' section.
- From there, head over to the 'Developers' subsection.
- 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 . |
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:
id
: The unique identifier of the customer.customerNo
: The customer number.name
: The name of the customer.customerType
: The type of the customer.email
: The email address of the customer.parentCustomerId
: The ID of the parent customer.billToParent
: Whether the bill is sent to the parent customer.language
: The language of the customer.taxable
: Whether the customer is taxable.taxIds
: The tax IDs of the customer.creditHold
: Whether the customer is on credit hold.contacts
: The contacts of the customer.primaryContactId
: The ID of the primary contact.autopay
: Whether autopay is enabled for the customer.autoConvertInvoice
: Whether the invoice is auto-converted for the customer.paymentSources
: The payment sources of the customer.paymentSourceRefs
: The references to the payment sources.paymentDate
: The payment date of the customer.disabledPaymentMethods
: The disabled payment methods for the customer.notes
: Any notes regarding the customer.isChasingPaused
: Whether chasing is paused for the customer.chasingEnabled
: Whether chasing is enabled for the customer.chasingId
: The ID of the chasing.nextChasingStepId
: The ID of the next chasing step.companyId
: The ID of the company.enabled
: Whether the customer is enabled.createdAt
: The creation date of the customer.updatedAt
: The last update date of the customer.source
: The source of the customer.address
: The address of the customer.signInToken
: The sign-in token of the customer.
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 |
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 |
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:
id
: The unique identifier of the credit note.creditNoteNo
: The credit note number.customerId
: The ID of the customer.invoiceId
: The ID of the invoice.date
: The date of the credit note.amount
: The amount of the credit note.remainingAmount
: The remaining amount of the credit note.status
: The status of the credit note.notes
: Any notes regarding the credit note.createdAt
: The creation date of the credit note.updatedAt
: The last update date of the credit note.
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:
id
: The unique identifier of the credit note.creditNoteNo
: The credit note number.customerId
: The ID of the customer.invoiceId
: The ID of the invoice.date
: The date of the credit note.amount
: The amount of the credit note.remainingAmount
: The remaining amount of the credit note.status
: The status of the credit note.notes
: Any notes regarding the credit note.createdAt
: The creation date of the credit note.updatedAt
: The last update date of the credit note.
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:
id
: The unique identifier of the credit note.creditNoteNo
: The credit note number.customerId
: The ID of the customer.invoiceId
: The ID of the invoice.date
: The date of the credit note.amount
: The amount of the credit note.remainingAmount
: The remaining amount of the credit note.status
: The status of the credit note.notes
: Any notes regarding the credit note.createdAt
: The creation date of the credit note.updatedAt
: The last update date of the credit note.
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:
id
: The unique identifier of the payment.amount
: The amount of the payment.currency
: The currency of the payment.status
: The status of the payment.createdAt
: The creation date of the payment.updatedAt
: The last update date of the payment.
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",
"invoiceId": "635e9126a34c63015da3873a",
"createdAt": "2022-11-03T03:58:44.564Z",
"updatedAt": "2022-11-03T03:58:44.564Z"
}
],
"braintree": {},
"stripe": {}
}
}
This API endpoint allows you to create a new payment. It's as simple as sending a POST request to https://api.blixo.com/v1/payments
. Think of it as telling the server, "Hey, I want to make a new payment!" And the server responds with the information about the newly created payment!
HTTP Request
POST https://api.blixo.com/v1/payments
Headers
Key | Value |
---|---|
Authorization | Basic {API_KEY} |
Parameters
Parameter | Type | Description |
---|---|---|
amount | Object | (required) The amount of the payment. Object includes unit , value , currency |
currency | String | (required) The currency of the payment. |
status | String | (required) The status of the payment. |
companyId | objectId | (required) Company ID |
customerId | objectId | (required) Customer ID |
paymentMethod | String | (required) Payment method |
paymentType | String | (required) Payment type |
reference | String | Reference ID number |
note | String | Note |
appliedTo | Array | An array of items. Each item are an object includes amount , type , invoiceId |
Example
To create a new payment, you would send a POST request to https://api.blixo.com/v1/payments
. Remember to replace {API_KEY}
with your actual API key.
Response
The response will be a JSON object with a data
key containing the details of the newly created payment. The payment will be an object with the following keys:
id
: The unique identifier of the payment.amount
: The amount of the payment.currency
: The currency of the payment.status
: The status of the payment.createdAt
: The creation date of the payment.updatedAt
: The last update date of the payment.
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 payment
curl "https://api.blixo.com/v1/payments/:paymentId" \
-u {API_KEY}: \
-X PATCH \
-d paymentMethod="CASH" \
-d paymentType="PAYMENT" \
-d amount[value]=76.85 \
-d amount[unit]="$" \
-d amount[currency]="USD" \
-d reference="2345678"
const fetch = require('node-fetch');
const url = 'https://api.blixo.com/v1/payments/:paymentId';
const options = {
method: 'PATCH',
headers: {
'Authorization': 'Basic ' + Buffer.from('{API_KEY}:').toString('base64'),
'Content-Type': 'application/json'
},
body: JSON.stringify({
paymentMethod: "CASH",
paymentType: "PAYMENT",
amount: {
value: 76.85,
unit: "$",
currency: "USD"
},
reference: "2345678"
})
};
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/:paymentId",
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_HTTPHEADER => array(
"Authorization: Basic " . base64_encode("{API_KEY}:"),
"Content-Type: application/json"
),
CURLOPT_POSTFIELDS => json_encode(array(
"paymentMethod" => "CASH",
"paymentType" => "PAYMENT",
"amount" => array(
"value" => 76.85,
"unit" => "$",
"currency" => "USD"
),
"reference" => "2345678"
))
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
?>
require 'uri'
require 'net/http'
require 'base64'
require 'json'
url = URI("https://api.blixo.com/v1/payments/:paymentId")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Basic ' + Base64.strict_encode64('{API_KEY}:')
request["Content-Type"] = 'application/json'
request.body = {
paymentMethod: "CASH",
paymentType: "PAYMENT",
amount: {
value: 76.85,
unit: "$",
currency: "USD"
},
reference: "2345678"
}.to_json
response = http.request(request)
puts response.read_body
import requests
import base64
import json
url = "https://api.blixo.com/v1/payments/:paymentId"
api_key = "{API_KEY}"
headers = {
"Authorization": "Basic " + base64.b64encode((api_key + ":").encode()).decode(),
"Content-Type": "application/json"
}
data = {
"paymentMethod": "CASH",
"paymentType": "PAYMENT",
"amount": {
"value": 76.85,
"unit": "$",
"currency": "USD"
},
"reference": "2345678"
}
response = requests.patch(url, headers=headers, data=json.dumps(data))
print(response.text)
package main
import (
"fmt"
"net/http"
"io/ioutil"
"encoding/base64"
"bytes"
"encoding/json"
)
func main() {
url := "https://api.blixo.com/v1/payments/:paymentId"
req, _ := http.NewRequest("PATCH", url, nil)
req.Header.Add("Authorization", "Basic " + base64.StdEncoding.EncodeToString([]byte("{API_KEY}:")))
req.Header.Add("Content-Type", "application/json")
data := map[string]interface{}{
"paymentMethod": "CASH",
"paymentType": "PAYMENT",
"amount": map[string]interface{}{
"value": 76.85,
"unit": "$",
"currency": "USD",
},
"reference": "2345678",
}
jsonData, _ := json.Marshal(data)
req.Body = ioutil.NopCloser(bytes.NewBuffer(jsonData))
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;
using Newtonsoft.Json;
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.Patch,
RequestUri = new Uri("https://api.blixo.com/v1/payments/:paymentId"),
};
var byteArray = Encoding.ASCII.GetBytes("{API_KEY}:");
request.Headers.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", Convert.ToBase64String(byteArray));
var data = new
{
paymentMethod = "CASH",
paymentType = "PAYMENT",
amount = new
{
value = 76.85,
unit = "$",
currency = "USD"
},
reference = "2345678"
};
request.Content = new StringContent(JsonConvert.SerializeObject(data), Encoding.UTF8, "application/json");
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;
import okhttp3.MediaType;
import okhttp3.RequestBody;
import com.google.gson.Gson;
import java.util.HashMap;
import java.util.Map;
public class Main {
public static void main(String[] args) {
OkHttpClient client = new OkHttpClient();
Gson gson = new Gson();
String url = "https://api.blixo.com/v1/payments/:paymentId";
String encoding = Base64.getEncoder().encodeToString(("{API_KEY}:".getBytes()));
Map<String, Object> amount = new HashMap<>();
amount.put("value", 76.85);
amount.put("unit", "$");
amount.put("currency", "USD");
Map<String, Object> data = new HashMap<>();
data.put("paymentMethod", "CASH");
data.put("paymentType", "PAYMENT");
data.put("amount", amount);
data.put("reference", "2345678");
MediaType JSON = MediaType.get("application/json; charset=utf-8");
RequestBody body = RequestBody.create(JSON, gson.toJson(data));
Request request = new Request.Builder()
.url(url)
.patch(body)
.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": "63634a39bc92e4015cc86bb0",
"paymentMethod": "CASH",
"paymentType": "PAYMENT",
"paymentStatus": "APPLIED",
"appliedTo": [
{
"_id": "63634a39bc92e4015cc86bb1",
"invoiceId": "63041c165a32a4016051a5be",
"amount": {
"value": 11,
"unit": "$",
"currency": "USD"
},
"type": "invoice"
}
],
"reference": "2345678",
"note": "notes update payment",
"amount": {
"value": 11,
"unit": "$",
"currency": "USD"
},
"balance": {
"value": 0,
"unit": "$",
"currency": "USD"
},
"companyId": "622294998bec060152bcad9c",
"customerId": "62f135085ff37c016a57f0eb",
"receiveDate": "2022-11-03T04:49:43.384Z",
"document": "INV-0257",
"updatedBy": "6222930b8bec060152bcad67",
"createdAt": "2022-11-03T04:57:29.543Z",
"updatedAt": "2022-11-03T06:34:42.532Z",
"source": "BLIXO",
"transactions": [
{
"paymentMethod": "CASH",
"paymentType": "PAYMENT",
"paymentStatus": "SUCCEEDED",
"source": "BLIXO",
"_id": "63634a39bc92e4015cc86bcb",
"amount": {
"value": 11,
"unit": "$",
"currency": "USD"
},
"companyId": "622294998bec060152bcad9c",
"customerId": "62f135085ff37c016a57f0eb",
"reference": "2345678",
"receiveDate": "2022-11-03T04:49:43.384Z",
"parentPayment": "63634a39bc92e4015cc86bb0",
"invoiceId": "63041c165a32a4016051a5be",
"createdAt": "2022-11-03T04:57:29.569Z",
"updatedAt": "2022-11-03T04:57:29.569Z",
"__v": 0
}
],
"braintree": {},
"stripe": {}
}
}
This API endpoint allows you to update an existing payment. It's as simple as sending a PATCH request to https://api.blixo.com/v1/payments/:paymentId
. Think of it as telling the server, "Hey, I want to update this payment!" And the server responds with the information about the updated payment!
HTTP Request
PATCH https://api.blixo.com/v1/payments/:paymentId
Headers
Key | Value |
---|---|
Authorization | Basic {API_KEY} |
Parameters
Parameter | Type | Description |
---|---|---|
amount | Object | (required) The updated amount of the payment. Object includes unit , value , currency |
currency | String | (required) The updated currency of the payment. |
status | String | (required) The updated status of the payment. |
companyId | objectId | (required) Company ID |
customerId | objectId | (required) Customer ID |
paymentMethod | String | (required) The updated payment method |
paymentType | String | (required) The updated payment type |
reference | String | Updated reference ID number |
note | String | Updated note |
appliedTo | Array | An updated array of items. Each item are an object includes amount , type , invoiceId |
creditAmount | object | Updated credit amount object includes unit , value , currency |
receiveDate | string | Updated receive date |
document | string | Updated document |
updatedBy | string | Updated by |
source | string | Updated source |
transactions | Array | Updated transactions array. Each transaction is an object includes paymentMethod , paymentType , paymentStatus , source , _id , amount , companyId , customerId , reference , receiveDate , parentPayment , invoiceId , createdAt , updatedAt |
braintree | object | Updated Braintree object |
stripe | object | Updated Stripe object |
Example
To update a payment, you would send a PATCH request to https://api.blixo.com/v1/payments/:paymentId
. Remember to replace {API_KEY}
and :paymentId
with your actual API key and the ID of the payment you want to update.
Response
The response will be a JSON object with a data
key containing the details of the updated payment. The payment will be an object with the following keys:
id
: The unique identifier of the payment.amount
: The updated amount of the payment.currency
: The updated currency of the payment.status
: The updated status of the payment.createdAt
: The creation date of the payment.updatedAt
: The last update date of the payment.
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 payment
curl "https://api.blixo.com/v1/payments/:paymentId" \
-u {API_KEY}: \
-X DELETE
const fetch = require('node-fetch');
const url = 'https://api.blixo.com/v1/payments/:paymentId';
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/payments/:paymentId",
CURLOPT_CUSTOMREQUEST => "DELETE",
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/:paymentId")
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
import base64
url = "https://api.blixo.com/v1/payments/:paymentId"
api_key = "{API_KEY}"
headers = {
"Authorization": "Basic " + base64.b64encode((api_key + ":").encode()).decode()
}
response = requests.delete(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/:paymentId"
req, _ := http.NewRequest("DELETE", 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.Delete,
RequestUri = new Uri("https://api.blixo.com/v1/payments/:paymentId"),
};
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/:paymentId";
String encoding = Base64.getEncoder().encodeToString(("{API_KEY}:".getBytes()));
Request request = new Request.Builder()
.url(url)
.delete()
.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": "611d4216a747250146ade2cf"
}
This API endpoint allows you to delete a payment. It's as simple as sending a DELETE request to https://api.blixo.com/v1/payments/:paymentId
. Think of it as telling the server, "Hey, I want to delete this payment!" And the server responds by deleting the payment.
HTTP Request
DELETE https://api.blixo.com/v1/payments/:paymentId
Headers
Key | Value |
---|---|
Authorization | Basic {API_KEY} |
Example
To delete a payment, you would send a DELETE request to https://api.blixo.com/v1/payments/:paymentId
. Remember to replace {API_KEY}
and :paymentId
with your actual API key and the ID of the payment you want to delete.
Response
The response will be a JSON object with a data
key containing the ID of the deleted payment.
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 payment
curl "https://api.blixo.com/v1/payments/:paymentId/actions/download" \
-u {API_KEY}: \
-X GET \
-o payment.pdf
const fetch = require('node-fetch');
const fs = require('fs');
const url = 'https://api.blixo.com/v1/payments/:paymentId/actions/download';
const options = {
method: 'GET',
headers: {
'Authorization': 'Basic ' + Buffer.from('{API_KEY}:').toString('base64')
}
};
fetch(url, options)
.then(res => res.buffer())
.then(buffer => fs.writeFileSync('payment.pdf', buffer))
.catch(error => console.error(error));
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.blixo.com/v1/payments/:paymentId/actions/download",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => array(
"Authorization: Basic " . base64_encode("{API_KEY}:")
),
));
$response = curl_exec($curl);
file_put_contents('payment.pdf', $response);
curl_close($curl);
?>
require 'uri'
require 'net/http'
require 'base64'
url = URI("https://api.blixo.com/v1/payments/:paymentId/actions/download")
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)
File.open('payment.pdf', 'w') { |file| file.write(response.body) }
import requests
import base64
url = "https://api.blixo.com/v1/payments/:paymentId/actions/download"
api_key = "{API_KEY}"
headers = {
"Authorization": "Basic " + base64.b64encode((api_key + ":").encode()).decode()
}
response = requests.get(url, headers=headers)
with open('payment.pdf', 'wb') as f:
f.write(response.content)
package main
import (
"fmt"
"net/http"
"io/ioutil"
"encoding/base64"
"os"
)
func main() {
url := "https://api.blixo.com/v1/payments/:paymentId/actions/download"
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)
ioutil.WriteFile("payment.pdf", body, 0644)
}
using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using System.IO;
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/payments/:paymentId/actions/download"),
};
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);
var content = await response.Content.ReadAsByteArrayAsync();
File.WriteAllBytes("payment.pdf", content);
}
}
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
import java.util.Base64;
import java.nio.file.Files;
import java.nio.file.Paths;
public class Main {
public static void main(String[] args) {
OkHttpClient client = new OkHttpClient();
String url = "https://api.blixo.com/v1/payments/:paymentId/actions/download";
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()) {
Files.write(Paths.get("payment.pdf"), response.body().bytes());
} catch (Exception e) {
e.printStackTrace();
}
}
}
This API endpoint allows you to download a payment. It's as simple as sending a GET request to https://api.blixo.com/v1/payments/:paymentId/actions/download
. Think of it as telling the server, "Hey, I want to download this payment!" And the server responds by providing the payment download.
HTTP Request
GET https://api.blixo.com/v1/payments/:paymentId/actions/download
Headers
Key | Value |
---|---|
Authorization | Basic {API_KEY} |
Example
To download a payment, you would send a GET request to https://api.blixo.com/v1/payments/:paymentId/actions/download
. Remember to replace {API_KEY}
and :paymentId
with your actual API key and the ID of the payment you want to download.
Response
The response will be a PDF file of the payment.
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.
Send a payment receipt
curl "https://api.blixo.com/v1/payments/:paymentId/actions/sendReceipt" \
-d to="customer@blixo.com" \
-d bcc="bcc_customer@blixo.com" \
-d subject="Thank You – Receipt for {{company_name}} Invoice {{invoice_number}} for {{customer_name}}" \
-d message="Hi {{customer_contact_name}},
We are writing to inform you that {{company_name}} Invoice {{invoice_number}} has been paid in full. Please keep the attached PDF for your records.
We appreciate your business and thank you for choosing Blixo." \
-X POST
const fetch = require('node-fetch');
const url = 'https://api.blixo.com/v1/payments/:paymentId/actions/sendReceipt';
const options = {
method: 'POST',
headers: {
'Authorization': 'Basic ' + Buffer.from('{API_KEY}:').toString('base64')
},
body: JSON.stringify({
to: 'customer@blixo.com',
bcc: 'bcc_customer@blixo.com',
subject: 'Thank You – Receipt for {{company_name}} Invoice {{invoice_number}} for {{customer_name}}',
message: 'Hi {{customer_contact_name}}, We are writing to inform you that {{company_name}} Invoice {{invoice_number}} has been paid in full. Please keep the attached PDF for your records. We appreciate your business and thank you for choosing Blixo.'
})
};
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/:paymentId/actions/sendReceipt",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => array(
'to' => 'customer@blixo.com',
'bcc' => 'bcc_customer@blixo.com',
'subject' => 'Thank You – Receipt for {{company_name}} Invoice {{invoice_number}} for {{customer_name}}',
'message' => 'Hi {{customer_contact_name}}, We are writing to inform you that {{company_name}} Invoice {{invoice_number}} has been paid in full. Please keep the attached PDF for your records. We appreciate your business and thank you for choosing Blixo.'
),
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/:paymentId/actions/sendReceipt")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic ' + Base64.strict_encode64('{API_KEY}:')
request.set_form_data({
'to' => 'customer@blixo.com',
'bcc' => 'bcc_customer@blixo.com',
'subject' => 'Thank You – Receipt for {{company_name}} Invoice {{invoice_number}} for {{customer_name}}',
'message' => 'Hi {{customer_contact_name}}, We are writing to inform you that {{company_name}} Invoice {{invoice_number}} has been paid in full. Please keep the attached PDF for your records. We appreciate your business and thank you for choosing Blixo.'
})
response = http.request(request)
puts response.read_body
import requests
import base64
url = "https://api.blixo.com/v1/payments/:paymentId/actions/sendReceipt"
api_key = "{API_KEY}"
headers = {
"Authorization": "Basic " + base64.b64encode((api_key + ":").encode()).decode()
}
data = {
'to': 'customer@blixo.com',
'bcc': 'bcc_customer@blixo.com',
'subject': 'Thank You – Receipt for {{company_name}} Invoice {{invoice_number}} for {{customer_name}}',
'message': 'Hi {{customer_contact_name}}, We are writing to inform you that {{company_name}} Invoice {{invoice_number}} has been paid in full. Please keep the attached PDF for your records. We appreciate your business and thank you for choosing Blixo.'
}
response = requests.post(url, headers=headers, data=data)
print(response.text)
package main
import (
"fmt"
"net/http"
"io/ioutil"
"encoding/base64"
"strings"
)
func main() {
url := "https://api.blixo.com/v1/payments/:paymentId/actions/sendReceipt"
payload := strings.NewReader("to=customer@blixo.com&bcc=bcc_customer@blixo.com&subject=Thank You – Receipt for {{company_name}} Invoice {{invoice_number}} for {{customer_name}}&message=Hi {{customer_contact_name}}, We are writing to inform you that {{company_name}} Invoice {{invoice_number}} has been paid in full. Please keep the attached PDF for your records. We appreciate your business and thank you for choosing Blixo.")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic " + base64.StdEncoding.EncodeToString([]byte("{API_KEY}:")))
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
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/:paymentId/actions/sendReceipt"),
Content = new StringContent("to=customer@blixo.com&bcc=bcc_customer@blixo.com&subject=Thank You – Receipt for {{company_name}} Invoice {{invoice_number}} for {{customer_name}}&message=Hi {{customer_contact_name}}, We are writing to inform you that {{company_name}} Invoice {{invoice_number}} has been paid in full. Please keep the attached PDF for your records. We appreciate your business and thank you for choosing Blixo.", Encoding.UTF8, "application/x-www-form-urlencoded")
};
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.RequestBody;
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/:paymentId/actions/sendReceipt";
String encoding = Base64.getEncoder().encodeToString(("{API_KEY}:".getBytes()));
RequestBody body = RequestBody.create("to=customer@blixo.com&bcc=bcc_customer@blixo.com&subject=Thank You – Receipt for {{company_name}} Invoice {{invoice_number}} for {{customer_name}}&message=Hi {{customer_contact_name}}, We are writing to inform you that {{company_name}} Invoice {{invoice_number}} has been paid in full. Please keep the attached PDF for your records. We appreciate your business and thank you for choosing Blixo.", okhttp3.MediaType.parse("application/x-www-form-urlencoded"));
Request request = new Request.Builder()
.url(url)
.addHeader("Authorization", "Basic " + encoding)
.post(body)
.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 payment receipt. It's as simple as sending a POST request to https://api.blixo.com/v1/payments/:paymentId/actions/sendReceipt
. Think of it as telling the server, "Hey, I want to send this receipt!" And the server responds by sending the receipt to the specified email.
HTTP Request
POST https://api.blixo.com/v1/payments/:paymentId/actions/sendReceipt
Headers
Key | Value |
---|---|
Authorization | Basic {API_KEY} |
Parameters
Parameter | Type | Description |
---|---|---|
to | (required) Receiver's email | |
bcc | Bcc email | |
subject | string | (required) Email subject |
message | string | (required) Email message |
Example
To send a payment receipt, you would send a POST request to https://api.blixo.com/v1/payments/:paymentId/actions/sendReceipt
. Remember to replace {API_KEY}
and :paymentId
with your actual API key and the ID of the payment for which you want to send a receipt.
Response
The response will be a JSON object with a data
key containing the ID of the payment for which the receipt was sent.
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.
Void a payment
curl "https://api.blixo.com/v1/payments/:paymentId/actions/void" \
-u {API_KEY}: \
-X POST
const fetch = require('node-fetch');
const url = 'https://api.blixo.com/v1/payments/:paymentId/actions/void';
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/:paymentId/actions/void",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "POST",
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/:paymentId/actions/void")
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/:paymentId/actions/void"
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/:paymentId/actions/void"
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/:paymentId/actions/void"),
};
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/:paymentId/actions/void";
String encoding = Base64.getEncoder().encodeToString(("{API_KEY}:".getBytes()));
Request request = new Request.Builder()
.url(url)
.post(RequestBody.create("", null)) // Empty body
.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": "63635be3bc92e4015cc92e45",
"paymentMethod": "CREDIT_CARD",
"paymentType": "CHARGE",
"paymentStatus": "VOIDED",
"appliedTo": [],
"note": "Payment voided",
"amount": {
"value": 100,
"unit": "$",
"currency": "USD"
},
"balance": {
"value": 0,
"unit": "$",
"currency": "USD"
},
"companyId": "622294998bec060152bcad9c",
"customerId": "62f135085ff37c016a57f0eb",
"receiveDate": "2022-11-03T06:12:22.769Z",
"document": "INV-0257",
"updatedBy": "6222930b8bec060152bcad67",
"createdAt": "2022-11-03T06:12:51.284Z",
"updatedAt": "2022-11-03T06:56:16.763Z",
"source": "BLIXO",
"transactions": [],
"braintree": {
"transactionId": "59ngy78x"
},
"stripe": {
"transactionId": "ch_1J2r5L2eZvKYlo2CtBU9ko2u"
}
}
}
This API endpoint allows you to void a payment. It's as simple as sending a POST request to https://api.blixo.com/v1/payments/:paymentId/actions/void
. Think of it as telling the server, "Hey, I want to void this payment!" And the server responds by voiding the payment.
HTTP Request
POST https://api.blixo.com/v1/payments/:paymentId/actions/void
Headers
Key | Value |
---|---|
Authorization | Basic {API_KEY} |
Example
To void a payment, you would send a POST request to https://api.blixo.com/v1/payments/:paymentId/actions/void
. Remember to replace {API_KEY}
and :paymentId
with your actual API key and the ID of the payment you want to void.
Response
The response will be a JSON object with a data
key containing the details of the voided payment. The payment will be an object with the following keys:
id
: The unique identifier of the payment.paymentMethod
: The method of payment.paymentType
: The type of payment.paymentStatus
: The status of the payment, which will be "VOIDED".amount
: The amount of the payment.balance
: The balance after the payment.companyId
: The ID of the company.customerId
: The ID of the customer.receiveDate
: The date the payment was received.document
: The document associated with the payment.updatedBy
: The ID of the user who updated the payment.createdAt
: The creation date of the payment.updatedAt
: The last update date of the payment.source
: The source of the payment.transactions
: The transactions associated with the payment.braintree
: The Braintree transaction ID.stripe
: The Stripe transaction ID.
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.
Refund a payment
curl "https://api.blixo.com/v1/payments/:paymentId/actions/refund" \
-u {API_KEY}: \
-X POST
const fetch = require('node-fetch');
const url = 'https://api.blixo.com/v1/payments/:paymentId/actions/refund';
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/:paymentId/actions/refund",
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/:paymentId/actions/refund")
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/:paymentId/actions/refund"
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/:paymentId/actions/refund"
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/:paymentId/actions/refund"),
};
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/:paymentId/actions/refund";
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": "63634712bc92e4015cc8637b",
"paymentMethod": "SCHEME",
"paymentType": "CHARGE",
"paymentStatus": "APPLIED",
"appliedTo": [
{
"_id": "63634712bc92e4015cc8637c",
"invoiceId": "635e9536a34c63015dae40c3",
"amount": {
"value": 33,
"unit": "$",
"currency": "USD"
},
"type": "invoice"
}
],
"reference": "nbhgdzmd",
"note": "...",
"amount": {
"value": 33,
"unit": "$",
"currency": "USD"
},
"refundAmount": {
"value": 33,
"unit": "$",
"currency": "USD"
},
"companyId": "622294998bec060152bcad9c",
"customerId": "62f135085ff37c016a57f0eb",
"receiveDate": "2022-11-03T04:43:37.215Z",
"document": "INV-4227",
"createdAt": "2022-11-03T04:44:02.052Z",
"updatedAt": "2022-11-03T07:25:32.214Z",
"source": "BLIXO",
"transactions": [
{
"paymentMethod": "SCHEME",
"paymentType": "CHARGE",
"paymentStatus": "SUCCEEDED",
"source": "BLIXO",
"_id": "63634712bc92e4015cc86396",
"amount": {
"value": 33,
"unit": "$",
"currency": "USD"
},
"companyId": "622294998bec060152bcad9c",
"customerId": "62f135085ff37c016a57f0eb",
"receiveDate": "2022-11-03T04:43:37.215Z",
"parentPayment": "63634712bc92e4015cc8637b",
"invoiceId": "635e9536a34c63015dae40c3",
"createdAt": "2022-11-03T04:44:02.081Z",
"updatedAt": "2022-11-03T04:44:02.081Z"
}
],
"braintree": {
"transactionId": "n8sgpy4g"
},
"stripe": {}
}
}
This API endpoint allows you to refund a payment. It's as simple as sending a POST request to https://api.blixo.com/v1/payments/:paymentId/actions/refund
. Think of it as telling the server, "Hey, I want to refund this payment!" And the server responds by processing the refund.
HTTP Request
POST https://api.blixo.com/v1/payments/:paymentId/actions/refund
Headers
Key | Value |
---|---|
Authorization | Basic {API_KEY} |
Parameters
Parameter | Type | Description |
---|---|---|
amount | object | (required) An amount object includes currency , unit , value |
Example
To refund a payment, you would send a POST request to https://api.blixo.com/v1/payments/:paymentId/actions/refund
. Remember to replace {API_KEY}
and :paymentId
with your actual API key and the ID of the payment you want to refund.
Response
The response will be a JSON object with a data
key containing the details of the refunded payment. The payment will be an object with the following keys:
id
: The unique identifier of the payment.paymentMethod
: The method of payment.paymentType
: The type of payment.paymentStatus
: The status of the payment, which will be "REFUNDED".amount
: The amount of the payment.balance
: The balance after the payment.companyId
: The ID of the company.customerId
: The ID of the customer.receiveDate
: The date the payment was received.document
: The document associated with the payment.updatedBy
: The ID of the user who updated the payment.createdAt
: The creation date of the payment.updatedAt
: The last update date of the payment.source
: The source of the payment.transactions
: The transactions associated with the payment.braintree
: The Braintree transaction ID.stripe
: The Stripe transaction ID.
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.
Subscriptions
Subscription object
Attribute | Type | Description |
---|---|---|
id | ObjectId | The ID of the subscription. |
name | String | The name of the subscription. |
subscriptionNo | String | The subscription number. |
companyId | ObjectId | The ID of the company. |
customerId | ObjectId | The ID of the customer. |
planId | ObjectId | The ID of the plan. |
planAmount | Object | The amount of the plan. 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 . |
||
planQuantity | Number | The quantity of the plan. |
contractPeriod | String | The contract period of the subscription, either 'monthly' or 'yearly'. |
contractQuantity | Number | The number of contracts per period. |
contractRenewal | String | The contract renewal of the subscription, either 'auto' or 'wait for confirm to renew'. |
interval | String | The interval of the subscription. |
intervalCount | Number | The interval count of the subscription. |
billingCycle | Number | The billing cycle of the subscription. |
addons | Array | The addons of the subscription. |
discounts | Array | The discounts of the subscription. |
taxes | Array | The taxes of the subscription. |
shippings | Array | The shippings of the subscription. |
shippingAmount | Object | The shipping amount of the subscription. 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 . |
||
addonAmount | Object | The addon amount of the subscription. 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 . |
||
discountAmount | Object | The discount amount of the subscription. 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 subscription. 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 . |
||
subTotalAmount | Object | The subtotal amount of the subscription. 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 subscription. 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 . |
||
invoices | Array | The invoices of the subscription. |
currentInvoice | Object | The current invoice of the subscription. |
upcomingInvoice | Object | The upcoming invoice of the subscription. |
proration | Number | The proration of the subscription. |
note | String | The note of the subscription. |
cancelReason | String | The cancel reason of the subscription. |
startDate | Date | The start date of the subscription. |
endDate | Date | The end date of the subscription. |
startedDate | Date | The started date of the subscription. |
paymentDay | Number | The payment day of the subscription. |
issueInvoiceDays | Number | The issue invoice days of the subscription. |
startInvoiceDate | Date | The start invoice date of the subscription. |
paymentDate | Date | The payment date of the subscription. |
nextIssueInvoiceDate | Date | The next issue invoice date of the subscription. |
prevInvoiceDate | Date | The previous invoice date of the subscription. |
nextInvoiceDate | Date | The next invoice date of the subscription. |
nextPaymentDate | Date | The next payment date of the subscription. |
status | String | The status of the subscription. |
oldPlanId | ObjectId | The ID of the old plan. |
oldPlanAmount | Object | The old plan amount of the subscription. 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 . |
||
shipTo | Object | The ship to of the subscription. |
canceledAt | Date | The canceled at of the subscription. |
cancelAtPeriodEnd | Boolean | Whether the subscription will be canceled at the end of period. |
customerFromPortal | Boolean | Whether the customer is from portal. |
attemptCount | Number | The attempt count of the subscription. |
nextRetryDate | Date | The next retry date of the subscription. |
createdAt | Date | The date when the subscription was created. |
updatedAt | Date | The date when the subscription was last updated. |
deletedBy | ObjectId | The ID of the user who deleted the subscription. |
deletedAt | Date | The date when the subscription was deleted. |
isDeleted | Boolean | Whether the subscription is deleted. |
loadedAt | Date | The loaded at of the subscription. |
source | String | The source of the subscription. |
integrations | Object | The integrations of the subscription. |
List all subscriptions
curl "https://api.blixo.com/v1/subscriptions" \
-u {API_KEY}:
const fetch = require('node-fetch');
const url = 'https://api.blixo.com/v1/subscriptions';
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/subscriptions",
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/subscriptions")
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/subscriptions"
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/subscriptions"
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/subscriptions"),
};
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/subscriptions";
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": "635b861c1a5711015ef679f0",
"name": "Custom Bundle Subscription",
"subscriptionNo": "",
"companyId": "622294998bec060152bcad9c",
"customerId": "634d16dcc9d031e8c4f41674",
"planId": "635b846efd32b4015e697f0e",
"planAmount": {
"currency": "USD",
"unit": "$",
"value": 2
},
"planQuantity": 1,
"contractPeriod": "MONTHLY",
"contractQuantity": -2222,
"contractRenewal": "AUTO_RENEW",
"interval": "months",
"intervalCount": 1,
"billingCycle": -2222,
"addons": [],
"discounts": [],
"taxes": [],
"shippings": [],
"shippingAmount": {
"currency": "USD",
"value": 0,
"unit": "$"
},
"discountAmount": {
"currency": "USD",
"value": 0,
"unit": "$"
},
"taxAmount": {
"currency": "USD",
"value": 0,
"unit": "$"
},
"subTotalAmount": {
"currency": "USD",
"value": 2,
"unit": "$"
},
"totalAmount": {
"currency": "USD",
"value": 2,
"unit": "$"
},
"invoices": [
"635b861c1a5711015ef67a30"
],
"currentInvoice": {
"items": [
{
"name": "2",
"rate": {
"value": 2,
"unit": "$",
"currency": "USD"
},
"quantity": 1,
"taxable": true,
"type": "Plan",
"fromDate": "2022-10-28T07:34:52.325Z",
"toDate": "2022-11-28T07:34:52.325Z",
"_id": "635b846efd32b4015e697f0e",
"integrations": {
"shopify": {
"customerId": "6365108175012",
"orderId": "",
"orderUrl": "",
"productId": "",
"variantId": ""
}
}
}
]
},
"upcomingInvoice": {
"items": [
{
"name": "2",
"rate": {
"value": 2,
"unit": "$",
"currency": "USD"
},
"quantity": 1,
"taxable": true,
"type": "Plan",
"fromDate": "2022-11-28T07:34:52.325Z",
"toDate": "2022-12-28T07:34:52+00:00",
"_id": "635b846efd32b4015e697f0e",
"integrations": {
"shopify": {
"customerId": "6365108175012",
"orderId": "",
"orderUrl": "",
"productId": "",
"variantId": ""
}
}
}
]
},
"proration": 0,
"startDate": "2022-10-28T07:34:52.325Z",
"endDate": "1837-08-28T07:34:52.325Z",
"startedDate": "2022-10-28T07:34:52.325Z",
"paymentDay": 0,
"issueInvoiceDays": 0,
"startInvoiceDate": "2022-10-28T07:34:52.325Z",
"paymentDate": "2022-10-28T07:34:52.325Z",
"nextIssueInvoiceDate": "2022-11-28T07:34:52.325Z",
"nextInvoiceDate": "2022-11-28T07:34:52.325Z",
"nextPaymentDate": "2022-11-28T07:34:52.325Z",
"status": "ACTIVE",
"oldPlanId": null,
"oldPlanAmount": {
"currency": "USD",
"value": 0,
"unit": "$"
},
"shipTo": "",
"cancelAtPeriodEnd": false,
"customerFromPortal": false,
"createdAt": "2022-10-28T07:34:52.326Z",
"updatedAt": "2022-10-28T08:00:03.386Z",
"source": "BLIXO",
"integrations": {
"shopify": {
"customerId": "6365108175012",
"orderId": "",
"orderUrl": "",
"productId": "",
"variantId": ""
},
"bigquery": {
"lastLineItemsSynced": "2022-10-28T08:00:02.060Z",
"lastSynced": "2022-10-28T08:00:03.386Z"
}
},
"planDetail": {
"code": "CUPL-00393",
"type": "CUSTOM",
"itemId": null,
"interval": "months",
"intervalCount": -2222,
"pricingMode": "per_unit",
"taxable": true,
"isTemplate": false,
"_id": "635b846efd32b4015e697f0e",
"name": "2",
"companyId": "622294998bec060152bcad9c",
"price": {
"unit": "$",
"currency": "USD",
"value": 2
},
"createdAt": "2022-10-28T07:27:42.909Z",
"updatedAt": "2022-10-29T06:15:44.841Z",
"integrations": {
"bigquery": {
"lastSynced": "2022-10-28T08:00:02.861Z"
}
},
"deletedAt": "2022-10-29T06:15:44.840Z",
"deletedBy": "6222930b8bec060152bcad67"
},
"customer": {
"id": "634d16dcc9d031e8c4f41674",
"name": "Customer"
}
}
],
"pagination": {
"total": 1
}
}
This API endpoint allows you to retrieve a list of all subscriptions in the database. It's as simple as sending a GET request to https://api.blixo.com/v1/subscriptions
. Think of it as asking the server, "Hey, can I get a list of all your subscriptions?" And the server responds with the information you asked for!
HTTP Request
GET https://api.blixo.com/v1/subscriptions
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 subscriptions to retrieve per page. Default is 100 . |
sort | array | Sort by field name and its ordering, e.g. sort[0]=creditNoteNo&sort[1]=-1 |
Example
To list all subscriptions, you would send a GET request to https://api.blixo.com/v1/subscriptions
. Remember to replace {API_KEY}
with your actual API key.
If you want to retrieve the third page of subscriptions, with 50 subscriptions per page, you would send a GET request to https://api.blixo.com/v1/subscriptions?page=3&perPage=50
.
Response
The response will be a JSON object with a data
key containing an array of subscriptions. Each subscription will be an object with the following keys:
id
: The unique identifier of the subscription.name
: The name of the subscription.subscriptionNo
: The subscription number.companyId
: The ID of the company.customerId
: The ID of the customer.planId
: The ID of the plan.planAmount
: The amount of the plan.planQuantity
: The quantity of the plan.contractPeriod
: The contract period of the subscription.contractQuantity
: The contract quantity of the subscription.contractRenewal
: The contract renewal of the subscription.interval
: The interval of the subscription.intervalCount
: The interval count of the subscription.billingCycle
: The billing cycle of the subscription.addons
: The addons of the subscription.discounts
: The discounts of the subscription.taxes
: The taxes of the subscription.shippings
: The shippings of the subscription.shippingAmount
: The shipping amount of the subscription.discountAmount
: The discount amount of the subscription.taxAmount
: The tax amount of the subscription.
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 subscription
curl "https://api.blixo.com/v1/subscriptions" \
-u {API_KEY}: \
-d companyId="60e1b7f0c6ef4219ff51824c" \
-d customerId="61d68e42f8779e8cb38499be" \
-d planId="61556ed175b9f7e7b3486dac" \
-d startDate="2021-08-22T17:18:17.182Z" \
-d paymentDay=0 \
-d issueInvoiceDays=0 \
-d contractQuantity=1 \
-d contractPeriod="YEARLY" \
-d contractRenewal="AUTO_RENEW" \
-d shipTo[name]="Travis Waldron" \
-d shipTo[address1]="78 First St." \
-d addons[0][_id]="615a5cc37d3e8f4f499bd423" \
-d addons[0][name]="MEMBER ADDON YEARLY" \
-d addons[0][quantity]=1 \
-d addons[0][amount][unit]="$" \
-d addons[0][amount][currency]="USD" \
-d addons[0][amount][value]="119.88" \
-d discounts=[] \
-d taxes=[] \
-X POST
const fetch = require('node-fetch');
const url = 'https://api.blixo.com/v1/subscriptions';
const options = {
method: 'POST',
headers: {
'Authorization': 'Basic ' + Buffer.from('{API_KEY}:').toString('base64'),
'Content-Type': 'application/json'
},
body: JSON.stringify({
companyId: "60e1b7f0c6ef4219ff51824c",
customerId: "61d68e42f8779e8cb38499be",
planId: "61556ed175b9f7e7b3486dac",
startDate: "2021-08-22T17:18:17.182Z",
paymentDay: 0,
issueInvoiceDays: 0,
contractQuantity: 1,
contractPeriod: "YEARLY",
contractRenewal: "AUTO_RENEW",
shipTo: {
name: "Travis Waldron",
address1: "78 First St."
},
addons: [
{
_id: "615a5cc37d3e8f4f499bd423",
name: "MEMBER ADDON YEARLY",
quantity: 1,
amount: {
unit: "$",
currency: "USD",
value: "119.88"
}
}
],
discounts: [],
taxes: []
})
};
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/subscriptions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => array(
"Authorization: Basic " . base64_encode("{API_KEY}:"),
"Content-Type: application/json"
),
CURLOPT_POSTFIELDS => json_encode(array(
"companyId" => "60e1b7f0c6ef4219ff51824c",
"customerId" => "61d68e42f8779e8cb38499be",
"planId" => "61556ed175b9f7e7b3486dac",
"startDate" => "2021-08-22T17:18:17.182Z",
"paymentDay" => 0,
"issueInvoiceDays" => 0,
"contractQuantity" => 1,
"contractPeriod" => "YEARLY",
"contractRenewal" => "AUTO_RENEW",
"shipTo" => array(
"name" => "Travis Waldron",
"address1" => "78 First St."
),
"addons" => array(
array(
"_id" => "615a5cc37d3e8f4f499bd423",
"name" => "MEMBER ADDON YEARLY",
"quantity" => 1,
"amount" => array(
"unit" => "$",
"currency" => "USD",
"value" => "119.88"
)
)
),
"discounts" => array(),
"taxes" => array()
))
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
?>
require 'uri'
require 'net/http'
require 'base64'
require 'json'
url = URI("https://api.blixo.com/v1/subscriptions")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic ' + Base64.strict_encode64('{API_KEY}:')
request["Content-Type"] = 'application/json'
request.body = JSON.generate({
companyId: "60e1b7f0c6ef4219ff51824c",
customerId: "61d68e42f8779e8cb38499be",
planId: "61556ed175b9f7e7b3486dac",
startDate: "2021-08-22T17:18:17.182Z",
paymentDay: 0,
issueInvoiceDays: 0,
contractQuantity: 1,
contractPeriod: "YEARLY",
contractRenewal: "AUTO_RENEW",
shipTo: {
name: "Travis Waldron",
address1: "78 First St."
},
addons: [
{
_id: "615a5cc37d3e8f4f499bd423",
name: "MEMBER ADDON YEARLY",
quantity: 1,
amount: {
unit: "$",
currency: "USD",
value: "119.88"
}
}
],
discounts: [],
taxes: []
})
response = http.request(request)
puts response.read_body
import requests
import base64
import json
url = "https://api.blixo.com/v1/subscriptions"
api_key = "{API_KEY}"
headers = {
"Authorization": "Basic " + base64.b64encode((api_key + ":").encode()).decode(),
"Content-Type": "application/json"
}
data = json.dumps({
"companyId": "60e1b7f0c6ef4219ff51824c",
"customerId": "61d68e42f8779e8cb38499be",
"planId": "61556ed175b9f7e7b3486dac",
"startDate": "2021-08-22T17:18:17.182Z",
"paymentDay": 0,
"issueInvoiceDays": 0,
"contractQuantity": 1,
"contractPeriod": "YEARLY",
"contractRenewal": "AUTO_RENEW",
"shipTo": {
"name": "Travis Waldron",
"address1": "78 First St."
},
"addons": [
{
"_id": "615a5cc37d3e8f4f499bd423",
"name": "MEMBER ADDON YEARLY",
"quantity": 1,
"amount": {
"unit": "$",
"currency": "USD",
"value": "119.88"
}
}
],
"discounts": [],
"taxes": []
})
response = requests.post(url, headers=headers, data=data)
print(response.text)
package main
import (
"fmt"
"net/http"
"io/ioutil"
"encoding/base64"
"strings"
)
func main() {
url := "https://api.blixo.com/v1/subscriptions"
method := "POST"
payload := strings.NewReader(`{
"companyId": "60e1b7f0c6ef4219ff51824c",
"customerId": "61d68e42f8779e8cb38499be",
"planId": "61556ed175b9f7e7b3486dac",
"startDate": "2021-08-22T17:18:17.182Z",
"paymentDay": 0,
"issueInvoiceDays": 0,
"contractQuantity": 1,
"contractPeriod": "YEARLY",
"contractRenewal": "AUTO_RENEW",
"shipTo": {
"name": "Travis Waldron",
"address1": "78 First St."
},
"addons": [
{
"_id": "615a5cc37d3e8f4f499bd423",
"name": "MEMBER ADDON YEARLY",
"quantity": 1,
"amount": {
"unit": "$",
"currency": "USD",
"value": "119.88"
}
}
],
"discounts": [],
"taxes": []
}`)
client := &http.Client {}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Authorization", "Basic " + base64.StdEncoding.EncodeToString([]byte("{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))
}
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/subscriptions"),
Content = new StringContent(
@"{
""companyId"": ""60e1b7f0c6ef4219ff51824c"",
""customerId"": ""61d68e42f8779e8cb38499be"",
""planId"": ""61556ed175b9f7e7b3486dac"",
""startDate"": ""2021-08-22T17:18:17.182Z"",
""paymentDay"": 0,
""issueInvoiceDays"": 0,
""contractQuantity"": 1,
""contractPeriod"": ""YEARLY"",
""contractRenewal"": ""AUTO_RENEW"",
""shipTo"": {
""name"": ""Travis Waldron"",
""address1"": ""78 First St.""
},
""addons"": [
{
""_id"": ""615a5cc37d3e8f4f499bd423"",
""name"": ""MEMBER ADDON YEARLY"",
""quantity"": 1,
""amount"": {
""unit"": ""$"",
""currency"": ""USD"",
""value"": ""119.88""
}
}
],
""discounts"": [],
""taxes"": []
}", Encoding.UTF8, "application/json")
};
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.MediaType;
import okhttp3.RequestBody;
import okhttp3.Request;
import okhttp3.Response;
import java.util.Base64;
public class Main {
public static void main(String[] args) {
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n" +
" \"companyId\": \"60e1b7f0c6ef4219ff51824c\",\n" +
" \"customerId\": \"61d68e42f8779e8cb38499be\",\n" +
" \"planId\": \"61556ed175b9f7e7b3486dac\",\n" +
" \"startDate\": \"2021-08-22T17:18:17.182Z\",\n" +
" \"paymentDay\": 0,\n" +
" \"issueInvoiceDays\": 0,\n" +
" \"contractQuantity\": 1,\n" +
" \"contractPeriod\": \"YEARLY\",\n" +
" \"contractRenewal\": \"AUTO_RENEW\",\n" +
" \"shipTo\": {\n" +
" \"name\": \"Travis Waldron\",\n" +
" \"address1\": \"78 First St.\"\n" +
" },\n" +
" \"addons\": [\n" +
" {\n" +
" \"_id\": \"615a5cc37d3e8f4f499bd423\",\n" +
" \"name\": \"MEMBER ADDON YEARLY\",\n" +
" \"quantity\": 1,\n" +
" \"amount\": {\n" +
" \"unit\": \"$\",\n" +
" \"currency\": \"USD\",\n" +
" \"value\": \"119.88\"\n" +
" }\n" +
" }\n" +
" ],\n" +
" \"discounts\": [],\n" +
" \"taxes\": []\n" +
"}");
String url = "https://api.blixo.com/v1/subscriptions";
String encoding = Base64.getEncoder().encodeToString(("{API_KEY}:".getBytes()));
Request request = new Request.Builder()
.url(url)
.method("POST", body)
.addHeader("Authorization", "Basic " + encoding)
.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": "63639887bc92e4015ccaa8ba",
"name": "Custom Bundle Subscription",
"subscriptionNo": "",
"companyId": "622294998bec060152bcad9c",
"customerId": "62f135085ff37c016a57f0eb",
"planId": "635b846efd32b4015e697f0e",
"planAmount": {
"currency": "USD",
"unit": "$",
"value": 2
},
"planQuantity": 1,
"contractPeriod": "MONTHLY",
"contractQuantity": 2,
"contractRenewal": "MANUALLY",
"interval": "months",
"intervalCount": 1,
"billingCycle": 2,
"addons": [],
"discounts": [],
"taxes": [],
"shippings": [],
"shippingAmount": {
"currency": "USD",
"value": 0,
"unit": "$"
},
"discountAmount": {
"currency": "USD",
"value": 0,
"unit": "$"
},
"taxAmount": {
"currency": "USD",
"value": 0,
"unit": "$"
},
"subTotalAmount": {
"currency": "USD",
"value": 2,
"unit": "$"
},
"totalAmount": {
"currency": "USD",
"value": 2,
"unit": "$"
},
"invoices": [
"63639887bc92e4015ccaa94e"
],
"currentInvoice": {
"items": [
{
"name": "2",
"rate": {
"value": 2,
"unit": "$",
"currency": "USD"
},
"quantity": 1,
"taxable": true,
"type": "Plan",
"fromDate": "2022-11-03T10:31:35.875Z",
"toDate": "2022-12-03T10:31:35.875Z",
"_id": "635b846efd32b4015e697f0e",
"integrations": {
"shopify": {
"customerId": "6244557389988",
"orderId": "",
"orderUrl": "",
"productId": "",
"variantId": ""
}
}
}
]
},
"upcomingInvoice": {
"items": [
{
"name": "2",
"rate": {
"value": 2,
"unit": "$",
"currency": "USD"
},
"quantity": 1,
"taxable": true,
"type": "Plan",
"fromDate": "2022-12-03T10:31:35.875Z",
"toDate": "2023-01-03T10:31:35+00:00",
"_id": "635b846efd32b4015e697f0e",
"integrations": {
"shopify": {
"customerId": "6244557389988",
"orderId": "",
"orderUrl": "",
"productId": "",
"variantId": ""
}
}
}
]
},
"proration": 0,
"startDate": "2022-11-03T10:31:35.875Z",
"endDate": "2023-01-03T10:31:35.875Z",
"startedDate": "2022-11-03T10:31:35.875Z",
"paymentDay": 0,
"issueInvoiceDays": 3,
"startInvoiceDate": "2022-11-03T10:31:35.875Z",
"paymentDate": "2022-11-03T10:31:35.875Z",
"nextIssueInvoiceDate": "2022-11-30T10:31:35.875Z",
"nextInvoiceDate": "2022-12-03T10:31:35.875Z",
"nextPaymentDate": "2022-12-03T10:31:35.875Z",
"status": "ACTIVE",
"oldPlanId": null,
"oldPlanAmount": {
"currency": "USD",
"value": 0,
"unit": "$"
},
"shipTo": {
"name": "customer test",
"attn": "customer h",
"address1": "asdf",
"address2": "asdf",
"city": "asdf",
"country": "US",
"state": "FL",
"zipCode": "33024"
},
"cancelAtPeriodEnd": false,
"customerFromPortal": false,
"createdAt": "2022-11-03T10:31:35.875Z",
"updatedAt": "2022-11-03T10:31:36.895Z",
"source": "BLIXO",
"integrations": {
"shopify": {
"customerId": "6244557389988",
"orderId": "",
"orderUrl": "",
"productId": "",
"variantId": ""
}
},
"planDetail": {
"code": "CUPL-00393",
"type": "CUSTOM",
"itemId": null,
"interval": "months",
"intervalCount": -2222,
"pricingMode": "per_unit",
"taxable": true,
"isTemplate": false,
"_id": "635b846efd32b4015e697f0e",
"name": "2",
"companyId": "622294998bec060152bcad9c",
"price": {
"unit": "$",
"currency": "USD",
"value": 2
},
"createdAt": "2022-10-28T07:27:42.909Z",
"updatedAt": "2022-10-29T06:15:44.841Z",
"__v": 0,
"integrations": {
"bigquery": {
"lastSynced": "2022-10-28T08:00:02.861Z"
}
},
"deletedAt": "2022-10-29T06:15:44.840Z",
"deletedBy": "6222930b8bec060152bcad67"
},
"upcomingInvoiceDetail": {
"items": [
{
"amount": {
"value": 2,
"unit": "$",
"currency": "USD"
},
"companyId": "622294998bec060152bcad9c",
"discountable": false,
"hasDefaultPrice": false,
"interval": "months",
"intervalCount": 1,
"itemId": null,
"name": "Custom Bundle Subscription",
"description": "",
"rate": {
"value": 2,
"unit": "$",
"currency": "USD"
},
"quantity": 1,
"pricingMode": "per_unit",
"taxable": true,
"taxes": [],
"type": "Plan",
"itemType": "NONE",
"fromDate": "2022-12-03T10:31:35.875Z",
"toDate": "2023-01-03T10:31:35+00:00",
"integrations": {
"shopify": {
"customerId": "6244557389988",
"orderId": "",
"orderUrl": "",
"productId": "",
"variantId": ""
}
},
"discountAmount": {
"value": 0,
"unit": "$"
},
"discountedAmount": {
"value": 2,
"unit": "$",
"currency": "USD"
}
}
],
"subTotalAmount": {
"value": 2,
"unit": "$",
"currency": "USD"
},
"discountAmount": {
"value": 0,
"unit": "$",
"currency": "USD"
},
"taxAmount": {
"value": 0,
"unit": "$",
"currency": "USD"
},
"taxLines": [],
"totalAmount": {
"value": 2,
"unit": "$",
"currency": "USD"
},
"shippingAmount": {
"value": 0,
"unit": "$"
},
"shippingLines": [],
"discountLines": []
}
}
}
This API endpoint allows you to create a new subscription. It's as simple as sending a POST request to https://api.blixo.com/v1/subscriptions
. Think of it as telling the server, "Hey, I want to create a new subscription!" And the server responds by creating the subscription for you!
HTTP Request
POST https://api.blixo.com/v1/subscriptions
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. |
planId | String | (required) The ID of the plan. |
startDate | String | The start date of the subscription. |
paymentDay | Integer | The payment day of the subscription. |
issueInvoiceDays | Integer | The number of days to issue the invoice. |
contractQuantity | Integer | The contract quantity of the subscription. |
contractPeriod | String | The contract period of the subscription. |
contractRenewal | String | The contract renewal of the subscription. |
shipTo | Object | The shipping details of the subscription. |
addons | Array | The addons of the subscription. |
discounts | Array | The discounts of the subscription. |
taxes | Array | The taxes of the subscription. |
status | String | The status of the subscription. e.g. ACTIVE , CANCELED |
planAmount | Object | The plan amount object includes currency , unit , value |
planQuantity | Integer | The plan quantity of the subscription. |
Example
To create a new subscription, you would send a POST request to https://api.blixo.com/v1/subscriptions
. Remember to replace {API_KEY}
with your actual API key.
Response
The response will be a JSON object with a data
key containing the details of the newly created subscription. 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.
Update a subscription
curl "https://api.blixo.com/v1/subscriptions/:subscriptionId" \
-u {API_KEY}: \
-d companyId="60e1b7f0c6ef4219ff51824c" \
-d planId="61556ed175b9f7e7b3486dac" \
-d startDate="2021-08-22T17:18:17.182Z" \
-d paymentDay=0 \
-d issueInvoiceDays=0 \
-d contractQuantity=1 \
-d contractPeriod="YEARLY" \
-d contractRenewal="AUTO_RENEW" \
-d shipTo[name]="Travis Waldron" \
-d shipTo[address1]="78 First St." \
-d addons[0][_id]="615a5cc37d3e8f4f499bd423" \
-d addons[0][name]="MEMBER ADDON YEARLY" \
-d addons[0][quantity]=1 \
-d addons[0][amount][unit]="$" \
-d addons[0][amount][currency]="USD" \
-d addons[0][amount][value]="119.88" \
-d discounts=[] \
-d taxes=[] \
-X PATCH
const fetch = require('node-fetch');
const url = 'https://api.blixo.com/v1/subscriptions/:subscriptionId';
const options = {
method: 'PATCH',
headers: {
'Authorization': 'Basic ' + {API_KEY},
'Content-Type': 'application/json'
},
body: JSON.stringify({
companyId: '60e1b7f0c6ef4219ff51824c',
planId: '61556ed175b9f7e7b3486dac',
startDate: '2021-08-22T17:18:17.182Z',
paymentDay: 0,
issueInvoiceDays: 0,
contractQuantity: 1,
contractPeriod: 'YEARLY',
contractRenewal: 'AUTO_RENEW',
shipTo: {
name: 'Travis Waldron',
address1: '78 First St.'
},
addons: [
{
_id: '615a5cc37d3e8f4f499bd423',
name: 'MEMBER ADDON YEARLY',
quantity: 1,
amount: {
unit: '$',
currency: 'USD',
value: '119.88'
}
}
],
discounts: [],
taxes: []
})
};
fetch(url, options);
<?php
$url = 'https://api.blixo.com/v1/subscriptions/:subscriptionId';
$data = array(
'companyId' => '60e1b7f0c6ef4219ff51824c',
'planId' => '61556ed175b9f7e7b3486dac',
'startDate' => '2021-08-22T17:18:17.182Z',
'paymentDay' => 0,
'issueInvoiceDays' => 0,
'contractQuantity' => 1,
'contractPeriod' => 'YEARLY',
'contractRenewal' => 'AUTO_RENEW',
'shipTo' => array(
'name' => 'Travis Waldron',
'address1' => '78 First St.'
),
'addons' => array(
array(
'_id' => '615a5cc37d3e8f4f499bd423',
'name' => 'MEMBER ADDON YEARLY',
'quantity' => 1,
'amount' => array(
'unit' => '$',
'currency' => 'USD',
'value' => '119.88'
)
)
),
'discounts' => array(),
'taxes' => array()
);
$options = array(
'http' => array(
'header' => "Content-type: application/json\r\nAuthorization: Basic " . {API_KEY},
'method' => 'PATCH',
'content' => json_encode($data)
)
);
$context = stream_context_create($options);
$result = file_get_contents($url, false, $context);
?>
require 'net/http'
require 'uri'
require 'json'
uri = URI.parse('https://api.blixo.com/v1/subscriptions/:subscriptionId')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(uri.request_uri, {
'Content-Type' => 'application/json',
'Authorization' => 'Basic ' + {API_KEY}
})
request.body = {
companyId: '60e1b7f0c6ef4219ff51824c',
planId: '61556ed175b9f7e7b3486dac',
startDate: '2021-08-22T17:18:17.182Z',
paymentDay: 0,
issueInvoiceDays: 0,
contractQuantity: 1,
contractPeriod: 'YEARLY',
contractRenewal: 'AUTO_RENEW',
shipTo: {
name: 'Travis Waldron',
address1: '78 First St.'
},
addons: [
{
_id: '615a5cc37d3e8f4f499bd423',
name: 'MEMBER ADDON YEARLY',
quantity: 1,
amount: {
unit: '$',
currency: 'USD',
value: '119.88'
}
}
],
discounts: [],
taxes: []
}.to_json
response = http.request(request)
import requests
import json
url = 'https://api.blixo.com/v1/subscriptions/:subscriptionId'
headers = {
'Content-Type': 'application/json',
'Authorization': 'Basic ' + {API_KEY}
}
data = {
'companyId': '60e1b7f0c6ef4219ff51824c',
'planId': '61556ed175b9f7e7b3486dac',
'startDate': '2021-08-22T17:18:17.182Z',
'paymentDay': 0,
'issueInvoiceDays': 0,
'contractQuantity': 1,
'contractPeriod': 'YEARLY',
'contractRenewal': 'AUTO_RENEW',
'shipTo': {
'name': 'Travis Waldron',
'address1': '78 First St.'
},
'addons': [
{
'_id': '615a5cc37d3e8f4f499bd423',
'name': 'MEMBER ADDON YEARLY',
'quantity': 1,
'amount': {
'unit': '$',
'currency': 'USD',
'value': '119.88'
}
}
],
'discounts': [],
'taxes': []
}
response = requests.patch(url, headers=headers, data=json.dumps(data))
package main
import (
"bytes"
"net/http"
"encoding/json"
)
func main() {
url := "https://api.blixo.com/v1/subscriptions/:subscriptionId"
var data = map[string]interface{}{
"companyId": "60e1b7f0c6ef4219ff51824c",
"planId": "61556ed175b9f7e7b3486dac",
"startDate": "2021-08-22T17:18:17.182Z",
"paymentDay": 0,
"issueInvoiceDays": 0,
"contractQuantity": 1,
"contractPeriod": "YEARLY",
"contractRenewal": "AUTO_RENEW",
"shipTo": map[string]string{
"name": "Travis Waldron",
"address1": "78 First St.",
},
"addons": []map[string]interface{}{
{
"_id": "615a5cc37d3e8f4f499bd423",
"name": "MEMBER ADDON YEARLY",
"quantity": 1,
"amount": map[string]string{
"unit": "$",
"currency": "USD",
"value": "119.88",
},
},
},
"discounts": []string{},
"taxes": []string{},
}
jsonData, _ := json.Marshal(data)
req, _ := 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, _ := client.Do(req)
defer resp.Body.Close()
}
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/subscriptions/:subscriptionId";
var data = new
{
companyId = "60e1b7f0c6ef4219ff51824c",
planId = "61556ed175b9f7e7b3486dac",
startDate = "2021-08-22T17:18:17.182Z",
paymentDay = 0,
issueInvoiceDays = 0,
contractQuantity = 1,
contractPeriod = "YEARLY",
contractRenewal = "AUTO_RENEW",
shipTo = new { name = "Travis Waldron", address1 = "78 First St." },
addons = new[] {
new {
_id = "615a5cc37d3e8f4f499bd423",
name = "MEMBER ADDON YEARLY",
quantity = 1,
amount = new { unit = "$", currency = "USD", value = "119.88" }
}
},
discounts = new string[] { },
taxes = new string[] { }
};
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;
}
}
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.URI;
import java.util.HashMap;
import java.util.Map;
import com.google.gson.Gson;
public class Main {
public static void main(String[] args) {
HttpClient client = HttpClient.newHttpClient();
Map<Object, Object> data = new HashMap<>();
data.put("companyId", "60e1b7f0c6ef4219ff51824c");
data.put("planId", "61556ed175b9f7e7b3486dac");
data.put("startDate", "2021-08-22T17:18:17.182Z");
data.put("paymentDay", 0);
data.put("issueInvoiceDays", 0);
data.put("contractQuantity", 1);
data.put("contractPeriod", "YEARLY");
data.put("contractRenewal", "AUTO_RENEW");
Map<String, String> shipTo = new HashMap<>();
shipTo.put("name", "Travis Waldron");
shipTo.put("address1", "78 First St.");
data.put("shipTo", shipTo);
Map<String, String> addon = new HashMap<>();
addon.put("_id", "615a5cc37d3e8f4f499bd423");
addon.put("name", "MEMBER ADDON YEARLY");
addon.put("quantity", "1");
Map<String, String> amount = new HashMap<>();
amount.put("unit", "$");
amount.put("currency", "USD");
amount.put("value", "119.88");
addon.put("amount", amount);
data.put("addons", addon);
data.put("discounts", new String[]{});
data.put("taxes", new String[]{});
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.blixo.com/v1/subscriptions/:subscriptionId"))
.header("Content-Type", "application/json")
.header("Authorization", "Basic " + {API_KEY})
.method("PATCH", HttpRequest.BodyPublishers.ofString(new Gson().toJson(data)))
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
}
}
The above command returns JSON structured like this:
{
"data": {
"id": "63639887bc92e4015ccaa8ba",
"name": "Custom Bundle Subscription",
"subscriptionNo": "",
"companyId": "622294998bec060152bcad9c",
"customerId": "62f135085ff37c016a57f0eb",
"planId": "635b846efd32b4015e697f0e",
"planAmount": {
"currency": "USD",
"unit": "$",
"value": 2
},
"planQuantity": 1,
"contractPeriod": "MONTHLY",
"contractQuantity": 2,
"contractRenewal": "MANUALLY",
"interval": "months",
"intervalCount": 1,
"billingCycle": 2,
"addons": [],
"discounts": [],
"taxes": [],
"shippings": [],
"shippingAmount": {
"currency": "USD",
"value": 0,
"unit": "$"
},
"discountAmount": {
"currency": "USD",
"value": 0,
"unit": "$"
},
"taxAmount": {
"currency": "USD",
"value": 0,
"unit": "$"
},
"subTotalAmount": {
"currency": "USD",
"value": 2,
"unit": "$"
},
"totalAmount": {
"currency": "USD",
"value": 2,
"unit": "$"
},
"invoices": [
"63639887bc92e4015ccaa94e"
],
"currentInvoice": {
"items": [
{
"name": "2",
"rate": {
"value": 2,
"unit": "$",
"currency": "USD"
},
"quantity": 1,
"taxable": true,
"type": "Plan",
"fromDate": "2022-11-03T10:31:35.875Z",
"toDate": "2022-12-03T10:31:35.875Z",
"_id": "635b846efd32b4015e697f0e",
"integrations": {
"shopify": {
"customerId": "6244557389988",
"orderId": "",
"orderUrl": "",
"productId": "",
"variantId": ""
}
}
}
]
},
"upcomingInvoice": {
"items": [
{
"name": "2",
"rate": {
"value": 2,
"unit": "$",
"currency": "USD"
},
"quantity": 1,
"taxable": true,
"type": "Plan",
"fromDate": "2022-12-03T10:31:35.875Z",
"toDate": "2023-01-03T10:31:35+00:00",
"_id": "635b846efd32b4015e697f0e",
"integrations": {
"shopify": {
"customerId": "6244557389988",
"orderId": "",
"orderUrl": "",
"productId": "",
"variantId": ""
}
}
}
]
},
"proration": 0,
"startDate": "2022-11-03T10:31:35.875Z",
"endDate": "2023-01-03T10:31:35.000Z",
"startedDate": "2022-11-03T10:31:35.875Z",
"paymentDay": 0,
"issueInvoiceDays": 3,
"startInvoiceDate": "2022-11-03T10:31:35.875Z",
"paymentDate": "2022-11-03T10:31:35.875Z",
"nextIssueInvoiceDate": "2022-11-30T10:31:35.875Z",
"nextInvoiceDate": "2022-12-03T10:31:35.875Z",
"nextPaymentDate": "2022-12-03T10:31:35.875Z",
"status": "ACTIVE",
"oldPlanId": null,
"oldPlanAmount": {
"currency": "USD",
"value": 0,
"unit": "$"
},
"shipTo": {
"name": "customer test",
"attn": "customer h",
"address1": "asdf",
"address2": "asdf",
"city": "asdf",
"country": "US",
"state": "FL",
"zipCode": "33024"
},
"cancelAtPeriodEnd": false,
"customerFromPortal": false,
"createdAt": "2022-11-03T10:31:35.875Z",
"updatedAt": "2022-11-03T10:50:19.940Z",
"source": "BLIXO",
"integrations": {
"shopify": {
"customerId": "6244557389988",
"orderId": "",
"orderUrl": "",
"productId": "",
"variantId": ""
}
},
"planDetail": {
"code": "CUPL-00393",
"type": "CUSTOM",
"itemId": null,
"interval": "months",
"intervalCount": -2222,
"pricingMode": "per_unit",
"taxable": true,
"isTemplate": false,
"_id": "635b846efd32b4015e697f0e",
"name": "2",
"companyId": "622294998bec060152bcad9c",
"price": {
"unit": "$",
"currency": "USD",
"value": 2
},
"createdAt": "2022-10-28T07:27:42.909Z",
"updatedAt": "2022-10-29T06:15:44.841Z",
"__v": 0,
"integrations": {
"bigquery": {
"lastSynced": "2022-10-28T08:00:02.861Z"
}
},
"deletedAt": "2022-10-29T06:15:44.840Z",
"deletedBy": "6222930b8bec060152bcad67"
},
"upcomingInvoiceDetail": {
"items": [
{
"amount": {
"value": 2,
"unit": "$",
"currency": "USD"
},
"companyId": "622294998bec060152bcad9c",
"discountable": false,
"hasDefaultPrice": false,
"interval": "months",
"intervalCount": 1,
"itemId": null,
"name": "Custom Bundle Subscription",
"description": "",
"rate": {
"value": 2,
"unit": "$",
"currency": "USD"
},
"quantity": 1,
"pricingMode": "per_unit",
"taxable": true,
"taxes": [],
"type": "Plan",
"itemType": "NONE",
"fromDate": "2022-12-03T10:31:35.875Z",
"toDate": "2023-01-03T10:31:35+00:00",
"integrations": {
"shopify": {
"customerId": "6244557389988",
"orderId": "",
"orderUrl": "",
"productId": "",
"variantId": ""
}
},
"discountAmount": {
"value": 0,
"unit": "$"
},
"discountedAmount": {
"value": 2,
"unit": "$",
"currency": "USD"
}
}
],
"subTotalAmount": {
"value": 2,
"unit": "$",
"currency": "USD"
},
"discountAmount": {
"value": 0,
"unit": "$",
"currency": "USD"
},
"taxAmount": {
"value": 0,
"unit": "$",
"currency": "USD"
},
"taxLines": [],
"totalAmount": {
"value": 2,
"unit": "$",
"currency": "USD"
},
"shippingAmount": {
"value": 0,
"unit": "$"
},
"shippingLines": [],
"discountLines": []
}
}
}
This API endpoint allows you to update an existing subscription. It's as simple as sending a PATCH request to https://api.blixo.com/v1/subscriptions/:subscriptionId
. Think of it as telling the server, "Hey, I want to update this subscription!" And the server responds by updating the subscription for you!
HTTP Request
PATCH https://api.blixo.com/v1/subscriptions/:subscriptionId
Headers
Key | Value |
---|---|
Authorization | Basic {API_KEY} |
Parameters
Parameter | Type | Description |
---|---|---|
subscriptionId | String | (required) The ID of the subscription. |
companyId | String | (required) The ID of the company. |
customerId | String | (required) The ID of the customer. |
planId | String | (required) The ID of the plan. |
startDate | String | The start date of the subscription. |
paymentDay | Integer | The payment day of the subscription. |
issueInvoiceDays | Integer | The number of days to issue the invoice in advance. |
contractQuantity | Integer | The contract quantity of the subscription. |
contractPeriod | String | The contract period of the subscription. e.g. MONTHLY , NONE |
contractRenewal | String | The contract renewal of the subscription. e.g. AUTO_RENEW , MANUALLY , NONE |
shipTo | Object | The shipping details of the subscription. Includes address1 , address2 , attn , city , country , phones , state , zipCode |
addons | Array | An array of addons. Each addon is an object includes _id_ , name , quantity , amount |
discounts | Array | An array of discount items. |
taxes | Array | An array of tax items. |
status | String | The status of the subscription. e.g. ACTIVE , CANCELED |
planAmount | Object | The plan amount object includes currency , unit , value |
planQuantity | Integer | The plan quantity of the subscription. |
billingCycle | Integer | The billing cycle of the subscription. |
interval | String | The interval of the subscription. e.g. months |
intervalCount | Integer | The interval count of the subscription. |
Example
To update a subscription, you would send a PATCH request to https://api.blixo.com/v1/subscriptions/:subscriptionId
. Remember to replace {API_KEY}
and :subscriptionId
with your actual API key and the ID of the subscription you want to update.
Response
The response will be a JSON object with a data
key containing the details of the updated subscription. 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 subscription
curl "https://api.blixo.com/v1/subscriptions/:subscriptionId" \
-u {API_KEY}: \
-X DELETE
const fetch = require('node-fetch');
const url = 'https://api.blixo.com/v1/subscriptions/:subscriptionId';
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/subscriptions/:subscriptionId",
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'
require 'base64'
url = URI("https://api.blixo.com/v1/subscriptions/:subscriptionId")
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
import base64
url = "https://api.blixo.com/v1/subscriptions/:subscriptionId"
api_key = "{API_KEY}"
headers = {
"Authorization": "Basic " + base64.b64encode((api_key + ":").encode()).decode()
}
response = requests.delete(url, headers=headers)
print(response.text)
package main
import (
"fmt"
"net/http"
"io/ioutil"
"encoding/base64"
)
func main() {
url := "https://api.blixo.com/v1/subscriptions/:subscriptionId"
req, _ := http.NewRequest("DELETE", 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.Delete,
RequestUri = new Uri("https://api.blixo.com/v1/subscriptions/:subscriptionId"),
};
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/subscriptions/:subscriptionId";
String encoding = Base64.getEncoder().encodeToString(("{API_KEY}:".getBytes()));
Request request = new Request.Builder()
.url(url)
.delete()
.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": "611d4216a747250146ade2cf"
}
This API endpoint allows you to remove an existing subscription. It's as simple as sending a DELETE request to https://api.blixo.com/v1/subscriptions/:subscriptionId
. Think of it as telling the server, "Hey, I want to delete this subscription!" And the server responds by deleting the subscription for you!
HTTP Request
DELETE https://api.blixo.com/v1/subscriptions/:subscriptionId
Headers
Key | Value |
---|---|
Authorization | Basic {API_KEY} |
Parameters
Parameter | Type | Description |
---|---|---|
subscriptionId | String | (required) The ID of the subscription. |
Example
To delete a subscription, you would send a DELETE request to https://api.blixo.com/v1/subscriptions/:subscriptionId
. Remember to replace {API_KEY}
and :subscriptionId
with your actual API key and the ID of the subscription you want to delete.
Response
The response will be a JSON object with a data
key containing the ID of the deleted subscription. 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.
Pause a subscription
curl "https://api.blixo.com/v1/subscriptions/:subscriptionId/pause" \
-u {API_KEY}: \
-X PATCH
const fetch = require('node-fetch');
const url = 'https://api.blixo.com/v1/subscriptions/:subscriptionId/pause';
const options = {
method: 'PATCH',
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/subscriptions/:subscriptionId/pause",
CURLOPT_CUSTOMREQUEST => "PATCH",
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/subscriptions/:subscriptionId/pause")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Patch.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/subscriptions/:subscriptionId/pause"
api_key = "{API_KEY}"
headers = {
"Authorization": "Basic " + base64.b64encode((api_key + ":").encode()).decode()
}
response = requests.patch(url, headers=headers)
print(response.text)
package main
import (
"fmt"
"net/http"
"io/ioutil"
"encoding/base64"
)
func main() {
url := "https://api.blixo.com/v1/subscriptions/:subscriptionId/pause"
req, _ := http.NewRequest("PATCH", 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 = new HttpMethod("PATCH"),
RequestUri = new Uri("https://api.blixo.com/v1/subscriptions/:subscriptionId/pause"),
};
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/subscriptions/:subscriptionId/pause";
String encoding = Base64.getEncoder().encodeToString(("{API_KEY}:".getBytes()));
Request request = new Request.Builder()
.url(url)
.patch(okhttp3.RequestBody.create("", null))
.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": "63639887bc92e4015ccaa8ba",
"name": "Custom Bundle Subscription",
"subscriptionNo": "",
"companyId": "622294998bec060152bcad9c",
"customerId": "62f135085ff37c016a57f0eb",
"planId": "635b846efd32b4015e697f0e",
"planAmount": {
"currency": "USD",
"unit": "$",
"value": 2
},
"planQuantity": 1,
"contractPeriod": "MONTHLY",
"contractQuantity": 2,
"contractRenewal": "MANUALLY",
"interval": "months",
"intervalCount": 1,
"billingCycle": 2,
"addons": [],
"discounts": [],
"taxes": [],
"shippings": [],
"shippingAmount": {
"currency": "USD",
"value": 0,
"unit": "$"
},
"discountAmount": {
"currency": "USD",
"value": 0,
"unit": "$"
},
"taxAmount": {
"currency": "USD",
"value": 0,
"unit": "$"
},
"subTotalAmount": {
"currency": "USD",
"value": 2,
"unit": "$"
},
"totalAmount": {
"currency": "USD",
"value": 2,
"unit": "$"
},
"invoices": [
"63639887bc92e4015ccaa94e"
],
"currentInvoice": {
"items": [
{
"name": "2",
"rate": {
"value": 2,
"unit": "$",
"currency": "USD"
},
"quantity": 1,
"taxable": true,
"type": "Plan",
"fromDate": "2022-11-03T10:31:35.875Z",
"toDate": "2022-12-03T10:31:35.875Z",
"_id": "635b846efd32b4015e697f0e",
"integrations": {
"shopify": {
"customerId": "6244557389988",
"orderId": "",
"orderUrl": "",
"productId": "",
"variantId": ""
}
}
}
]
},
"upcomingInvoice": {
"items": [
{
"name": "2",
"rate": {
"value": 2,
"unit": "$",
"currency": "USD"
},
"quantity": 1,
"taxable": true,
"type": "Plan",
"fromDate": "2022-12-03T10:31:35.875Z",
"toDate": "2023-01-03T10:31:35+00:00",
"_id": "635b846efd32b4015e697f0e",
"integrations": {
"shopify": {
"customerId": "6244557389988",
"orderId": "",
"orderUrl": "",
"productId": "",
"variantId": ""
}
}
}
]
},
"proration": 0,
"startDate": "2022-11-03T10:31:35.875Z",
"endDate": "2023-01-03T10:31:35.000Z",
"startedDate": "2022-11-03T10:31:35.875Z",
"paymentDay": 0,
"issueInvoiceDays": 3,
"startInvoiceDate": "2022-11-03T10:31:35.875Z",
"paymentDate": "2022-11-03T10:31:35.875Z",
"nextIssueInvoiceDate": "2022-11-30T10:31:35.875Z",
"nextInvoiceDate": "2022-12-03T10:31:35.875Z",
"nextPaymentDate": "2022-12-03T10:31:35.875Z",
"status": "PAUSED",
"oldPlanId": null,
"oldPlanAmount": {
"currency": "USD",
"value": 0,
"unit": "$"
},
"shipTo": {
"name": "customer test",
"attn": "customer h",
"address1": "asdf",
"address2": "asdf",
"city": "asdf",
"country": "US",
"state": "FL",
"zipCode": "33024"
},
"cancelAtPeriodEnd": false,
"customerFromPortal": false,
"createdAt": "2022-11-03T10:31:35.875Z",
"updatedAt": "2022-11-03T14:00:02.982Z",
"source": "BLIXO",
"integrations": {
"shopify": {
"customerId": "6244557389988",
"orderId": "",
"orderUrl": "",
"productId": "",
"variantId": ""
},
"bigquery": {
"lastLineItemsSynced": "2022-11-03T12:00:02.214Z",
"lastSynced": "2022-11-03T12:00:03.761Z"
}
},
"planDetail": {
"code": "CUPL-00393",
"type": "CUSTOM",
"itemId": null,
"interval": "months",
"intervalCount": -2222,
"pricingMode": "per_unit",
"taxable": true,
"isTemplate": false,
"_id": "635b846efd32b4015e697f0e",
"name": "2",
"companyId": "622294998bec060152bcad9c",
"price": {
"unit": "$",
"currency": "USD",
"value": 2
},
"createdAt": "2022-10-28T07:27:42.909Z",
"updatedAt": "2022-10-29T06:15:44.841Z",
"__v": 0,
"integrations": {
"bigquery": {
"lastSynced": "2022-10-28T08:00:02.861Z"
}
},
"deletedAt": "2022-10-29T06:15:44.840Z",
"deletedBy": "6222930b8bec060152bcad67"
},
"upcomingInvoiceDetail": {
"items": [
{
"amount": {
"value": 2,
"unit": "$",
"currency": "USD"
},
"companyId": "622294998bec060152bcad9c",
"discountable": false,
"hasDefaultPrice": false,
"interval": "months",
"intervalCount": 1,
"itemId": null,
"name": "Custom Bundle Subscription",
"description": "",
"rate": {
"value": 2,
"unit": "$",
"currency": "USD"
},
"quantity": 1,
"pricingMode": "per_unit",
"taxable": true,
"taxes": [],
"type": "Plan",
"itemType": "NONE",
"fromDate": "2022-12-03T10:31:35.875Z",
"toDate": "2023-01-03T10:31:35+00:00",
"integrations": {
"shopify": {
"customerId": "6244557389988",
"orderId": "",
"orderUrl": "",
"productId": "",
"variantId": ""
},
"bigquery": {
"lastLineItemsSynced": "2022-11-03T12:00:02.214Z",
"lastSynced": "2022-11-03T12:00:03.761Z"
}
},
"discountAmount": {
"value": 0,
"unit": "$"
},
"discountedAmount": {
"value": 2,
"unit": "$",
"currency": "USD"
}
}
],
"subTotalAmount": {
"value": 2,
"unit": "$",
"currency": "USD"
},
"discountAmount": {
"value": 0,
"unit": "$",
"currency": "USD"
},
"taxAmount": {
"value": 0,
"unit": "$",
"currency": "USD"
},
"taxLines": [],
"totalAmount": {
"value": 2,
"unit": "$",
"currency": "USD"
},
"shippingAmount": {
"value": 0,
"unit": "$"
},
"shippingLines": [],
"discountLines": []
}
}
}
This API endpoint allows you to pause an existing subscription. It's as simple as sending a PATCH request to https://api.blixo.com/v1/subscriptions/:subscriptionId/pause
. Think of it as telling the server, "Hey, I want to pause this subscription!" And the server responds by pausing the subscription for you!
HTTP Request
PATCH https://api.blixo.com/v1/subscriptions/:subscriptionId/pause
Headers
Key | Value |
---|---|
Authorization | Basic {API_KEY} |
Parameters
Parameter | Type | Description |
---|---|---|
subscriptionId | String | (required) The ID of the subscription. |
Example
To pause a subscription, you would send a PATCH request to https://api.blixo.com/v1/subscriptions/:subscriptionId/pause
. Remember to replace {API_KEY}
and :subscriptionId
with your actual API key and the ID of the subscription you want to pause.
Response
The response will be a JSON object with a data
key containing the details of the paused subscription. 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.
Resume a subscription
curl "https://api.blixo.com/v1/subscriptions/:subscriptionId/resume" \
-u {API_KEY}: \
-X PATCH
const fetch = require('node-fetch');
const url = 'https://api.blixo.com/v1/subscriptions/:subscriptionId/resume';
const options = {
method: 'PATCH',
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/subscriptions/:subscriptionId/resume",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "PATCH",
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/subscriptions/:subscriptionId/resume")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Patch.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/subscriptions/:subscriptionId/resume"
api_key = "{API_KEY}"
headers = {
"Authorization": "Basic " + base64.b64encode((api_key + ":").encode()).decode()
}
response = requests.patch(url, headers=headers)
print(response.text)
package main
import (
"fmt"
"net/http"
"io/ioutil"
"encoding/base64"
)
func main() {
url := "https://api.blixo.com/v1/subscriptions/:subscriptionId/resume"
req, _ := http.NewRequest("PATCH", 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 = new HttpMethod("PATCH"),
RequestUri = new Uri("https://api.blixo.com/v1/subscriptions/:subscriptionId/resume"),
};
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/subscriptions/:subscriptionId/resume";
String encoding = Base64.getEncoder().encodeToString(("{API_KEY}:".getBytes()));
Request request = new Request.Builder()
.url(url)
.patch(okhttp3.RequestBody.create("", null))
.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": "63639887bc92e4015ccaa8ba",
"name": "Custom Bundle Subscription",
"subscriptionNo": "",
"companyId": "622294998bec060152bcad9c",
"customerId": "62f135085ff37c016a57f0eb",
"planId": "635b846efd32b4015e697f0e",
"planAmount": {
"currency": "USD",
"unit": "$",
"value": 2
},
"planQuantity": 1,
"contractPeriod": "MONTHLY",
"contractQuantity": 2,
"contractRenewal": "MANUALLY",
"interval": "months",
"intervalCount": 1,
"billingCycle": 2,
"addons": [],
"discounts": [],
"taxes": [],
"shippings": [],
"shippingAmount": {
"currency": "USD",
"value": 0,
"unit": "$"
},
"discountAmount": {
"currency": "USD",
"value": 0,
"unit": "$"
},
"taxAmount": {
"currency": "USD",
"value": 0,
"unit": "$"
},
"subTotalAmount": {
"currency": "USD",
"value": 2,
"unit": "$"
},
"totalAmount": {
"currency": "USD",
"value": 2,
"unit": "$"
},
"invoices": [
"63639887bc92e4015ccaa94e"
],
"currentInvoice": {
"items": [
{
"name": "2",
"rate": {
"value": 2,
"unit": "$",
"currency": "USD"
},
"quantity": 1,
"taxable": true,
"type": "Plan",
"fromDate": "2022-11-03T10:31:35.875Z",
"toDate": "2022-12-03T10:31:35.875Z",
"_id": "635b846efd32b4015e697f0e",
"integrations": {
"shopify": {
"customerId": "6244557389988",
"orderId": "",
"orderUrl": "",
"productId": "",
"variantId": ""
}
}
}
]
},
"upcomingInvoice": {
"items": [
{
"name": "2",
"rate": {
"value": 2,
"unit": "$",
"currency": "USD"
},
"quantity": 1,
"taxable": true,
"type": "Plan",
"fromDate": "2022-12-03T10:31:35.875Z",
"toDate": "2023-01-03T10:31:35+00:00",
"_id": "635b846efd32b4015e697f0e",
"integrations": {
"shopify": {
"customerId": "6244557389988",
"orderId": "",
"orderUrl": "",
"productId": "",
"variantId": ""
}
}
}
]
},
"proration": 0,
"startDate": "2022-11-03T10:31:35.875Z",
"endDate": "2023-01-03T10:31:35.000Z",
"startedDate": "2022-11-03T10:31:35.875Z",
"paymentDay": 0,
"issueInvoiceDays": 3,
"startInvoiceDate": "2022-11-03T10:31:35.875Z",
"paymentDate": "2022-11-03T10:31:35.875Z",
"nextIssueInvoiceDate": "2022-11-30T10:31:35.875Z",
"nextInvoiceDate": "2022-12-04T10:31:35.875Z",
"nextPaymentDate": "2022-12-03T10:31:35.875Z",
"status": "ACTIVE",
"oldPlanId": null,
"oldPlanAmount": {
"currency": "USD",
"value": 0,
"unit": "$"
},
"shipTo": {
"name": "customer test",
"attn": "customer h",
"address1": "asdf",
"address2": "asdf",
"city": "asdf",
"country": "US",
"state": "FL",
"zipCode": "33024"
},
"cancelAtPeriodEnd": false,
"customerFromPortal": false,
"createdAt": "2022-11-03T10:31:35.875Z",
"updatedAt": "2022-11-03T14:13:03.810Z",
"source": "BLIXO",
"integrations": {
"shopify": {
"customerId": "6244557389988",
"orderId": "",
"orderUrl": "",
"productId": "",
"variantId": ""
},
"bigquery": {
"lastLineItemsSynced": "2022-11-03T12:00:02.214Z",
"lastSynced": "2022-11-03T12:00:03.761Z"
}
},
"planDetail": {
"code": "CUPL-00393",
"type": "CUSTOM",
"itemId": null,
"interval": "months",
"intervalCount": -2222,
"pricingMode": "per_unit",
"taxable": true,
"isTemplate": false,
"_id": "635b846efd32b4015e697f0e",
"name": "2",
"companyId": "622294998bec060152bcad9c",
"price": {
"unit": "$",
"currency": "USD",
"value": 2
},
"createdAt": "2022-10-28T07:27:42.909Z",
"updatedAt": "2022-10-29T06:15:44.841Z",
"__v": 0,
"integrations": {
"bigquery": {
"lastSynced": "2022-10-28T08:00:02.861Z"
}
},
"deletedAt": "2022-10-29T06:15:44.840Z",
"deletedBy": "6222930b8bec060152bcad67"
},
"upcomingInvoiceDetail": {
"items": [
{
"amount": {
"value": 2,
"unit": "$",
"currency": "USD"
},
"companyId": "622294998bec060152bcad9c",
"discountable": false,
"hasDefaultPrice": false,
"interval": "months",
"intervalCount": 1,
"itemId": null,
"name": "Custom Bundle Subscription",
"description": "",
"rate": {
"value": 2,
"unit": "$",
"currency": "USD"
},
"quantity": 1,
"pricingMode": "per_unit",
"taxable": true,
"taxes": [],
"type": "Plan",
"itemType": "NONE",
"fromDate": "2022-12-03T10:31:35.875Z",
"toDate": "2023-01-03T10:31:35+00:00",
"integrations": {
"shopify": {
"customerId": "6244557389988",
"orderId": "",
"orderUrl": "",
"productId": "",
"variantId": ""
},
"bigquery": {
"lastLineItemsSynced": "2022-11-03T12:00:02.214Z",
"lastSynced": "2022-11-03T12:00:03.761Z"
}
},
"discountAmount": {
"value": 0,
"unit": "$"
},
"discountedAmount": {
"value": 2,
"unit": "$",
"currency": "USD"
}
}
],
"subTotalAmount": {
"value": 2,
"unit": "$",
"currency": "USD"
},
"discountAmount": {
"value": 0,
"unit": "$",
"currency": "USD"
},
"taxAmount": {
"value": 0,
"unit": "$",
"currency": "USD"
},
"taxLines": [],
"totalAmount": {
"value": 2,
"unit": "$",
"currency": "USD"
},
"shippingAmount": {
"value": 0,
"unit": "$"
},
"shippingLines": [],
"discountLines": []
}
}
}
This API endpoint allows you to resume a paused subscription. It's as simple as sending a PATCH request to https://api.blixo.com/v1/subscriptions/:subscriptionId/resume
. Think of it as telling the server, "Hey, I want to resume this subscription!" And the server responds by resuming the subscription for you!
HTTP Request
PATCH https://api.blixo.com/v1/subscriptions/:subscriptionId/resume
Headers
Key | Value |
---|---|
Authorization | Basic {API_KEY} |
Parameters
Parameter | Type | Description |
---|---|---|
subscriptionId | String | (required) The ID of the subscription. |
Example
To resume a subscription, you would send a PATCH request to https://api.blixo.com/v1/subscriptions/:subscriptionId/resume
. Remember to replace {API_KEY}
and :subscriptionId
with your actual API key and the ID of the subscription you want to resume.
Response
The response will be a JSON object with a data
key containing the details of the resumed subscription. 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.
Cancel a subscription
curl "https://api.blixo.com/v1/subscriptions/:subscriptionId/cancel" \
-u {API_KEY}: \
-X PATCH
const fetch = require('node-fetch');
const url = 'https://api.blixo.com/v1/subscriptions/:subscriptionId/cancel';
const options = {
method: 'PATCH',
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/subscriptions/:subscriptionId/cancel",
CURLOPT_CUSTOMREQUEST => "PATCH",
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/subscriptions/:subscriptionId/cancel")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Patch.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/subscriptions/:subscriptionId/cancel"
api_key = "{API_KEY}"
headers = {
"Authorization": "Basic " + base64.b64encode((api_key + ":").encode()).decode()
}
response = requests.patch(url, headers=headers)
print(response.text)
package main
import (
"fmt"
"net/http"
"io/ioutil"
"encoding/base64"
)
func main() {
url := "https://api.blixo.com/v1/subscriptions/:subscriptionId/cancel"
req, _ := http.NewRequest("PATCH", 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.Patch,
RequestUri = new Uri("https://api.blixo.com/v1/subscriptions/:subscriptionId/cancel"),
};
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/subscriptions/:subscriptionId/cancel";
String encoding = Base64.getEncoder().encodeToString(("{API_KEY}:".getBytes()));
Request request = new Request.Builder()
.url(url)
.patch(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": "63639887bc92e4015ccaa8ba",
"name": "Custom Bundle Subscription",
"subscriptionNo": "",
"companyId": "622294998bec060152bcad9c",
"customerId": "62f135085ff37c016a57f0eb",
"planId": "635b846efd32b4015e697f0e",
"planAmount": {
"currency": "USD",
"unit": "$",
"value": 2
},
"planQuantity": 1,
"contractPeriod": "MONTHLY",
"contractQuantity": 2,
"contractRenewal": "MANUALLY",
"interval": "months",
"intervalCount": 1,
"billingCycle": 2,
"addons": [],
"discounts": [],
"taxes": [],
"shippings": [],
"shippingAmount": {
"currency": "USD",
"value": 0,
"unit": "$"
},
"discountAmount": {
"currency": "USD",
"value": 0,
"unit": "$"
},
"taxAmount": {
"currency": "USD",
"value": 0,
"unit": "$"
},
"subTotalAmount": {
"currency": "USD",
"value": 2,
"unit": "$"
},
"totalAmount": {
"currency": "USD",
"value": 2,
"unit": "$"
},
"invoices": [
"63639887bc92e4015ccaa94e"
],
"currentInvoice": {
"items": [
{
"name": "2",
"rate": {
"value": 2,
"unit": "$",
"currency": "USD"
},
"quantity": 1,
"taxable": true,
"type": "Plan",
"fromDate": "2022-11-03T10:31:35.875Z",
"toDate": "2022-12-03T10:31:35.875Z",
"_id": "635b846efd32b4015e697f0e",
"integrations": {
"shopify": {
"customerId": "6244557389988",
"orderId": "",
"orderUrl": "",
"productId": "",
"variantId": ""
}
}
}
]
},
"upcomingInvoice": {
"items": [
{
"name": "2",
"rate": {
"value": 2,
"unit": "$",
"currency": "USD"
},
"quantity": 1,
"taxable": true,
"type": "Plan",
"fromDate": "2022-12-03T10:31:35.875Z",
"toDate": "2023-01-03T10:31:35+00:00",
"_id": "635b846efd32b4015e697f0e",
"integrations": {
"shopify": {
"customerId": "6244557389988",
"orderId": "",
"orderUrl": "",
"productId": "",
"variantId": ""
}
}
}
]
},
"proration": 0,
"cancelReason": "",
"startDate": "2022-11-03T10:31:35.875Z",
"endDate": "2023-01-03T10:31:35.000Z",
"startedDate": "2022-11-03T10:31:35.875Z",
"paymentDay": 0,
"issueInvoiceDays": 3,
"startInvoiceDate": "2022-11-03T10:31:35.875Z",
"paymentDate": "2022-11-03T10:31:35.875Z",
"nextIssueInvoiceDate": "2022-11-30T10:31:35.875Z",
"nextInvoiceDate": "2022-12-04T10:31:35.875Z",
"nextPaymentDate": "2022-12-03T10:31:35.875Z",
"status": "CANCELED",
"oldPlanId": null,
"oldPlanAmount": {
"currency": "USD",
"value": 0,
"unit": "$"
},
"shipTo": {
"name": "customer test",
"attn": "customer h",
"address1": "asdf",
"address2": "asdf",
"city": "asdf",
"country": "US",
"state": "FL",
"zipCode": "33024"
},
"canceledAt": "2022-11-03T14:42:16.831Z",
"cancelAtPeriodEnd": false,
"customerFromPortal": false,
"createdAt": "2022-11-03T10:31:35.875Z",
"updatedAt": "2022-11-03T14:42:16.835Z",
"source": "BLIXO",
"integrations": {
"shopify": {
"customerId": "6244557389988",
"orderId": "",
"orderUrl": "",
"productId": "",
"variantId": ""
},
"bigquery": {
"lastLineItemsSynced": "2022-11-03T12:00:02.214Z",
"lastSynced": "2022-11-03T12:00:03.761Z"
}
},
"planDetail": {
"code": "CUPL-00393",
"type": "CUSTOM",
"itemId": null,
"interval": "months",
"intervalCount": -2222,
"pricingMode": "per_unit",
"taxable": true,
"isTemplate": false,
"_id": "635b846efd32b4015e697f0e",
"name": "2",
"companyId": "622294998bec060152bcad9c",
"price": {
"unit": "$",
"currency": "USD",
"value": 2
},
"createdAt": "2022-10-28T07:27:42.909Z",
"updatedAt": "2022-10-29T06:15:44.841Z",
"__v": 0,
"integrations": {
"bigquery": {
"lastSynced": "2022-10-28T08:00:02.861Z"
}
},
"deletedAt": "2022-10-29T06:15:44.840Z",
"deletedBy": "6222930b8bec060152bcad67"
},
"upcomingInvoiceDetail": {
"items": [
{
"amount": {
"value": 2,
"unit": "$",
"currency": "USD"
},
"companyId": "622294998bec060152bcad9c",
"discountable": false,
"hasDefaultPrice": false,
"interval": "months",
"intervalCount": 1,
"itemId": null,
"name": "Custom Bundle Subscription",
"description": "",
"rate": {
"value": 2,
"unit": "$",
"currency": "USD"
},
"quantity": 1,
"pricingMode": "per_unit",
"taxable": true,
"taxes": [],
"type": "Plan",
"itemType": "NONE",
"fromDate": "2022-12-03T10:31:35.875Z",
"toDate": "2023-01-03T10:31:35+00:00",
"integrations": {
"shopify": {
"customerId": "6244557389988",
"orderId": "",
"orderUrl": "",
"productId": "",
"variantId": ""
},
"bigquery": {
"lastLineItemsSynced": "2022-11-03T12:00:02.214Z",
"lastSynced": "2022-11-03T12:00:03.761Z"
}
},
"discountAmount": {
"value": 0,
"unit": "$"
},
"discountedAmount": {
"value": 2,
"unit": "$",
"currency": "USD"
}
}
],
"subTotalAmount": {
"value": 2,
"unit": "$",
"currency": "USD"
},
"discountAmount": {
"value": 0,
"unit": "$",
"currency": "USD"
},
"taxAmount": {
"value": 0,
"unit": "$",
"currency": "USD"
},
"taxLines": [],
"totalAmount": {
"value": 2,
"unit": "$",
"currency": "USD"
},
"shippingAmount": {
"value": 0,
"unit": "$"
},
"shippingLines": [],
"discountLines": []
}
}
}
This API endpoint allows you to cancel an existing subscription. It's as simple as sending a PATCH request to https://api.blixo.com/v1/subscriptions/:subscriptionId/cancel
. Think of it as telling the server, "Hey, I want to cancel this subscription!" And the server responds by cancelling the subscription for you!
HTTP Request
PATCH https://api.blixo.com/v1/subscriptions/:subscriptionId/cancel
Headers
Key | Value |
---|---|
Authorization | Basic {API_KEY} |
Parameters
Parameter | Type | Description |
---|---|---|
subscriptionId | String | (required) The ID of the subscription. |
cancelNow | Number | Number of time for cancel (End of contract term/Now/Select a date). Default 1. |
Example
To cancel a subscription, you would send a PATCH request to https://api.blixo.com/v1/subscriptions/:subscriptionId/cancel
. Remember to replace {API_KEY}
and :subscriptionId
with your actual API key and the ID of the subscription you want to cancel.
Response
The response will be a JSON object with a data
key containing the details of the cancelled subscription. 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.
Reactive a subscription
curl "https://api.blixo.com/v1/subscriptions/:subscriptionId/reactive" \
-u {API_KEY}: \
-X PATCH
const fetch = require('node-fetch');
const url = 'https://api.blixo.com/v1/subscriptions/:subscriptionId/reactive';
const options = {
method: 'PATCH',
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/subscriptions/:subscriptionId/reactive",
CURLOPT_CUSTOMREQUEST => "PATCH",
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/subscriptions/:subscriptionId/reactive")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Patch.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/subscriptions/:subscriptionId/reactive"
api_key = "{API_KEY}"
headers = {
"Authorization": "Basic " + base64.b64encode((api_key + ":").encode()).decode()
}
response = requests.patch(url, headers=headers)
print(response.text)
package main
import (
"fmt"
"net/http"
"io/ioutil"
"encoding/base64"
)
func main() {
url := "https://api.blixo.com/v1/subscriptions/:subscriptionId/reactive"
req, _ := http.NewRequest("PATCH", 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.Patch,
RequestUri = new Uri("https://api.blixo.com/v1/subscriptions/:subscriptionId/reactive"),
};
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/subscriptions/:subscriptionId/reactive";
String encoding = Base64.getEncoder().encodeToString(("{API_KEY}:".getBytes()));
Request request = new Request.Builder()
.url(url)
.patch(okhttp3.RequestBody.create("", null))
.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": "6351316327e5fd015d3a99ac",
"name": "24 Meals",
"subscriptionNo": "",
"companyId": "622294998bec060152bcad9c",
"customerId": "62f135085ff37c016a57f0eb",
"planId": "634f9df32b1297015d8db73c",
"planAmount": {
"currency": "EUR",
"unit": "$",
"value": 84
},
"planQuantity": 1,
"contractPeriod": "YEARLY",
"contractQuantity": 1,
"contractRenewal": "AUTO_RENEW",
"interval": "months",
"intervalCount": 1,
"billingCycle": 13,
"addons": [
{
"_id": "6332a63157b074015f09208d",
"name": "Dark Chocolate Sea Salt",
"amount": {
"currency": "USD",
"unit": "$",
"value": 0
},
"type": "MONTHLY",
"quantity": 8,
"isOld": false
},
{
"_id": "631741694eef1f015fc53da6",
"name": "Strawberry Rhubarb",
"amount": {
"currency": "USD",
"unit": "$",
"value": 0
},
"type": "MONTHLY",
"quantity": 8,
"isOld": false
},
{
"_id": "630dcf57c755b0015e9d6b4d",
"name": "Lemon Poppy Seed",
"amount": {
"currency": "USD",
"unit": "$",
"value": 0
},
"type": "MONTHLY",
"quantity": 8,
"isOld": false
}
],
"discounts": [],
"taxes": [],
"shippings": [],
"shippingAmount": {
"currency": "USD",
"value": 0,
"unit": "$"
},
"discountAmount": {
"currency": "USD",
"value": 0,
"unit": "$"
},
"taxAmount": {
"currency": "USD",
"value": 0,
"unit": "$"
},
"subTotalAmount": {
"currency": "USD",
"value": 84,
"unit": "$"
},
"totalAmount": {
"currency": "USD",
"value": 84,
"unit": "$"
},
"invoices": [
"6351316327e5fd015d3a9a12"
],
"currentInvoice": {
"items": [
{
"name": "24 Meals",
"rate": {
"value": 84,
"unit": "$",
"currency": "EUR"
},
"quantity": 1,
"taxable": true,
"type": "Plan",
"fromDate": "2022-10-20T11:30:43.123Z",
"toDate": "2022-11-20T11:30:43.123Z",
"_id": "634f9df32b1297015d8db73c",
"integrations": null
}
]
},
"upcomingInvoice": {
"items": [
{
"name": "24 Meals",
"rate": {
"value": 84,
"unit": "$",
"currency": "EUR"
},
"quantity": 1,
"taxable": true,
"type": "Plan",
"fromDate": "2022-11-20T11:30:43.123Z",
"toDate": "2022-12-20T11:30:43+00:00",
"_id": "634f9df32b1297015d8db73c",
"integrations": null
}
]
},
"proration": 0,
"cancelReason": "",
"startDate": "2022-10-20T11:30:43.123Z",
"endDate": "2022-11-30T14:55:56.113Z",
"startedDate": "2022-10-20T11:30:43.123Z",
"paymentDay": 0,
"issueInvoiceDays": 2,
"startInvoiceDate": "2022-10-20T11:30:43.123Z",
"paymentDate": "2022-10-20T11:30:43.123Z",
"nextIssueInvoiceDate": "2022-11-18T11:30:43.123Z",
"nextInvoiceDate": "2022-11-20T11:30:43.123Z",
"nextPaymentDate": "2022-11-20T11:30:43.123Z",
"status": "ACTIVE",
"oldPlanId": null,
"oldPlanAmount": {
"currency": "USD",
"value": 0,
"unit": "$"
},
"shipTo": {
"name": "customer test",
"attn": "customer h",
"address1": "asdf",
"address2": "asdf",
"city": "asdf",
"country": "US",
"state": "FL",
"zipCode": "33024"
},
"cancelAtPeriodEnd": false,
"customerFromPortal": false,
"createdAt": "2022-10-20T11:30:43.124Z",
"updatedAt": "2022-11-03T15:11:23.641Z",
"source": "BLIXO",
"planDetail": {
"code": "",
"type": "CUSTOM",
"itemId": null,
"interval": "months",
"intervalCount": 1,
"pricingMode": "per_unit",
"taxable": true,
"isTemplate": false,
"_id": "634f9df32b1297015d8db73c",
"name": "24 Meals",
"companyId": "622294998bec060152bcad9c",
"price": {
"unit": "$",
"currency": "EUR",
"value": 84
},
"createdAt": "2022-10-19T06:49:23.531Z",
"updatedAt": "2022-10-19T08:00:02.006Z",
"__v": 0,
"integrations": {
"bigquery": {
"lastSynced": "2022-10-19T08:00:02.006Z"
}
}
},
"upcomingInvoiceDetail": {
"items": [
{
"amount": {
"value": 84,
"unit": "$",
"currency": "EUR"
},
"companyId": "622294998bec060152bcad9c",
"discountable": false,
"hasDefaultPrice": false,
"interval": "months",
"intervalCount": 1,
"itemId": null,
"name": "24 Meals",
"description": "",
"rate": {
"value": 84,
"unit": "$",
"currency": "EUR"
},
"quantity": 1,
"pricingMode": "per_unit",
"taxable": true,
"taxes": [],
"type": "Plan",
"itemType": "NONE",
"fromDate": "2022-11-20T11:30:43.123Z",
"toDate": "2022-12-20T11:30:43+00:00",
"integrations": null,
"discountAmount": {
"value": 0,
"unit": "$"
},
"discountedAmount": {
"value": 84,
"unit": "$",
"currency": "EUR"
}
}
],
"subTotalAmount": {
"value": 84,
"unit": "$",
"currency": "USD"
},
"discountAmount": {
"value": 0,
"unit": "$",
"currency": "USD"
},
"taxAmount": {
"value": 0,
"unit": "$",
"currency": "USD"
},
"taxLines": [],
"totalAmount": {
"value": 84,
"unit": "$",
"currency": "USD"
},
"shippingAmount": {
"value": 0,
"unit": "$"
},
"shippingLines": [],
"discountLines": []
}
}
}
This API endpoint allows you to reactivate a previously cancelled subscription. It's as simple as sending a PATCH request to https://api.blixo.com/v1/subscriptions/:subscriptionId/reactive
. Think of it as telling the server, "Hey, I want to reactivate this subscription!" And the server responds by reactivating the subscription for you!
HTTP Request
PATCH https://api.blixo.com/v1/subscriptions/:subscriptionId/reactive
Headers
Key | Value |
---|---|
Authorization | Basic {API_KEY} |
Parameters
Parameter | Type | Description |
---|---|---|
subscriptionId | String | (required) The ID of the subscription. |
Example
To reactivate a subscription, you would send a PATCH request to https://api.blixo.com/v1/subscriptions/:subscriptionId/reactive
. Remember to replace {API_KEY}
and :subscriptionId
with your actual API key and the ID of the subscription you want to reactivate.
Response
The response will be a JSON object with a data
key containing the details of the reactivated subscription. 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.
Edit schedule
curl "https://api.blixo.com/v1/subscriptions/shopify/updateInterval" \
-u {API_KEY}: \
-X POST
const fetch = require('node-fetch');
const url = 'https://api.blixo.com/v1/subscriptions/shopify/updateInterval';
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/subscriptions/shopify/updateInterval",
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/subscriptions/shopify/updateInterval")
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/subscriptions/shopify/updateInterval"
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/subscriptions/shopify/updateInterval"
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/subscriptions/shopify/updateInterval"),
};
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/subscriptions/shopify/updateInterval";
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": "6351316327e5fd015d3a99ac",
"name": "24 Meals",
"subscriptionNo": "",
"companyId": "622294998bec060152bcad9c",
"customerId": "62f135085ff37c016a57f0eb",
"planId": "634f9df32b1297015d8db73c",
"planAmount": {
"currency": "EUR",
"unit": "$",
"value": 84
},
"planQuantity": 1,
"contractPeriod": "YEARLY",
"contractQuantity": 1,
"contractRenewal": "AUTO_RENEW",
"interval": "years",
"intervalCount": 3,
"billingCycle": 1,
"addons": [
{
"_id": "6332a63157b074015f09208d",
"name": "Dark Chocolate Sea Salt",
"amount": {
"currency": "USD",
"unit": "$",
"value": 0
},
"type": "MONTHLY",
"quantity": 8,
"isOld": false
}
],
"discounts": [],
"taxes": [],
"shippings": [],
"shippingAmount": {
"currency": "USD",
"value": 0,
"unit": "$"
},
"discountAmount": {
"currency": "USD",
"value": 0,
"unit": "$"
},
"taxAmount": {
"currency": "USD",
"value": 0,
"unit": "$"
},
"subTotalAmount": {
"currency": "USD",
"value": 84,
"unit": "$"
},
"totalAmount": {
"currency": "USD",
"value": 84,
"unit": "$"
},
"invoices": [
"6351316327e5fd015d3a9a12"
],
"currentInvoice": {
"items": [
{
"name": "24 Meals",
"rate": {
"value": 84,
"unit": "$",
"currency": "EUR"
},
"quantity": 1,
"taxable": true,
"type": "Plan",
"fromDate": "2022-10-20T11:30:43.123Z",
"toDate": "2022-11-20T11:30:43.123Z",
"_id": "634f9df32b1297015d8db73c",
"integrations": null
}
]
},
"upcomingInvoice": {
"items": [
{
"name": "24 Meals",
"rate": {
"value": 84,
"unit": "$",
"currency": "EUR"
},
"quantity": 1,
"taxable": true,
"type": "Plan",
"fromDate": "2022-11-10T15:25:19+00:00",
"toDate": "2025-11-10T15:25:19+00:00",
"_id": "634f9df32b1297015d8db73c",
"integrations": null
}
]
},
"proration": 0,
"cancelReason": "",
"startDate": "2022-10-20T11:30:43.123Z",
"endDate": "2022-11-30T14:55:56.113Z",
"startedDate": "2022-10-20T11:30:43.123Z",
"paymentDay": 0,
"issueInvoiceDays": 2,
"startInvoiceDate": "2022-10-20T11:30:43.123Z",
"paymentDate": "2022-10-20T11:30:43.123Z",
"nextIssueInvoiceDate": "2022-11-10T15:25:19.962Z",
"nextInvoiceDate": "2022-11-10T15:25:19.964Z",
"nextPaymentDate": "2022-11-10T15:25:19.964Z",
"status": "ACTIVE",
"oldPlanId": null,
"oldPlanAmount": {
"currency": "USD",
"value": 0,
"unit": "$"
},
"shipTo": {
"name": "customer test",
"attn": "customer h",
"address1": "asdf",
"address2": "asdf",
"city": "asdf",
"country": "US",
"state": "FL",
"zipCode": "33024"
},
"cancelAtPeriodEnd": false,
"customerFromPortal": false,
"createdAt": "2022-10-20T11:30:43.124Z",
"updatedAt": "2022-11-03T15:25:28.967Z",
"source": "BLIXO",
"planDetail": {
"code": "",
"type": "CUSTOM",
"itemId": null,
"interval": "months",
"intervalCount": 1,
"pricingMode": "per_unit",
"taxable": true,
"isTemplate": false,
"_id": "634f9df32b1297015d8db73c",
"name": "24 Meals",
"companyId": "622294998bec060152bcad9c",
"price": {
"unit": "$",
"currency": "EUR",
"value": 84
},
"createdAt": "2022-10-19T06:49:23.531Z",
"updatedAt": "2022-10-19T08:00:02.006Z",
"__v": 0,
"integrations": {
"bigquery": {
"lastSynced": "2022-10-19T08:00:02.006Z"
}
}
},
"upcomingInvoiceDetail": {
"items": [
{
"amount": {
"value": 84,
"unit": "$",
"currency": "EUR"
},
"companyId": "622294998bec060152bcad9c",
"discountable": false,
"hasDefaultPrice": false,
"interval": "months",
"intervalCount": 1,
"itemId": null,
"name": "24 Meals",
"description": "",
"rate": {
"value": 84,
"unit": "$",
"currency": "EUR"
},
"quantity": 1,
"pricingMode": "per_unit",
"taxable": true,
"taxes": [],
"type": "Plan",
"itemType": "NONE",
"fromDate": "2022-11-10T15:25:19+00:00",
"toDate": "2025-11-10T15:25:19+00:00",
"integrations": null,
"discountAmount": {
"value": 0,
"unit": "$"
},
"discountedAmount": {
"value": 84,
"unit": "$",
"currency": "EUR"
}
}
],
"subTotalAmount": {
"value": 84,
"unit": "$",
"currency": "USD"
},
"discountAmount": {
"value": 0,
"unit": "$",
"currency": "USD"
},
"taxAmount": {
"value": 0,
"unit": "$",
"currency": "USD"
},
"taxLines": [],
"totalAmount": {
"value": 84,
"unit": "$",
"currency": "USD"
},
"shippingAmount": {
"value": 0,
"unit": "$"
},
"shippingLines": [],
"discountLines": []
}
}
}
This API endpoint allows you to modify the schedule of an existing subscription. It's as simple as sending a POST request to https://api.blixo.com/v1/subscriptions/shopify/updateInterval
. Think of it as telling the server, "Hey, I want to change the schedule of this subscription!" And the server responds by updating the schedule for you!
HTTP Request
POST https://api.blixo.com/v1/subscriptions/shopify/updateInterval
Headers
Key | Value |
---|---|
Authorization | Basic {API_KEY} |
Parameters
Parameter | Type | Description |
---|---|---|
subscriptionId | String | (required) The ID of the subscription. |
interval | String | (required) The new interval for the subscription. Can be days , weeks , months , or years . |
intervalCount | Integer | (required) The new interval count for the subscription. This is the number of intervals between each billing cycle. |
nextInvoiceDate | datetime | The date of the next invoice. If not provided, the next invoice date will be calculated based on the new interval and interval count. |
Example
To edit the schedule of a subscription, you would send a POST request to https://api.blixo.com/v1/subscriptions/shopify/updateInterval
. Remember to replace {API_KEY}
, :subscriptionId
, interval
, and intervalCount
with your actual API key, the ID of the subscription you want to edit, the new interval, and the new interval count respectively.
Response
The response will be a JSON object with a data
key containing the details of the updated subscription. 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.
Delay schedule
curl "https://api.blixo.com/v1/subscriptions/shopify/delay" \
-u {API_KEY}: \
-X POST
const fetch = require('node-fetch');
const url = 'https://api.blixo.com/v1/subscriptions/shopify/delay';
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/subscriptions/shopify/delay",
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/subscriptions/shopify/delay")
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/subscriptions/shopify/delay"
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/subscriptions/shopify/delay"
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/subscriptions/shopify/delay"),
};
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/subscriptions/shopify/delay";
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": "6351316327e5fd015d3a99ac",
"name": "24 Meals",
"subscriptionNo": "",
"companyId": "622294998bec060152bcad9c",
"customerId": "62f135085ff37c016a57f0eb",
"planId": "634f9df32b1297015d8db73c",
"planAmount": {
"currency": "EUR",
"unit": "$",
"value": 84
},
"planQuantity": 1,
"contractPeriod": "YEARLY",
"contractQuantity": 1,
"contractRenewal": "AUTO_RENEW",
"interval": "years",
"intervalCount": 3,
"billingCycle": 1,
"addons": [
{
"_id": "6332a63157b074015f09208d",
"name": "Dark Chocolate Sea Salt",
"amount": {
"currency": "USD",
"unit": "$",
"value": 0
},
"type": "MONTHLY",
"quantity": 8,
"isOld": false
}
],
"discounts": [],
"taxes": [],
"shippings": [],
"shippingAmount": {
"currency": "USD",
"value": 0,
"unit": "$"
},
"discountAmount": {
"currency": "USD",
"value": 0,
"unit": "$"
},
"taxAmount": {
"currency": "USD",
"value": 0,
"unit": "$"
},
"subTotalAmount": {
"currency": "USD",
"value": 84,
"unit": "$"
},
"totalAmount": {
"currency": "USD",
"value": 84,
"unit": "$"
},
"invoices": [
"6351316327e5fd015d3a9a12"
],
"currentInvoice": {
"items": [
{
"name": "24 Meals",
"rate": {
"value": 84,
"unit": "$",
"currency": "EUR"
},
"quantity": 1,
"taxable": true,
"type": "Plan",
"fromDate": "2022-10-20T11:30:43.123Z",
"toDate": "2022-11-20T11:30:43.123Z",
"_id": "634f9df32b1297015d8db73c",
"integrations": null
}
]
},
"upcomingInvoice": {
"items": [
{
"name": "24 Meals",
"rate": {
"value": 84,
"unit": "$",
"currency": "EUR"
},
"quantity": 1,
"taxable": true,
"type": "Plan",
"fromDate": "2022-11-24T15:25:19+00:00",
"toDate": "2023-11-24T15:25:19+00:00",
"_id": "634f9df32b1297015d8db73c",
"integrations": null
}
]
},
"proration": 0,
"cancelReason": "",
"startDate": "2022-10-20T11:30:43.123Z",
"endDate": "2022-11-30T14:55:56.113Z",
"startedDate": "2022-10-20T11:30:43.123Z",
"paymentDay": 0,
"issueInvoiceDays": 2,
"startInvoiceDate": "2022-10-20T11:30:43.123Z",
"paymentDate": "2022-10-20T11:30:43.123Z",
"nextIssueInvoiceDate": "2022-11-24T15:25:19.000Z",
"nextInvoiceDate": "2022-11-24T15:25:19.000Z",
"nextPaymentDate": "2022-11-24T15:25:19.000Z",
"status": "ACTIVE",
"oldPlanId": null,
"oldPlanAmount": {
"currency": "USD",
"value": 0,
"unit": "$"
},
"shipTo": {
"name": "customer test",
"attn": "customer h",
"address1": "asdf",
"address2": "asdf",
"city": "asdf",
"country": "US",
"state": "FL",
"zipCode": "33024"
},
"cancelAtPeriodEnd": false,
"customerFromPortal": false,
"createdAt": "2022-10-20T11:30:43.124Z",
"updatedAt": "2022-11-03T16:04:44.967Z",
"source": "BLIXO",
"planDetail": {
"code": "",
"type": "CUSTOM",
"itemId": null,
"interval": "months",
"intervalCount": 1,
"pricingMode": "per_unit",
"taxable": true,
"isTemplate": false,
"_id": "634f9df32b1297015d8db73c",
"name": "24 Meals",
"companyId": "622294998bec060152bcad9c",
"price": {
"unit": "$",
"currency": "EUR",
"value": 84
},
"createdAt": "2022-10-19T06:49:23.531Z",
"updatedAt": "2022-10-19T08:00:02.006Z",
"__v": 0,
"integrations": {
"bigquery": {
"lastSynced": "2022-10-19T08:00:02.006Z"
}
}
},
"upcomingInvoiceDetail": {
"items": [
{
"amount": {
"value": 84,
"unit": "$",
"currency": "EUR"
},
"companyId": "622294998bec060152bcad9c",
"discountable": false,
"hasDefaultPrice": false,
"interval": "months",
"intervalCount": 1,
"itemId": null,
"name": "24 Meals",
"description": "",
"rate": {
"value": 84,
"unit": "$",
"currency": "EUR"
},
"quantity": 1,
"pricingMode": "per_unit",
"taxable": true,
"taxes": [],
"type": "Plan",
"itemType": "NONE",
"fromDate": "2022-11-24T15:25:19+00:00",
"toDate": "2023-11-24T15:25:19+00:00",
"integrations": null,
"discountAmount": {
"value": 0,
"unit": "$"
},
"discountedAmount": {
"value": 84,
"unit": "$",
"currency": "EUR"
}
}
],
"subTotalAmount": {
"value": 84,
"unit": "$",
"currency": "USD"
},
"discountAmount": {
"value": 0,
"unit": "$",
"currency": "USD"
},
"taxAmount": {
"value": 0,
"unit": "$",
"currency": "USD"
},
"taxLines": [],
"totalAmount": {
"value": 84,
"unit": "$",
"currency": "USD"
},
"shippingAmount": {
"value": 0,
"unit": "$"
},
"shippingLines": [],
"discountLines": []
},
"customer": {
"id": "62f135085ff37c016a57f0eb",
"name": "customer test"
}
}
}
This API endpoint allows you to delay the schedule of an existing subscription. It's as simple as sending a POST request to https://api.blixo.com/v1/subscriptions/shopify/delay
. Think of it as telling the server, "Hey, I want to delay the schedule of this subscription!" And the server responds by updating the schedule for you!
HTTP Request
POST https://api.blixo.com/v1/subscriptions/shopify/delay
Headers
Key | Value |
---|---|
Authorization | Basic {API_KEY} |
Parameters
Parameter | Type | Description |
---|---|---|
subscriptionId | String | (required) The ID of the subscription. |
delay | Integer | (required) The number of days to delay the subscription. |
interval | string | Interval. e.g. days ,weeks , months , years |
intervalCount | number | Number of Interval count. |
Example
To delay the schedule of a subscription, you would send a POST request to https://api.blixo.com/v1/subscriptions/shopify/delay
. Remember to replace {API_KEY}
, :subscriptionId
, and delay
with your actual API key, the ID of the subscription you want to delay, and the number of days you want to delay the subscription respectively.
Response
The response will be a JSON object with a data
key containing the details of the updated subscription. 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.
Charge now
curl "https://api.blixo.com/v1/subscriptions/shopify/shipNow" \
-u {API_KEY}: \
-X POST
const fetch = require('node-fetch');
const url = 'https://api.blixo.com/v1/subscriptions/shopify/shipNow';
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/subscriptions/shopify/shipNow",
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/subscriptions/shopify/shipNow")
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/subscriptions/shopify/shipNow"
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/subscriptions/shopify/shipNow"
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/subscriptions/shopify/shipNow"),
};
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/subscriptions/shopify/shipNow";
String encoding = Base64.getEncoder().encodeToString(("{API_KEY}:".getBytes()));
Request request = new Request.Builder()
.url(url)
.addHeader("Authorization", "Basic " + encoding)
.post(okhttp3.RequestBody.create(null, new byte[0]))
.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": "6351316327e5fd015d3a99ac",
"name": "24 Meals",
"subscriptionNo": "",
"companyId": "622294998bec060152bcad9c",
"customerId": "62f135085ff37c016a57f0eb",
"planId": "634f9df32b1297015d8db73c",
"planAmount": {
"currency": "EUR",
"unit": "$",
"value": 84
},
"planQuantity": 1,
"contractPeriod": "YEARLY",
"contractQuantity": 1,
"contractRenewal": "AUTO_RENEW",
"interval": "years",
"intervalCount": 3,
"billingCycle": 1,
"addons": [],
"discounts": [],
"taxes": [],
"shippings": [],
"shippingAmount": {
"currency": "USD",
"value": 0,
"unit": "$"
},
"discountAmount": {
"currency": "USD",
"value": 0,
"unit": "$"
},
"taxAmount": {
"currency": "USD",
"value": 0,
"unit": "$"
},
"subTotalAmount": {
"currency": "EUR",
"value": 84,
"unit": "$"
},
"totalAmount": {
"currency": "EUR",
"value": 84,
"unit": "$"
},
"invoices": [
"6351316327e5fd015d3a9a12"
],
"currentInvoice": {
"items": [
{
"name": "24 Meals",
"rate": {
"value": 84,
"unit": "$",
"currency": "EUR"
},
"quantity": 1,
"taxable": true,
"type": "Plan",
"fromDate": "2022-10-20T11:30:43.123Z",
"toDate": "2022-11-20T11:30:43.123Z",
"_id": "634f9df32b1297015d8db73c",
"integrations": null
}
]
},
"upcomingInvoice": {
"items": [
{
"name": "24 Meals",
"rate": {
"value": 84,
"unit": "$",
"currency": "EUR"
},
"quantity": 1,
"taxable": true,
"type": "Plan",
"fromDate": "2022-11-04T16:27:30+00:00",
"toDate": "2023-11-04T16:27:30+00:00",
"_id": "634f9df32b1297015d8db73c",
"integrations": null
}
]
},
"proration": 0,
"cancelReason": "",
"startDate": "2022-10-20T11:30:43.123Z",
"endDate": "2025-10-20T11:30:43.000Z",
"startedDate": "2022-10-20T11:30:43.123Z",
"paymentDay": 0,
"issueInvoiceDays": 2,
"startInvoiceDate": "2022-10-20T11:30:43.123Z",
"paymentDate": "2022-10-20T11:30:43.123Z",
"nextIssueInvoiceDate": "2022-11-04T16:27:30.000Z",
"nextInvoiceDate": "2022-11-06T16:27:30.000Z",
"nextPaymentDate": "2022-11-06T16:27:30.000Z",
"status": "ACTIVE",
"oldPlanId": null,
"oldPlanAmount": {
"currency": "USD",
"value": 0,
"unit": "$"
},
"shipTo": {
"name": " ",
"address1": "",
"address2": "",
"city": "",
"state": "",
"zipCode": "",
"country": "",
"phones": [
""
]
},
"cancelAtPeriodEnd": false,
"customerFromPortal": false,
"createdAt": "2022-10-20T11:30:43.124Z",
"updatedAt": "2022-11-03T16:27:30.972Z",
"source": "BLIXO",
"planDetail": {
"code": "",
"type": "CUSTOM",
"itemId": null,
"interval": "months",
"intervalCount": 1,
"pricingMode": "per_unit",
"taxable": true,
"isTemplate": false,
"_id": "634f9df32b1297015d8db73c",
"name": "24 Meals",
"companyId": "622294998bec060152bcad9c",
"price": {
"unit": "$",
"currency": "EUR",
"value": 84
},
"createdAt": "2022-10-19T06:49:23.531Z",
"updatedAt": "2022-10-19T08:00:02.006Z",
"__v": 0,
"integrations": {
"bigquery": {
"lastSynced": "2022-10-19T08:00:02.006Z"
}
}
},
"upcomingInvoiceDetail": {
"items": [
{
"amount": {
"value": 84,
"unit": "$",
"currency": "EUR"
},
"companyId": "622294998bec060152bcad9c",
"discountable": false,
"hasDefaultPrice": false,
"interval": "months",
"intervalCount": 1,
"itemId": null,
"name": "24 Meals",
"description": "",
"rate": {
"value": 84,
"unit": "$",
"currency": "EUR"
},
"quantity": 1,
"pricingMode": "per_unit",
"taxable": true,
"taxes": [],
"type": "Plan",
"itemType": "NONE",
"fromDate": "2022-11-04T16:27:30+00:00",
"toDate": "2023-11-04T16:27:30+00:00",
"integrations": null,
"discountAmount": {
"value": 0,
"unit": "$"
},
"discountedAmount": {
"value": 84,
"unit": "$",
"currency": "EUR"
}
}
],
"subTotalAmount": {
"value": 84,
"unit": "$",
"currency": "USD"
},
"discountAmount": {
"value": 0,
"unit": "$",
"currency": "USD"
},
"taxAmount": {
"value": 0,
"unit": "$",
"currency": "USD"
},
"taxLines": [],
"totalAmount": {
"value": 84,
"unit": "$",
"currency": "USD"
},
"shippingAmount": {
"value": 0,
"unit": "$"
},
"shippingLines": [],
"discountLines": []
}
}
]
}
This API endpoint allows you to immediately charge a subscription. It's as simple as sending a POST request to https://api.blixo.com/v1/subscriptions/shopify/shipNow
. Think of it as telling the server, "Hey, I want to charge this subscription now!" And the server responds by processing the charge for you!
HTTP Request
POST https://api.blixo.com/v1/subscriptions/shopify/shipNow
Headers
Key | Value |
---|---|
Authorization | Basic {API_KEY} |
Parameters
Parameter | Type | Description |
---|---|---|
subscriptionId | String | (required) The ID of the subscription. |
Example
To charge a subscription now, you would send a POST request to https://api.blixo.com/v1/subscriptions/shopify/shipNow
. Remember to replace {API_KEY}
and :subscriptionId
with your actual API key and the ID of the subscription you want to charge respectively.
Response
The response will be a JSON object with a data
key containing the details of the charged subscription. 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.
Skip next billing
curl "https://api.blixo.com/v1/subscriptions/:subscriptionId/skip" \
-u {API_KEY}: \
-X PATCH
const fetch = require('node-fetch');
const url = 'https://api.blixo.com/v1/subscriptions/:subscriptionId/skip';
const options = {
method: 'PATCH',
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/subscriptions/:subscriptionId/skip",
CURLOPT_CUSTOMREQUEST => "PATCH",
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/subscriptions/:subscriptionId/skip")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Patch.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/subscriptions/:subscriptionId/skip"
api_key = "{API_KEY}"
headers = {
"Authorization": "Basic " + base64.b64encode((api_key + ":").encode()).decode()
}
response = requests.patch(url, headers=headers)
print(response.text)
package main
import (
"fmt"
"net/http"
"io/ioutil"
"encoding/base64"
)
func main() {
url := "https://api.blixo.com/v1/subscriptions/:subscriptionId/skip"
req, _ := http.NewRequest("PATCH", 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 = new HttpMethod("PATCH"),
RequestUri = new Uri("https://api.blixo.com/v1/subscriptions/:subscriptionId/skip"),
};
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/subscriptions/:subscriptionId/skip";
String encoding = Base64.getEncoder().encodeToString(("{API_KEY}:".getBytes()));
Request request = new Request.Builder()
.url(url)
.patch(okhttp3.RequestBody.create("", null))
.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": "6351316327e5fd015d3a99ac",
"name": "24 Meals",
"subscriptionNo": "",
"companyId": "622294998bec060152bcad9c",
"customerId": "62f135085ff37c016a57f0eb",
"planId": "634f9df32b1297015d8db73c",
"planAmount": {
"currency": "EUR",
"unit": "$",
"value": 84
},
"planQuantity": 1,
"contractPeriod": "YEARLY",
"contractQuantity": 1,
"contractRenewal": "AUTO_RENEW",
"interval": "years",
"intervalCount": 3,
"billingCycle": 1,
"addons": [],
"discounts": [],
"taxes": [],
"shippings": [],
"shippingAmount": {
"currency": "USD",
"value": 0,
"unit": "$"
},
"discountAmount": {
"currency": "USD",
"value": 0,
"unit": "$"
},
"taxAmount": {
"currency": "USD",
"value": 0,
"unit": "$"
},
"subTotalAmount": {
"currency": "EUR",
"value": 84,
"unit": "$"
},
"totalAmount": {
"currency": "EUR",
"value": 84,
"unit": "$"
},
"invoices": [
"6351316327e5fd015d3a9a12"
],
"currentInvoice": {
"items": [
{
"name": "24 Meals",
"rate": {
"value": 84,
"unit": "$",
"currency": "EUR"
},
"quantity": 1,
"taxable": true,
"type": "Plan",
"fromDate": "2022-10-20T11:30:43.123Z",
"toDate": "2022-11-20T11:30:43.123Z",
"_id": "634f9df32b1297015d8db73c",
"integrations": null
}
]
},
"upcomingInvoice": {
"items": [
{
"name": "24 Meals",
"rate": {
"value": 84,
"unit": "$",
"currency": "EUR"
},
"quantity": 1,
"taxable": true,
"type": "Plan",
"fromDate": "2023-11-20T16:27:30+00:00",
"toDate": "2024-11-20T16:27:30+00:00",
"_id": "634f9df32b1297015d8db73c",
"integrations": null
}
]
},
"proration": 0,
"cancelReason": "",
"startDate": "2022-10-20T11:30:43.123Z",
"endDate": "2025-10-20T11:30:43.000Z",
"startedDate": "2022-10-20T11:30:43.123Z",
"paymentDay": 0,
"issueInvoiceDays": 2,
"startInvoiceDate": "2022-10-20T11:30:43.123Z",
"paymentDate": "2022-10-20T11:30:43.123Z",
"nextIssueInvoiceDate": "2023-11-18T16:27:30.000Z",
"nextInvoiceDate": "2023-11-20T16:27:30.000Z",
"nextPaymentDate": "2023-11-20T16:27:30.000Z",
"status": "ACTIVE",
"oldPlanId": null,
"oldPlanAmount": {
"currency": "USD",
"value": 0,
"unit": "$"
},
"shipTo": {
"name": " ",
"address1": "",
"address2": "",
"city": "",
"state": "",
"zipCode": "",
"country": "",
"phones": [
""
]
},
"cancelAtPeriodEnd": false,
"customerFromPortal": false,
"createdAt": "2022-10-20T11:30:43.124Z",
"updatedAt": "2022-11-03T17:01:47.672Z",
"source": "BLIXO",
"planDetail": {
"code": "",
"type": "CUSTOM",
"itemId": null,
"interval": "months",
"intervalCount": 1,
"pricingMode": "per_unit",
"taxable": true,
"isTemplate": false,
"_id": "634f9df32b1297015d8db73c",
"name": "24 Meals",
"companyId": "622294998bec060152bcad9c",
"price": {
"unit": "$",
"currency": "EUR",
"value": 84
},
"createdAt": "2022-10-19T06:49:23.531Z",
"updatedAt": "2022-10-19T08:00:02.006Z",
"__v": 0,
"integrations": {
"bigquery": {
"lastSynced": "2022-10-19T08:00:02.006Z"
}
}
},
"upcomingInvoiceDetail": {
"items": [
{
"amount": {
"value": 84,
"unit": "$",
"currency": "EUR"
},
"companyId": "622294998bec060152bcad9c",
"discountable": false,
"hasDefaultPrice": false,
"interval": "months",
"intervalCount": 1,
"itemId": null,
"name": "24 Meals",
"description": "",
"rate": {
"value": 84,
"unit": "$",
"currency": "EUR"
},
"quantity": 1,
"pricingMode": "per_unit",
"taxable": true,
"taxes": [],
"type": "Plan",
"itemType": "NONE",
"fromDate": "2023-11-20T16:27:30+00:00",
"toDate": "2024-11-20T16:27:30+00:00",
"integrations": null,
"discountAmount": {
"value": 0,
"unit": "$"
},
"discountedAmount": {
"value": 84,
"unit": "$",
"currency": "EUR"
}
}
],
"subTotalAmount": {
"value": 84,
"unit": "$",
"currency": "USD"
},
"discountAmount": {
"value": 0,
"unit": "$",
"currency": "USD"
},
"taxAmount": {
"value": 0,
"unit": "$",
"currency": "USD"
},
"taxLines": [],
"totalAmount": {
"value": 84,
"unit": "$",
"currency": "USD"
},
"shippingAmount": {
"value": 0,
"unit": "$"
},
"shippingLines": [],
"discountLines": []
}
}
}
This API endpoint allows you to skip the next billing cycle for a subscription. It's as simple as sending a PATCH request to https://api.blixo.com/v1/subscriptions/:subscriptionId/skip
. Think of it as telling the server, "Hey, I want to skip the next billing for this subscription!" And the server responds by processing your request!
HTTP Request
PATCH https://api.blixo.com/v1/subscriptions/:subscriptionId/skip
Headers
Key | Value |
---|---|
Authorization | Basic {API_KEY} |
Parameters
Parameter | Type | Description |
---|---|---|
subscriptionId | String | (required) The ID of the subscription. |
Example
To skip the next billing for a subscription, you would send a PATCH request to https://api.blixo.com/v1/subscriptions/:subscriptionId/skip
. Remember to replace {API_KEY}
and :subscriptionId
with your actual API key and the ID of the subscription you want to skip the next billing for respectively.
Response
The response will be a JSON object with a data
key containing the details of the updated subscription. 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.
Quotes
Quote object
Attribute | Type | Description |
---|---|---|
id | ObjectId | The ID of the quote. |
quoteNo | String | The quote number. |
managerId | ObjectId | The ID of the manager. |
issueDate | Date | The issue date of the quote. |
expireDate | Date | The expiration date of the quote. |
billTo | Object | The billing address of the quote. 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 quote. 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 quote. |
attachments | Array | Any attachments to the quote. |
subTotalAmount | Object | The subtotal amount of the quote. 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 quote. 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 quote. 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 . |
||
quoteStatus | Array | The status of the quote. |
sentStatus | String | The sent status of the quote. |
itemLines | Array | The item lines of the quote. |
discountLines | Array | The discount lines of the quote. |
discountAmount | Object | The discount amount of the quote. 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 . |
||
discountedAmount | Object | The discounted amount of the quote. 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 quote. |
taxAmount | Object | The tax amount of the quote. 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 . |
||
depositAmount | Object | The deposit amount of the quote. 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 quote. |
shippingAmount | Object | The shipping amount of the quote. 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 quote. |
updatedBy | ObjectId | The ID of the user who last updated the quote. |
createdAt | Date | The date when the quote was created. |
updatedAt | Date | The date when the quote was last updated. |
deletedBy | ObjectId | The ID of the user who deleted the quote. |
deletedAt | Date | The date when the quote was deleted. |
isDeleted | Boolean | Whether the quote is deleted. |
source | String | The source of the quote. |
initial | String | The initial of the quote. |
signatureUrl | String | The signature URL of the quote. |
approvalDetail | Object | The approval detail of the quote. |
contractTerms | String | The contract terms of the quote. |
List all quotes
curl "https://api.blixo.com/v1/quotes" \
-u {API_KEY}:
const fetch = require('node-fetch');
const url = 'https://api.blixo.com/v1/quotes';
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/quotes",
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/quotes")
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/quotes"
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/quotes"
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/quotes"),
};
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/quotes";
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": "632899edac3a1aa3b3eaeac7",
"quoteNo": "QTE-0004",
"managerId": "65289eb09d9571a357f09a5c",
"issueDate": "2022-09-19T16:33:36.947Z",
"expireDate": "2022-09-19T16:33:36.947Z",
"billTo": {
"attn": "",
"phones": [],
"address1": "",
"address2": "",
"city": "",
"state": "",
"zipCode": "",
"country": "",
"name": ""
},
"notes": "",
"attachments": [
""
],
"subTotalAmount": {
"currency": "USD",
"_id": "632899eeac3a1aa3b3eaeadc",
"value": 100,
"unit": "$"
},
"totalAmount": {
"currency": "USD",
"value": 100,
"unit": "$"
},
"balanceAmount": {
"currency": "USD",
"value": 100,
"unit": "$"
},
"quoteStatus": [
"ISSUED"
],
"sentStatus": "NOT_SENT",
"itemLines": [
{
"detail": null,
"_id": "632899e059848c7fd4ab3907",
"title": "test",
"description": "",
"quantity": 1,
"rate": {
"currency": "USD",
"_id": "632899edac3a1aa3b3eaeac9",
"unit": "$",
"value": 100
},
"amount": {
"currency": "USD",
"_id": "632899eeac3a1aa3b3eaead8",
"value": 100,
"unit": "$"
},
"taxLines": [],
"discountLines": [],
"discountAmount": {
"currency": "USD",
"_id": "632899eeac3a1aa3b3eaead6",
"value": 0,
"unit": "$"
},
"discountedAmount": {
"currency": "USD",
"_id": "632899eeac3a1aa3b3eaead7",
"value": 100,
"unit": "$"
}
}
],
"discountLines": [],
"discountAmount": {
"currency": "USD",
"_id": "632899eeac3a1aa3b3eaead9",
"value": 0,
"unit": "$"
},
"discountedAmount": {
"currency": "USD",
"_id": "632899eeac3a1aa3b3eaeada",
"value": 100,
"unit": "$"
},
"taxLines": [],
"taxAmount": {
"currency": "USD",
"_id": "632899eeac3a1aa3b3eaeadb",
"value": 0,
"unit": "$"
},
"companyId": "622294998bec060152bcad9c",
"customerId": "63243a6864c52f1156d665d0",
"shippingLines": [],
"shippingAmount": {
"currency": "USD",
"_id": "632899eeac3a1aa3b3eaeadd",
"value": 0,
"unit": "$"
},
"createdBy": "6222930b8bec060152bcad67",
"updatedBy": "6222930b8bec060152bcad67",
"createdAt": "2022-09-19T16:33:49.499Z",
"updatedAt": "2022-09-19T16:33:51.298Z",
"source": "BLIXO",
"initial": "",
"signatureUrl": "",
"approvalDetail": null,
"contractTerms": "Any changes in the specifications, quantities, schedule, and/or other aspects of the agreed to work and/or specified product that has come after the quote has been finalized are requested or approved by the signatory (you) and do not become binding upon our company (us) unless approved in writing by our company. Any such changes may result in increased charges or additional fees, and the signatory agrees to pay these increased expenses.",
"invoice": null,
"transactions": []
}
],
"pagination": {
"total": 1
}
}
This API endpoint allows you to retrieve a list of all quotes in the database. It's as simple as sending a GET request to https://api.blixo.com/v1/quotes
. Think of it as asking the server, "Hey, can I get a list of all your quotes?" And the server responds with the information you asked for!
HTTP Request
GET https://api.blixo.com/v1/quotes
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 quotes to retrieve per page. Default is 100 . |
quoteStatus | Array | Filter quotes by status, e.g. ISSUED , DRAFT , CLOSED . |
sort | Array | Sort quotes by field name and its ordering, e.g. sort[0]=invoiceNo&sort[1]=-1 . |
Example
To list all quotes, you would send a GET request to https://api.blixo.com/v1/quotes
. Remember to replace {API_KEY}
with your actual API key.
If you want to retrieve the third page of quotes, with 50 quotes per page, you would send a GET request to https://api.blixo.com/v1/quotes?page=3&perPage=50
.
Response
The response will be a JSON object with a data
key containing an array of quotes. Each quote will be an object with the following keys:
id
: The unique identifier of the quote.quoteNo
: The quote number.managerId
: The ID of the manager who issued the quote.issueDate
: The date the quote was issued.expireDate
: The date the quote will expire.billTo
: The billing details.notes
: Any notes regarding the quote.attachments
: Any attachments related to the quote.subTotalAmount
: The subtotal amount of the quote.totalAmount
: The total amount of the quote.balanceAmount
: The balance amount of the quote.quoteStatus
: The status of the quote.
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 quote
curl "https://api.blixo.com/v1/quotes" \
-u {API_KEY}: \
-d companyId="60e1b7f0c6ef4219ff51824c" \
-d customerId="61d68e42f8779e8cb38499be" \
-d issueDate="2021-08-22T17:18:17.182Z" \
-d expireDate="2021-08-22T17:18:17.182Z" \
-d contractTerms="Any changes in the specifications, quantities, schedule, and/or other aspects of the agreed to work and/or specified product that has come after the quote has been finalized are requested or approved by the signatory (you) and do not become binding upon our company (us) unless approved in writing by our company. Any such changes may result in increased charges or additional fees, and the signatory agrees to pay these increased expenses." \
-d notes="notes" \
-d quoteNo="3223232" \
-d quoteStatus[0]="ISSUED" \
-d shipTo[name]="Travis Waldron" \
-d shipTo[address1]="" \
-d shipTo[address2]="" \
-d shipTo[attn]="" \
-d shipTo[city]="" \
-d shipTo[country]="" \
-d shipTo[zipCode]="" \
-d shipTo[state]="" \
-d itemLines[0][_id]="615a5cc37d3e8f4f499bd423" \
-d itemLines[0][description]="MEMBER ADDON YEARLY" \
-d itemLines[0][title]="Title" \
-d itemLines[0][quantity]=1 \
-d itemLines[0][amount][unit]="$" \
-d itemLines[0][amount][value]="119.88" \
-d itemLines[0][rate][unit]="$" \
-d itemLines[0][rate][value]="119.88" \
-d depositAmount[currency]="USD" \
-d depositAmount[unit]="$" \
-d depositAmount[value]="" \
-X POST
const fetch = require('node-fetch');
const url = 'https://api.blixo.com/v1/quotes';
const options = {
method: 'POST',
headers: {
'Authorization': 'Basic ' + Buffer.from('{API_KEY}:').toString('base64'),
'Content-Type': 'application/json'
},
body: JSON.stringify({
companyId: "60e1b7f0c6ef4219ff51824c",
customerId: "61d68e42f8779e8cb38499be",
issueDate: "2021-08-22T17:18:17.182Z",
expireDate: "2021-08-22T17:18:17.182Z",
contractTerms: "Any changes in the specifications, quantities, schedule, and/or other aspects of the agreed to work and/or specified product that has come after the quote has been finalized are requested or approved by the signatory (you) and do not become binding upon our company (us) unless approved in writing by our company. Any such changes may result in increased charges or additional fees, and the signatory agrees to pay these increased expenses.",
notes: "notes",
quoteNo: "3223232",
quoteStatus: ["ISSUED"],
shipTo: {
name: "Travis Waldron",
address1: "",
address2: "",
attn: "",
city: "",
country: "",
zipCode: "",
state: ""
},
itemLines: [
{
_id: "615a5cc37d3e8f4f499bd423",
description: "MEMBER ADDON YEARLY",
title: "Title",
quantity: 1,
amount: {
unit: "$",
value: "119.88"
},
rate: {
unit: "$",
value: "119.88"
}
}
],
depositAmount: {
currency: "USD",
unit: "$",
value: ""
}
})
};
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/quotes",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode(array(
"companyId" => "60e1b7f0c6ef4219ff51824c",
"customerId" => "61d68e42f8779e8cb38499be",
"issueDate" => "2021-08-22T17:18:17.182Z",
"expireDate" => "2021-08-22T17:18:17.182Z",
"contractTerms" => "Any changes in the specifications, quantities, schedule, and/or other aspects of the agreed to work and/or specified product that has come after the quote has been finalized are requested or approved by the signatory (you) and do not become binding upon our company (us) unless approved in writing by our company. Any such changes may result in increased charges or additional fees, and the signatory agrees to pay these increased expenses.",
"notes" => "notes",
"quoteNo" => "3223232",
"quoteStatus" => array("ISSUED"),
"shipTo" => array(
"name" => "Travis Waldron",
"address1" => "",
"address2" => "",
"attn" => "",
"city" => "",
"country" => "",
"zipCode" => "",
"state" => ""
),
"itemLines" => array(
array(
"_id" => "615a5cc37d3e8f4f499bd423",
"description" => "MEMBER ADDON YEARLY",
"title" => "Title",
"quantity" => 1,
"amount" => array(
"unit" => "$",
"value" => "119.88"
),
"rate" => array(
"unit" => "$",
"value" => "119.88"
)
)
),
"depositAmount" => array(
"currency" => "USD",
"unit" => "$",
"value" => ""
)
)),
CURLOPT_HTTPHEADER => array(
"Authorization: Basic " . base64_encode("{API_KEY}:"),
"Content-Type: application/json"
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
?>
require 'uri'
require 'net/http'
require 'base64'
require 'json'
url = URI("https://api.blixo.com/v1/quotes")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic ' + Base64.strict_encode64('{API_KEY}:')
request["Content-Type"] = 'application/json'
request.body = JSON.generate({
companyId: "60e1b7f0c6ef4219ff51824c",
customerId: "61d68e42f8779e8cb38499be",
issueDate: "2021-08-22T17:18:17.182Z",
expireDate: "2021-08-22T17:18:17.182Z",
contractTerms: "Any changes in the specifications, quantities, schedule, and/or other aspects of the agreed to work and/or specified product that has come after the quote has been finalized are requested or approved by the signatory (you) and do not become binding upon our company (us) unless approved in writing by our company. Any such changes may result in increased charges or additional fees, and the signatory agrees to pay these increased expenses.",
notes: "notes",
quoteNo: "3223232",
quoteStatus: ["ISSUED"],
shipTo: {
name: "Travis Waldron",
address1: "",
address2: "",
attn: "",
city: "",
country: "",
zipCode: "",
state: ""
},
itemLines: [
{
_id: "615a5cc37d3e8f4f499bd423",
description: "MEMBER ADDON YEARLY",
title: "Title",
quantity: 1,
amount: {
unit: "$",
value: "119.88"
},
rate: {
unit: "$",
value: "119.88"
}
}
],
depositAmount: {
currency: "USD",
unit: "$",
value: ""
}
})
response = http.request(request)
puts response.read_body
import requests
import base64
import json
url = "https://api.blixo.com/v1/quotes"
api_key = "{API_KEY}"
headers = {
"Authorization": "Basic " + base64.b64encode((api_key + ":").encode()).decode(),
"Content-Type": "application/json"
}
data = json.dumps({
"companyId": "60e1b7f0c6ef4219ff51824c",
"customerId": "61d68e42f8779e8cb38499be",
"issueDate": "2021-08-22T17:18:17.182Z",
"expireDate": "2021-08-22T17:18:17.182Z",
"contractTerms": "Any changes in the specifications, quantities, schedule, and/or other aspects of the agreed to work and/or specified product that has come after the quote has been finalized are requested or approved by the signatory (you) and do not become binding upon our company (us) unless approved in writing by our company. Any such changes may result in increased charges or additional fees, and the signatory agrees to pay these increased expenses.",
"notes": "notes",
"quoteNo": "3223232",
"quoteStatus": ["ISSUED"],
"shipTo": {
"name": "Travis Waldron",
"address1": "",
"address2": "",
"attn": "",
"city": "",
"country": "",
"zipCode": "",
"state": ""
},
"itemLines": [
{
"_id": "615a5cc37d3e8f4f499bd423",
"description": "MEMBER ADDON YEARLY",
"title": "Title",
"quantity": 1,
"amount": {
"unit": "$",
"value": "119.88"
},
"rate": {
"unit": "$",
"value": "119.88"
}
}
],
"depositAmount": {
"currency": "USD",
"unit": "$",
"value": ""
}
})
response = requests.post(url, headers=headers, data=data)
print(response.text)
package main
import (
"fmt"
"net/http"
"io/ioutil"
"encoding/base64"
"bytes"
"encoding/json"
)
func main() {
url := "https://api.blixo.com/v1/quotes"
reqBody, _ := json.Marshal(map[string]interface{}{
"companyId": "60e1b7f0c6ef4219ff51824c",
"customerId": "61d68e42f8779e8cb38499be",
"issueDate": "2021-08-22T17:18:17.182Z",
"expireDate": "2021-08-22T17:18:17.182Z",
"contractTerms": "Any changes in the specifications, quantities, schedule, and/or other aspects of the agreed to work and/or specified product that has come after the quote has been finalized are requested or approved by the signatory (you) and do not become binding upon our company (us) unless approved in writing by our company. Any such changes may result in increased charges or additional fees, and the signatory agrees to pay these increased expenses.",
"notes": "notes",
"quoteNo": "3223232",
"quoteStatus": []string{"ISSUED"},
"shipTo": map[string]string{
"name": "Travis Waldron",
"address1": "",
"address2": "",
"attn": "",
"city": "",
"country": "",
"zipCode": "",
"state": "",
},
"itemLines": []map[string]interface{}{
{
"_id": "615a5cc37d3e8f4f499bd423",
"description": "MEMBER ADDON YEARLY",
"title": "Title",
"quantity": 1,
"amount": map[string]string{
"unit": "$",
"value": "119.88",
},
"rate": map[string]string{
"unit": "$",
"value": "119.88",
},
},
},
"depositAmount": map[string]string{
"currency": "USD",
"unit": "$",
"value": "",
},
})
req, _ := http.NewRequest("POST", url, bytes.NewBuffer(reqBody))
req.Header.Add("Authorization", "Basic " + base64.StdEncoding.EncodeToString([]byte("{API_KEY}:")))
req.Header.Add("Content-Type", "application/json")
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;
using Newtonsoft.Json;
using System.Collections.Generic;
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/quotes"),
Content = new StringContent(JsonConvert.SerializeObject(new
{
companyId = "60e1b7f0c6ef4219ff51824c",
customerId = "61d68e42f8779e8cb38499be",
issueDate = "2021-08-22T17:18:17.182Z",
expireDate = "2021-08-22T17:18:17.182Z",
contractTerms = "Any changes in the specifications, quantities, schedule, and/or other aspects of the agreed to work and/or specified product that has come after the quote has been finalized are requested or approved by the signatory (you) and do not become binding upon our company (us) unless approved in writing by our company. Any such changes may result in increased charges or additional fees, and the signatory agrees to pay these increased expenses.",
notes = "notes",
quoteNo = "3223232",
quoteStatus = new List<string> { "ISSUED" },
shipTo = new
{
name = "Travis Waldron",
address1 = "",
address2 = "",
attn = "",
city = "",
country = "",
zipCode = "",
state = ""
},
itemLines = new List<object>
{
new
{
_id = "615a5cc37d3e8f4f499bd423",
description = "MEMBER ADDON YEARLY",
title = "Title",
quantity = 1,
amount = new { unit = "$", value = "119.88" },
rate = new { unit = "$", value = "119.88" }
}
},
depositAmount = new { currency = "USD", unit = "$", value = "" }
}), Encoding.UTF8, "application/json")
};
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.MediaType;
import okhttp3.RequestBody;
import okhttp3.Request;
import okhttp3.Response;
import java.util.Base64;
import org.json.JSONObject;
import org.json.JSONArray;
public class Main {
public static void main(String[] args) {
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
JSONObject itemLine = new JSONObject();
itemLine.put("_id", "615a5cc37d3e8f4f499bd423");
itemLine.put("description", "MEMBER ADDON YEARLY");
itemLine.put("title", "Title");
itemLine.put("quantity", 1);
itemLine.put("amount", new JSONObject().put("unit", "$").put("value", "119.88"));
itemLine.put("rate", new JSONObject().put("unit", "$").put("value", "119.88"));
JSONArray itemLines = new JSONArray();
itemLines.put(itemLine);
JSONObject shipTo = new JSONObject();
shipTo.put("name", "Travis Waldron");
shipTo.put("address1", "");
shipTo.put("address2", "");
shipTo.put("attn", "");
shipTo.put("city", "");
shipTo.put("country", "");
shipTo.put("zipCode", "");
shipTo.put("state", "");
JSONArray quoteStatus = new JSONArray();
quoteStatus.put("ISSUED");
JSONObject depositAmount = new JSONObject();
depositAmount.put("currency", "USD");
depositAmount.put("unit", "$");
depositAmount.put("value", "");
JSONObject body = new JSONObject();
body.put("companyId", "60e1b7f0c6ef4219ff51824c");
body.put("customerId", "61d68e42f8779e8cb38499be");
body.put("issueDate", "2021-08-22T17:18:17.182Z");
body.put("expireDate", "2021-08-22T17:18:17.182Z");
body.put("contractTerms", "Any changes in the specifications, quantities, schedule, and/or other aspects of the agreed to work and/or specified product that has come after the quote has been finalized are requested or approved by the signatory (you) and do not become binding upon our company (us) unless approved in writing by our company. Any such changes may result in increased charges or additional fees, and the signatory agrees to pay these increased expenses.");
body.put("notes", "notes");
body.put("quoteNo", "3223232");
body.put("quoteStatus", quoteStatus);
body.put("shipTo", shipTo);
body.put("itemLines", itemLines);
body.put("depositAmount", depositAmount);
RequestBody requestBody = RequestBody.create(mediaType, body.toString());
String url = "https://api.blixo.com/v1/quotes";
String encoding = Base64.getEncoder().encodeToString(("{API_KEY}:".getBytes()));
Request request = new Request.Builder()
.url(url)
.post(requestBody)
.addHeader("Authorization", "Basic " + encoding)
.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": "63649a7ebc92e4015cd12bc7",
"quoteNo": "3223232",
"managerId": "65289eb09d9571a357f09a5c",
"issueDate": "2022-11-04T04:51:12.993Z",
"expireDate": "2022-11-04T04:51:12.993Z",
"notes": "45324634453536353941433339384332:2044a5fffdd9cbe1557b4354efcf14ba",
"subTotalAmount": {
"currency": "USD",
"_id": "63649a7fbc92e4015cd12be1",
"value": 0,
"unit": "$"
},
"totalAmount": {
"currency": "USD",
"value": 0,
"unit": "$"
},
"balanceAmount": {
"currency": "USD",
"value": -3232,
"unit": "$"
},
"quoteStatus": [
"ISSUED"
],
"sentStatus": "NOT_SENT",
"discountLines": [],
"discountAmount": {
"currency": "USD",
"_id": "63649a7fbc92e4015cd12bde",
"value": 0,
"unit": "$"
},
"discountedAmount": {
"currency": "USD",
"_id": "63649a7fbc92e4015cd12bdf",
"value": 0,
"unit": "$"
},
"taxLines": [],
"taxAmount": {
"currency": "USD",
"_id": "63649a7fbc92e4015cd12be0",
"value": 0,
"unit": "$"
},
"depositAmount": {
"currency": "USD",
"_id": "63649a7ebc92e4015cd12bcb",
"unit": "$",
"value": 3232
},
"companyId": "622294998bec060152bcad9c",
"customerId": "6331629360eea3015e855e40",
"shippingLines": [],
"shippingAmount": {
"currency": "USD",
"_id": "63649a7fbc92e4015cd12be2",
"value": 0,
"unit": "$"
},
"createdBy": "6222930b8bec060152bcad67",
"updatedBy": "6222930b8bec060152bcad67",
"createdAt": "2022-11-04T04:52:14.936Z",
"updatedAt": "2022-11-04T04:52:15.020Z",
"source": "BLIXO",
"initial": "",
"signatureUrl": "",
"approvalDetail": null,
"contractTerms": "Any changes in the specifications, quantities, schedule, and/or other aspects of the agreed to work and/or specified product that has come after the quote has been finalized are requested or approved by the signatory (you) and do not become binding upon our company (us) unless approved in writing by our company. Any such changes may result in increased charges or additional fees, and the signatory agrees to pay these increased expenses.",
"invoice": null
}
}
This API endpoint allows you to create a new quote in the database. It's as simple as sending a POST request to https://api.blixo.com/v1/quotes
. Think of it as telling the server, "Hey, I want to create a new quote!" And the server responds with the information about the newly created quote!
HTTP Request
POST https://api.blixo.com/v1/quotes
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. |
issueDate | String | (required) The date the quote was issued. |
expireDate | String | (required) The date the quote will expire. |
contractTerms | String | The contract terms of the quote. |
notes | String | Any notes regarding the quote. |
quoteNo | String | The quote number. |
quoteStatus | Array | The status of the quote, e.g. ISSUED . |
shipTo | Object | The shipping details, includes address1 , address2 , attn , city , country , phones , state , zipCode . |
itemLines | Array | The item lines of the quote, each item is an object includes title , description , quantity , rate , taxLines ,integrations , amount , rate . |
depositAmount | Object | The deposit amount of the quote, includes currency , unit , value . |
Example
To create a new quote, you would send a POST request to https://api.blixo.com/v1/quotes
. Remember to replace {API_KEY}
with your actual API key.
Response
The response will be a JSON object with a data
key containing the details of the newly created quote. 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 quote
curl "https://api.blixo.com/v1/quotes/:quoteId" \
-u {API_KEY}: \
-d companyId="60e1b7f0c6ef4219ff51824c" \
-d customerId="61d68e42f8779e8cb38499be" \
-d issueDate="2021-08-22T17:18:17.182Z" \
-d expireDate="2021-08-22T17:18:17.182Z" \
-d contractTerms="Any changes in the specifications, quantities, schedule, and/or other aspects of the agreed to work and/or specified product that has come after the quote has been finalized are requested or approved by the signatory (you) and do not become binding upon our company (us) unless approved in writing by our company. Any such changes may result in increased charges or additional fees, and the signatory agrees to pay these increased expenses." \
-d notes="notes" \
-d quoteNo="3223232" \
-d quoteStatus[0]="ISSUED" \
-d shipTo[name]="Travis Waldron" \
-d shipTo[address1]="" \
-d shipTo[address2]="" \
-d shipTo[attn]="" \
-d shipTo[city]="" \
-d shipTo[country]="" \
-d shipTo[zipCode]="" \
-d shipTo[state]="" \
-d itemLines[0][_id]="615a5cc37d3e8f4f499bd423" \
-d itemLines[0][description]="MEMBER ADDON YEARLY" \
-d itemLines[0][title]="Title" \
-d itemLines[0][quantity]=1 \
-d itemLines[0][amount][unit]="$" \
-d itemLines[0][amount][value]="119.88" \
-d itemLines[0][rate][unit]="$" \
-d itemLines[0][rate][value]="119.88" \
-d depositAmount[currency]="USD" \
-d depositAmount[unit]="$" \
-d depositAmount[value]="" \
-X PATCH
const fetch = require('node-fetch');
const url = 'https://api.blixo.com/v1/quotes/:quoteId';
const options = {
method: 'PATCH',
headers: {
'Authorization': 'Basic ' + Buffer.from('{API_KEY}:').toString('base64'),
'Content-Type': 'application/json'
},
body: JSON.stringify({
companyId: "60e1b7f0c6ef4219ff51824c",
customerId: "61d68e42f8779e8cb38499be",
issueDate: "2021-08-22T17:18:17.182Z",
expireDate: "2021-08-22T17:18:17.182Z",
contractTerms: "Any changes in the specifications, quantities, schedule, and/or other aspects of the agreed to work and/or specified product that has come after the quote has been finalized are requested or approved by the signatory (you) and do not become binding upon our company (us) unless approved in writing by our company. Any such changes may result in increased charges or additional fees, and the signatory agrees to pay these increased expenses.",
notes: "notes",
quoteNo: "3223232",
quoteStatus: ["ISSUED"],
shipTo: {
name: "Travis Waldron",
address1: "",
address2: "",
attn: "",
city: "",
country: "",
zipCode: "",
state: ""
},
itemLines: [{
_id: "615a5cc37d3e8f4f499bd423",
description: "MEMBER ADDON YEARLY",
title: "Title",
quantity: 1,
amount: {
unit: "$",
value: "119.88"
},
rate: {
unit: "$",
value: "119.88"
}
}],
depositAmount: {
currency: "USD",
unit: "$",
value: ""
}
})
};
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/quotes/:quoteId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode(array(
"companyId" => "60e1b7f0c6ef4219ff51824c",
"customerId" => "61d68e42f8779e8cb38499be",
"issueDate" => "2021-08-22T17:18:17.182Z",
"expireDate" => "2021-08-22T17:18:17.182Z",
"contractTerms" => "Any changes in the specifications, quantities, schedule, and/or other aspects of the agreed to work and/or specified product that has come after the quote has been finalized are requested or approved by the signatory (you) and do not become binding upon our company (us) unless approved in writing by our company. Any such changes may result in increased charges or additional fees, and the signatory agrees to pay these increased expenses.",
"notes" => "notes",
"quoteNo" => "3223232",
"quoteStatus" => array("ISSUED"),
"shipTo" => array(
"name" => "Travis Waldron",
"address1" => "",
"address2" => "",
"attn" => "",
"city" => "",
"country" => "",
"zipCode" => "",
"state" => ""
),
"itemLines" => array(array(
"_id" => "615a5cc37d3e8f4f499bd423",
"description" => "MEMBER ADDON YEARLY",
"title" => "Title",
"quantity" => 1,
"amount" => array(
"unit" => "$",
"value" => "119.88"
),
"rate" => array(
"unit" => "$",
"value" => "119.88"
)
)),
"depositAmount" => array(
"currency" => "USD",
"unit" => "$",
"value" => ""
)
)),
CURLOPT_HTTPHEADER => array(
"Authorization: Basic " . base64_encode("{API_KEY}:"),
"Content-Type: application/json"
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
?>
require 'uri'
require 'net/http'
require 'base64'
require 'json'
url = URI("https://api.blixo.com/v1/quotes/:quoteId")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Basic ' + Base64.strict_encode64('{API_KEY}:')
request["Content-Type"] = 'application/json'
request.body = JSON.dump({
"companyId" => "60e1b7f0c6ef4219ff51824c",
"customerId" => "61d68e42f8779e8cb38499be",
"issueDate" => "2021-08-22T17:18:17.182Z",
"expireDate" => "2021-08-22T17:18:17.182Z",
"contractTerms" => "Any changes in the specifications, quantities, schedule, and/or other aspects of the agreed to work and/or specified product that has come after the quote has been finalized are requested or approved by the signatory (you) and do not become binding upon our company (us) unless approved in writing by our company. Any such changes may result in increased charges or additional fees, and the signatory agrees to pay these increased expenses.",
"notes" => "notes",
"quoteNo" => "3223232",
"quoteStatus" => ["ISSUED"],
"shipTo" => {
"name" => "Travis Waldron",
"address1" => "",
"address2" => "",
"attn" => "",
"city" => "",
"country" => "",
"zipCode" => "",
"state" => ""
},
"itemLines" => [{
"_id" => "615a5cc37d3e8f4f499bd423",
"description" => "MEMBER ADDON YEARLY",
"title" => "Title",
"quantity" => 1,
"amount" => {
"unit" => "$",
"value" => "119.88"
},
"rate" => {
"unit" => "$",
"value" => "119.88"
}
}],
"depositAmount" => {
"currency" => "USD",
"unit" => "$",
"value" => ""
}
})
response = http.request(request)
puts response.read_body
import requests
import base64
import json
url = "https://api.blixo.com/v1/quotes/:quoteId"
api_key = "{API_KEY}"
headers = {
"Authorization": "Basic " + base64.b64encode((api_key + ":").encode()).decode(),
"Content-Type": "application/json"
}
data = json.dumps({
"companyId": "60e1b7f0c6ef4219ff51824c",
"customerId": "61d68e42f8779e8cb38499be",
"issueDate": "2021-08-22T17:18:17.182Z",
"expireDate": "2021-08-22T17:18:17.182Z",
"contractTerms": "Any changes in the specifications, quantities, schedule, and/or other aspects of the agreed to work and/or specified product that has come after the quote has been finalized are requested or approved by the signatory (you) and do not become binding upon our company (us) unless approved in writing by our company. Any such changes may result in increased charges or additional fees, and the signatory agrees to pay these increased expenses.",
"notes": "notes",
"quoteNo": "3223232",
"quoteStatus": ["ISSUED"],
"shipTo": {
"name": "Travis Waldron",
"address1": "",
"address2": "",
"attn": "",
"city": "",
"country": "",
"zipCode": "",
"state": ""
},
"itemLines": [{
"_id": "615a5cc37d3e8f4f499bd423",
"description": "MEMBER ADDON YEARLY",
"title": "Title",
"quantity": 1,
"amount": {
"unit": "$",
"value": "119.88"
},
"rate": {
"unit": "$",
"value": "119.88"
}
}],
"depositAmount": {
"currency": "USD",
"unit": "$",
"value": ""
}
})
response = requests.patch(url, headers=headers, data=data)
print(response.text)
package main
import (
"fmt"
"net/http"
"io/ioutil"
"encoding/base64"
"strings"
)
func main() {
url := "https://api.blixo.com/v1/quotes/:quoteId"
method := "PATCH"
payload := strings.NewReader(`{
"companyId": "60e1b7f0c6ef4219ff51824c",
"customerId": "61d68e42f8779e8cb38499be",
"issueDate": "2021-08-22T17:18:17.182Z",
"expireDate": "2021-08-22T17:18:17.182Z",
"contractTerms": "Any changes in the specifications, quantities, schedule, and/or other aspects of the agreed to work and/or specified product that has come after the quote has been finalized are requested or approved by the signatory (you) and do not become binding upon our company (us) unless approved in writing by our company. Any such changes may result in increased charges or additional fees, and the signatory agrees to pay these increased expenses.",
"notes": "notes",
"quoteNo": "3223232",
"quoteStatus": ["ISSUED"],
"shipTo": {
"name": "Travis Waldron",
"address1": "",
"address2": "",
"attn": "",
"city": "",
"country": "",
"zipCode": "",
"state": ""
},
"itemLines": [{
"_id": "615a5cc37d3e8f4f499bd423",
"description": "MEMBER ADDON YEARLY",
"title": "Title",
"quantity": 1,
"amount": {
"unit": "$",
"value": "119.88"
},
"rate": {
"unit": "$",
"value": "119.88"
}
}],
"depositAmount": {
"currency": "USD",
"unit": "$",
"value": ""
}
}`)
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Authorization", "Basic " + base64.StdEncoding.EncodeToString([]byte("{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))
}
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 = new HttpMethod("PATCH"),
RequestUri = new Uri("https://api.blixo.com/v1/quotes/:quoteId"),
Content = new StringContent(`{
"companyId": "60e1b7f0c6ef4219ff51824c",
"customerId": "61d68e42f8779e8cb38499be",
"issueDate": "2021-08-22T17:18:17.182Z",
"expireDate": "2021-08-22T17:18:17.182Z",
"contractTerms": "Any changes in the specifications, quantities, schedule, and/or other aspects of the agreed to work and/or specified product that has come after the quote has been finalized are requested or approved by the signatory (you) and do not become binding upon our company (us) unless approved in writing by our company. Any such changes may result in increased charges or additional fees, and the signatory agrees to pay these increased expenses.",
"notes": "notes",
"quoteNo": "3223232",
"quoteStatus": ["ISSUED"],
"shipTo": {
"name": "Travis Waldron",
"address1": "",
"address2": "",
"attn": "",
"city": "",
"country": "",
"zipCode": "",
"state": ""
},
"itemLines": [{
"_id": "615a5cc37d3e8f4f499bd423",
"description": "MEMBER ADDON YEARLY",
"title": "Title",
"quantity": 1,
"amount": {
"unit": "$",
"value": "119.88"
},
"rate": {
"unit": "$",
"value": "119.88"
}
}],
"depositAmount": {
"currency": "USD",
"unit": "$",
"value": ""
}
}`, Encoding.UTF8, "application/json")
};
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.MediaType;
import okhttp3.RequestBody;
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/quotes/:quoteId";
String encoding = Base64.getEncoder().encodeToString(("{API_KEY}:".getBytes()));
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, `{
"companyId": "60e1b7f0c6ef4219ff51824c",
"customerId": "61d68e42f8779e8cb38499be",
"issueDate": "2021-08-22T17:18:17.182Z",
The above command returns JSON structured like this:
{
"data": {
"id": "63649a7ebc92e4015cd12bc7",
"quoteNo": "3223232",
"managerId": "65289eb09d9571a357f09a5c",
"issueDate": "2022-11-04T04:51:12.993Z",
"expireDate": "2022-11-04T04:51:12.993Z",
"billTo": {
"attn": "customer",
"phones": [],
"address1": "",
"address2": "",
"city": "",
"state": "",
"zipCode": "",
"country": "DE",
"integrations": {
"shopify": {
"addressId": "7571863634084"
}
},
"name": "customer"
},
"shipTo": {
"name": "customertest99",
"attn": "customer",
"address1": "Address 1",
"address2": "2323",
"country": "DE",
"city": "Address 2",
"state": "76543",
"zipCode": "1"
},
"notes": "3434343",
"attachments": [
""
],
"subTotalAmount": {
"currency": "USD",
"_id": "6364c292bc92e4015cd20c48",
"value": 0,
"unit": "$"
},
"totalAmount": {
"currency": "USD",
"value": 0,
"unit": "$"
},
"balanceAmount": {
"currency": "USD",
"value": -3232,
"unit": "$"
},
"quoteStatus": [
"ISSUED"
],
"sentStatus": "NOT_SENT",
"itemLines": [
{
"detail": null,
"_id": "63649a40a135707610508976",
"title": "3434",
"description": "",
"quantity": 1,
"rate": {
"currency": "USD",
"_id": "63649a7ebc92e4015cd12bc9",
"value": 0,
"unit": "$"
},
"amount": {
"currency": "USD",
"_id": "6364c292bc92e4015cd20c42",
"value": 0,
"unit": "$"
},
"taxLines": [],
"discountLines": [],
"discountAmount": {
"currency": "USD",
"_id": "6364c292bc92e4015cd20c40",
"value": 0,
"unit": "$"
},
"discountedAmount": {
"currency": "USD",
"_id": "6364c292bc92e4015cd20c41",
"value": 0,
"unit": "$"
}
}
],
"discountLines": [
{
"_id": "6329dc5985cd80015e9c0b51",
"name": "NGUYEN",
"amount": {
"currency": "USD",
"_id": "6329dc5985cd80015e9c0b52",
"unit": "%",
"value": 10
}
}
],
"discountAmount": {
"currency": "USD",
"_id": "6364c292bc92e4015cd20c46",
"value": 0,
"unit": "$"
},
"discountedAmount": {
"currency": "USD",
"_id": "6364c292bc92e4015cd20c47",
"value": 0,
"unit": "$"
},
"taxLines": [],
"taxAmount": {
"currency": "USD",
"_id": "63649a7fbc92e4015cd12be0",
"value": 0,
"unit": "$"
},
"depositAmount": {
"currency": "USD",
"_id": "6364c292bc92e4015cd20c2f",
"unit": "$",
"value": 3232
},
"companyId": "622294998bec060152bcad9c",
"customerId": "6331629360eea3015e855e40",
"shippingLines": [],
"shippingAmount": {
"currency": "USD",
"_id": "6364c292bc92e4015cd20c49",
"value": 0,
"unit": "$"
},
"createdBy": "6222930b8bec060152bcad67",
"updatedBy": "6222930b8bec060152bcad67",
"createdAt": "2022-11-04T04:52:14.936Z",
"updatedAt": "2022-11-04T07:43:14.682Z",
"source": "BLIXO",
"initial": "",
"signatureUrl": "",
"approvalDetail": null,
"contractTerms": "Any changes in the specifications, quantities, schedule, and/or other aspects of the agreed to work and/or specified product that has come after the quote has been finalized are requested or approved by the signatory (you) and do not become binding upon our company (us) unless approved in writing by our company. Any such changes may result in increased charges or additional fees, and the signatory agrees to pay these increased expenses.",
"invoice": null,
"transactions": []
}
}
This API endpoint allows you to update an existing quote in the database. It's as simple as sending a PATCH request to https://api.blixo.com/v1/quotes/:quoteId
. Think of it as telling the server, "Hey, I want to update this quote!" And the server responds with the information about the updated quote!
HTTP Request
PATCH https://api.blixo.com/v1/quotes/:quoteId
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. |
issueDate | String | (required) The date the quote was issued. |
expireDate | String | (required) The date the quote will expire. |
contractTerms | String | The contract terms of the quote. |
notes | String | Any notes regarding the quote. |
quoteNo | String | The quote number. |
quoteStatus | Array | The status of the quote, e.g. ISSUED . |
shipTo | Object | The shipping details, includes address1 , address2 , attn , city , country , phones , state , zipCode . |
itemLines | Array | The item lines of the quote, each item is an object includes title , description , quantity , rate , taxLines ,integrations , amount , rate . |
depositAmount | Object | The deposit amount of the quote, includes currency , unit , value . |
subTotalAmount | Object | The sub total amount of the quote, includes currency , unit , value . |
taxAmount | Object | The tax amount of the quote, includes currency , unit , value . |
shippingAmount | Object | The shipping amount of the quote, includes currency , unit , value . |
updatedAt | String | The date the quote was updated. |
updatedBy | String | The ID of the user who updated the quote. |
totalAmount | Object | The total amount of the quote, includes currency , unit , value . |
taxLines | Array | The tax line items of the quote. |
sentStatus | String | The sent status of the quote, e.g. SENT or NOT_SENT . |
discountedAmount | Object | The discounted amount of the quote, includes currency , unit , value . |
Example
To update a quote, you would send a PATCH request to https://api.blixo.com/v1/quotes/:quoteId
. Remember to replace {API_KEY}
and :quoteId
with your actual API key and the ID of the quote you want to update, respectively.
Response
The response will be a JSON object with a data
key containing the details of the updated quote. 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 quote
curl "https://api.blixo.com/v1/quotes/:quoteId" \
-u {API_KEY}: \
-X DELETE
const fetch = require('node-fetch');
const url = 'https://api.blixo.com/v1/quotes/:quoteId';
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/quotes/:quoteId",
CURLOPT_CUSTOMREQUEST => "DELETE",
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/quotes/:quoteId")
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
import base64
url = "https://api.blixo.com/v1/quotes/:quoteId"
api_key = "{API_KEY}"
headers = {
"Authorization": "Basic " + base64.b64encode((api_key + ":").encode()).decode()
}
response = requests.delete(url, headers=headers)
print(response.text)
package main
import (
"fmt"
"net/http"
"io/ioutil"
"encoding/base64"
)
func main() {
url := "https://api.blixo.com/v1/quotes/:quoteId"
req, _ := http.NewRequest("DELETE", 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.Delete,
RequestUri = new Uri("https://api.blixo.com/v1/quotes/:quoteId"),
};
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/quotes/:quoteId";
String encoding = Base64.getEncoder().encodeToString(("{API_KEY}:".getBytes()));
Request request = new Request.Builder()
.url(url)
.delete()
.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": "611d4216a747250146ade2cf"
}
This API endpoint allows you to remove an existing quote from the database. It's as simple as sending a DELETE request to https://api.blixo.com/v1/quotes/:quoteId
. Think of it as telling the server, "Hey, I want to delete this quote!" And the server responds with the confirmation of the deletion!
HTTP Request
DELETE https://api.blixo.com/v1/quotes/:quoteId
Headers
Key | Value |
---|---|
Authorization | Basic {API_KEY} |
Example
To delete a quote, you would send a DELETE request to https://api.blixo.com/v1/quotes/:quoteId
. Remember to replace {API_KEY}
and :quoteId
with your actual API key and the ID of the quote you want to delete, respectively.
Response
The response will be a JSON object with a data
key containing the ID of the deleted quote. 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 quote
curl "https://api.blixo.com/v1/quotes/:quoteId/actions/download" \
-u {API_KEY}: \
-X GET \
-o quote.pdf
const fetch = require('node-fetch');
const fs = require('fs');
const url = 'https://api.blixo.com/v1/quotes/:quoteId/actions/download';
const options = {
method: 'GET',
headers: {
'Authorization': 'Basic ' + Buffer.from('{API_KEY}:').toString('base64')
}
};
fetch(url, options)
.then(res => res.buffer())
.then(buffer => fs.writeFileSync('quote.pdf', buffer))
.catch(error => console.error(error));
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.blixo.com/v1/quotes/:quoteId/actions/download",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => array(
"Authorization: Basic " . base64_encode("{API_KEY}:")
),
));
$response = curl_exec($curl);
file_put_contents('quote.pdf', $response);
curl_close($curl);
?>
require 'uri'
require 'net/http'
require 'base64'
url = URI("https://api.blixo.com/v1/quotes/:quoteId/actions/download")
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)
File.open('quote.pdf', 'w') { |file| file.write(response.body) }
import requests
import base64
url = "https://api.blixo.com/v1/quotes/:quoteId/actions/download"
api_key = "{API_KEY}"
headers = {
"Authorization": "Basic " + base64.b64encode((api_key + ":").encode()).decode()
}
response = requests.get(url, headers=headers)
with open('quote.pdf', 'wb') as f:
f.write(response.content)
package main
import (
"fmt"
"net/http"
"io/ioutil"
"encoding/base64"
"os"
)
func main() {
url := "https://api.blixo.com/v1/quotes/:quoteId/actions/download"
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)
ioutil.WriteFile("quote.pdf", body, 0644)
}
using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using System.IO;
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/quotes/:quoteId/actions/download"),
};
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);
var content = await response.Content.ReadAsByteArrayAsync();
File.WriteAllBytes("quote.pdf", content);
}
}
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
import java.util.Base64;
import java.nio.file.Files;
import java.nio.file.Paths;
public class Main {
public static void main(String[] args) {
OkHttpClient client = new OkHttpClient();
String url = "https://api.blixo.com/v1/quotes/:quoteId/actions/download";
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()) {
Files.write(Paths.get("quote.pdf"), response.body().bytes());
} catch (Exception e) {
e.printStackTrace();
}
}
}
This API endpoint allows you to download an existing quote from the database. It's as simple as sending a GET request to https://api.blixo.com/v1/quotes/:quoteId/actions/download
. Think of it as telling the server, "Hey, I want to download this quote!" And the server responds with the quote in a downloadable format!
HTTP Request
GET https://api.blixo.com/v1/quotes/:quoteId/actions/download
Headers
Key | Value |
---|---|
Authorization | Basic {API_KEY} |
Example
To download a quote, you would send a GET request to https://api.blixo.com/v1/quotes/:quoteId/actions/download
. Remember to replace {API_KEY}
and :quoteId
with your actual API key and the ID of the quote you want to download, respectively.
Response
The response will be a downloadable file of the quote. 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.
Send a quote
curl "https://api.blixo.com/v1/quotes/:quoteId/send" \
-d to="customer@blixo.com" \
-d bcc="bcc_customer@blixo.com" \
-d subject="{{company_name}} Quote {{quote_number}} for {{customer_name}}" \
-d message="Hi {{customer_contact_name}},
We prepared Quote #{{quote_number}} for you. We kindly ask that you review the quote as soon as you can.
If you have questions about this quote, please contact us at {{company_email}} or reply to this email.
We look forward to doing business with you.
{{view_approve_quote_button}}" \
-X POST
const fetch = require('node-fetch');
const url = 'https://api.blixo.com/v1/quotes/:quoteId/send';
const options = {
method: 'POST',
headers: {
'Authorization': 'Basic ' + Buffer.from('{API_KEY}:').toString('base64'),
'Content-Type': 'application/json'
},
body: JSON.stringify({
to: 'customer@blixo.com',
bcc: 'bcc_customer@blixo.com',
subject: '{{company_name}} Quote {{quote_number}} for {{customer_name}}',
message: 'Hi {{customer_contact_name}},\nWe prepared Quote #{{quote_number}} for you. We kindly ask that you review the quote as soon as you can.\nIf you have questions about this quote, please contact us at {{company_email}} or reply to this email.\nWe look forward to doing business with you.\n{{view_approve_quote_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/quotes/:quoteId/send",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode(array(
"to" => "customer@blixo.com",
"bcc" => "bcc_customer@blixo.com",
"subject" => "{{company_name}} Quote {{quote_number}} for {{customer_name}}",
"message" => "Hi {{customer_contact_name}},\nWe prepared Quote #{{quote_number}} for you. We kindly ask that you review the quote as soon as you can.\nIf you have questions about this quote, please contact us at {{company_email}} or reply to this email.\nWe look forward to doing business with you.\n{{view_approve_quote_button}}"
)),
CURLOPT_HTTPHEADER => array(
"Authorization: Basic " . base64_encode("{API_KEY}:"),
"Content-Type: application/json"
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
?>
require 'uri'
require 'net/http'
require 'json'
require 'base64'
url = URI("https://api.blixo.com/v1/quotes/:quoteId/send")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic ' + Base64.strict_encode64('{API_KEY}:')
request["Content-Type"] = 'application/json'
request.body = JSON.dump({
"to" => "customer@blixo.com",
"bcc" => "bcc_customer@blixo.com",
"subject" => "{{company_name}} Quote {{quote_number}} for {{customer_name}}",
"message" => "Hi {{customer_contact_name}},\nWe prepared Quote #{{quote_number}} for you. We kindly ask that you review the quote as soon as you can.\nIf you have questions about this quote, please contact us at {{company_email}} or reply to this email.\nWe look forward to doing business with you.\n{{view_approve_quote_button}}"
})
response = http.request(request)
puts response.read_body
import requests
import base64
import json
url = "https://api.blixo.com/v1/quotes/:quoteId/send"
api_key = "{API_KEY}"
headers = {
"Authorization": "Basic " + base64.b64encode((api_key + ":").encode()).decode(),
"Content-Type": "application/json"
}
data = {
"to": "customer@blixo.com",
"bcc": "bcc_customer@blixo.com",
"subject": "{{company_name}} Quote {{quote_number}} for {{customer_name}}",
"message": "Hi {{customer_contact_name}},\nWe prepared Quote #{{quote_number}} for you. We kindly ask that you review the quote as soon as you can.\nIf you have questions about this quote, please contact us at {{company_email}} or reply to this email.\nWe look forward to doing business with you.\n{{view_approve_quote_button}}"
}
response = requests.post(url, headers=headers, data=json.dumps(data))
print(response.text)
package main
import (
"fmt"
"net/http"
"bytes"
"encoding/base64"
"encoding/json"
)
func main() {
url := "https://api.blixo.com/v1/quotes/:quoteId/send"
data := map[string]string{
"to": "customer@blixo.com",
"bcc": "bcc_customer@blixo.com",
"subject": "{{company_name}} Quote {{quote_number}} for {{customer_name}}",
"message": "Hi {{customer_contact_name}},\nWe prepared Quote #{{quote_number}} for you. We kindly ask that you review the quote as soon as you can.\nIf you have questions about this quote, please contact us at {{company_email}} or reply to this email.\nWe look forward to doing business with you.\n{{view_approve_quote_button}}",
}
jsonData, err := json.Marshal(data)
if err != nil {
fmt.Println(err)
}
req, _ := http.NewRequest("POST", url, bytes.NewBuffer(jsonData))
req.Header.Add("Authorization", "Basic " + base64.StdEncoding.EncodeToString([]byte("{API_KEY}:")))
req.Header.Add("Content-Type", "application/json")
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;
using Newtonsoft.Json;
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/quotes/:quoteId/send"),
Content = new StringContent(JsonConvert.SerializeObject(new
{
to = "customer@blixo.com",
bcc = "bcc_customer@blixo.com",
subject = "{{company_name}} Quote {{quote_number}} for {{customer_name}}",
message = "Hi {{customer_contact_name}},\nWe prepared Quote #{{quote_number}} for you. We kindly ask that you review the quote as soon as you can.\nIf you have questions about this quote, please contact us at {{company_email}} or reply to this email.\nWe look forward to doing business with you.\n{{view_approve_quote_button}}"
}), Encoding.UTF8, "application/json")
};
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.MediaType;
import okhttp3.RequestBody;
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/quotes/:quoteId/send";
String encoding = Base64.getEncoder().encodeToString(("{API_KEY}:".getBytes()));
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}} Quote {{quote_number}} for {{customer_name}}\",\n\t\"message\": \"Hi {{customer_contact_name}},\\nWe prepared Quote #{{quote_number}} for you. We kindly ask that you review the quote as soon as you can.\\nIf you have questions about this quote, please contact us at {{company_email}} or reply to this email.\\nWe look forward to doing business with you.\\n{{view_approve_quote_button}}\"\n}");
Request request = new Request.Builder()
.url(url)
.post(body)
.addHeader("Authorization", "Basic " + encoding)
.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 an existing quote to a customer. It's as simple as sending a POST request to https://api.blixo.com/v1/quotes/:quoteId/send
. Think of it as telling the server, "Hey, I want to send this quote to the customer!" And the server responds by sending the quote to the specified email address!
HTTP Request
POST https://api.blixo.com/v1/quotes/:quoteId/send
Headers
Key | Value |
---|---|
Authorization | Basic {API_KEY} |
Parameters
Parameter | Type | Description |
---|---|---|
to | (required) Receiver's email | |
bcc | Bcc email | |
subject | string | (required) Email subject |
message | string | (required) Email message |
Example
To send a quote, you would send a POST request to https://api.blixo.com/v1/quotes/:quoteId/send
. Remember to replace {API_KEY}
and :quoteId
with your actual API key and the ID of the quote you want to send, respectively.
Response
The response will be a JSON object with a data
key containing the ID of the sent quote. 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.
Convert to invoice
curl "https://api.blixo.com/v1/quotes/:quoteId/actions/convertToInvoice" \
-u {API_KEY}: \
-X POST
const fetch = require('node-fetch');
const url = 'https://api.blixo.com/v1/quotes/:quoteId/actions/convertToInvoice';
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/quotes/:quoteId/actions/convertToInvoice",
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/quotes/:quoteId/actions/convertToInvoice")
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/quotes/:quoteId/actions/convertToInvoice"
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/quotes/:quoteId/actions/convertToInvoice"
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/quotes/:quoteId/actions/convertToInvoice"),
};
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/quotes/:quoteId/actions/convertToInvoice";
String encoding = Base64.getEncoder().encodeToString(("{API_KEY}:".getBytes()));
Request request = new Request.Builder()
.url(url)
.addHeader("Authorization", "Basic " + encoding)
.post(okhttp3.RequestBody.create(null, new byte[0]))
.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": "6364bcffbc92e4015cd205a9",
"quoteNo": "QTE-0006",
"managerId": "65289eb09d9571a357f09a5c",
"issueDate": "2022-11-04T07:15:35.258Z",
"expireDate": "2022-11-04T07:15:35.258Z",
"notes": "45324634453536353941433339384332:0a30a6b59f01a267e4cb2fdd9b6f7eb9",
"subTotalAmount": {
"currency": "USD",
"_id": "6364bcffbc92e4015cd205c4",
"value": 0,
"unit": "$"
},
"totalAmount": {
"currency": "USD",
"value": 0,
"unit": "$"
},
"balanceAmount": {
"currency": "USD",
"value": -23,
"unit": "$"
},
"quoteStatus": [
"INVOICED",
"CLOSED"
],
"sentStatus": "SENT",
"discountLines": [
{
"_id": "6329dc5985cd80015e9c0b51",
"name": "NGUYEN",
"amount": {
"currency": "USD",
"_id": "6329dc5985cd80015e9c0b52",
"unit": "%",
"value": 10
}
}
],
"discountAmount": {
"currency": "USD",
"_id": "6364bcffbc92e4015cd205c1",
"value": 0,
"unit": "$"
},
"discountedAmount": {
"currency": "USD",
"_id": "6364bcffbc92e4015cd205c2",
"value": 0,
"unit": "$"
},
"taxLines": [],
"taxAmount": {
"currency": "USD",
"_id": "6364bcffbc92e4015cd205c3",
"value": 0,
"unit": "$"
},
"depositAmount": {
"currency": "USD",
"_id": "6364bcffbc92e4015cd205ae",
"unit": "$",
"value": 23
},
"companyId": "622294998bec060152bcad9c",
"customerId": "6331629360eea3015e855e40",
"invoiceId": "6364ca54bc92e4015cd2b7c3",
"shippingLines": [],
"shippingAmount": {
"currency": "USD",
"_id": "6364bcffbc92e4015cd205c5",
"value": 0,
"unit": "$"
},
"createdBy": "6222930b8bec060152bcad67",
"updatedBy": "6222930b8bec060152bcad67",
"createdAt": "2022-11-04T07:19:27.655Z",
"updatedAt": "2022-11-04T08:16:20.805Z",
"source": "BLIXO",
"initial": "",
"signatureUrl": "",
"approvalDetail": null,
"contractTerms": "Any changes in the specifications, quantities, schedule, and/or other aspects of the agreed to work and/or specified product that has come after the quote has been finalized are requested or approved by the signatory (you) and do not become binding upon our company (us) unless approved in writing by our company. Any such changes may result in increased charges or additional fees, and the signatory agrees to pay these increased expenses.",
"transactions": [],
"invoice": {
"invoiceNo": "INV-4261",
"managerId": "65289eb09d9571a357f09a5c",
"notes": "",
"attachments": [
""
],
"paymentStatus": [
"PAID"
],
"invoiceStatus": [
"CLOSED"
],
"sentStatus": "NOT_SENT",
"disableChasing": true,
"useCustomerEmail": true,
"invoiceEmail": "",
"source": "BLIXO",
"isPaymentPlan": false,
"paymentPlanAutoPay": false,
"requireApprove": false,
"approvalDetail": null,
"attemptCount": 0,
"_id": "6364ca54bc92e4015cd2b7c3",
"discountLines": [
{
"_id": "6329dc5985cd80015e9c0b51",
"name": "NGUYEN",
"amount": {
"currency": "USD",
"_id": "6329dc5985cd80015e9c0b52",
"unit": "%",
"value": 10
}
}
],
"taxLines": [],
"shippingLines": [],
"chasingSchedules": [],
"installments": [],
"issueDate": "2022-11-04T08:16:20.681Z",
"paymentTerms": "AUTO_PAY",
"companyId": "622294998bec060152bcad9c",
"customerId": "6331629360eea3015e855e40",
"createdAt": "2022-11-04T08:16:20.688Z",
"updatedAt": "2022-11-04T08:16:20.774Z",
"__enc_billTo_d": "",
"__enc_billTo": false,
"__enc_shipTo_d": "",
"__enc_shipTo": false,
"__enc_attachments_d": "",
"__enc_attachments": false,
"__enc_itemLines_d": "",
"__enc_itemLines": false,
"__v": 1,
"balanceAmount": {
"currency": "USD",
"value": 0,
"unit": "$"
},
"creditAmount": {
"currency": "USD",
"_id": "6364ca54bc92e4015cd2b7e3",
"value": 0,
"unit": "$"
},
"discountAmount": {
"currency": "USD",
"_id": "6364ca54bc92e4015cd2b7db",
"value": 0,
"unit": "$"
},
"discountedAmount": {
"currency": "USD",
"_id": "6364ca54bc92e4015cd2b7dc",
"value": 0,
"unit": "$"
},
"paidAmount": {
"currency": "USD",
"_id": "6364ca54bc92e4015cd2b7e2",
"value": 0,
"unit": "$"
},
"paidDate": "2022-11-04T08:16:20.770Z",
"shippingAmount": {
"currency": "USD",
"_id": "6364ca54bc92e4015cd2b7df",
"value": 0,
"unit": "$"
},
"subTotalAmount": {
"currency": "USD",
"_id": "6364ca54bc92e4015cd2b7de",
"value": 0,
"unit": "$"
},
"taxAmount": {
"currency": "USD",
"_id": "6364ca54bc92e4015cd2b7dd",
"value": 0,
"unit": "$"
},
"totalAmount": {
"currency": "USD",
"value": 0,
"unit": "$"
},
"itemLines": [
{
"detail": null,
"_id": "6364bc17a1f539afd72f36be",
"title": "ádfgh",
"description": "",
"quantity": 1,
"rate": {
"currency": "USD",
"_id": "6364bcffbc92e4015cd205ab",
"value": 0,
"unit": "$"
},
"amount": {
"currency": "USD",
"_id": "6364ca54bc92e4015cd2b7da",
"value": 0,
"unit": "$"
},
"taxLines": [],
"discountLines": [],
"discountAmount": {
"currency": "USD",
"_id": "6364ca54bc92e4015cd2b7d8",
"value": 0,
"unit": "$"
},
"discountedAmount": {
"currency": "USD",
"_id": "6364ca54bc92e4015cd2b7d9",
"value": 0,
"unit": "$"
}
}
],
"billTo": {
"attn": "John Doe",
"phones": ["123-456-7890"],
"address1": "123 Main St",
"address2": "Apt 4B",
"city": "New York",
"state": "NY",
"zipCode": "10001",
"country": "US",
"integrations": {
"shopify": {
"addressId": "7571863634084"
}
},
"name": "John Doe"
},
"shipTo": {
"name": "Jane Doe",
"attn": "Jane Doe",
"address1": "456 Elm St",
"address2": "Suite 1A",
"country": "US",
"city": "Los Angeles",
"state": "CA",
"zipCode": "90001"
}
}
}
}
This API endpoint allows you to convert an existing quote to an invoice. It's as simple as sending a POST request to https://api.blixo.com/v1/quotes/:quoteId/actions/convertToInvoice
. Think of it as telling the server, "Hey, I want to convert this quote to an invoice!" And the server responds by converting the quote to an invoice!
HTTP Request
POST https://api.blixo.com/v1/quotes/:quoteId/actions/convertToInvoice
Headers
Key | Value |
---|---|
Authorization | Basic {API_KEY} |
Parameters
No parameters are required for this request.
Example
To convert a quote to an invoice, you would send a POST request to https://api.blixo.com/v1/quotes/:quoteId/actions/convertToInvoice
. Remember to replace {API_KEY}
and :quoteId
with your actual API key and the ID of the quote you want to convert, respectively.
Response
The response will be a JSON object with a data
key containing the ID of the converted invoice. 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.
Mark as approved
curl "https://api.blixo.com/v1/quotes/:quoteId/actions/markApproved" \
-u {API_KEY}: \
-X POST
const fetch = require('node-fetch');
const url = 'https://api.blixo.com/v1/quotes/:quoteId/actions/markApproved';
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/quotes/:quoteId/actions/markApproved",
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/quotes/:quoteId/actions/markApproved")
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/quotes/:quoteId/actions/markApproved"
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/quotes/:quoteId/actions/markApproved"
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/quotes/:quoteId/actions/markApproved"),
};
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/quotes/:quoteId/actions/markApproved";
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": "632899edac3a1aa3b3eaeac7",
"quoteNo": "QTE-0004",
"managerId": "65289eb09d9571a357f09a5c",
"issueDate": "2022-09-19T16:33:36.947Z",
"expireDate": "2022-09-19T16:33:36.947Z",
"notes": "",
"subTotalAmount": {
"currency": "USD",
"_id": "632899eeac3a1aa3b3eaeadc",
"value": 100,
"unit": "$"
},
"totalAmount": {
"currency": "USD",
"value": 100,
"unit": "$"
},
"balanceAmount": {
"currency": "USD",
"value": 100,
"unit": "$"
},
"quoteStatus": [
"INVOICED",
"CLOSED"
],
"sentStatus": "NOT_SENT",
"discountLines": [],
"discountAmount": {
"currency": "USD",
"_id": "632899eeac3a1aa3b3eaead9",
"value": 0,
"unit": "$"
},
"discountedAmount": {
"currency": "USD",
"_id": "632899eeac3a1aa3b3eaeada",
"value": 100,
"unit": "$"
},
"taxLines": [],
"taxAmount": {
"currency": "USD",
"_id": "632899eeac3a1aa3b3eaeadb",
"value": 0,
"unit": "$"
},
"companyId": "622294998bec060152bcad9c",
"customerId": "63243a6864c52f1156d665d0",
"invoiceId": "6364cc52bc92e4015cd2bb0b",
"shippingLines": [],
"shippingAmount": {
"currency": "USD",
"_id": "632899eeac3a1aa3b3eaeadd",
"value": 0,
"unit": "$"
},
"createdBy": "6222930b8bec060152bcad67",
"updatedBy": "6222930b8bec060152bcad67",
"createdAt": "2022-09-19T16:33:49.499Z",
"updatedAt": "2022-11-04T08:24:50.499Z",
"source": "BLIXO",
"initial": "",
"signatureUrl": "",
"approvalDetail": {
"ip": "116.109.9.246",
"client": {
"ua": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36",
"browser": {
"name": "Chrome",
"version": "106.0.0.0",
"major": "106"
},
"engine": {
"name": "Blink",
"version": "106.0.0.0"
},
"os": {
"name": "Mac OS",
"version": "10.15.7"
},
"device": {},
"cpu": {}
},
"timestamp": "2022-11-04T08:24:50.413Z"
},
"contractTerms": "Any changes in the specifications, quantities, schedule, and/or other aspects of the agreed to work and/or specified product that has come after the quote has been finalized are requested or approved by the signatory (you) and do not become binding upon our company (us) unless approved in writing by our company. Any such changes may result in increased charges or additional fees, and the signatory agrees to pay these increased expenses.",
"transactions": [],
"invoice": {
"invoiceNo": "INV-4262",
"managerId": "65289eb09d9571a357f09a5c",
"notes": "",
"attachments": [
""
],
"paymentStatus": [
"OUTSTANDING"
],
"invoiceStatus": [
"ISSUED"
],
"sentStatus": "NOT_SENT",
"disableChasing": true,
"useCustomerEmail": true,
"invoiceEmail": "",
"source": "BLIXO",
"isPaymentPlan": false,
"paymentPlanAutoPay": false,
"requireApprove": false,
"approvalDetail": null,
"attemptCount": 0,
"_id": "6364cc52bc92e4015cd2bb0b",
"discountLines": [],
"taxLines": [],
"shippingLines": [],
"chasingSchedules": [],
"installments": [],
"issueDate": "2022-11-04T08:24:50.436Z",
"paymentTerms": "AUTO_PAY",
"companyId": "622294998bec060152bcad9c",
"customerId": "63243a6864c52f1156d665d0",
"createdAt": "2022-11-04T08:24:50.439Z",
"updatedAt": "2022-11-04T08:24:50.477Z",
"__enc_billTo_d": "",
"__enc_billTo": false,
"__enc_attachments_d": "",
"__enc_attachments": false,
"__enc_itemLines_d": "",
"__enc_itemLines": false,
"__v": 0,
"balanceAmount": {
"currency": "USD",
"value": 100,
"unit": "$"
},
"creditAmount": {
"currency": "USD",
"_id": "6364cc52bc92e4015cd2bb30",
"value": 0,
"unit": "$"
},
"discountAmount": {
"currency": "USD",
"_id": "6364cc52bc92e4015cd2bb28",
"value": 0,
"unit": "$"
},
"discountedAmount": {
"currency": "USD",
"_id": "6364cc52bc92e4015cd2bb29",
"value": 100,
"unit": "$"
},
"paidAmount": {
"currency": "USD",
"_id": "6364cc52bc92e4015cd2bb2f",
"value": 0,
"unit": "$"
},
"paidDate": null,
"shippingAmount": {
"currency": "USD",
"_id": "6364cc52bc92e4015cd2bb2c",
"value": 0,
"unit": "$"
},
"subTotalAmount": {
"currency": "USD",
"_id": "6364cc52bc92e4015cd2bb2b",
"value": 100,
"unit": "$"
},
"taxAmount": {
"currency": "USD",
"_id": "6364cc52bc92e4015cd2bb2a",
"value": 0,
"unit": "$"
},
"totalAmount": {
"currency": "USD",
"value": 100,
"unit": "$"
},
"itemLines": [
{
"detail": null,
"_id": "632899e059848c7fd4ab3907",
"title": "test",
"description": "",
"quantity": 1,
"rate": {
"currency": "USD",
"_id": "632899edac3a1aa3b3eaeac9",
"unit": "$",
"value": 100
},
"amount": {
"currency": "USD",
"_id": "6364cc52bc92e4015cd2bb27",
"value": 100,
"unit": "$"
},
"taxLines": [],
"discountLines": [],
"discountAmount": {
"currency": "USD",
"_id": "6364cc52bc92e4015cd2bb25",
"value": 0,
"unit": "$"
},
"discountedAmount": {
"currency": "USD",
"_id": "6364cc52bc92e4015cd2bb26",
"value": 100,
"unit": "$"
}
}
],
"billTo": {
"attn": "",
"phones": [],
"address1": "",
"address2": "",
"city": "",
"state": "",
"zipCode": "",
"country": "",
"name": ""
}
}
}
}
This API endpoint allows you to approve a specific quote. It's as simple as sending a POST request to https://api.blixo.com/v1/quotes/:quoteId/actions/markApproved
. Think of it as telling the server, "Hey, I want to approve this quote!" And the server responds by marking the quote as approved!
HTTP Request
POST https://api.blixo.com/v1/quotes/:quoteId/actions/markApproved
Headers
Key | Value |
---|---|
Authorization | Basic {API_KEY} |
Example
To approve a quote, you would send a POST request to https://api.blixo.com/v1/quotes/:quoteId/actions/markApproved
. Remember to replace {API_KEY}
and :quoteId
with your actual API key and the ID of the quote you want to approve, respectively.
Response
The response will be a JSON object with a data
key containing the ID of the approved quote. 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.
Close a quote
curl "https://api.blixo.com/v1/quotes/:quoteId/actions/close" \
-u {API_KEY}: \
-X POST
const fetch = require('node-fetch');
const url = 'https://api.blixo.com/v1/quotes/:quoteId/actions/close';
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/quotes/:quoteId/actions/close",
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/quotes/:quoteId/actions/close")
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/quotes/:quoteId/actions/close"
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/quotes/:quoteId/actions/close"
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/quotes/:quoteId/actions/close"),
};
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/quotes/:quoteId/actions/close";
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": "63289763ac3a1aa3b3ead120",
"quoteNo": "QTE-0003",
"managerId": "65289eb09d9571a357f09a5c",
"issueDate": "2022-09-19T16:22:51.768Z",
"expireDate": "2022-09-19T16:22:51.768Z",
"billTo": {
"attn": "",
"phones": [],
"address1": "",
"address2": "",
"city": "",
"state": "",
"zipCode": "",
"country": "",
"name": ""
},
"notes": "",
"attachments": [
""
],
"subTotalAmount": {
"currency": "USD",
"_id": "63289764ac3a1aa3b3ead12c",
"value": 0,
"unit": "$"
},
"totalAmount": {
"currency": "USD",
"value": 0,
"unit": "$"
},
"balanceAmount": {
"currency": "USD",
"value": 0,
"unit": "$"
},
"quoteStatus": [
"DRAFT",
"CLOSED",
"DECLINED"
],
"sentStatus": "NOT_SENT",
"itemLines": [],
"discountLines": [],
"discountAmount": {
"currency": "USD",
"_id": "63289764ac3a1aa3b3ead129",
"value": 0,
"unit": "$"
},
"discountedAmount": {
"currency": "USD",
"_id": "63289764ac3a1aa3b3ead12a",
"value": 0,
"unit": "$"
},
"taxLines": [],
"taxAmount": {
"currency": "USD",
"_id": "63289764ac3a1aa3b3ead12b",
"value": 0,
"unit": "$"
},
"companyId": "622294998bec060152bcad9c",
"customerId": "6324b0af2eaf9a51dee5307e",
"shippingLines": [],
"shippingAmount": {
"currency": "USD",
"_id": "63289764ac3a1aa3b3ead12d",
"value": 0,
"unit": "$"
},
"createdBy": "6222930b8bec060152bcad67",
"updatedBy": "6222930b8bec060152bcad67",
"createdAt": "2022-09-19T16:22:59.353Z",
"updatedAt": "2022-11-04T08:32:03.460Z",
"source": "BLIXO",
"initial": "",
"signatureUrl": "",
"approvalDetail": null,
"contractTerms": "Any changes in the specifications, quantities, schedule, and/or other aspects of the agreed to work and/or specified product that has come after the quote has been finalized are requested or approved by the signatory (you) and do not become binding upon our company (us) unless approved in writing by our company. Any such changes may result in increased charges or additional fees, and the signatory agrees to pay these increased expenses.",
"invoice": null,
"transactions": []
}
}
This API endpoint allows you to close a specific quote. It's as simple as sending a POST request to https://api.blixo.com/v1/quotes/:quoteId/actions/close
. Think of it as telling the server, "Hey, I want to close this quote!" And the server responds by marking the quote as closed!
HTTP Request
POST https://api.blixo.com/v1/quotes/:quoteId/actions/close
Headers
Key | Value |
---|---|
Authorization | Basic {API_KEY} |
Example
To close a quote, you would send a POST request to https://api.blixo.com/v1/quotes/:quoteId/actions/close
. Remember to replace {API_KEY}
and :quoteId
with your actual API key and the ID of the quote you want to close, respectively.
Response
The response will be a JSON object with a data
key containing the ID of the closed quote. 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.
Void a quote
curl "https://api.blixo.com/v1/quotes/:quoteId/actions/void" \
-u {API_KEY}: \
-X POST
const fetch = require('node-fetch');
const url = 'https://api.blixo.com/v1/quotes/:quoteId/actions/void';
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/quotes/:quoteId/actions/void",
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/quotes/:quoteId/actions/void")
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/quotes/:quoteId/actions/void"
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/quotes/:quoteId/actions/void"
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/quotes/:quoteId/actions/void"),
};
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/quotes/:quoteId/actions/void";
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": "63289763ac3a1aa3b3ead120",
"quoteNo": "QTE-0003",
"managerId": "65289eb09d9571a357f09a5c",
"issueDate": "2022-09-19T16:22:51.768Z",
"expireDate": "2022-09-19T16:22:51.768Z",
"billTo": {
"attn": "",
"phones": [],
"address1": "",
"address2": "",
"city": "",
"state": "",
"zipCode": "",
"country": "",
"name": ""
},
"notes": "",
"attachments": [
""
],
"subTotalAmount": {
"currency": "USD",
"_id": "63289764ac3a1aa3b3ead12c",
"value": 0,
"unit": "$"
},
"totalAmount": {
"currency": "USD",
"value": 0,
"unit": "$"
},
"balanceAmount": {
"currency": "USD",
"value": 0,
"unit": "$"
},
"quoteStatus": [
"VOIDED"
],
"sentStatus": "NOT_SENT",
"itemLines": [],
"discountLines": [],
"discountAmount": {
"currency": "USD",
"_id": "63289764ac3a1aa3b3ead129",
"value": 0,
"unit": "$"
},
"discountedAmount": {
"currency": "USD",
"_id": "63289764ac3a1aa3b3ead12a",
"value": 0,
"unit": "$"
},
"taxLines": [],
"taxAmount": {
"currency": "USD",
"_id": "63289764ac3a1aa3b3ead12b",
"value": 0,
"unit": "$"
},
"companyId": "622294998bec060152bcad9c",
"customerId": "6324b0af2eaf9a51dee5307e",
"shippingLines": [],
"shippingAmount": {
"currency": "USD",
"_id": "63289764ac3a1aa3b3ead12d",
"value": 0,
"unit": "$"
},
"createdBy": "6222930b8bec060152bcad67",
"updatedBy": "6222930b8bec060152bcad67",
"createdAt": "2022-09-19T16:22:59.353Z",
"updatedAt": "2022-11-04T08:45:09.614Z",
"source": "BLIXO",
"initial": "",
"signatureUrl": "",
"approvalDetail": null,
"contractTerms": "Any changes in the specifications, quantities, schedule, and/or other aspects of the agreed to work and/or specified product that has come after the quote has been finalized are requested or approved by the signatory (you) and do not become binding upon our company (us) unless approved in writing by our company. Any such changes may result in increased charges or additional fees, and the signatory agrees to pay these increased expenses.",
"invoice": null,
"transactions": []
}
}
This API endpoint allows you to void a specific quote. It's as simple as sending a POST request to https://api.blixo.com/v1/quotes/:quoteId/actions/void
. Think of it as telling the server, "Hey, I want to void this quote!" And the server responds by marking the quote as voided!
HTTP Request
POST https://api.blixo.com/v1/quotes/:quoteId/actions/void
Headers
Key | Value |
---|---|
Authorization | Basic {API_KEY} |
Example
To void a quote, you would send a POST request to https://api.blixo.com/v1/quotes/:quoteId/actions/void
. Remember to replace {API_KEY}
and :quoteId
with your actual API key and the ID of the quote you want to void, respectively.
Response
The response will be a JSON object with a data
key containing the ID of the voided quote. 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.
Tasks
Task object
Attribute | Type | Description |
---|---|---|
id | ObjectId | The ID of the task. |
name | String | The name of the task. |
type | String | The type of the task, either REVIEW , MEETING , etc. |
customerId | ObjectId | The ID of the customer associated with the task. |
assignedTo | ObjectId | The ID of the user to whom the task is assigned. |
dueDate | Date | The due date of the task. |
completed | Boolean | Whether the task is completed. |
companyId | ObjectId | The ID of the company associated with the task. |
createdAt | Date | The date when the task was created. |
createdBy | ObjectId | The ID of the user who created the task. |
updatedBy | ObjectId | The ID of the user who last updated the task. |
List all tasks
curl "https://api.blixo.com/v1/tasks" \
-u {API_KEY}:
const fetch = require('node-fetch');
const url = 'https://api.blixo.com/v1/tasks';
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/tasks",
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/tasks")
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/tasks"
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/tasks"
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/tasks"),
};
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/tasks";
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": "635e9354a34c63015da92fc8",
"name": "customer",
"type": "EMAIL",
"customerId": "635b569ec9d031e8c45b3deb",
"assignedTo": "6222930b8bec060152bcad67",
"dueDate": "2022-10-31T10:07:52.000Z",
"completed": false,
"companyId": "622294998bec060152bcad9c",
"createdAt": "2022-10-30T15:08:04.984Z",
"createdBy": "6222930b8bec060152bcad67",
"updatedBy": "6222930b8bec060152bcad67"
}
],
"pagination": {
"total": 1
}
}
This API endpoint allows you to retrieve a list of all tasks in the database. It's as simple as sending a GET request to https://api.blixo.com/v1/tasks
. Think of it as asking the server, "Hey, can I get a list of all your tasks?" And the server responds with the information you asked for!
HTTP Request
GET https://api.blixo.com/v1/tasks
Headers
Key | Value |
---|---|
Authorization | Basic {API_KEY} |
Parameters
Parameter | Type | Description |
---|---|---|
assignedTo | objectId | Assigned To ID |
completed | boolean | If set TRUE to get tasks completed else for FALSE. |
page | integer | Current page |
perPage | integer | Number of items per pages |
dueDate | date | The due date of the task. |
createdBy | objectId | The ID of the person who created the task. |
updatedBy | objectId | The ID of the person who last updated the task. |
customerId | objectId | The ID of the customer. |
companyId | objectId | The ID of the company. |
type | string | The type of the task. |
name | string | The name of the task. |
Example
To list all tasks, you would send a GET request to https://api.blixo.com/v1/tasks
. Remember to replace {API_KEY}
with your actual API key.
If you want to retrieve the third page of tasks, with 50 tasks per page, you would send a GET request to https://api.blixo.com/v1/tasks?page=3&perPage=50
.
Response
The response will be a JSON object with a data
key containing an array of tasks. Each task will be an object with the following keys:
id
: The unique identifier of the task.name
: The name of the task.type
: The type of the task.customerId
: The ID of the customer.assignedTo
: The ID of the person the task is assigned to.dueDate
: The due date of the task.completed
: Whether the task is completed.companyId
: The ID of the company.createdAt
: The creation date of the task.createdBy
: The ID of the person who created the task.updatedBy
: The ID of the person who last updated the task.
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 task
curl "https://api.blixo.com/v1/tasks" \
-u {API_KEY}: \
const fetch = require('node-fetch');
const url = 'https://api.blixo.com/v1/tasks';
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/tasks",
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/tasks")
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/tasks"
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/tasks"
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/tasks"),
};
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/tasks";
String encoding = Base64.getEncoder().encodeToString(("{API_KEY}:".getBytes()));
Request request = new Request.Builder()
.url(url)
.post(okhttp3.RequestBody.create("", okhttp3.MediaType.parse("application/json; charset=utf-8")))
.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": "63652176bc92e4015cd4e29e",
"name": "customer add new task",
"type": "REVIEW",
"customerId": "6331629360eea3015e855e40",
"assignedTo": "6222930b8bec060152bcad67",
"dueDate": "2022-11-05T09:25:58.000Z",
"completed": false,
"companyId": "622294998bec060152bcad9c",
"createdAt": "2022-11-04T14:28:06.986Z",
"createdBy": "6222930b8bec060152bcad67",
"updatedBy": "6222930b8bec060152bcad67"
}
}
This API endpoint allows you to create a new task. It's as simple as sending a POST request to https://api.blixo.com/v1/tasks
. Think of it as telling the server, "Hey, I want to create a new task!" And the server responds by creating the task for you!
HTTP Request
POST https://api.blixo.com/v1/tasks
Headers
Key | Value |
---|---|
Authorization | Basic {API_KEY} |
Parameters
Parameter | Type | Description |
---|---|---|
name | string | (required) Task name |
assignedTo | objectId | Assigned To ID |
companyId | objectId | (required) Company ID |
customerId | objectId | (required) Customer ID |
dueDate | datetime | (required) Due date |
type | array | (required)Type of task, e.g. LETTER , REVIEW , EMAIL , PHONE |
completed | boolean | Task completion status, default is false |
createdAt | datetime | The date and time when the task was created |
createdBy | objectId | The ID of the person who created the task |
updatedBy | objectId | The ID of the person who last updated the task |
Example
To create a new task, you would send a POST request to https://api.blixo.com/v1/tasks
. Remember to replace {API_KEY}
with your actual API key.
Response
The response will be a JSON object with a data
key containing the details of the newly created task. 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.
Update a task
curl -X PATCH "https://api.blixo.com/v1/tasks/:taskId" \
-u {API_KEY}: \
-d name="Updated task name" \
-d assignedTo="objectId" \
-d companyId="objectId" \
-d customerId="objectId" \
-d dueDate="datetime" \
-d type="LETTER" \
-d completed="false"
const fetch = require('node-fetch');
const url = 'https://api.blixo.com/v1/tasks/:taskId';
const options = {
method: 'PATCH',
headers: {
'Authorization': 'Basic ' + Buffer.from('{API_KEY}:').toString('base64')
},
body: JSON.stringify({
name: 'Updated task name',
assignedTo: 'objectId',
companyId: 'objectId',
customerId: 'objectId',
dueDate: 'datetime',
type: 'LETTER',
completed: false
})
};
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/tasks/:taskId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => http_build_query(array(
'name' => 'Updated task name',
'assignedTo' => 'objectId',
'companyId' => 'objectId',
'customerId' => 'objectId',
'dueDate' => 'datetime',
'type' => 'LETTER',
'completed' => 'false'
)),
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/tasks/:taskId")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Basic ' + Base64.strict_encode64('{API_KEY}:')
request.set_form_data({
'name' => 'Updated task name',
'assignedTo' => 'objectId',
'companyId' => 'objectId',
'customerId' => 'objectId',
'dueDate' => 'datetime',
'type' => 'LETTER',
'completed' => 'false'
})
response = http.request(request)
puts response.read_body
import requests
import base64
url = "https://api.blixo.com/v1/tasks/:taskId"
api_key = "{API_KEY}"
headers = {
"Authorization": "Basic " + base64.b64encode((api_key + ":").encode()).decode()
}
data = {
'name': 'Updated task name',
'assignedTo': 'objectId',
'companyId': 'objectId',
'customerId': 'objectId',
'dueDate': 'datetime',
'type': 'LETTER',
'completed': 'false'
}
response = requests.patch(url, headers=headers, data=data)
print(response.text)
package main
import (
"fmt"
"net/http"
"io/ioutil"
"encoding/base64"
"strings"
)
func main() {
url := "https://api.blixo.com/v1/tasks/:taskId"
payload := strings.NewReader("name=Updated task name&assignedTo=objectId&companyId=objectId&customerId=objectId&dueDate=datetime&type=LETTER&completed=false")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Basic " + base64.StdEncoding.EncodeToString([]byte("{API_KEY}:")))
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
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.Patch,
RequestUri = new Uri("https://api.blixo.com/v1/tasks/:taskId"),
Content = new StringContent("name=Updated task name&assignedTo=objectId&companyId=objectId&customerId=objectId&dueDate=datetime&type=LETTER&completed=false", Encoding.UTF8, "application/x-www-form-urlencoded")
};
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.RequestBody;
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/tasks/:taskId";
String encoding = Base64.getEncoder().encodeToString(("{API_KEY}:".getBytes()));
RequestBody body = RequestBody.create("name=Updated task name&assignedTo=objectId&companyId=objectId&customerId=objectId&dueDate=datetime&type=LETTER&completed=false", null);
Request request = new Request.Builder()
.url(url)
.patch(body)
.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": "6365259fbc92e4015cd4e4b2",
"name": "customer update task",
"type": "PHONE",
"customerId": "62f135085ff37c016a57f0eb",
"assignedTo": "6222930b8bec060152bcad67",
"dueDate": "2022-11-05T04:45:29.000Z",
"completed": false,
"companyId": "622294998bec060152bcad9c",
"createdAt": "2022-11-04T14:45:51.539Z",
"createdBy": "6222930b8bec060152bcad67",
"updatedBy": "6222930b8bec060152bcad67"
}
}
This API endpoint allows you to modify an existing task. It's as simple as sending a PATCH request to https://api.blixo.com/v1/tasks/:taskId
. Think of it as telling the server, "Hey, I want to update this task!" And the server responds by updating the task for you!
HTTP Request
PATCH https://api.blixo.com/v1/tasks/:taskId
Headers
Key | Value |
---|---|
Authorization | Basic {API_KEY} |
Parameters
Parameter | Type | Description |
---|---|---|
name | string | (required) Task name |
assignedTo | objectId | Assigned To ID |
companyId | objectId | (required) Company ID |
customerId | objectId | (required) Customer ID |
dueDate | datetime | (required) Due date |
type | array | (required)Type of task, e.g. LETTER , REVIEW , EMAIL , PHONE |
completed | boolean | Task completion status, default is false |
createdAt | datetime | The date and time when the task was created |
createdBy | objectId | The ID of the person who created the task |
updatedBy | objectId | The ID of the person who last updated the task |
updatedAt | datetime | The date and time when the task was last updated |
Example
To update a task, you would send a PATCH request to https://api.blixo.com/v1/tasks/:taskId
. Remember to replace {API_KEY}
and :taskId
with your actual API key and the ID of the task you want to update.
Response
The response will be a JSON object with a data
key containing the details of the updated task. 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 task
curl "https://api.blixo.com/v1/tasks/:taskId" \
-u {API_KEY}: \
-X DELETE
const fetch = require('node-fetch');
const url = 'https://api.blixo.com/v1/tasks/:taskId';
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/tasks/:taskId",
CURLOPT_CUSTOMREQUEST => "DELETE",
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/tasks/:taskId")
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
import base64
url = "https://api.blixo.com/v1/tasks/:taskId"
api_key = "{API_KEY}"
headers = {
"Authorization": "Basic " + base64.b64encode((api_key + ":").encode()).decode()
}
response = requests.delete(url, headers=headers)
print(response.text)
package main
import (
"fmt"
"net/http"
"io/ioutil"
"encoding/base64"
)
func main() {
url := "https://api.blixo.com/v1/tasks/:taskId"
req, _ := http.NewRequest("DELETE", 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.Delete,
RequestUri = new Uri("https://api.blixo.com/v1/tasks/:taskId"),
};
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/tasks/:taskId";
String encoding = Base64.getEncoder().encodeToString(("{API_KEY}:".getBytes()));
Request request = new Request.Builder()
.url(url)
.delete()
.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": "611d4216a747250146ade2cf"
}
This API endpoint allows you to remove an existing task. It's as simple as sending a DELETE request to https://api.blixo.com/v1/tasks/:taskId
. Think of it as telling the server, "Hey, I want to delete this task!" And the server responds by deleting the task for you!
HTTP Request
DELETE https://api.blixo.com/v1/tasks/:taskId
Headers
Key | Value |
---|---|
Authorization | Basic {API_KEY} |
Example
To delete a task, you would send a DELETE request to https://api.blixo.com/v1/tasks/:taskId
. Remember to replace {API_KEY}
and :taskId
with your actual API key and the ID of the task you want to delete.
Response
The response will be a JSON object with a data
key containing the ID of the deleted task. 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.
Chasings
Chasing object
Attribute | Type | Description |
---|---|---|
id | ObjectId | The ID of the chasing. |
name | String | The name of the chasing. |
assignmentConditions | String | The assignment conditions of the chasing. |
assignmentMode | String | The assignment mode of the chasing. |
frequency | String | The frequency of the chasing. |
runDate | Number | The run date of the chasing. |
timeOfDay | Number | The time of day of the chasing. |
nextRun | Date | The next run of the chasing. |
isPausing | Boolean | Whether the chasing is pausing. |
lastRun | Date | The last run of the chasing. |
minBalance | Object | The minimum balance of the chasing. |
customerIds | Array | The customer IDs of the chasing. |
companyId | ObjectId | The ID of the company of the chasing. |
steps | Array | The steps of the chasing. |
createdBy | ObjectId | The ID of the user who created the chasing. |
updatedBy | ObjectId | The ID of the user who last updated the chasing. |
createdAt | Date | The date when the chasing was created. |
updatedAt | Date | The date when the chasing was last updated. |
deletedBy | ObjectId | The ID of the user who deleted the chasing. |
deletedAt | Date | The date when the chasing was deleted. |
isDeleted | Boolean | Whether the chasing is deleted. |
List all customer chasings
curl "https://api.blixo.com/v1/chasings" \
-u {API_KEY}:
const fetch = require('node-fetch');
const url = 'https://api.blixo.com/v1/chasings';
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/chasings",
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/chasings")
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/chasings"
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/chasings"
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/chasings"),
};
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/chasings";
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": "6203635fbd2219dad21363b0",
"name": "Test customer chasing",
"assignmentConditions": "",
"assignmentMode": "NEVER",
"frequency": "EVERY_DAY",
"runDate": 0,
"timeOfDay": 24,
"nextRun": "2022-02-18T17:00:00.000Z",
"isPausing": false,
"lastRun": "2022-02-14T17:00:00.000Z",
"minBalance": null,
"customerIds": [],
"companyId": "615ad8109e222b30b21c8903",
"steps": [
{
"action": "SEND_AN_EMAIL",
"assignedUserId": null,
"emailTemplateId": "62061815a2fd07fa205181e8",
"smsTemplateId": null,
"scheduleType": "ACCOUNT_AGE",
"days": 1,
"_id": "6203624563b939693d35c907",
"name": "Notification for issued invoices"
}
],
"createdBy": "615ad79a9e222b30b21c88ba",
"updatedBy": "615ad79a9e222b30b21c88ba",
"createdAt": "2022-02-09T06:46:55.808Z",
"updatedAt": "2022-02-18T06:23:40.642Z",
"customers": []
}
],
"pagination": {
"total": 1
}
}
This API endpoint allows you to retrieve a list of all customer chasings in the database. It's as simple as sending a GET request to https://api.blixo.com/v1/chasings
. Think of it as asking the server, "Hey, can I get a list of all your customer chasings?" And the server responds with the information you asked for!
HTTP Request
GET https://api.blixo.com/v1/chasings
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 chasings to retrieve per page. Default is 100 . |
Example
To list all customer chasings, you would send a GET request to https://api.blixo.com/v1/chasings
. Remember to replace {API_KEY}
with your actual API key.
If you want to retrieve the third page of chasings, with 50 chasings per page, you would send a GET request to https://api.blixo.com/v1/chasings?page=3&perPage=50
.
Response
The response will be a JSON object with a data
key containing an array of chasings. Each chasing will be an object with the following keys:
id
: The unique identifier of the chasing.name
: The name of the chasing.assignmentConditions
: The assignment conditions of the chasing.assignmentMode
: The assignment mode of the chasing.frequency
: The frequency of the chasing.runDate
: The run date of the chasing.timeOfDay
: The time of day of the chasing.nextRun
: The next run of the chasing.isPausing
: Whether the chasing is pausing.lastRun
: The last run of the chasing.minBalance
: The minimum balance of the chasing.customerIds
: The customer IDs of the chasing.companyId
: The company ID of the chasing.steps
: The steps of the chasing.createdBy
: The creator of the chasing.updatedBy
: The last person who updated the chasing.createdAt
: The creation date of the chasing.updatedAt
: The last update date of the chasing.customers
: The customers of the chasing.
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 chasing
curl "https://api.blixo.com/v1/chasings" \
-u {API_KEY}: \
-d companyId="615ad8109e222b30b21c8903" \
-d name="Test customer chasing" \
-d frequency="EVERY_DAY" \
-d timeOfDay="24" \
-d hasMinBalance="false" \
-d assignmentMode="NEVER" \
-d steps[0][name]="Notification for issued invoices" \
-d steps[0][action]="SEND_AN_EMAIL" \
-d steps[0][scheduleType]="ACCOUNT_AGE" \
-d steps[0][days]="1" \
-d steps[0][emailTemplateId]="62061815a2fd07fa205181e8" \
-X POST
const fetch = require('node-fetch');
const url = 'https://api.blixo.com/v1/chasings';
const options = {
method: 'POST',
headers: {
'Authorization': 'Basic ' + Buffer.from('{API_KEY}:').toString('base64'),
'Content-Type': 'application/json'
},
body: JSON.stringify({
companyId: "615ad8109e222b30b21c8903",
name: "Test customer chasing",
frequency: "EVERY_DAY",
timeOfDay: "24",
hasMinBalance: "false",
assignmentMode: "NEVER",
steps: [
{
name: "Notification for issued invoices",
action: "SEND_AN_EMAIL",
scheduleType: "ACCOUNT_AGE",
days: "1",
emailTemplateId: "62061815a2fd07fa205181e8"
}
]
})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error('error:' + err));
import requests
import json
import base64
url = "https://api.blixo.com/v1/chasings"
api_key = "{API_KEY}"
headers = {
"Authorization": "Basic " + base64.b64encode((api_key + ":").encode()).decode(),
"Content-Type": "application/json"
}
data = {
"companyId": "615ad8109e222b30b21c8903",
"name": "Test customer chasing",
"frequency": "EVERY_DAY",
"timeOfDay": "24",
"hasMinBalance": "false",
"assignmentMode": "NEVER",
"steps": [
{
"name": "Notification for issued invoices",
"action": "SEND_AN_EMAIL",
"scheduleType": "ACCOUNT_AGE",
"days": "1",
"emailTemplateId": "62061815a2fd07fa205181e8"
}
]
}
response = requests.post(url, headers=headers, data=json.dumps(data))
print(response.text)
require 'uri'
require 'net/http'
require 'json'
require 'base64'
url = URI("https://api.blixo.com/v1/chasings")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic ' + Base64.strict_encode64('{API_KEY}:')
request["Content-Type"] = 'application/json'
request.body = JSON.dump({
"companyId" => "615ad8109e222b30b21c8903",
"name" => "Test customer chasing",
"frequency" => "EVERY_DAY",
"timeOfDay" => "24",
"hasMinBalance" => "false",
"assignmentMode" => "NEVER",
"steps" => [
{
"name" => "Notification for issued invoices",
"action" => "SEND_AN_EMAIL",
"scheduleType" => "ACCOUNT_AGE",
"days" => "1",
"emailTemplateId" => "62061815a2fd07fa205181e8"
}
]
})
response = http.request(request)
puts response.read_body
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.blixo.com/v1/chasings",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => array(
"Authorization: Basic " . base64_encode("{API_KEY}:"),
"Content-Type: application/json"
),
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => json_encode(array(
"companyId" => "615ad8109e222b30b21c8903",
"name" => "Test customer chasing",
"frequency" => "EVERY_DAY",
"timeOfDay" => "24",
"hasMinBalance" => "false",
"assignmentMode" => "NEVER",
"steps" => array(
array(
"name" => "Notification for issued invoices",
"action" => "SEND_AN_EMAIL",
"scheduleType" => "ACCOUNT_AGE",
"days" => "1",
"emailTemplateId" => "62061815a2fd07fa205181e8"
)
)
))
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
?>
import okhttp3.OkHttpClient;
import okhttp3.MediaType;
import okhttp3.RequestBody;
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/chasings";
String encoding = Base64.getEncoder().encodeToString(("{API_KEY}:".getBytes()));
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\\\"companyId\\\": \\\"615ad8109e222b30b21c8903\\\",\\\"name\\\": \\\"Test customer chasing\\\",\\\"frequency\\\": \\\"EVERY_DAY\\\",\\\"timeOfDay\\\": \\\"24\\\",\\\"hasMinBalance\\\": \\\"false\\\",\\\"assignmentMode\\\": \\\"NEVER\\\",\\\"steps\\\": [{\\\"name\\\": \\\"Notification for issued invoices\\\",\\\"action\\\": \\\"SEND_AN_EMAIL\\\",\\\"scheduleType\\\": \\\"ACCOUNT_AGE\\\",\\\"days\\\": \\\"1\\\",\\\"emailTemplateId\\\": \\\"62061815a2fd07fa205181e8\\\"}]}");
Request request = new Request.Builder()
.url(url)
.addHeader("Authorization", "Basic " + encoding)
.addHeader("Content-Type", "application/json")
.post(body)
.build();
try (Response response = client.newCall(request).execute()) {
System.out.println(response.body().string());
} catch (Exception e) {
e.printStackTrace();
}
}
}
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/chasings"),
Headers =
{
{ HttpRequestHeader.Authorization.ToString(), "Basic " + Convert.ToBase64String(Encoding.ASCII.GetBytes("{API_KEY}:")) },
{ HttpRequestHeader.ContentType.ToString(), "application/json" }
},
Content = new StringContent("{\\\"companyId\\\": \\\"615ad8109e222b30b21c8903\\\",\\\"name\\\": \\\"Test customer chasing\\\",\\\"frequency\\\": \\\"EVERY_DAY\\\",\\\"timeOfDay\\\": \\\"24\\\",\\\"hasMinBalance\\\": \\\"false\\\",\\\"assignmentMode\\\": \\\"NEVER\\\",\\\"steps\\\": [{\\\"name\\\": \\\"Notification for issued invoices\\\",\\\"action\\\": \\\"SEND_AN_EMAIL\\\",\\\"scheduleType\\\": \\\"ACCOUNT_AGE\\\",\\\"days\\\": \\\"1\\\",\\\"emailTemplateId\\\": \\\"62061815a2fd07fa205181e8\\\"}]}", Encoding.UTF8, "application/json")
};
var response = await client.SendAsync(request);
Console.WriteLine(await response.Content.ReadAsStringAsync());
}
}
package main
import (
"fmt"
"net/http"
"io/ioutil"
"encoding/base64"
"strings"
)
func main() {
url := "https://api.blixo.com/v1/chasings"
method := "POST"
payload := strings.NewReader("{\\\"companyId\\\": \\\"615ad8109e222b30b21c8903\\\",\\\"name\\\": \\\"Test customer chasing\\\",\\\"frequency\\\": \\\"EVERY_DAY\\\",\\\"timeOfDay\\\": \\\"24\\\",\\\"hasMinBalance\\\": \\\"false\\\",\\\"assignmentMode\\\": \\\"NEVER\\\",\\\"steps\\\": [{\\\"name\\\": \\\"Notification for issued invoices\\\",\\\"action\\\": \\\"SEND_AN_EMAIL\\\",\\\"scheduleType\\\": \\\"ACCOUNT_AGE\\\",\\\"days\\\": \\\"1\\\",\\\"emailTemplateId\\\": \\\"62061815a2fd07fa205181e8\\\"}]}")
client := &http.Client {}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Authorization", "Basic " + base64.StdEncoding.EncodeToString([]byte("{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))
}
The above command returns JSON structured like this:
{
"data": {
"id": "6203635fbd2219dad21363b0",
"name": "Test customer chasing",
"assignmentConditions": "",
"assignmentMode": "NEVER",
"frequency": "EVERY_DAY",
"runDate": 0,
"timeOfDay": 24,
"nextRun": "2022-02-18T17:00:00.000Z",
"isPausing": false,
"lastRun": "2022-02-14T17:00:00.000Z",
"minBalance": null,
"customerIds": [],
"companyId": "615ad8109e222b30b21c8903",
"steps": [
{
"action": "SEND_AN_EMAIL",
"assignedUserId": null,
"emailTemplateId": "62061815a2fd07fa205181e8",
"smsTemplateId": null,
"scheduleType": "ACCOUNT_AGE",
"days": 1,
"_id": "6203624563b939693d35c907",
"name": "Notification for issued invoices"
}
],
"createdBy": "615ad79a9e222b30b21c88ba",
"updatedBy": "615ad79a9e222b30b21c88ba",
"createdAt": "2022-02-09T06:46:55.808Z",
"updatedAt": "2022-02-18T06:23:40.642Z",
"customers": []
}
}
This API endpoint allows you to create a new customer chasing. It's as simple as sending a POST request to https://api.blixo.com/v1/chasings
. Think of it as telling the server, "Hey, I want to create a new customer chasing!" And the server responds by processing your request!
HTTP Request
POST https://api.blixo.com/v1/chasings
Headers
Key | Value |
---|---|
Authorization | Basic {API_KEY} |
Parameters
Parameter | Type | Description |
---|---|---|
companyId | String | (required) The ID of the company. |
name | String | (required) The name of the customer chasing. |
frequency | String | (required) The frequency of the chasing. E.g. EVERY_DAY , DAY_OF_WEEK , DAY_OF_MONTH |
runDate | Number | (required ) if frequency is DAY_OF_WEEK or DAY_OF_MONTH . Run date |
timeOfDay | Integer | (required) The time of day of the chasing. |
hasMinBalance | Boolean | (required) Whether the chasing has a minimum balance. |
isPausing | Boolean | Set true to pause chasing, false to resume |
assignmentMode | String | (required) The assignment mode of the chasing. Options: NEVER Never assign (default) or ALWAYS Always assign new customer or CERTAIN_CONDITIONS_ARE_MET certain conditions are met |
steps | Array | (required) The steps of the chasing. Includes name (required), action (required), scheduleType (required), days (required), emailTemplateId (required) if action is SEND_AN_EMAIL , assignedUserId (required) if action is ESCALATE |
minBalance | Object | Min balance object includes currency , unit , value |
Example
To create a new customer chasing, you would send a POST request to https://api.blixo.com/v1/chasings
. Remember to replace {API_KEY}
with your actual API key.
Response
The response will be a JSON object with a data
key containing the details of the created chasing. 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.
Update a customer chasing
curl -X PATCH "https://api.blixo.com/v1/chasings/:chasingId" \
-u {API_KEY}: \
-d companyId="615ad8109e222b30b21c8903" \
-d name="Test customer chasing update" \
-d frequency="DAY_OF_WEEK" \
-d runDate="2" \
-d timeOfDay="20" \
-d hasMinBalance="false" \
-d assignmentMode="NEVER" \
-d steps[0][name]="Notification for issued invoices" \
-d steps[0][action]="SEND_AN_EMAIL" \
-d steps[0][scheduleType]="ACCOUNT_AGE" \
-d steps[0][days]="2" \
-d steps[0][emailTemplateId]="62061815a2fd07fa205181e8"
const fetch = require('node-fetch');
const url = 'https://api.blixo.com/v1/chasings/:chasingId';
const options = {
method: 'PATCH',
headers: {
'Authorization': 'Basic ' + Buffer.from('{API_KEY}:').toString('base64')
},
body: JSON.stringify({
companyId: "615ad8109e222b30b21c8903",
name: "Test customer chasing update",
frequency: "DAY_OF_WEEK",
runDate: 2,
timeOfDay: 20,
hasMinBalance: false,
assignmentMode: "NEVER",
steps: [
{
name: "Notification for issued invoices",
action: "SEND_AN_EMAIL",
scheduleType: "ACCOUNT_AGE",
days: 2,
emailTemplateId: "62061815a2fd07fa205181e8"
}
]
})
};
fetch(url, options)
.then(res => res.text())
.then(body => console.log(body))
.catch(error => console.error(error));
import requests
import base64
import json
url = "https://api.blixo.com/v1/chasings/:chasingId"
api_key = "{API_KEY}"
headers = {
"Authorization": "Basic " + base64.b64encode((api_key + ":").encode()).decode()
}
data = {
"companyId": "615ad8109e222b30b21c8903",
"name": "Test customer chasing update",
"frequency": "DAY_OF_WEEK",
"runDate": 2,
"timeOfDay": 20,
"hasMinBalance": False,
"assignmentMode": "NEVER",
"steps": [
{
"name": "Notification for issued invoices",
"action": "SEND_AN_EMAIL",
"scheduleType": "ACCOUNT_AGE",
"days": 2,
"emailTemplateId": "62061815a2fd07fa205181e8"
}
]
}
response = requests.patch(url, headers=headers, data=json.dumps(data))
print(response.text)
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.blixo.com/v1/chasings/:chasingId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode(array(
"companyId" => "615ad8109e222b30b21c8903",
"name" => "Test customer chasing update",
"frequency" => "DAY_OF_WEEK",
"runDate" => 2,
"timeOfDay" => 20,
"hasMinBalance" => false,
"assignmentMode" => "NEVER",
"steps" => array(
array(
"name" => "Notification for issued invoices",
"action" => "SEND_AN_EMAIL",
"scheduleType" => "ACCOUNT_AGE",
"days" => 2,
"emailTemplateId" => "62061815a2fd07fa205181e8"
)
)
)),
CURLOPT_HTTPHEADER => array(
"Authorization: Basic " . base64_encode("{API_KEY}:"),
"Content-Type: application/json"
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
?>
require 'uri'
require 'net/http'
require 'base64'
require 'json'
url = URI("https://api.blixo.com/v1/chasings/:chasingId")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Basic ' + Base64.strict_encode64('{API_KEY}:')
request["Content-Type"] = 'application/json'
request.body = JSON.dump({
"companyId" => "615ad8109e222b30b21c8903",
"name" => "Test customer chasing update",
"frequency" => "DAY_OF_WEEK",
"runDate" => 2,
"timeOfDay" => 20,
"hasMinBalance" => false,
"assignmentMode" => "NEVER",
"steps" => [
{
"name" => "Notification for issued invoices",
"action" => "SEND_AN_EMAIL",
"scheduleType" => "ACCOUNT_AGE",
"days" => 2,
"emailTemplateId" => "62061815a2fd07fa205181e8"
}
]
})
response = http.request(request)
puts response.read_body
package main
import (
"fmt"
"net/http"
"io/ioutil"
"encoding/base64"
"bytes"
"encoding/json"
)
type Step struct {
Name string `json:"name"`
Action string `json:"action"`
ScheduleType string `json:"scheduleType"`
Days int `json:"days"`
EmailTemplateId string `json:"emailTemplateId"`
}
type Chasing struct {
CompanyId string `json:"companyId"`
Name string `json:"name"`
Frequency string `json:"frequency"`
RunDate int `json:"runDate"`
TimeOfDay int `json:"timeOfDay"`
HasMinBalance bool `json:"hasMinBalance"`
AssignmentMode string `json:"assignmentMode"`
Steps []Step `json:"steps"`
}
func main() {
url := "https://api.blixo.com/v1/chasings/:chasingId"
chasing := Chasing{
CompanyId: "615ad8109e222b30b21c8903",
Name: "Test customer chasing update",
Frequency: "DAY_OF_WEEK",
RunDate: 2,
TimeOfDay: 20,
HasMinBalance: false,
AssignmentMode: "NEVER",
Steps: []Step{
{
Name: "Notification for issued invoices",
Action: "SEND_AN_EMAIL",
ScheduleType: "ACCOUNT_AGE",
Days: 2,
EmailTemplateId: "62061815a2fd07fa205181e8",
},
},
}
jsonData, _ := json.Marshal(chasing)
req, _ := http.NewRequest("PATCH", url, bytes.NewBuffer(jsonData))
req.Header.Add("Authorization", "Basic " + base64.StdEncoding.EncodeToString([]byte("{API_KEY}:")))
req.Header.Add("Content-Type", "application/json")
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;
using Newtonsoft.Json;
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.Patch,
RequestUri = new Uri("https://api.blixo.com/v1/chasings/:chasingId"),
Content = new StringContent(JsonConvert.SerializeObject(new
{
companyId = "615ad8109e222b30b21c8903",
name = "Test customer chasing update",
frequency = "DAY_OF_WEEK",
runDate = 2,
timeOfDay = 20,
hasMinBalance = false,
assignmentMode = "NEVER",
steps = new[]
{
new
{
name = "Notification for issued invoices",
action = "SEND_AN_EMAIL",
scheduleType = "ACCOUNT_AGE",
days = 2,
emailTemplateId = "62061815a2fd07fa205181e8"
}
}
}), Encoding.UTF8, "application/json")
};
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.RequestBody;
import okhttp3.MediaType;
import okhttp3.Response;
import java.util.Base64;
import org.json.JSONObject;
import org.json.JSONArray;
public class Main {
public static void main(String[] args) {
OkHttpClient client = new OkHttpClient();
String url = "https://api.blixo.com/v1/chasings/:chasingId";
String encoding = Base64.getEncoder().encodeToString(("{API_KEY}:".getBytes()));
JSONObject step = new JSONObject();
step.put("name", "Notification for issued invoices");
step.put("action", "SEND_AN_EMAIL");
step.put("scheduleType", "ACCOUNT_AGE");
step.put("days", 2);
step.put("emailTemplateId", "62061815a2fd07fa205181e8");
JSONArray steps = new JSONArray();
steps.put(step);
JSONObject json = new JSONObject();
json.put("companyId", "615ad8109e222b30b21c8903");
json.put("name", "Test customer chasing update");
json.put("frequency", "DAY_OF_WEEK");
json.put("runDate", 2);
json.put("timeOfDay", 20);
json.put("hasMinBalance", false);
json.put("assignmentMode", "NEVER");
json.put("steps", steps);
MediaType JSON = MediaType.get("application/json; charset=utf-8");
RequestBody body = RequestBody.create(JSON, json.toString());
Request request = new Request.Builder()
.url(url)
.patch(body)
.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": "6203635fbd2219dad21363b0",
"name": "Test customer chasing update",
"assignmentConditions": "",
"assignmentMode": "NEVER",
"frequency": "DAY_OF_WEEK",
"runDate": 2,
"timeOfDay": 20,
"nextRun": "2022-02-18T17:00:00.000Z",
"isPausing": false,
"lastRun": "2022-02-14T17:00:00.000Z",
"minBalance": null,
"customerIds": [],
"companyId": "615ad8109e222b30b21c8903",
"steps": [
{
"action": "SEND_AN_EMAIL",
"assignedUserId": null,
"emailTemplateId": "62061815a2fd07fa205181e8",
"smsTemplateId": null,
"scheduleType": "ACCOUNT_AGE",
"days": 2,
"_id": "6203624563b939693d35c907",
"name": "Notification for issued invoices"
}
],
"createdBy": "615ad79a9e222b30b21c88ba",
"updatedBy": "615ad79a9e222b30b21c88ba",
"createdAt": "2022-02-09T06:46:55.808Z",
"updatedAt": "2022-02-18T06:23:40.642Z",
"customers": []
}
}
This API endpoint allows you to update an existing customer chasing. It's as simple as sending a PATCH request to https://api.blixo.com/v1/chasings/:chasingId
. Think of it as telling the server, "Hey, I want to update this customer chasing!" And the server responds by processing your request!
HTTP Request
PATCH https://api.blixo.com/v1/chasings/:chasingId
Headers
Key | Value |
---|---|
Authorization | Basic {API_KEY} |
Parameters
Parameter | Type | Description |
---|---|---|
companyId | String | (required) The ID of the company. |
name | String | (required) The new name of the customer chasing. |
frequency | String | (required) The new frequency of the chasing. E.g. EVERY_DAY , DAY_OF_WEEK , DAY_OF_MONTH |
runDate | Number | (required ) if frequency is DAY_OF_WEEK or DAY_OF_MONTH . The new run date |
timeOfDay | Integer | (required) The new time of day of the chasing. |
hasMinBalance | Boolean | (required) Whether the chasing has a new minimum balance. |
isPausing | Boolean | Set true to pause chasing, false to resume |
assignmentMode | String | (required) The new assignment mode of the chasing. Options: NEVER Never assign (default) or ALWAYS Always assign new customer or CERTAIN_CONDITIONS_ARE_MET certain conditions are met |
steps | Array | (required) The new steps of the chasing. Includes name (required), action (required), scheduleType (required), days (required), emailTemplateId (required) if action is SEND_AN_EMAIL , assignedUserId (required) if action is ESCALATE |
minBalance | Object | New min balance object includes currency (required), unit (required), value (required) |
customerIds | Array | The new list of customer IDs for the chasing. |
lastRun | String | The new last run date of the chasing. |
nextRun | String | The new next run date of the chasing. |
Example
To update a customer chasing, you would send a PATCH request to https://api.blixo.com/v1/chasings/:chasingId
. Remember to replace {API_KEY}
and :chasingId
with your actual API key and the ID of the chasing you want to update.
Response
The response will be a JSON object with a data
key containing the details of the updated chasing. 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.
List all invoice chasings
curl "https://api.blixo.com/v1/invoiceChasings" \
-u {API_KEY}:
const fetch = require('node-fetch');
const url = 'https://api.blixo.com/v1/invoiceChasings';
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/invoiceChasings",
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/invoiceChasings")
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/invoiceChasings"
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/invoiceChasings"
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/invoiceChasings"),
};
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/invoiceChasings";
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": "620f230341fe7a283ed7e0c1",
"name": "Test invoice chasing",
"companyId": "615ad8109e222b30b21c8903",
"isDefault": false,
"schedules": [
{
"_id": "620f22e9dee4a2967675b6f4",
"days": 0,
"hour": 0,
"repeats": 1,
"timeOfDay": 12,
"email": true,
"text": true,
"letter": true,
"phone": false,
"trigger": "WHEN_INVOICE_ISSUED"
}
],
"createdBy": "615ad79a9e222b30b21c88ba",
"updatedBy": "615ad79a9e222b30b21c88ba",
"createdAt": "2022-02-18T04:39:31.151Z",
"updatedAt": "2022-02-18T04:39:31.151Z"
},
],
"pagination": {
"total": 1
}
}
This API endpoint allows you to retrieve a list of all invoice chasings in the database. It's as simple as sending a GET request to https://api.blixo.com/v1/invoiceChasings
. Think of it as asking the server, "Hey, can I get a list of all your invoice chasings?" And the server responds with the information you asked for!
HTTP Request
GET https://api.blixo.com/v1/invoiceChasings
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 invoice chasings to retrieve per page. Default is 100 . |
Example
To list all invoice chasings, you would send a GET request to https://api.blixo.com/v1/invoiceChasings
. Remember to replace {API_KEY}
with your actual API key.
If you want to retrieve the third page of invoice chasings, with 50 invoice chasings per page, you would send a GET request to https://api.blixo.com/v1/invoiceChasings?page=3&perPage=50
.
Response
The response will be a JSON object with a data
key containing an array of invoice chasings. Each invoice chasing will be an object with the following keys:
id
: The unique identifier of the invoice chasing.name
: The name of the invoice chasing.companyId
: The ID of the company.isDefault
: Whether the invoice chasing is default.schedules
: The schedules of the invoice chasing.createdBy
: The ID of the user who created the invoice chasing.updatedBy
: The ID of the user who last updated the invoice chasing.createdAt
: The creation date of the invoice chasing.updatedAt
: The last update date of the invoice chasing.
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 an invoice chasing
curl "https://api.blixo.com/v1/invoiceChasings" \
-u {API_KEY}: \
-d companyId="615ad8109e222b30b21c8903" \
-d name="Test invoice chasing" \
-d schedules[0][trigger]="WHEN_INVOICE_ISSUED" \
-d schedules[0][days]="0" \
-d schedules[0][timeOfDay]="12" \
-d schedules[0][repeats]="1" \
-d schedules[0][email]="true" \
-d schedules[0][text]="true" \
-d schedules[0][letter]="true" \
-d schedules[0][phone]="false" \
-X POST
const fetch = require('node-fetch');
const url = 'https://api.blixo.com/v1/invoiceChasings';
const options = {
method: 'POST',
headers: {
'Authorization': 'Basic ' + Buffer.from('{API_KEY}:').toString('base64'),
'Content-Type': 'application/json'
},
body: JSON.stringify({
companyId: "615ad8109e222b30b21c8903",
name: "Test invoice chasing",
schedules: [
{
trigger: "WHEN_INVOICE_ISSUED",
days: 0,
timeOfDay: 12,
repeats: 1,
email: true,
text: true,
letter: true,
phone: false
}
]
})
};
fetch(url, options)
.then(res => res.text())
.then(body => console.log(body))
.catch(error => console.error(error));
import requests
import base64
import json
url = "https://api.blixo.com/v1/invoiceChasings"
api_key = "{API_KEY}"
headers = {
"Authorization": "Basic " + base64.b64encode((api_key + ":").encode()).decode(),
"Content-Type": "application/json"
}
data = {
"companyId": "615ad8109e222b30b21c8903",
"name": "Test invoice chasing",
"schedules": [
{
"trigger": "WHEN_INVOICE_ISSUED",
"days": 0,
"timeOfDay": 12,
"repeats": 1,
"email": True,
"text": True,
"letter": True,
"phone": False
}
]
}
response = requests.post(url, headers=headers, data=json.dumps(data))
print(response.text)
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.blixo.com/v1/invoiceChasings",
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' => '615ad8109e222b30b21c8903',
'name' => 'Test invoice chasing',
'schedules[0][trigger]' => 'WHEN_INVOICE_ISSUED',
'schedules[0][days]' => '0',
'schedules[0][timeOfDay]' => '12',
'schedules[0][repeats]' => '1',
'schedules[0][email]' => 'true',
'schedules[0][text]' => 'true',
'schedules[0][letter]' => 'true',
'schedules[0][phone]' => 'false'
),
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'
require 'json'
url = URI("https://api.blixo.com/v1/invoiceChasings")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic ' + Base64.strict_encode64('{API_KEY}:')
request.body = JSON.dump({
"companyId" => "615ad8109e222b30b21c8903",
"name" => "Test invoice chasing",
"schedules" => [
{
"trigger" => "WHEN_INVOICE_ISSUED",
"days" => 0,
"timeOfDay" => 12,
"repeats" => 1,
"email" => true,
"text" => true,
"letter" => true,
"phone" => false
}
]
})
response = http.request(request)
puts response.read_body
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
"encoding/base64"
)
func main() {
url := "https://api.blixo.com/v1/invoiceChasings"
method := "POST"
payload := strings.NewReader(`{
"companyId": "615ad8109e222b30b21c8903",
"name": "Test invoice chasing",
"schedules": [
{
"trigger": "WHEN_INVOICE_ISSUED",
"days": 0,
"timeOfDay": 12,
"repeats": 1,
"email": true,
"text": true,
"letter": true,
"phone": false
}
]
}`)
client := &http.Client {}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Authorization", "Basic " + base64.StdEncoding.EncodeToString([]byte("{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))
}
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/invoiceChasings"),
Content = new StringContent("{\"companyId\":\"615ad8109e222b30b21c8903\",\"name\":\"Test invoice chasing\",\"schedules\":[{\"trigger\":\"WHEN_INVOICE_ISSUED\",\"days\":0,\"timeOfDay\":12,\"repeats\":1,\"email\":true,\"text\":true,\"letter\":true,\"phone\":false}]}", Encoding.UTF8, "application/json")
};
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.MediaType;
import okhttp3.RequestBody;
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/invoiceChasings";
String encoding = Base64.getEncoder().encodeToString(("{API_KEY}:".getBytes()));
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"companyId\":\"615ad8109e222b30b21c8903\",\"name\":\"Test invoice chasing\",\"schedules\":[{\"trigger\":\"WHEN_INVOICE_ISSUED\",\"days\":0,\"timeOfDay\":12,\"repeats\":1,\"email\":true,\"text\":true,\"letter\":true,\"phone\":false}]}");
Request request = new Request.Builder()
.url(url)
.method("POST", body)
.addHeader("Authorization", "Basic " + encoding)
.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": "620f230341fe7a283ed7e0c1",
"name": "Test invoice chasing",
"companyId": "615ad8109e222b30b21c8903",
"isDefault": false,
"schedules": [
{
"_id": "620f22e9dee4a2967675b6f4",
"days": 0,
"hour": 0,
"repeats": 1,
"timeOfDay": 12,
"email": true,
"text": true,
"letter": true,
"phone": false,
"trigger": "WHEN_INVOICE_ISSUED"
}
],
"createdBy": "615ad79a9e222b30b21c88ba",
"updatedBy": "615ad79a9e222b30b21c88ba",
"createdAt": "2022-02-18T04:39:31.151Z",
"updatedAt": "2022-02-18T04:39:31.151Z"
}
}
This API endpoint allows you to create a new invoice chasing. It's as simple as sending a POST request to https://api.blixo.com/v1/invoiceChasings
. Think of it as telling the server, "Hey, I want to create a new invoice chasing!" And the server responds by processing your request!
HTTP Request
POST https://api.blixo.com/v1/invoiceChasings
Headers
Key | Value |
---|---|
Authorization | Basic {API_KEY} |
Parameters
Parameter | Type | Description |
---|---|---|
companyId | String | (required) The ID of the company. |
name | String | (required) The name of the invoice chasing. |
isDefault | Boolean | Set true to make this the default invoice chasing. |
schedules | Array | (required) The schedules of the invoice chasing. Each schedule is an object with the following keys: |
• trigger : (required) The trigger of the schedule. Possible values are WHEN_INVOICE_ISSUED , AFTER_INVOICE_ISSUE_DATE , BEFORE_INVOICE_DUE_DATE , AFTER_INVOICE_DUE_DATE , REPEATING_REMINDER . |
||
• days : (required) The number of days after which the schedule triggers. |
||
• timeOfDay : (required) The time of day of the schedule in 24-hour format. |
||
• repeats : (required) The number of times the schedule repeats. |
||
• email : Whether the schedule sends an email. Set true to enable. |
||
• text : Whether the schedule sends a text. Set true to enable. |
||
• letter : Whether the schedule sends a letter. Set true to enable. |
||
• phone : Whether the schedule makes a phone call. Set true to enable. |
Example
To create a new invoice chasing, you would send a POST request to https://api.blixo.com/v1/invoiceChasings
. Make sure to replace {API_KEY}
with your actual API key.
For example, if you want to create an invoice chasing with a schedule that triggers when the invoice is issued, sends an email, a text, and a letter on the same day the invoice is issued, and repeats once, you would send a POST request to https://api.blixo.com/v1/invoiceChasings
with the following json object:
{
"companyId": "615ad8109e222b30b21c8903",
"name": "Sample invoice chasing",
"schedules": [
{
"trigger": "WHEN_INVOICE_ISSUED",
"days": 0,
"timeOfDay": 12,
"repeats": 1,
"email": true,
"text": true,
"letter": true,
"phone": false
}
]
}
Response
The response will be a JSON object with a data
key containing the details of the created invoice chasing. 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.
Update an invoice chasing
curl -X PATCH "https://api.blixo.com/v1/invoiceChasings/:invoiceChasingId" \
-u {API_KEY}: \
-d companyId="615ad8109e222b30b21c8903" \
-d name="Test invoice chasing update" \
-d schedules[0][trigger]="REPEATING_REMINDER" \
-d schedules[0][days]="2" \
-d schedules[0][timeOfDay]="10" \
-d schedules[0][repeats]="3" \
-d schedules[0][email]="true" \
-d schedules[0][text]="true" \
-d schedules[0][letter]="true" \
-d schedules[0][phone]="false"
const fetch = require('node-fetch');
const url = 'https://api.blixo.com/v1/invoiceChasings/:invoiceChasingId';
const options = {
method: 'PATCH',
headers: {
'Authorization': 'Basic ' + Buffer.from('{API_KEY}:').toString('base64'),
'Content-Type': 'application/json'
},
body: JSON.stringify({
companyId: "615ad8109e222b30b21c8903",
name: "Test invoice chasing update",
schedules: [
{
trigger: "REPEATING_REMINDER",
days: 2,
timeOfDay: 10,
repeats: 3,
email: true,
text: true,
letter: true,
phone: false
}
]
})
};
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/invoiceChasings/:invoiceChasingId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode(array(
"companyId" => "615ad8109e222b30b21c8903",
"name" => "Test invoice chasing update",
"schedules" => array(
array(
"trigger" => "REPEATING_REMINDER",
"days" => 2,
"timeOfDay" => 10,
"repeats" => 3,
"email" => true,
"text" => true,
"letter" => true,
"phone" => false
)
)
)),
CURLOPT_HTTPHEADER => array(
"Authorization: Basic " . base64_encode("{API_KEY}:"),
"Content-Type: application/json"
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
?>
require 'uri'
require 'net/http'
require 'base64'
require 'json'
url = URI("https://api.blixo.com/v1/invoiceChasings/:invoiceChasingId")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Basic ' + Base64.strict_encode64('{API_KEY}:')
request["Content-Type"] = 'application/json'
request.body = JSON.dump({
"companyId" => "615ad8109e222b30b21c8903",
"name" => "Test invoice chasing update",
"schedules" => [
{
"trigger" => "REPEATING_REMINDER",
"days" => 2,
"timeOfDay" => 10,
"repeats" => 3,
"email" => true,
"text" => true,
"letter" => true,
"phone" => false
}
]
})
response = http.request(request)
puts response.read_body
import requests
import base64
import json
url = "https://api.blixo.com/v1/invoiceChasings/:invoiceChasingId"
api_key = "{API_KEY}"
headers = {
"Authorization": "Basic " + base64.b64encode((api_key + ":").encode()).decode(),
"Content-Type": "application/json"
}
data = json.dumps({
"companyId": "615ad8109e222b30b21c8903",
"name": "Test invoice chasing update",
"schedules": [
{
"trigger": "REPEATING_REMINDER",
"days": 2,
"timeOfDay": 10,
"repeats": 3,
"email": True,
"text": True,
"letter": True,
"phone": False
}
]
})
response = requests.patch(url, headers=headers, data=data)
print(response.text)
package main
import (
"fmt"
"net/http"
"io/ioutil"
"encoding/base64"
"bytes"
"encoding/json"
)
type Schedule struct {
Trigger string `json:"trigger"`
Days int `json:"days"`
TimeOfDay int `json:"timeOfDay"`
Repeats int `json:"repeats"`
Email bool `json:"email"`
Text bool `json:"text"`
Letter bool `json:"letter"`
Phone bool `json:"phone"`
}
type InvoiceChasing struct {
CompanyId string `json:"companyId"`
Name string `json:"name"`
Schedules []Schedule `json:"schedules"`
}
func main() {
url := "https://api.blixo.com/v1/invoiceChasings/:invoiceChasingId"
req, _ := http.NewRequest("PATCH", url, nil)
req.Header.Add("Authorization", "Basic "+base64.StdEncoding.EncodeToString([]byte("{API_KEY}:")))
req.Header.Add("Content-Type", "application/json")
invoiceChasing := &InvoiceChasing{
CompanyId: "615ad8109e222b30b21c8903",
Name: "Test invoice chasing update",
Schedules: []Schedule{
{
Trigger: "REPEATING_REMINDER",
Days: 2,
TimeOfDay: 10,
Repeats: 3,
Email: true,
Text: true,
Letter: true,
Phone: false,
},
},
}
jsonData, _ := json.Marshal(invoiceChasing)
req.Body = ioutil.NopCloser(bytes.NewBuffer(jsonData))
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;
using Newtonsoft.Json;
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.Patch,
RequestUri = new Uri("https://api.blixo.com/v1/invoiceChasings/:invoiceChasingId"),
};
var byteArray = Encoding.ASCII.GetBytes("{API_KEY}:");
request.Headers.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", Convert.ToBase64String(byteArray));
request.Headers.Add("Content-Type", "application/json");
var invoiceChasing = new
{
companyId = "615ad8109e222b30b21c8903",
name = "Test invoice chasing update",
schedules = new[]
{
new
{
trigger = "REPEATING_REMINDER",
days = 2,
timeOfDay = 10,
repeats = 3,
email = true,
text = true,
letter = true,
phone = false
}
}
};
request.Content = new StringContent(JsonConvert.SerializeObject(invoiceChasing), Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
Console.WriteLine(await response.Content.ReadAsStringAsync());
}
}
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.RequestBody;
import okhttp3.MediaType;
import okhttp3.Response;
import java.util.Base64;
import org.json.JSONObject;
import org.json.JSONArray;
public class Main {
public static void main(String[] args) {
OkHttpClient client = new OkHttpClient();
String url = "https://api.blixo.com/v1/invoiceChasings/:invoiceChasingId";
String encoding = Base64.getEncoder().encodeToString(("{API_KEY}:".getBytes()));
JSONObject schedule = new JSONObject();
schedule.put("trigger", "REPEATING_REMINDER");
schedule.put("days", 2);
schedule.put("timeOfDay", 10);
schedule.put("repeats", 3);
schedule.put("email", true);
schedule.put("text", true);
schedule.put("letter", true);
schedule.put("phone", false);
JSONArray schedules = new JSONArray();
schedules.put(schedule);
JSONObject invoiceChasing = new JSONObject();
invoiceChasing.put("companyId", "615ad8109e222b30b21c8903");
invoiceChasing.put("name", "Test invoice chasing update");
invoiceChasing.put("schedules", schedules);
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, invoiceChasing.toString());
Request request = new Request.Builder()
.url(url)
.patch(body)
.addHeader("Authorization", "Basic " + encoding)
.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": "620f230341fe7a283ed7e0c1",
"name": "Test invoice chasing update",
"companyId": "615ad8109e222b30b21c8903",
"isDefault": false,
"schedules": [
{
"_id": "620f22e9dee4a2967675b6f4",
"days": 2,
"repeats": 3,
"timeOfDay": 10,
"email": true,
"text": true,
"letter": true,
"phone": false,
"trigger": "REPEATING_REMINDER"
}
],
"createdBy": "615ad79a9e222b30b21c88ba",
"updatedBy": "615ad79a9e222b30b21c88ba",
"createdAt": "2022-02-18T04:39:31.151Z",
"updatedAt": "2022-02-18T04:39:31.151Z"
}
}
This API endpoint allows you to update an existing invoice chasing. It's as simple as sending a PATCH request to https://api.blixo.com/v1/invoiceChasings/:invoiceChasingId
. Remember to replace :invoiceChasingId
with the ID of the invoice chasing you want to update.
HTTP Request
PATCH https://api.blixo.com/v1/invoiceChasings/:invoiceChasingId
Parameters
Parameter | Type | Description |
---|---|---|
invoiceChasingId | String | (required) The ID of the invoice chasing you want to update. |
companyId | String | (required) The ID of the company. |
name | String | (required) The new name of the invoice chasing. |
isDefault | Boolean | Set true to make this the default invoice chasing. |
schedules | Array | (required) The new schedules of the invoice chasing. Each schedule is an object with the following keys: |
• trigger : (required) The new trigger of the schedule. Possible values are WHEN_INVOICE_ISSUED , AFTER_INVOICE_ISSUE_DATE , BEFORE_INVOICE_DUE_DATE , AFTER_INVOICE_DUE_DATE , REPEATING_REMINDER . |
||
• days : (required) The new number of days after which the schedule triggers. |
||
• timeOfDay : (required) The new time of day of the schedule in 24-hour format. |
||
• repeats : (required) The new number of times the schedule repeats. |
||
• email : Whether the schedule sends an email. Set true to enable. |
||
• text : Whether the schedule sends a text. Set true to enable. |
||
• letter : Whether the schedule sends a letter. Set true to enable. |
||
• phone : Whether the schedule makes a phone call. Set true to enable. |
Example
To update an invoice chasing, you would send a PATCH request to https://api.blixo.com/v1/invoiceChasings/:invoiceChasingId
. Remember to replace {API_KEY}
and :invoiceChasingId
with your actual API key and the ID of the invoice chasing you want to update.
For example, if you want to update an invoice chasing with a schedule that triggers two days after the invoice is issued, sends an email, a text, and a letter at 10 AM, and repeats three times, you would send a PATCH request to https://api.blixo.com/v1/invoiceChasings/:invoiceChasingId
with the following json object:
{
"companyId": "615ad8109e222b30b21c8903",
"name": "Updated invoice chasing",
"schedules": [
{
"trigger": "AFTER_INVOICE_ISSUE_DATE",
"days": 2,
"timeOfDay": 10,
"repeats": 3,
"email": true,
"text": true,
"letter": true,
"phone": false
}
]
}
Response
The response will be a JSON object with a data
key containing the details of the updated invoice chasing. 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.
Items
Item object
Attribute | Type | Description |
---|---|---|
name | String | The name of the item. |
itemID | String | The ID of the item. |
sku | String | The SKU of the item. |
accountingCode | String | The accounting code of the item. |
hasDefaultPrice | Boolean | Whether the item has a default price. |
amount | Object | The amount of the item, includes value , unit . |
taxes | Array | The taxes of the item. |
taxable | Boolean | Whether the item is taxable. |
discountable | Boolean | Whether the item is discountable. |
type | String | The type of the item. |
companyId | ObjectId | The ID of the company of the item. |
createdBy | ObjectId | The ID of the user who created the item. |
updatedBy | ObjectId | The ID of the user who last updated the item. |
createdAt | Date | The date when the item was created. |
updatedAt | Date | The date when the item was last updated. |
source | String | The source of the item. |
integrations | Object | The integrations of the item. |
isBundle | Boolean | Whether the item is a bundle. |
image | String | The image of the item. |
shopifySync | Boolean | Whether the item is synced with Shopify. |
status | Boolean | The status of the item. |
productCategory | String | The product category of the item. |
description | String | The description of the item. |
websiteDescription | String | The website description of the item. |
vendor | String | The vendor of the item. |
tags | Array | The tags of the item. |
weight | Number | The weight of the item. |
weightUnit | String | The weight unit of the item. |
options | Array | The options of the item. |
variants | Array | The variants of the item. |
List all items
curl "https://api.blixo.com/v1/items" \
-u {API_KEY}:
const fetch = require('node-fetch');
const url = 'https://api.blixo.com/v1/items';
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/items",
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/items")
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/items"
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/items"
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/items"),
};
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/items";
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": "621b8c13a9a2e62de0ff89b1",
"name": "YEAR ITEM",
"itemID": "YEAR-ITEM",
"hasDefaultPrice": true,
"amount": {
"unit": "$",
"value": 100
},
"taxes": [],
"taxable": true,
"discountable": true,
"description": "",
"type": "YEAR",
"companyId": "615ad8109e222b30b21c8903",
"createdBy": "615ad79a9e222b30b21c88ba",
"updatedBy": "615ad79a9e222b30b21c88ba",
"createdAt": "2022-02-27T14:34:59.033Z",
"updatedAt": "2022-02-27T14:34:59.033Z",
"source": "BLIXO"
}
],
"pagination": {
"total": 1
}
}
This API endpoint allows you to retrieve a list of all items in the database. It's as simple as sending a GET request to https://api.blixo.com/v1/items
. Think of it as asking the server, "Hey, can I get a list of all your items?" And the server responds with the information you asked for!
HTTP Request
GET https://api.blixo.com/v1/items
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 items to retrieve per page. Default is 100 . |
companyId | objectId | Company ID |
completed | boolean | If set TRUE to get tasks completed else for FALSE. |
Example
To list all items, you would send a GET request to https://api.blixo.com/v1/items
. Remember to replace {API_KEY}
with your actual API key.
If you want to retrieve the third page of items, with 50 items per page, you would send a GET request to https://api.blixo.com/v1/items?page=3&perPage=50
.
Response
The response will be a JSON object with a data
key containing an array of items. Each item will be an object with the following keys:
id
: The unique identifier of the item.name
: The name of the item.itemID
: The item ID.hasDefaultPrice
: Whether the item has a default price.amount
: The amount of the item.taxes
: The taxes of the item.taxable
: Whether the item is taxable.discountable
: Whether the item is discountable.description
: The description of the item.type
: The type of the item.companyId
: The ID of the company.createdBy
: The ID of the user who created the item.updatedBy
: The ID of the user who last updated the item.createdAt
: The creation date of the item.updatedAt
: The last update date of the item.source
: The source of the item.
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 an item
curl "https://api.blixo.com/v1/items" \
-u {API_KEY}: \
-d companyId="60e1b7f0c6ef4219ff51824c" \
-d accountingCode="212111" \
-d description="description .." \
-d websiteDescription="" \
-d options[0][createdAt]="2022-11-04T16:27:53.000Z" \
-d options[0][name]="size" \
-d options[0][optionId]="100" \
-d options[0][productId]="100" \
-d options[0][updatedAt]="2022-11-04T16:27:53.000Z" \
-d productCategory="sub" \
-d sku="" \
-d hasOptions=true \
-d hasShipping=true \
-d shopifySync=true \
-d status=true \
-d tags[0]="subcription" \
-d type="PRODUCT" \
-d name="NAME ITEM" \
-d variants[0][accountingCode]="3232" \
-d variants[0][barcode]="232" \
-d variants[0][compareAtPrice][unit]="$" \
-d variants[0][compareAtPrice][value]="100" \
-d variants[0][createdAt]="2022-11-04T16:27:50.000Z" \
-d variants[0][description]="variant description" \
-d variants[0][fulfillmentService]="manual" \
-d variants[0][grams]="100" \
-d variants[0][image]=null \
-d variants[0][imageId]=null \
-d variants[0][inventoryManagement]=null \
-d variants[0][name]="100" \
-d variants[0][productId]="100" \
-d variants[0][requiresShipping]=false \
-d vendor="tag" \
-d weight=2211 \
-d weightUnit="kg" \
-d amount[unit]="$" \
-d amount[currency]="USD" \
-d amount[value]="100" \
-X POST
const fetch = require('node-fetch');
const url = 'https://api.blixo.com/v1/items';
const options = {
method: 'POST',
headers: {
'Authorization': 'Basic ' + Buffer.from('{API_KEY}:').toString('base64'),
'Content-Type': 'application/json'
},
body: JSON.stringify({
companyId: "60e1b7f0c6ef4219ff51824c",
accountingCode: "212111",
description: "description ..",
websiteDescription: "",
options: [
{
createdAt: "2022-11-04T16:27:53.000Z",
name: "size",
optionId: "100",
productId: "100",
updatedAt: "2022-11-04T16:27:53.000Z"
}
],
productCategory: "sub",
sku: "",
hasOptions: true,
hasShipping: true,
shopifySync: true,
status: true,
tags: ["subcription"],
type: "PRODUCT",
name: "NAME ITEM",
variants: [
{
accountingCode: "3232",
barcode: "232",
compareAtPrice: {
unit: "$",
value: "100"
},
createdAt: "2022-11-04T16:27:50.000Z",
description: "variant description",
fulfillmentService: "manual",
grams: "100",
image: null,
imageId: null,
inventoryManagement: null,
name: "100",
productId: "100",
requiresShipping: false
}
],
vendor: "tag",
weight: 2211,
weightUnit: "kg",
amount: {
unit: "$",
currency: "USD",
value: "100"
}
})
};
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/items",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode(array(
"companyId" => "60e1b7f0c6ef4219ff51824c",
"accountingCode" => "212111",
"description" => "description ..",
"websiteDescription" => "",
"options" => array(
array(
"createdAt" => "2022-11-04T16:27:53.000Z",
"name" => "size",
"optionId" => "100",
"productId" => "100",
"updatedAt" => "2022-11-04T16:27:53.000Z"
)
),
"productCategory" => "sub",
"sku" => "",
"hasOptions" => true,
"hasShipping" => true,
"shopifySync" => true,
"status" => true,
"tags" => array("subcription"),
"type" => "PRODUCT",
"name" => "NAME ITEM",
"variants" => array(
array(
"accountingCode" => "3232",
"barcode" => "232",
"compareAtPrice" => array(
"unit" => "$",
"value" => "100"
),
"createdAt" => "2022-11-04T16:27:50.000Z",
"description" => "variant description",
"fulfillmentService" => "manual",
"grams" => "100",
"image" => null,
"imageId" => null,
"inventoryManagement" => null,
"name" => "100",
"productId" => "100",
"requiresShipping" => false
)
),
"vendor" => "tag",
"weight" => 2211,
"weightUnit" => "kg",
"amount" => array(
"unit" => "$",
"currency" => "USD",
"value" => "100"
)
)),
CURLOPT_HTTPHEADER => array(
"Authorization: Basic " . base64_encode("{API_KEY}:"),
"Content-Type: application/json"
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
?>
import requests
import base64
import json
url = "https://api.blixo.com/v1/items"
api_key = "{API_KEY}"
headers = {
"Authorization": "Basic " + base64.b64encode((api_key + ":").encode()).decode(),
"Content-Type": "application/json"
}
data = {
"companyId": "60e1b7f0c6ef4219ff51824c",
"accountingCode": "212111",
"description": "description ..",
"websiteDescription": "",
"options": [
{
"createdAt": "2022-11-04T16:27:53.000Z",
"name": "size",
"optionId": "100",
"productId": "100",
"updatedAt": "2022-11-04T16:27:53.000Z"
}
],
"productCategory": "sub",
"sku": "",
"hasOptions": True,
"hasShipping": True,
"shopifySync": True,
"status": True,
"tags": ["subcription"],
"type": "PRODUCT",
"name": "NAME ITEM",
"variants": [
{
"accountingCode": "3232",
"barcode": "232",
"compareAtPrice": {
"unit": "$",
"value": "100"
},
"createdAt": "2022-11-04T16:27:50.000Z",
"description": "variant description",
"fulfillmentService": "manual",
"grams": "100",
"image": None,
"imageId": None,
"inventoryManagement": None,
"name": "100",
"productId": "100",
"requiresShipping": False
}
],
"vendor": "tag",
"weight": 2211,
"weightUnit": "kg",
"amount": {
"unit": "$",
"currency": "USD",
"value": "100"
}
}
response = requests.post(url, headers=headers, data=json.dumps(data))
print(response.text)
require 'uri'
require 'net/http'
require 'base64'
require 'json'
url = URI("https://api.blixo.com/v1/items")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic ' + Base64.strict_encode64('{API_KEY}:')
request["Content-Type"] = 'application/json'
request.body = JSON.generate({
companyId: "60e1b7f0c6ef4219ff51824c",
accountingCode: "212111",
description: "description ..",
websiteDescription: "",
options: [
{
createdAt: "2022-11-04T16:27:53.000Z",
name: "size",
optionId: "100",
productId: "100",
updatedAt: "2022-11-04T16:27:53.000Z"
}
],
productCategory: "sub",
sku: "",
hasOptions: true,
hasShipping: true,
shopifySync: true,
status: true,
tags: ["subcription"],
type: "PRODUCT",
name: "NAME ITEM",
variants: [
{
accountingCode: "3232",
barcode: "232",
compareAtPrice: {
unit: "$",
value: "100"
},
createdAt: "2022-11-04T16:27:50.000Z",
description: "variant description",
fulfillmentService: "manual",
grams: "100",
image: nil,
imageId: nil,
inventoryManagement: nil,
name: "100",
productId: "100",
requiresShipping: false
}
],
vendor: "tag",
weight: 2211,
weightUnit: "kg",
amount: {
unit: "$",
currency: "USD",
value: "100"
}
})
response = http.request(request)
puts response.read_body
package main
import (
"fmt"
"net/http"
"io/ioutil"
"encoding/base64"
"bytes"
"encoding/json"
)
func main() {
url := "https://api.blixo.com/v1/items"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Basic " + base64.StdEncoding.EncodeToString([]byte("{API_KEY}:")))
req.Header.Add("Content-Type", "application/json")
data := map[string]interface{}{
"companyId": "60e1b7f0c6ef4219ff51824c",
"accountingCode": "212111",
"description": "description ..",
"websiteDescription": "",
"options": []map[string]interface{}{
{
"createdAt": "2022-11-04T16:27:53.000Z",
"name": "size",
"optionId": "100",
"productId": "100",
"updatedAt": "2022-11-04T16:27:53.000Z",
},
},
"productCategory": "sub",
"sku": "",
"hasOptions": true,
"hasShipping": true,
"shopifySync": true,
"status": true,
"tags": []string{"subcription"},
"type": "PRODUCT",
"name": "NAME ITEM",
"variants": []map[string]interface{}{
{
"accountingCode": "3232",
"barcode": "232",
"compareAtPrice": map[string]string{
"unit": "$",
"value": "100",
},
"createdAt": "2022-11-04T16:27:50.000Z",
"description": "variant description",
"fulfillmentService": "manual",
"grams": "100",
"image": nil,
"imageId": nil,
"inventoryManagement": nil,
"name": "100",
"productId": "100",
"requiresShipping": false,
},
},
"vendor": "tag",
"weight": 2211,
"weightUnit": "kg",
"amount": map[string]string{
"unit": "$",
"currency": "USD",
"value": "100",
},
}
jsonData, _ := json.Marshal(data)
req.Body = ioutil.NopCloser(bytes.NewBuffer(jsonData))
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;
using Newtonsoft.Json;
using System.Collections.Generic;
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/items"),
};
var byteArray = Encoding.ASCII.GetBytes("{API_KEY}:");
request.Headers.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", Convert.ToBase64String(byteArray));
request.Headers.Add("Content-Type", "application/json");
var data = new
{
companyId = "60e1b7f0c6ef4219ff51824c",
accountingCode = "212111",
description = "description ..",
websiteDescription = "",
options = new List<object>
{
new
{
createdAt = "2022-11-04T16:27:53.000Z",
name = "size",
optionId = "100",
productId = "100",
updatedAt = "2022-11-04T16:27:53.000Z"
}
},
productCategory = "sub",
sku = "",
hasOptions = true,
hasShipping = true,
shopifySync = true,
status = true,
tags = new List<string> { "subcription" },
type = "PRODUCT",
name = "NAME ITEM",
variants = new List<object>
{
new
{
accountingCode = "3232",
barcode = "232",
compareAtPrice = new { unit = "$", value = "100" },
createdAt = "2022-11-04T16:27:50.000Z",
description = "variant description",
fulfillmentService = "manual",
grams = "100",
image = (string)null,
imageId = (string)null,
inventoryManagement = (string)null,
name = "100",
productId = "100",
requiresShipping = false
}
},
vendor = "tag",
weight = 2211,
weightUnit = "kg",
amount = new { unit = "$", currency = "USD", value = "100" }
};
request.Content = new StringContent(JsonConvert.SerializeObject(data), Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
Console.WriteLine(await response.Content.ReadAsStringAsync());
}
}
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.RequestBody;
import okhttp3.MediaType;
import okhttp3.Response;
import java.util.Base64;
import org.json.JSONObject;
import org.json.JSONArray;
public class Main {
public static void main(String[] args) {
OkHttpClient client = new OkHttpClient();
String url = "https://api.blixo.com/v1/items";
String encoding = Base64.getEncoder().encodeToString(("{API_KEY}:".getBytes()));
JSONObject json = new JSONObject();
JSONArray options = new JSONArray();
JSONObject option = new JSONObject();
option.put("createdAt", "2022-11-04T16:27:53.000Z");
option.put("name", "size");
option.put("optionId", "100");
option.put("productId", "100");
option.put("updatedAt", "2022-11-04T16:27:53.000Z");
options.put(option);
JSONArray variants = new JSONArray();
JSONObject variant = new JSONObject();
variant.put("accountingCode", "3232");
variant.put("barcode", "232");
variant.put("compareAtPrice", new JSONObject().put("unit", "$").put("value", "100"));
variant.put("createdAt", "2022-11-04T16:27:50.000Z");
variant.put("description", "variant description");
variant.put("fulfillmentService", "manual");
variant.put("grams", "100");
variant.put("image", JSONObject.NULL);
variant.put("imageId", JSONObject.NULL);
variant.put("inventoryManagement", JSONObject.NULL);
variant.put("name", "100");
variant.put("productId", "100");
variant.put("requiresShipping", false);
variants.put(variant);
JSONArray tags = new JSONArray();
tags.put("subcription");
json.put("companyId", "60e1b7f0c6ef4219ff51824c");
json.put("accountingCode", "212111");
json.put("description", "description ..");
json.put("websiteDescription", "");
json.put("options", options);
json.put("productCategory", "sub");
json.put("sku", "");
json.put("hasOptions", true);
json.put("hasShipping", true);
json.put("shopifySync", true);
json.put("status", true);
json.put("tags", tags);
json.put("type", "PRODUCT");
json.put("name", "NAME ITEM");
json.put("variants", variants);
json.put("vendor", "tag");
json.put("weight", 2211);
json.put("weightUnit", "kg");
json.put("amount", new JSONObject().put("unit", "$").put("currency", "USD").put("value", "100"));
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, json.toString());
Request request = new Request.Builder()
.url(url)
.addHeader("Authorization", "Basic " + encoding)
.addHeader("Content-Type", "application/json")
.post(body)
.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": "63653d84bc92e4015cd5be72",
"name": "Name",
"itemID": "Name",
"sku": "3434",
"accountingCode": "343",
"hasDefaultPrice": false,
"amount": {
"unit": "$",
"value": 232334
},
"taxes": [],
"type": "PRODUCT",
"companyId": "622294998bec060152bcad9c",
"createdBy": "6222930b8bec060152bcad67",
"updatedBy": "6222930b8bec060152bcad67",
"createdAt": "2022-11-04T16:27:48.366Z",
"updatedAt": "2022-11-04T16:27:48.366Z",
"source": "BLIXO",
"isBundle": false,
"image": "https://blixo-staging.s3.us-west-2.amazonaws.com/company/622294998bec060152bcad9c/images/item/new/2022/11/04/1667579228839-Screen%20Shot%202022-11-04%20at%2023.22.47.png",
"shopifySync": true,
"status": true,
"productCategory": "sub",
"description": "Description",
"websiteDescription": "Description",
"vendor": "tag",
"tags": [
"subcription"
],
"weight": 2,
"options": [
{
"values": [
"21"
],
"_id": "63653d3a3b2141b9d4d81399",
"name": "size"
}
],
"variants": [
{
"_id": "63653d4182e3d15a60e510ae",
"name": "21",
"option1": "21",
"sku": "232",
"barcode": "232",
"price": {
"unit": "$",
"value": 232
},
"compareAtPrice": {
"unit": "$",
"value": 232
},
"image": null
}
]
}
}
This API endpoint allows you to create a new item in the database. It's as simple as sending a POST request to https://api.blixo.com/v1/items
. Think of it as telling the server, "Hey, I have a new item for you!" And the server responds by creating the item for you!
HTTP Request
POST https://api.blixo.com/v1/items
Headers
Key | Value |
---|---|
Authorization | Basic {API_KEY} |
Parameters
Parameter | Type | Description |
---|---|---|
companyId | objectId | (required) Company ID |
accountingCode | String | Accounting Code |
description | String | Description of the item |
websiteDescription | String | Website Description of the item |
options | Array | Array of options for the item. Each option is an object that includes isNew , name , values ,_id |
productCategory | String | Product Category of the item |
sku | String | SKU of the item |
hasOptions | Boolean | If the item has options |
hasShipping | Boolean | If the item has shipping |
shopifySync | Boolean | If the item is synced with Shopify |
status | Boolean | Status of the item |
tags | Array | Array of tags for the item, e.g. subscription |
type | String | Type of the item |
name | String | (required) Name of the item |
variants | Array | Array of variants for the item. Each variant is an object that includes accountingCode , barcode , compareAtPrice ,description , image , name , option1 , price , sku ,_id |
vendor | String | Vendor of the item |
weight | Number | Weight of the item |
weightUnit | String | Weight Unit of the item |
amount | Object | Amount of the item. The object includes currency , unit , value |
image | String | Path of the item image |
discountable | Boolean | If the item is discountable |
taxable | Boolean | If the item is taxable |
Example
To create a new item, you would send a POST request to https://api.blixo.com/v1/items
. 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 item. 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 an item
curl "https://api.blixo.com/v1/items/itemId" \
-u {API_KEY}: \
-d companyId="60e1b7f0c6ef4219ff51824c" \
-d accountingCode="212111" \
-d description="description .." \
-d websiteDescription="" \
-d options[0][createdAt]="2022-11-04T16:27:53.000Z" \
-d options[0][name]="size" \
-d options[0][optionId]="100" \
-d options[0][productId]="100" \
-d options[0][updatedAt]="2022-11-04T16:27:53.000Z" \
-d productCategory="sub" \
-d sku="" \
-d hasOptions=true \
-d hasShipping=true \
-d shopifySync=true \
-d status=true \
-d tags[0]="subcription" \
-d type="PRODUCT" \
-d name="NAME ITEM" \
-d variants[0][accountingCode]="3232" \
-d variants[0][barcode]="232" \
-d variants[0][compareAtPrice][unit]="$" \
-d variants[0][compareAtPrice][value]="100" \
-d variants[0][createdAt]="2022-11-04T16:27:50.000Z" \
-d variants[0][description]="variant description" \
-d variants[0][fulfillmentService]="manual" \
-d variants[0][grams]="100" \
-d variants[0][image]=null \
-d variants[0][imageId]=null \
-d variants[0][inventoryManagement]=null \
-d variants[0][name]="100" \
-d variants[0][productId]="100" \
-d variants[0][requiresShipping]=false \
-d vendor="tag" \
-d weight=2211 \
-d weightUnit="kg" \
-d amount[unit]="$" \
-d amount[currency]="USD" \
-d amount[value]="100" \
-X PATCH
const fetch = require('node-fetch');
const url = 'https://api.blixo.com/v1/items/itemId';
const options = {
method: 'PATCH',
headers: {
'Authorization': 'Basic ' + Buffer.from('{API_KEY}:').toString('base64'),
'Content-Type': 'application/json'
},
body: JSON.stringify({
companyId: "60e1b7f0c6ef4219ff51824c",
accountingCode: "212111",
description: "description ..",
// ... other fields ...
})
};
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/items/itemId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_HTTPHEADER => array(
"Authorization: Basic " . base64_encode("{API_KEY}:"),
"Content-Type: "application/json"
),
CURLOPT_POSTFIELDS => json_encode(array(
"companyId" => "60e1b7f0c6ef4219ff51824c",
"accountingCode" => "212111",
"description" => "description ..",
// ... other fields ...
))
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
?>
import requests
import base64
import json
url = "https://api.blixo.com/v1/items/itemId"
api_key = "{API_KEY}"
headers = {
"Authorization": "Basic " + base64.b64encode((api_key + ":").encode()).decode(),
"Content-Type": "application/json"
}
data = {
"companyId": "60e1b7f0c6ef4219ff51824c",
"accountingCode": "212111",
"description": "description ..",
# ... other fields ...
}
response = requests.patch(url, headers=headers, data=json.dumps(data))
print(response.text)
require 'uri'
require 'net/http'
require 'base64'
require 'json'
url = URI("https://api.blixo.com/v1/items/itemId")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Basic ' + Base64.strict_encode64('{API_KEY}:')
request["Content-Type"] = 'application/json'
request.body = {
companyId: "60e1b7f0c6ef4219ff51824c",
accountingCode: "212111",
description: "description ..",
# ... other fields ...
}.to_json
response = http.request(request)
puts response.read_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.Patch,
RequestUri = new Uri("https://api.blixo.com/v1/items/itemId"),
};
var byteArray = Encoding.ASCII.GetBytes("{API_KEY}:");
request.Headers.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", Convert.ToBase64String(byteArray));
request.Content = new StringContent("{" +
"\"companyId\": \"60e1b7f0c6ef4219ff51824c\"," +
"\"accountingCode\": \"212111\"," +
"\"description\": \"description ..\"," +
// ... other fields ...
"}", Encoding.UTF8, "application/json");
var 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;
import java.util.Base64;
public class Main {
public static void main(String[] args) {
OkHttpClient client = new OkHttpClient();
String url = "https://api.blixo.com/v1/items/itemId";
String encoding = Base64.getEncoder().encodeToString(("{API_KEY}:".getBytes()));
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{" +
"\"companyId\": \"60e1b7f0c6ef4219ff51824c\"," +
"\"accountingCode\": \"212111\"," +
"\"description\": \"description ..\"," +
// ... other fields ...
"}");
Request request = new Request.Builder()
.url(url)
.patch(body)
.addHeader("Authorization", "Basic " + encoding)
.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": "63653d84bc92e4015cd5be72",
"name": "Name",
"itemID": "Name",
"sku": "3434",
"accountingCode": "343",
"hasDefaultPrice": false,
"amount": {
"unit": "$",
"value": 232334
},
"taxes": [],
"type": "PRODUCT",
"companyId": "622294998bec060152bcad9c",
"createdBy": "6222930b8bec060152bcad67",
"updatedBy": "6222930b8bec060152bcad67",
"createdAt": "2022-11-04T16:27:48.366Z",
"updatedAt": "2022-11-04T16:27:48.366Z",
"source": "BLIXO",
"isBundle": false,
"image": "https://blixo-staging.s3.us-west-2.amazonaws.com/company/622294998bec060152bcad9c/images/item/new/2022/11/04/1667579228839-Screen%20Shot%202022-11-04%20at%2023.22.47.png",
"shopifySync": true,
"status": true,
"productCategory": "sub",
"description": "Description",
"websiteDescription": "Description",
"vendor": "tag",
"tags": [
"subcription"
],
"weight": 2,
"options": [
{
"values": [
"21"
],
"_id": "63653d3a3b2141b9d4d81399",
"name": "size"
}
],
"variants": [
{
"_id": "63653d4182e3d15a60e510ae",
"name": "21",
"option1": "21",
"sku": "232",
"barcode": "232",
"price": {
"unit": "$",
"value": 232
},
"compareAtPrice": {
"unit": "$",
"value": 232
},
"image": null
}
]
}
}
This API endpoint allows you to update an existing item in the database. To do this, you need to send a PATCH request to https://api.blixo.com/v1/items/{itemId}
. Replace {itemId}
with the ID of the item you want to update. Also, remember to replace {API_KEY}
with your actual API key.
HTTP Request
PATCH https://api.blixo.com/v1/items/{itemId}
Headers
Key | Value |
---|---|
Authorization | Basic {API_KEY} |
Parameters
Parameter | Type | Description |
---|---|---|
itemID | objectId | Item ID |
companyId | objectId | (required) Company ID |
name | string | (required) Name of item |
amount | object | Amount object includes currency , unit , value |
options | array | An array of items. Each item are an object includes isNew , name , values ,_id |
productCategory | string | Product Category |
shopifySync | boolean | Shopify Sync |
sku | string | SKU |
status | boolean | Status |
tags | array | Tags, e.g. subcription |
variants | array | An array of items. Each item are an object includes accountingCode , barcode , compareAtPrice ,description , image , name , option1 , price , sku ,_id |
vendor | string | Vendor |
websiteDescription | string | Website Description |
weight | number | Weight |
accountingCode | string | Accounting Code |
description | string | Description of item |
type | string | Type of item |
image | string | Path of image |
discountable | boolean | Discountable |
hasOptions | boolean | Has Options |
hasShipping | boolean | Has Shipping |
taxable | boolean | Taxable |
Example
To update an item, you would send a PATCH request to https://api.blixo.com/v1/items/{itemId}
. In the request, you can include any parameters you want to update. For example, if you want to update the description
and name
of an item, your request might look like this:
curl "https://api.blixo.com/v1/items/{itemId}" \
-u {API_KEY}: \
-d description="New description" \
-d name="New name" \
-X PATCH
Response
The response will be a JSON object with a data
key containing the updated item. 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.
The above command returns JSON structured like this:
{
"data": {
"id": "{itemId}",
"description": "New description",
"name": "New name",
// ... other item properties ...
}
}
Delete an item
curl "https://api.blixo.com/v1/items/:itemId" \
-u {API_KEY}: \
-X DELETE
const fetch = require('node-fetch');
const url = 'https://api.blixo.com/v1/items/:itemId';
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/items/:itemId",
CURLOPT_CUSTOMREQUEST => "DELETE",
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/items/:itemId")
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
import base64
url = "https://api.blixo.com/v1/items/:itemId"
api_key = "{API_KEY}"
headers = {
"Authorization": "Basic " + base64.b64encode((api_key + ":").encode()).decode()
}
response = requests.delete(url, headers=headers)
print(response.text)
package main
import (
"fmt"
"net/http"
"io/ioutil"
"encoding/base64"
)
func main() {
url := "https://api.blixo.com/v1/items/:itemId"
req, _ := http.NewRequest("DELETE", 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.Delete,
RequestUri = new Uri("https://api.blixo.com/v1/items/:itemId"),
};
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/items/:itemId";
String encoding = Base64.getEncoder().encodeToString(("{API_KEY}:".getBytes()));
Request request = new Request.Builder()
.url(url)
.delete()
.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": "63653d84bc92e4015cd5be72"
}
This API endpoint allows you to delete a specific item from the database. It's as simple as sending a DELETE request to https://api.blixo.com/v1/items/:itemId
. Think of it as telling the server, "Hey, I don't need this item anymore, can you please remove it?" And the server responds by deleting the item!
HTTP Request
DELETE https://api.blixo.com/v1/items/:itemId
Headers
Key | Value |
---|---|
Authorization | Basic {API_KEY} |
Parameters
Parameter | Type | Description |
---|---|---|
itemId | String | The unique identifier of the item you want to delete. |
Example
To delete an item, you would send a DELETE request to https://api.blixo.com/v1/items/:itemId
. Remember to replace :itemId
with the actual ID of the item you want to delete, and {API_KEY}
with your actual API key.
Response
The response will be a JSON object with a data
key containing the ID of the deleted item. 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.
Plans
Plan object
Attribute | Type | Description |
---|---|---|
id | ObjectId | The ID of the plan. |
name | String | The name of the plan. |
code | String | The unique code of the plan. |
pricePerMonth | Object | The price per month of the plan. It includes the following attributes: |
• value : Number - The value of the price. |
||
• unit : String - The unit of the price. |
||
• currency : String - The currency of the price. Default is USD . |
||
pricePerYear | Object | The price per year of the plan. It includes the following attributes: |
• value : Number - The value of the price. |
||
• unit : String - The unit of the price. |
||
• currency : String - The currency of the price. Default is USD . |
||
trialPeriods | Number | The trial periods of the plan. Default is 30. |
usageRules | Array | The usage rules of the plan. Each usage rule is an object with the following keys: |
• name : String - The name of the usage rule. |
||
• action : String - The action of the usage rule. Possible values are 'BLOCK', 'ALERT'. |
||
• value : Number - The value of the usage rule. |
||
• value2 : Number - The second value of the usage rule. |
||
createdAt | Date | The date when the plan was created. |
updatedAt | Date | The date when the plan was last updated. |
List all plans
curl "https://api.blixo.com/v1/plans" \
-u {API_KEY}:
const fetch = require('node-fetch');
const url = 'https://api.blixo.com/v1/plans';
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/plans",
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/plans")
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/plans"
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/plans"
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/plans"),
};
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/plans";
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": "6363b4bdbc92e4015ccb5cd2",
"name": "8 MEALS",
"companyId": "622294998bec060152bcad9c",
"code": "CUPL-00396",
"price": {
"unit": "$",
"currency": "USD",
"value": 32
},
"type": "MONTHLY",
"itemId": "6350349a2b1297015dc759e5",
"interval": "months",
"intervalCount": 1,
"pricingMode": "per_unit",
"taxable": true,
"isTemplate": true,
"deletedBy": "6222930b8bec060152bcad67",
"deletedAt": "2022-11-03T12:32:23.607Z",
"integrations": {
"shopify": {
"productId": "7469497221284",
"variantId": "42857887105188"
},
"bigquery": {
"lastSynced": "2022-11-03T14:00:03.595Z"
}
}
}
],
"pagination": {
"total": 404
}
}
This API endpoint allows you to retrieve a list of all plans available. It's as simple as sending a GET request to https://api.blixo.com/v1/plans
. Think of it as asking the server, "Hey, can I get a list of all your plans?" And the server responds with the information you asked for!
HTTP Request
GET https://api.blixo.com/v1/plans
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 plans to retrieve per page. Default is 100 . |
companyId | objectId | (required) Company ID |
Example
To list all plans, you would send a GET request to https://api.blixo.com/v1/plans
. Remember to replace {API_KEY}
with your actual API key.
If you want to retrieve the third page of plans, with 50 plans per page, you would send a GET request to https://api.blixo.com/v1/plans?page=3&perPage=50
.
Response
The response will be a JSON object with a data
key containing an array of plans. Each plan will be an object with the following keys:
id
: The unique identifier of the plan.name
: The name of the plan.companyId
: The ID of the company.code
: The code of the plan.price
: The price of the plan.type
: The type of the plan.itemId
: The ID of the item.interval
: The interval of the plan.intervalCount
: The interval count of the plan.pricingMode
: The pricing mode of the plan.taxable
: Whether the plan is taxable.isTemplate
: Whether the plan is a template.deletedBy
: The ID of the user who deleted the plan.deletedAt
: The date and time when the plan was deleted.integrations
: The integrations of the plan.
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 plan
curl "https://api.blixo.com/v1/plans" \
-u {API_KEY}: \
-d companyId="60e1b7f0c6ef4219ff51824c" \
-d item[label]="Paperweights" \
-d item[value]="636678a6bc92e4015cdd62cf" \
-d itemId=null \
-d isTemplate=false \
-d name="TEAM YEARLY PLAN UPDATE" \
-d price[unit]="$" \
-d price[currency]="USD" \
-d price[value]="699.88" \
-d pricingMode="per_unit" \
-d type="YEARLY" \
-X POST
const fetch = require('node-fetch');
const url = 'https://api.blixo.com/v1/plans';
const options = {
method: 'POST',
headers: {
'Authorization': 'Basic ' + Buffer.from('{API_KEY}:').toString('base64'),
'Content-Type': 'application/json'
},
body: JSON.stringify({
companyId: "60e1b7f0c6ef4219ff51824c",
item: {
label: "Paperweights",
value: "636678a6bc92e4015cdd62cf"
},
itemId: null,
isTemplate: false,
name: "TEAM YEARLY PLAN UPDATE",
price: {
unit: "$",
currency: "USD",
value: "699.88"
},
pricingMode: "per_unit",
type: "YEARLY"
})
};
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/plans",
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => json_encode(array(
"companyId" => "60e1b7f0c6ef4219ff51824c",
"item" => array(
"label" => "Paperweights",
"value" => "636678a6bc92e4015cdd62cf"
),
"itemId" => null,
"isTemplate" => false,
"name" => "TEAM YEARLY PLAN UPDATE",
"price" => array(
"unit" => "$",
"currency" => "USD",
"value" => "699.88"
),
"pricingMode" => "per_unit",
"type" => "YEARLY"
)),
CURLOPT_HTTPHEADER => array(
"Authorization: Basic " . base64_encode("{API_KEY}:"),
"Content-Type: "application/json"
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
?>
require 'uri'
require 'net/http'
require 'json'
url = URI("https://api.blixo.com/v1/plans")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request["Authorization"] = 'Basic ' + Base64.strict_encode64('{API_KEY}:')
request.body = JSON.dump({
"companyId" => "60e1b7f0c6ef4219ff51824c",
"item" => {
"label" => "Paperweights",
"value" => "636678a6bc92e4015cdd62cf"
},
"itemId" => nil,
"isTemplate" => false,
"name" => "TEAM YEARLY PLAN UPDATE",
"price" => {
"unit" => "$",
"currency" => "USD",
"value" => "699.88"
},
"pricingMode" => "per_unit",
"type" => "YEARLY"
})
response = http.request(request)
puts response.read_body
import requests
import json
import base64
url = "https://api.blixo.com/v1/plans"
api_key = "{API_KEY}"
headers = {
"Authorization": "Basic " + base64.b64encode((api_key + ":").encode()).decode(),
"Content-Type": "application/json"
}
data = {
"companyId": "60e1b7f0c6ef4219ff51824c",
"item": {
"label": "Paperweights",
"value": "636678a6bc92e4015cdd62cf"
},
"itemId": None,
"isTemplate": False,
"name": "TEAM YEARLY PLAN UPDATE",
"price": {
"unit": "$",
"currency": "USD",
"value": "699.88"
},
"pricingMode": "per_unit",
"type": "YEARLY"
}
response = requests.post(url, headers=headers, data=json.dumps(data))
print(response.text)
package main
import (
"fmt"
"net/http"
"bytes"
"encoding/json"
"encoding/base64"
)
func main() {
url := "https://api.blixo.com/v1/plans"
data := map[string]interface{}{
"companyId": "60e1b7f0c6ef4219ff51824c",
"item": map[string]string{
"label": "Paperweights",
"value": "636678a6bc92e4015cdd62cf",
},
"itemId": nil,
"isTemplate": false,
"name": "TEAM YEARLY PLAN UPDATE",
"price": map[string]string{
"unit": "$",
"currency": "USD",
"value": "699.88",
},
"pricingMode": "per_unit",
"type": "YEARLY",
}
jsonData, _ := json.Marshal(data)
req, _ := http.NewRequest("POST", url, bytes.NewBuffer(jsonData))
req.Header.Add("Authorization", "Basic " + base64.StdEncoding.EncodeToString([]byte("{API_KEY}:")))
req.Header.Add("Content-Type", "application/json")
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;
using Newtonsoft.Json;
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/plans"),
Headers = {
{ HttpRequestHeader.Authorization.ToString(), "Basic " + Convert.ToBase64String(Encoding.ASCII.GetBytes("{API_KEY}:")) },
{ HttpRequestHeader.ContentType.ToString(), "application/json" }
},
Content = new StringContent(JsonConvert.SerializeObject(new
{
companyId = "60e1b7f0c6ef4219ff51824c",
item = new { label = "Paperweights", value = "636678a6bc92e4015cdd62cf" },
itemId = (string)null,
isTemplate = false,
name = "TEAM YEARLY PLAN UPDATE",
price = new { unit = "$", currency = "USD", value = "699.88" },
pricingMode = "per_unit",
type = "YEARLY"
}), Encoding.UTF8, "application/json")
};
var response = await client.SendAsync(request);
Console.WriteLine(await response.Content.ReadAsStringAsync());
}
}
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.RequestBody;
import okhttp3.MediaType;
import okhttp3.Response;
import java.util.Base64;
import org.json.JSONObject;
public class Main {
public static void main(String[] args) {
OkHttpClient client = new OkHttpClient();
String url = "https://api.blixo.com/v1/plans";
String encoding = Base64.getEncoder().encodeToString(("{API_KEY}:".getBytes()));
JSONObject json = new JSONObject();
json.put("companyId", "60e1b7f0c6ef4219ff51824c");
JSONObject item = new JSONObject();
item.put("label", "Paperweights");
item.put("value", "636678a6bc92e4015cdd62cf");
json.put("item", item);
json.put("itemId", JSONObject.NULL);
json.put("isTemplate", false);
json.put("name", "TEAM YEARLY PLAN UPDATE");
JSONObject price = new JSONObject();
price.put("unit", "$");
price.put("currency", "USD");
price.put("value", "699.88");
json.put("price", price);
json.put("pricingMode", "per_unit");
json.put("type", "YEARLY");
MediaType JSON = MediaType.get("application/json; charset=utf-8");
RequestBody body = RequestBody.create(JSON, json.toString());
Request request = new Request.Builder()
.url(url)
.addHeader("Authorization", "Basic " + encoding)
.addHeader("Content-Type", "application/json")
.post(body)
.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": "63667d8cbc92e4015cdd6734",
"name": "plan test 2",
"companyId": "622294998bec060152bcad9c",
"code": "CUPL-00406",
"price": {
"unit": "$",
"currency": "USD",
"value": 545
},
"type": "MONTHLY",
"itemId": "63653cc9bc92e4015cd5bc8b",
"interval": "months",
"intervalCount": 1,
"pricingMode": "per_unit",
"taxable": true,
"isTemplate": false,
"integrations": {
"shopify": {
"productId": "7482556678308",
"variantId": "42917954093220"
}
}
}
}
This API endpoint allows you to create a new plan. It's as simple as sending a POST request to https://api.blixo.com/v1/plans
. Remember to replace {API_KEY}
with your actual API key and provide all the required parameters. Think of it as telling the server, "Hey, I want to create a new plan with these details." And the server responds with the details of the newly created plan!
HTTP Request
POST https://api.blixo.com/v1/plans
Headers
Key | Value |
---|---|
Authorization | Basic {API_KEY} |
Parameters
Parameter | Type | Description |
---|---|---|
companyId | objectId | (required) Company ID |
item[label] | String | (required) Label of the item |
item[value] | String | (required) Value of the item |
itemId | objectId | Item ID |
isTemplate | Boolean | Whether the plan is a template |
name | String | (required) Name of the plan |
price[unit] | String | (required) Unit of the price |
price[currency] | String | (required) Currency of the price |
price[value] | String | (required) Value of the price |
pricingMode | String | (required) Pricing mode of the plan |
type | String | (required) Type of the plan |
interval | String | (required) Interval of the plan |
intervalCount | Integer | (required) Interval count of the plan |
taxable | Boolean | Whether the plan is taxable |
integrations | Object | Integrations of the plan |
Example
To create a new plan, you would send a POST request to https://api.blixo.com/v1/plans
. Remember to replace {API_KEY}
with your actual API key and provide all the required parameters.
Response
The response will be a JSON object with a data
key containing the details of the newly created plan. 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 plan
curl "https://api.blixo.com/v1/plans/:planId" \
-u {API_KEY}: \
-d companyId="60e1b7f0c6ef4219ff51824c" \
-d item[label]="Paperweights" \
-d item[value]="636678a6bc92e4015cdd62cf" \
-d itemId=null \
-d name="TEAM YEARLY PLAN UPDATE" \
-d price[unit]="$" \
-d price[currency]="USD" \
-d price[value]="699.88" \
-d pricingMode="per_unit" \
-d type="YEARLY" \
-X PATCH
const fetch = require('node-fetch');
const url = 'https://api.blixo.com/v1/plans/:planId';
const options = {
method: 'PATCH',
headers: {
'Authorization': 'Basic ' + Buffer.from('{API_KEY}:').toString('base64'),
'Content-Type': 'application/json'
},
body: JSON.stringify({
"companyId": "60e1b7f0c6ef4219ff51824c",
"item": {
"label": "Paperweights",
"value": "636678a6bc92e4015cdd62cf"
},
"itemId": null,
"name": "TEAM YEARLY PLAN UPDATE",
"price": {
"unit": "$",
"currency": "USD",
"value": "699.88"
},
"pricingMode": "per_unit",
"type": "YEARLY"
})
};
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/plans/:planId",
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode(array(
"companyId" => "60e1b7f0c6ef4219ff51824c",
"item" => array(
"label" => "Paperweights",
"value" => "636678a6bc92e4015cdd62cf"
),
"itemId" => null,
"name" => "TEAM YEARLY PLAN UPDATE",
"price" => array(
"unit" => "$",
"currency" => "USD",
"value" => "699.88"
),
"pricingMode" => "per_unit",
"type" => "YEARLY"
)),
CURLOPT_HTTPHEADER => array(
"Authorization: Basic " . base64_encode("{API_KEY}:"),
"Content-Type: application/json"
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
?>
require 'uri'
require 'net/http'
require 'json'
require 'base64'
url = URI("https://api.blixo.com/v1/plans/:planId")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Patch.new(url)
request["Content-Type"] = 'application/json'
request["Authorization"] = 'Basic ' + Base64.strict_encode64('{API_KEY}:')
request.body = JSON.dump({
"companyId" => "60e1b7f0c6ef4219ff51824c",
"item" => {
"label" => "Paperweights",
"value" => "636678a6bc92e4015cdd62cf"
},
"itemId" => null,
"name" => "TEAM YEARLY PLAN UPDATE",
"price" => {
"unit" => "$",
"currency" => "USD",
"value" => "699.88"
},
"pricingMode" => "per_unit",
"type" => "YEARLY"
})
response = http.request(request)
puts response.read_body
import requests
import json
import base64
url = "https://api.blixo.com/v1/plans/:planId"
api_key = "{API_KEY}"
headers = {
"Authorization": "Basic " + base64.b64encode((api_key + ":").encode()).decode(),
"Content-Type": "application/json"
}
data = {
"companyId": "60e1b7f0c6ef4219ff51824c",
"item": {
"label": "Paperweights",
"value": "636678a6bc92e4015cdd62cf"
},
"itemId": None,
"name": "TEAM YEARLY PLAN UPDATE",
"price": {
"unit": "$",
"currency": "USD",
"value": "699.88"
},
"pricingMode": "per_unit",
"type": "YEARLY"
}
response = requests.patch(url, headers=headers, data=json.dumps(data))
print(response.text)
package main
import (
"fmt"
"net/http"
"io/ioutil"
"bytes"
"encoding/json"
"encoding/base64"
)
func main() {
url := "https://api.blixo.com/v1/plans/:planId"
data := map[string]interface{}{
"companyId": "60e1b7f0c6ef4219ff51824c",
"item": map[string]string{
"label": "Paperweights",
"value": "636678a6bc92e4015cdd62cf",
},
"itemId": nil,
"name": "TEAM YEARLY PLAN UPDATE",
"price": map[string]string{
"unit": "$",
"currency": "USD",
"value": "699.88",
},
"pricingMode": "per_unit",
"type": "YEARLY",
}
jsonData, _ := json.Marshal(data)
req, _ := http.NewRequest("PATCH", url, bytes.NewBuffer(jsonData))
req.Header.Add("Authorization", "Basic " + base64.StdEncoding.EncodeToString([]byte("{API_KEY}:")))
req.Header.Add("Content-Type", "application/json")
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;
using Newtonsoft.Json;
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.Patch,
RequestUri = new Uri("https://api.blixo.com/v1/plans/:planId"),
Content = new StringContent(JsonConvert.SerializeObject(new
{
companyId = "60e1b7f0c6ef4219ff51824c",
item = new
{
label = "Paperweights",
value = "636678a6bc92e4015cdd62cf"
},
itemId = (string)null,
name = "TEAM YEARLY PLAN UPDATE",
price = new
{
unit = "$",
currency = "USD",
value = "699.88"
},
pricingMode = "per_unit",
type = "YEARLY"
}), Encoding.UTF8, "application/json")
};
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.RequestBody;
import okhttp3.MediaType;
import okhttp3.Response;
import java.util.Base64;
import org.json.JSONObject;
public class Main {
public static void main(String[] args) {
OkHttpClient client = new OkHttpClient();
String url = "https://api.blixo.com/v1/plans/:planId";
String encoding = Base64.getEncoder().encodeToString(("{API_KEY}:".getBytes()));
JSONObject item = new JSONObject();
item.put("label", "Paperweights");
item.put("value", "636678a6bc92e4015cdd62cf");
JSONObject price = new JSONObject();
price.put("unit", "$");
price.put("currency", "USD");
price.put("value", "699.88");
JSONObject json = new JSONObject();
json.put("companyId", "60e1b7f0c6ef4219ff51824c");
json.put("item", item);
json.put("itemId", JSONObject.NULL);
json.put("name", "TEAM YEARLY PLAN UPDATE");
json.put("price", price);
json.put("pricingMode", "per_unit");
json.put("type", "YEARLY");
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, json.toString());
Request request = new Request.Builder()
.url(url)
.patch(body)
.addHeader("Authorization", "Basic " + encoding)
.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": "63662329bc92e4015cdb5dbd",
"name": "Khoa To",
"companyId": "622294998bec060152bcad9c",
"code": "CUPL-00404",
"price": {
"unit": "$",
"currency": "USD",
"value": 323
},
"type": "MONTHLY",
"itemId": null,
"interval": "months",
"intervalCount": 1,
"pricingMode": "per_unit",
"taxable": true,
"isTemplate": false,
"integrations": {
"bigquery": {
"lastSynced": "2022-11-05T10:00:04.531Z"
}
}
}
}
This API endpoint allows you to update an existing plan. It's as simple as sending a PATCH request to https://api.blixo.com/v1/plans/:planId
. Remember to replace {API_KEY}
with your actual API key and :planId
with the ID of the plan you want to update. Think of it as telling the server, "Hey, I want to update this plan with these new details." And the server responds with the details of the updated plan!
HTTP Request
PATCH https://api.blixo.com/v1/plans/:planId
Headers
Key | Value |
---|---|
Authorization | Basic {API_KEY} |
Parameters
Parameter | Type | Description |
---|---|---|
companyId | objectId | (required) Company ID |
item[label] | String | Label of the item |
item[value] | String | Value of the item |
itemId | objectId | (required) Item ID |
isTemplate | Boolean | Whether the plan is a template |
name | String | (required) Name of the plan |
price[unit] | String | (required) Unit of the price |
price[currency] | String | (required) Currency of the price |
price[value] | Integer | (required) Value of the price |
pricingMode | String | Pricing mode of the plan |
type | String | (required) Type of the plan |
interval | String | Interval of the plan |
intervalCount | Integer | Interval count of the plan |
taxable | Boolean | Whether the plan is taxable |
integrations | Object | Integrations of the plan |
Example
To update a plan, you would send a PATCH request to https://api.blixo.com/v1/plans/:planId
. Remember to replace {API_KEY}
with your actual API key and :planId
with the ID of the plan you want to update.
Response
The response will be a JSON object with a data
key containing the details of the updated plan. 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 plan
curl "https://api.blixo.com/v1/plans/:planId" \
-u {API_KEY}: \
-X DELETE
const fetch = require('node-fetch');
const url = 'https://api.blixo.com/v1/plans/:planId';
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/plans/:planId",
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'
require 'base64'
url = URI("https://api.blixo.com/v1/plans/:planId")
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
import base64
url = "https://api.blixo.com/v1/plans/:planId"
api_key = "{API_KEY}"
headers = {
"Authorization": "Basic " + base64.b64encode((api_key + ":").encode()).decode()
}
response = requests.delete(url, headers=headers)
print(response.text)
package main
import (
"fmt"
"net/http"
"io/ioutil"
"encoding/base64"
)
func main() {
url := "https://api.blixo.com/v1/plans/:planId"
req, _ := http.NewRequest("DELETE", 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.Delete,
RequestUri = new Uri("https://api.blixo.com/v1/plans/:planId"),
};
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/plans/:planId";
String encoding = Base64.getEncoder().encodeToString(("{API_KEY}:".getBytes()));
Request request = new Request.Builder()
.url(url)
.delete()
.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": "63653d84bc92e4015cd5be72"
}
This API endpoint allows you to delete an existing plan. It's as simple as sending a DELETE request to https://api.blixo.com/v1/plans/:planId
. Remember to replace {API_KEY}
with your actual API key and :planId
with the ID of the plan you want to delete. Think of it as telling the server, "Hey, I want to delete this plan." And the server responds with the details of the deleted plan!
HTTP Request
DELETE https://api.blixo.com/v1/plans/:planId
Headers
Key | Value |
---|---|
Authorization | Basic {API_KEY} |
Parameters
No parameters are required for this request.
Example
To delete a plan, you would send a DELETE request to https://api.blixo.com/v1/plans/:planId
. Remember to replace {API_KEY}
with your actual API key and :planId
with the ID of the plan you want to delete.
Response
The response will be a JSON object with a data
key containing the ID of the deleted plan. 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.
Addons
Addon object
Attribute | Type | Description |
---|---|---|
id | ObjectId | The ID of the addon. |
name | String | The name of the addon. |
amount | Object | The amount of the addon, includes value , unit , currency . |
type | String | The type of the addon, either 'MEMBER'. |
createdAt | Date | The date when the addon was created. |
updatedAt | Date | The date when the addon was last updated. |
List all addons
curl "https://api.blixo.com/v1/addons" \
-u {API_KEY}:
const fetch = require('node-fetch');
const url = 'https://api.blixo.com/v1/addons';
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/addons",
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/addons")
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/addons"
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/addons"
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/addons"),
};
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/addons";
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": "633f031da53ad001603fc004",
"name": "Khoa",
"companyId": "622294998bec060152bcad9c",
"code": "CUAD-00050",
"price": {
"unit": "$",
"currency": "USD",
"value": 0
},
"type": "MONTHLY",
"itemId": "6328b29b7d8766015dde51b7",
"interval": "months",
"intervalCount": 1,
"pricingMode": "per_unit",
"taxable": true,
"createdBy": "6222930b8bec060152bcad67",
"updatedBy": "6222930b8bec060152bcad67",
"createdAt": "2022-10-06T16:32:29.876Z",
"updatedAt": "2022-10-06T18:00:01.116Z",
"integrations": {
"shopify": {
"productId": "7439849685156",
"variantId": "42740517372068"
},
"bigquery": {
"lastSynced": "2022-10-06T18:00:01.116Z"
}
}
}
],
"pagination": {
"total": 50
}
}
This API endpoint allows you to retrieve a list of all addons in the database. It's as simple as sending a GET request to https://api.blixo.com/v1/addons
. Think of it as asking the server, "Hey, can I get a list of all your addons?" And the server responds with the information you asked for!
HTTP Request
GET https://api.blixo.com/v1/addons
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 addons to retrieve per page. Default is 100 . |
companyId | objectId | (optional) Company ID to filter addons by company. |
Example
To list all addons, you would send a GET request to https://api.blixo.com/v1/addons
. Remember to replace {API_KEY}
with your actual API key.
If you want to retrieve the third page of addons, with 50 addons per page, you would send a GET request to https://api.blixo.com/v1/addons?page=3&perPage=50
.
Response
The response will be a JSON object with a data
key containing an array of addons. Each addon will be an object with the following keys:
id
: The unique identifier of the addon.name
: The name of the addon.companyId
: The ID of the company.code
: The code of the addon.price
: The price of the addon.type
: The type of the addon.itemId
: The ID of the item.interval
: The interval of the addon.intervalCount
: The interval count of the addon.pricingMode
: The pricing mode of the addon.taxable
: Whether the addon is taxable.createdBy
: The ID of the user who created the addon.updatedBy
: The ID of the user who last updated the addon.createdAt
: The creation date of the addon.updatedAt
: The last update date of the addon.integrations
: The integrations of the addon.
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 addon
curl "https://api.blixo.com/v1/addons" \
-u {API_KEY}: \
-d companyId="60e1b7f0c6ef4219ff51824c" \
-d item[label]="Paperweights" \
-d item[value]="636678a6bc92e4015cdd62cf" \
-d name="YEARLY MEMBER ADDON" \
-d price[unit]="$" \
-d price[currency]="USD" \
-d price[value]="199.88" \
-d subscriptionId="6358a6819d00a71b345896eb" \
-d type="YEARLY" \
-X POST
const fetch = require('node-fetch');
const url = 'https://api.blixo.com/v1/addons';
const options = {
method: 'POST',
headers: {
'Authorization': 'Basic ' + Buffer.from('{API_KEY}:').toString('base64'),
'Content-Type': 'application/json'
},
body: JSON.stringify({
companyId: "60e1b7f0c6ef4219ff51824c",
item: {
label: "Paperweights",
value: "636678a6bc92e4015cdd62cf"
},
name: "YEARLY MEMBER ADDON",
price: {
unit: "$",
currency: "USD",
value: "199.88"
},
subscriptionId: "6358a6819d00a71b345896eb",
type: "YEARLY"
})
};
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/addons",
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => array(
"Authorization: Basic " . base64_encode("{API_KEY}:"),
"Content-Type" => "application/json"
),
CURLOPT_POSTFIELDS => json_encode(array(
"companyId" => "60e1b7f0c6ef4219ff51824c",
"item" => array(
"label" => "Paperweights",
"value" => "636678a6bc92e4015cdd62cf"
),
"name" => "YEARLY MEMBER ADDON",
"price" => array(
"unit" => "$",
"currency" => "USD",
"value" => "199.88"
),
"subscriptionId" => "6358a6819d00a71b345896eb",
"type" => "YEARLY"
))
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
?>
import requests
import json
import base64
url = "https://api.blixo.com/v1/addons"
api_key = "{API_KEY}"
headers = {
"Authorization": "Basic " + base64.b64encode((api_key + ":").encode()).decode(),
"Content-Type": "application/json"
}
data = {
"companyId": "60e1b7f0c6ef4219ff51824c",
"item": {
"label": "Paperweights",
"value": "636678a6bc92e4015cdd62cf"
},
"name": "YEARLY MEMBER ADDON",
"price": {
"unit": "$",
"currency": "USD",
"value": "199.88"
},
"subscriptionId": "6358a6819d00a71b345896eb",
"type": "YEARLY"
}
response = requests.post(url, headers=headers, data=json.dumps(data))
print(response.text)
package main
import (
"fmt"
"net/http"
"io/ioutil"
"encoding/base64"
)
func main() {
url := "https://api.blixo.com/v1/addons"
api_key := "{API_KEY}"
headers := {
"Authorization": "Basic " + base64.StdEncoding.EncodeToString([]byte(api_key+":")),
"Content-Type": "application/json",
}
data := `{
"companyId": "60e1b7f0c6ef4219ff51824c",
"item": {
"label": "Paperweights",
"value": "636678a6bc92e4015cdd62cf"
},
"name": "YEARLY MEMBER ADDON",
"price": {
"unit": "$",
"currency": "USD",
"value": "199.88"
},
"subscriptionId": "6358a6819d00a71b345896eb",
"type": "YEARLY"
}`
req, _ := http.NewRequest("POST", url, strings.NewReader(data))
req.Header.Add("Authorization", headers["Authorization"])
req.Header.Add("Content-Type", headers["Content-Type"])
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/addons"),
Content = new StringContent("{\"companyId\":\"60e1b7f0c6ef4219ff51824c\",\"item\":{\"label\":\"Paperweights\",\"value\":\"636678a6bc92e4015cdd62cf\"},\"name\":\"YEARLY MEMBER ADDON\",\"price\":{\"unit\":\"$\",\"currency\":\"USD\",\"value\":\"199.88\"},\"subscriptionId\":\"6358a6819d00a71b345896eb\",\"type\":\"YEARLY\"}", Encoding.UTF8, "application/json")
};
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.MediaType;
import okhttp3.RequestBody;
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/addons";
String encoding = Base64.getEncoder().encodeToString(("{API_KEY}:".getBytes()));
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"companyId\":\"60e1b7f0c6ef4219ff51824c\",\"item\":{\"label\":\"Paperweights\",\"value\":\"636678a6bc92e4015cdd62cf\"},\"name\":\"YEARLY MEMBER ADDON\",\"price\":{\"unit\":\"$\",\"currency\":\"USD\",\"value\":\"199.88\"},\"subscriptionId\":\"6358a6819d00a71b345896eb\",\"type\":\"YEARLY\"}");
Request request = new Request.Builder()
.url(url)
.post(body)
.addHeader("Authorization", "Basic " + encoding)
.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": "636682acbc92e4015cdd6bae",
"name": "test add new add on ",
"companyId": "622294998bec060152bcad9c",
"code": "CUAD-00053",
"price": {
"unit": "$",
"currency": "USD",
"value": 23232
},
"type": "MONTHLY",
"itemId": null,
"interval": "months",
"intervalCount": 1,
"pricingMode": "per_unit",
"taxable": true,
"createdBy": "6222930b8bec060152bcad67",
"updatedBy": "6222930b8bec060152bcad67",
"createdAt": "2022-11-05T15:35:08.540Z",
"updatedAt": "2022-11-05T15:35:08.561Z"
}
}
This API endpoint allows you to create a new addon. It's as simple as sending a POST request to https://api.blixo.com/v1/addons
. Think of it as telling the server, "Hey, I have a new addon, can you please add it?" And the server responds by creating the addon!
HTTP Request
POST https://api.blixo.com/v1/addons
Headers
Key | Value |
---|---|
Authorization | Basic {API_KEY} |
Parameters
Parameter | Type | Description |
---|---|---|
companyId | objectId | (required) The ID of the company. |
item[label] | String | (required) The label of the item. |
item[value] | String | (required) The value of the item. |
name | String | (required) The name of the addon. |
price[unit] | String | (required) The unit of the price. |
price[currency] | String | (required) The currency of the price. |
price[value] | Number | (required) The value of the price. |
subscriptionId | objectId | The ID of the subscription. |
type | String | (required) The type of the addon. E.g. DAILY , WEEKLY , MONTHLY , SEMIANNUALLY , YEARLY , CUSTOM |
itemId | objectId | Item ID |
interval | String | Interval of the addon. E.g. days , weeks , months , years |
intervalCount | Number | The count of intervals. |
pricingMode | String | The pricing mode of the addon. E.g. per_unit , tiered , volume , stairstep |
taxable | Boolean | Whether the addon is taxable or not. |
createdBy | objectId | The ID of the user who created the addon. |
updatedBy | objectId | The ID of the user who last updated the addon. |
createdAt | Date | The date when the addon was created. |
updatedAt | Date | The date when the addon was last updated. |
Example
To create an addon, you would send a POST request to https://api.blixo.com/v1/addons
. Remember to replace {API_KEY}
with your actual API key.
curl "https://api.blixo.com/v1/addons" \
-u {API_KEY}: \
-d companyId="60e1b7f0c6ef4219ff51824c" \
-d item[label]="Paperweights" \
-d item[value]="636678a6bc92e4015cdd62cf" \
-d name="YEARLY MEMBER ADDON" \
-d price[unit]="$" \
-d price[currency]="USD" \
-d price[value]="199.88" \
-d subscriptionId="6358a6819d00a71b345896eb" \
-d type="YEARLY" \
-X POST
Response
The response will be a JSON object with a data
key containing the created addon. 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.
Update a addon
curl "https://api.blixo.com/v1/addon/:addonId" \
-u {API_KEY}: \
-d companyId="60e1b7f0c6ef4219ff51824c" \
-d item[label]="Paperweights" \
-d item[value]="636678a6bc92e4015cdd62cf" \
-d name="YEARLY MEMBER ADDON" \
-d itemId=null \
-d price[unit]="$" \
-d price[currency]="USD" \
-d price[value]="199.88" \
-d pricingMode="per_unit" \
-d type="YEARLY" \
-X PATCH
const fetch = require('node-fetch');
const url = 'https://api.blixo.com/v1/addon/:addonId';
const options = {
method: 'PATCH',
headers: {
'Authorization': 'Basic ' + Buffer.from('{API_KEY}:').toString('base64'),
'Content-Type': 'application/json'
},
body: JSON.stringify({
"companyId": "60e1b7f0c6ef4219ff51824c",
"item": {
"label": "Paperweights",
"value": "636678a6bc92e4015cdd62cf"
},
"name": "YEARLY MEMBER ADDON",
"itemId": null,
"price": {
"unit": "$",
"currency": "USD",
"value": "199.88"
},
"pricingMode": "per_unit",
"type": "YEARLY"
})
};
fetch(url, options)
.then(res => res.text())
.then(body => console.log(body))
.catch(error => console.error(error));
import requests
import json
import base64
url = "https://api.blixo.com/v1/addon/:addonId"
api_key = "{API_KEY}"
headers = {
"Authorization": "Basic " + base64.b64encode((api_key + ":").encode()).decode(),
"Content-Type": "application/json"
}
data = {
"companyId": "60e1b7f0c6ef4219ff51824c",
"item": {
"label": "Paperweights",
"value": "636678a6bc92e4015cdd62cf"
},
"name": "YEARLY MEMBER ADDON",
"itemId": null,
"price": {
"unit": "$",
"currency": "USD",
"value": "199.88"
},
"pricingMode": "per_unit",
"type": "YEARLY"
}
response = requests.patch(url, headers=headers, data=json.dumps(data))
print(response.text)
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.blixo.com/v1/addon/:addonId",
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => array(
"Authorization: Basic " . base64_encode("{API_KEY}:"),
"Content-Type: "application/json"
),
CURLOPT_POSTFIELDS => json_encode(array(
"companyId" => "60e1b7f0c6ef4219ff51824c",
"item" => array(
"label" => "Paperweights",
"value" => "636678a6bc92e4015cdd62cf"
),
"name" => "YEARLY MEMBER ADDON",
"itemId" => null,
"price" => array(
"unit" => "$",
"currency" => "USD",
"value" => "199.88"
),
"pricingMode" => "per_unit",
"type" => "YEARLY"
))
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
?>
require 'uri'
require 'net/http'
require 'base64'
require 'json'
url = URI("https://api.blixo.com/v1/addon/:addonId")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Basic ' + Base64.strict_encode64('{API_KEY}:')
request["Content-Type"] = 'application/json'
request.body = JSON.generate({
"companyId" => "60e1b7f0c6ef4219ff51824c",
"item" => {
"label" => "Paperweights",
"value" => "636678a6bc92e4015cdd62cf"
},
"name" => "YEARLY MEMBER ADDON",
"itemId" => nil,
"price" => {
"unit" => "$",
"currency" => "USD",
"value" => "199.88"
},
"pricingMode" => "per_unit",
"type" => "YEARLY"
})
response = http.request(request)
puts response.read_body
package main
import (
"fmt"
"net/http"
"io/ioutil"
"encoding/base64"
"strings"
)
func main() {
url := "https://api.blixo.com/v1/addon/:addonId"
method := "PATCH"
payload := strings.NewReader(`{
"companyId": "60e1b7f0c6ef4219ff51824c",
"item": {
"label": "Paperweights",
"value": "636678a6bc92e4015cdd62cf"
},
"name": "YEARLY MEMBER ADDON",
"itemId": null,
"price": {
"unit": "$",
"currency": "USD",
"value": "199.88"
},
"pricingMode": "per_unit",
"type": "YEARLY"
}`)
client := &http.Client {}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Authorization", "Basic " + base64.StdEncoding.EncodeToString([]byte("{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))
}
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.Patch,
RequestUri = new Uri("https://api.blixo.com/v1/addon/:addonId"),
Headers = {
{ HttpRequestHeader.Authorization.ToString(), "Basic " + Convert.ToBase64String(Encoding.ASCII.GetBytes("{API_KEY}:")) },
{ HttpRequestHeader.ContentType.ToString(), "application/json" }
},
Content = new StringContent(@"{
""companyId"": ""60e1b7f0c6ef4219ff51824c"",
""item"": {
""label"": ""Paperweights"",
""value"": ""636678a6bc92e4015cdd62cf""
},
""name"": ""YEARLY MEMBER ADDON"",
""itemId"": null,
""price"": {
""unit"": ""$"",
""currency"": ""USD"",
""value"": ""199.88""
},
""pricingMode"": ""per_unit"",
""type"": ""YEARLY""
}", Encoding.UTF8, "application/json")
};
var 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;
import java.util.Base64;
public class Main {
public static void main(String[] args) {
OkHttpClient client = new OkHttpClient();
String url = "https://api.blixo.com/v1/addon/:addonId";
String encoding = Base64.getEncoder().encodeToString(("{API_KEY}:".getBytes()));
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n" +
" \"companyId\": \"60e1b7f0c6ef4219ff51824c\",\n" +
" \"item\": {\n" +
" \"label\": \"Paperweights\",\n" +
" \"value\": \"636678a6bc92e4015cdd62cf\"\n" +
" },\n" +
" \"name\": \"YEARLY MEMBER ADDON\",\n" +
" \"itemId\": null,\n" +
" \"price\": {\n" +
" \"unit\": \"$\",\n" +
" \"currency\": \"USD\",\n" +
" \"value\": \"199.88\"\n" +
" },\n" +
" \"pricingMode\": \"per_unit\",\n" +
" \"type\": \"YEARLY\"\n" +
"}");
Request request = new Request.Builder()
.url(url)
.method("PATCH", body)
.addHeader("Authorization", "Basic " + encoding)
.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": "63668164bc92e4015cdd6a7c",
"name": "add new add-on 222",
"companyId": "622294998bec060152bcad9c",
"code": "CUAD-00052",
"price": {
"unit": "$",
"currency": "USD",
"value": 23232
},
"type": "MONTHLY",
"itemId": null,
"interval": "months",
"intervalCount": 1,
"pricingMode": "per_unit",
"taxable": true,
"createdBy": "6222930b8bec060152bcad67",
"updatedBy": "6222930b8bec060152bcad67",
"createdAt": "2022-11-05T15:29:40.621Z",
"updatedAt": "2022-11-05T15:31:39.331Z"
}
}
This API endpoint allows you to update an existing addon in the database. It's as simple as sending a PATCH request to https://api.blixo.com/v1/addon/:addonId
. Think of it as telling the server, "Hey, I want to update this specific addon." And the server responds by updating the addon with the information you provided!
HTTP Request
PATCH https://api.blixo.com/v1/addon/:addonId
Headers
Key | Value |
---|---|
Authorization | Basic {API_KEY} |
Parameters
Parameter | Type | Description |
---|---|---|
addonId | objectId | (required) The ID of the addon. |
companyId | objectId | (required) The ID of the company. |
item[label] | String | (required) The label of the item. |
item[value] | String | (required) The value of the item. |
name | String | (required) The name of the addon. |
itemId | objectId | (optional) Item ID |
price[unit] | String | (required) The unit of the price. |
price[currency] | String | (required) The currency of the price. |
price[value] | Number | (required) The value of the price. |
pricingMode | String | (required) The pricing mode of the addon. E.g. per_unit , tiered , volume , stairstep |
type | String | (required) The type of the addon. E.g. DAILY , WEEKLY , MONTHLY , SEMIANNUALLY , YEARLY , CUSTOM |
interval | String | (optional) The interval of the addon. E.g. days , weeks , months , years |
intervalCount | Number | (optional) The interval count of the addon. |
taxable | Boolean | (optional) Whether the addon is taxable or not. |
createdBy | objectId | (optional) The ID of the user who created the addon. |
updatedBy | objectId | (optional) The ID of the user who last updated the addon. |
Example
To update an addon, you would send a PATCH request to https://api.blixo.com/v1/addon/:addonId
. Remember to replace {API_KEY}
and :addonId
with your actual API key and the ID of the addon you want to update, respectively.
Response
The response will be a JSON object with a data
key containing the updated addon. 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.
Taxes
Tax object
Attribute | Type | Description |
---|---|---|
id | ObjectId | The ID of the tax. |
name | String | The name of the tax. |
amount | Object | The amount of the tax. It includes the following attributes: |
• value : Number - The value of the amount. |
||
• unit : String - The unit of the amount. Default is % . |
||
priceInclude | Boolean | Whether the price includes the tax. Default is true . |
companyId | ObjectId | The ID of the company associated with the tax. |
createdBy | ObjectId | The ID of the user who created the tax. |
updatedBy | ObjectId | The ID of the user who last updated the tax. |
createdAt | Date | The date when the tax was created. |
updatedAt | Date | The date when the tax was last updated. |
List all taxes
curl "https://api.blixo.com/v1/taxes" \
-u {API_KEY}:
const fetch = require('node-fetch');
const url = 'https://api.blixo.com/v1/taxes';
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/taxes",
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/taxes")
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/taxes"
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/taxes"
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/taxes"),
};
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/taxes";
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": "636619f3bc92e4015cdb5989",
"name": "Customer",
"amount": {
"_id": "636619f3bc92e4015cdb598a",
"unit": "%",
"value": 5
},
"priceInclude": true,
"companyId": "622294998bec060152bcad9c",
"createdBy": "6222930b8bec060152bcad67",
"updatedBy": "6222930b8bec060152bcad67",
"createdAt": "2022-11-05T08:08:19.718Z",
"updatedAt": "2022-11-05T08:08:19.718Z"
}
],
"pagination": {
"total": 79
}
}
This API endpoint allows you to retrieve a list of all taxes in the database. It's as simple as sending a GET request to https://api.blixo.com/v1/taxes
. Think of it as asking the server, "Hey, can I get a list of all your taxes?" And the server responds with the information you asked for!
HTTP Request
GET https://api.blixo.com/v1/taxes
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 taxes to retrieve per page. Default is 100 . |
Example
To list all taxes, you would send a GET request to https://api.blixo.com/v1/taxes
. Remember to replace {API_KEY}
with your actual API key.
If you want to retrieve the third page of taxes, with 50 taxes per page, you would send a GET request to https://api.blixo.com/v1/taxes?page=3&perPage=50
.
Response
The response will be a JSON object with a data
key containing an array of taxes. Each tax will be an object with the following keys:
id
: The unique identifier of the tax.name
: The name of the tax.amount
: The amount of the tax.priceInclude
: Whether the price includes the tax.companyId
: The ID of the company.createdBy
: The ID of the user who created the tax.updatedBy
: The ID of the user who last updated the tax.createdAt
: The creation date of the tax.updatedAt
: The last update date of the tax.
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 tax
curl "https://api.blixo.com/v1/taxes" \
-u {API_KEY}: \
-d name="TEAM YEARLY PLAN UPDATE" \
-d amount[unit]="$" \
-d amount[currency]="USD" \
-d amount[value]="699.88" \
-d priceInclude=true \
-X POST
const fetch = require('node-fetch');
const url = 'https://api.blixo.com/v1/taxes';
const options = {
method: 'POST',
headers: {
'Authorization': 'Basic ' + Buffer.from('{API_KEY}:').toString('base64'),
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: "TEAM YEARLY PLAN UPDATE",
amount: {
unit: "$",
currency: "USD",
value: "699.88"
},
priceInclude: true
})
};
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/taxes",
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(
'name' => 'TEAM YEARLY PLAN UPDATE',
'amount[unit]' => '$',
'amount[currency]' => 'USD',
'amount[value]' => '699.88',
'priceInclude' => 'true'
),
CURLOPT_HTTPHEADER => array(
"Authorization: Basic " . base64_encode("{API_KEY}:"),
"Content-Type: application/x-www-form-urlencoded"
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
?>
import requests
import base64
import json
url = "https://api.blixo.com/v1/taxes"
api_key = "{API_KEY}"
headers = {
"Authorization": "Basic " + base64.b64encode((api_key + ":").encode()).decode(),
"Content-Type": "application/json"
}
data = {
"name": "TEAM YEARLY PLAN UPDATE",
"amount": {
"unit": "$",
"currency": "USD",
"value": "699.88"
},
"priceInclude": True
}
response = requests.post(url, headers=headers, data=json.dumps(data))
print(response.text)
require 'uri'
require 'net/http'
require 'base64'
require 'json'
url = URI("https://api.blixo.com/v1/taxes")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic ' + Base64.strict_encode64('{API_KEY}:')
request["Content-Type"] = 'application/json'
request.body = JSON.dump({
"name" => "TEAM YEARLY PLAN UPDATE",
"amount" => {
"unit" => "$",
"currency" => "USD",
"value" => "699.88"
},
"priceInclude" => true
})
response = http.request(request)
puts response.read_body
package main
import (
"fmt"
"net/http"
"io/ioutil"
"encoding/base64"
"strings"
)
func main() {
url := "https://api.blixo.com/v1/taxes"
method := "POST"
payload := strings.NewReader(`{
"name": "TEAM YEARLY PLAN UPDATE",
"amount": {
"unit": "$",
"currency": "USD",
"value": "699.88"
},
"priceInclude": true
}`)
client := &http.Client {}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Authorization", "Basic " + base64.StdEncoding.EncodeToString([]byte("{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))
}
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/taxes"),
Content = new StringContent(
"{\"name\":\"TEAM YEARLY PLAN UPDATE\",\"amount\":{\"unit\":\"$\",\"currency\":\"USD\",\"value\":\"699.88\"},\"priceInclude\":true}",
Encoding.UTF8,
"application/json"
)
};
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.MediaType;
import okhttp3.RequestBody;
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/taxes";
String encoding = Base64.getEncoder().encodeToString(("{API_KEY}:".getBytes()));
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"name\":\"TEAM YEARLY PLAN UPDATE\",\"amount\":{\"unit\":\"$\",\"currency\":\"USD\",\"value\":\"699.88\"},\"priceInclude\":true}");
Request request = new Request.Builder()
.url(url)
.method("POST", body)
.addHeader("Authorization", "Basic " + encoding)
.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": "63668f7dbc92e4015cde1605",
"name": "new tax rate",
"amount": {
"_id": "63668f7dbc92e4015cde1606",
"unit": "%",
"value": 54554
},
"priceInclude": true,
"companyId": "622294998bec060152bcad9c",
"createdBy": "6222930b8bec060152bcad67",
"updatedBy": "6222930b8bec060152bcad67",
"createdAt": "2022-11-05T16:29:49.257Z",
"updatedAt": "2022-11-05T16:29:49.257Z"
}
}
This API endpoint allows you to create a new tax. It's as simple as sending a POST request to https://api.blixo.com/v1/taxes
. Think of it as telling the server, "Hey, I want to create a new tax." And the server responds with the details of the newly created tax!
HTTP Request
POST https://api.blixo.com/v1/taxes
Headers
Key | Value |
---|---|
Authorization | Basic {API_KEY} |
Parameters
Parameter | Type | Description |
---|---|---|
name | string | (required) The name of the tax. |
amount[unit] | string | (required) The unit of the tax amount (e.g., "$" or "%"). |
amount[currency] | string | (required) The currency of the tax amount (e.g., "USD"). |
amount[value] | number | (required) The value of the tax amount. |
priceInclude | boolean | (required) Whether the price includes the tax. |
companyId | string | (required) The ID of the company associated with the tax. |
createdBy | string | (required) The ID of the user who created the tax. |
updatedBy | string | (required) The ID of the user who last updated the tax. |
Example
To create a new tax, you would send a POST request to https://api.blixo.com/v1/taxes
. Remember to replace {API_KEY}
with your actual API key.
Response
The response will be a JSON object with a data
key containing the details of the newly created tax. 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 tax
curl "https://api.blixo.com/v1/taxes/:taxId" \
-u {API_KEY}: \
-d name="TEAM YEARLY PLAN UPDATE" \
-d amount[unit]="$" \
-d amount[currency]="USD" \
-d amount[value]="699.88" \
-d priceInclude=true \
-X PATCH
const fetch = require('node-fetch');
const url = 'https://api.blixo.com/v1/taxes/:taxId';
const options = {
method: 'PATCH',
headers: {
'Authorization': 'Basic ' + Buffer.from('{API_KEY}:').toString('base64'),
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: "TEAM YEARLY PLAN UPDATE",
amount: {
unit: "$",
currency: "USD",
value: "699.88"
},
priceInclude: true
})
};
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/taxes/:taxId",
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode(array(
"name" => "TEAM YEARLY PLAN UPDATE",
"amount" => array(
"unit" => "$",
"currency" => "USD",
"value" => "699.88"
),
"priceInclude" => true
)),
CURLOPT_HTTPHEADER => array(
"Authorization: Basic " . base64_encode("{API_KEY}:"),
"Content-Type: application/json"
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
?>
require 'uri'
require 'net/http'
require 'base64'
require 'json'
url = URI("https://api.blixo.com/v1/taxes/:taxId")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Basic ' + Base64.strict_encode64('{API_KEY}:')
request["Content-Type"] = 'application/json'
request.body = JSON.dump({
"name" => "TEAM YEARLY PLAN UPDATE",
"amount" => {
"unit" => "$",
"currency" => "USD",
"value" => "699.88"
},
"priceInclude" => true
})
response = http.request(request)
puts response.read_body
import requests
import base64
import json
url = "https://api.blixo.com/v1/taxes/:taxId"
api_key = "{API_KEY}"
headers = {
"Authorization": "Basic " + base64.b64encode((api_key + ":").encode()).decode(),
"Content-Type": "application/json"
}
data = {
"name": "TEAM YEARLY PLAN UPDATE",
"amount": {
"unit": "$",
"currency": "USD",
"value": "699.88"
},
"priceInclude": true
}
response = requests.patch(url, headers=headers, data=json.dumps(data))
print(response.text)
package main
import (
"fmt"
"net/http"
"io/ioutil"
"encoding/base64"
"bytes"
"encoding/json"
)
func main() {
url := "https://api.blixo.com/v1/taxes/:taxId"
data := map[string]interface{}{
"name": "TEAM YEARLY PLAN UPDATE",
"amount": map[string]string{
"unit": "$",
"currency": "USD",
"value": "699.88",
},
"priceInclude": true,
}
jsonData, _ := json.Marshal(data)
req, _ := http.NewRequest("PATCH", url, bytes.NewBuffer(jsonData))
req.Header.Add("Authorization", "Basic " + base64.StdEncoding.EncodeToString([]byte("{API_KEY}:")))
req.Header.Add("Content-Type", "application/json")
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;
using Newtonsoft.Json;
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.Patch,
RequestUri = new Uri("https://api.blixo.com/v1/taxes/:taxId"),
Content = new StringContent(JsonConvert.SerializeObject(new
{
name = "TEAM YEARLY PLAN UPDATE",
amount = new
{
unit = "$",
currency = "USD",
value = "699.88"
},
priceInclude = true
}), Encoding.UTF8, "application/json")
};
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.RequestBody;
import okhttp3.MediaType;
import okhttp3.Response;
import java.util.Base64;
import org.json.JSONObject;
public class Main {
public static void main(String[] args) {
OkHttpClient client = new OkHttpClient();
String url = "https://api.blixo.com/v1/taxes/:taxId";
String encoding = Base64.getEncoder().encodeToString(("{API_KEY}:".getBytes()));
JSONObject json = new JSONObject();
JSONObject amount = new JSONObject();
amount.put("unit", "$");
amount.put("currency", "USD");
amount.put("value", "699.88");
json.put("name", "TEAM YEARLY PLAN UPDATE");
json.put("amount", amount);
json.put("priceInclude", true);
RequestBody body = RequestBody.create(
MediaType.parse("application/json; charset=utf-8"),
json.toString()
);
Request request = new Request.Builder()
.url(url)
.patch(body)
.addHeader("Authorization", "Basic " + encoding)
.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": "63668f7dbc92e4015cde1605",
"name": "new tax rate",
"amount": {
"_id": "63668f7dbc92e4015cde1606",
"unit": "%",
"value": 8766
},
"priceInclude": true,
"companyId": "622294998bec060152bcad9c",
"createdBy": "6222930b8bec060152bcad67",
"updatedBy": "6222930b8bec060152bcad67",
"createdAt": "2022-11-05T16:29:49.257Z",
"updatedAt": "2022-11-05T16:37:04.402Z"
}
}
This API endpoint allows you to update an existing tax. It's as simple as sending a PATCH request to https://api.blixo.com/v1/taxes/:taxId
. Remember to replace {API_KEY}
with your actual API key and :taxId
with the ID of the tax you want to update. Think of it as telling the server, "Hey, I want to update this tax." And the server responds with the details of the updated tax!
HTTP Request
PATCH https://api.blixo.com/v1/taxes/:taxId
Headers
Key | Value |
---|---|
Authorization | Basic {API_KEY} |
Parameters
Parameter | Type | Description |
---|---|---|
name | string | (required) The name of the tax. |
amount[unit] | string | (required) The unit of the tax amount (e.g., "$" or "%"). |
amount[currency] | string | (required) The currency of the tax amount (e.g., "USD"). |
amount[value] | number | (required) The value of the tax amount. |
priceInclude | boolean | (required) Whether the price includes the tax. |
companyId | string | (optional) The ID of the company associated with the tax. |
createdBy | string | (optional) The ID of the user who created the tax. |
updatedBy | string | (optional) The ID of the user who last updated the tax. |
createdAt | string | (optional) The creation date of the tax. |
updatedAt | string | (optional) The last update date of the tax. |
Example
To update a tax, you would send a PATCH request to https://api.blixo.com/v1/taxes/:taxId
. Remember to replace {API_KEY}
with your actual API key and :taxId
with the ID of the tax you want to update.
Response
The response will be a JSON object with a data
key containing the details of the updated tax. 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 tax
curl "https://api.blixo.com/v1/taxes/:taxId" \
-u {API_KEY}: \
-X DELETE
const fetch = require('node-fetch');
const url = 'https://api.blixo.com/v1/taxes/:taxId';
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/taxes/:taxId",
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'
require 'base64'
url = URI("https://api.blixo.com/v1/taxes/:taxId")
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
import base64
url = "https://api.blixo.com/v1/taxes/:taxId"
api_key = "{API_KEY}"
headers = {
"Authorization": "Basic " + base64.b64encode((api_key + ":").encode()).decode()
}
response = requests.delete(url, headers=headers)
print(response.text)
package main
import (
"fmt"
"net/http"
"io/ioutil"
"encoding/base64"
)
func main() {
url := "https://api.blixo.com/v1/taxes/:taxId"
req, _ := http.NewRequest("DELETE", 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.Delete,
RequestUri = new Uri("https://api.blixo.com/v1/taxes/:taxId"),
};
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/taxes/:taxId";
String encoding = Base64.getEncoder().encodeToString(("{API_KEY}:".getBytes()));
Request request = new Request.Builder()
.url(url)
.delete()
.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": "611d4216a747250146ade2cf"
}
This API endpoint allows you to remove an existing tax from the database. It's as simple as sending a DELETE request to https://api.blixo.com/v1/taxes/:taxId
. Remember to replace {API_KEY}
with your actual API key and :taxId
with the ID of the tax you want to delete. Think of it as telling the server, "Hey, I want to delete this tax." And the server responds with the confirmation of the deletion!
HTTP Request
DELETE https://api.blixo.com/v1/taxes/:taxId
Headers
Key | Value |
---|---|
Authorization | Basic {API_KEY} |
Example
To delete a tax, you would send a DELETE request to https://api.blixo.com/v1/taxes/:taxId
. Remember to replace {API_KEY}
with your actual API key and :taxId
with the ID of the tax you want to delete.
Response
The response will be a JSON object with a data
key containing the ID of the deleted tax. 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.
Coupons
Coupon object
Attribute | Type | Description |
---|---|---|
id | ObjectId | The ID of the coupon. |
name | String | The name of the coupon. |
amount | Object | The amount of the coupon. It includes the following attributes: |
• value : Number - The value of the amount. |
||
• unit : String - The unit of the amount. |
||
codeType | String | The type of the code, either 'single' or 'bulk'. |
numberOfCodes | Number | The number of codes. |
codePrefix | String | The prefix of the code. |
codeSuffix | String | The suffix of the code. |
codeLength | Number | The length of the code. |
codeValue | String | The value of the code. |
codeUniqValue | String | The unique value of the code. |
duration | Object | The duration of the coupon, includes type . |
maxRedemptions | Number | The maximum number of redemptions. |
onceRedemptionPerCustomer | Boolean | Whether the coupon can be redeemed once per customer. |
invoiceDescription | String | The invoice description of the coupon. |
companyId | ObjectId | The ID of the company of the coupon. |
createdBy | ObjectId | The ID of the user who created the coupon. |
updatedBy | ObjectId | The ID of the user who last updated the coupon. |
createdAt | Date | The date when the coupon was created. |
updatedAt | Date | The date when the coupon was last updated. |
shopifyId | String | The Shopify ID of the coupon. |
startsAt | Date | The start date of the coupon. |
endsAt | Date | The end date of the coupon. |
List all coupons
curl "https://api.blixo.com/v1/coupons" \
-u {API_KEY}:
const fetch = require('node-fetch');
const url = 'https://api.blixo.com/v1/coupons';
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/coupons",
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/coupons")
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/coupons"
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/coupons"
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/coupons"),
};
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/coupons";
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": "636726e6bc92e4015ce15e83",
"name": "new coupon",
"amount": {
"_id": "636726e6bc92e4015ce15e84",
"unit": "%",
"value": 23232
},
"companyId": "622294998bec060152bcad9c",
"createdBy": "6222930b8bec060152bcad67",
"updatedBy": "6222930b8bec060152bcad67",
"createdAt": "2022-11-06T03:15:50.114Z",
"updatedAt": "2022-11-06T03:15:50.114Z"
}
],
"pagination": {
"total": 5
}
}
This API endpoint allows you to retrieve a list of all coupons in the database. It's as simple as sending a GET request to https://api.blixo.com/v1/coupons
. Think of it as asking the server, "Hey, can I get a list of all your coupons?" And the server responds with the information you asked for!
HTTP Request
GET https://api.blixo.com/v1/coupons
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 coupons to retrieve per page. Default is 100 . |
Example
To list all coupons, you would send a GET request to https://api.blixo.com/v1/coupons
. Remember to replace {API_KEY}
with your actual API key.
If you want to retrieve the third page of coupons, with 50 coupons per page, you would send a GET request to https://api.blixo.com/v1/coupons?page=3&perPage=50
.
Response
The response will be a JSON object with a data
key containing an array of coupons. Each coupon will be an object with the following keys:
id
: The unique identifier of the coupon.name
: The name of the coupon.amount
: The amount of the coupon.companyId
: The ID of the company.createdBy
: The ID of the user who created the coupon.updatedBy
: The ID of the user who last updated the coupon.createdAt
: The creation date of the coupon.updatedAt
: The last update date of the coupon.
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 coupon
curl "https://api.blixo.com/v1/coupons" \
-u {API_KEY}: \
-d name="TEAM YEARLY PLAN UPDATE" \
-d amount[unit]="$" \
-d amount[currency]="USD" \
-d amount[value]="699.88" \
-X POST
const fetch = require('node-fetch');
const url = 'https://api.blixo.com/v1/coupons';
const options = {
method: 'POST',
headers: {
'Authorization': 'Basic ' + Buffer.from('{API_KEY}:').toString('base64'),
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: "TEAM YEARLY PLAN UPDATE",
amount: {
unit: "$",
currency: "USD",
value: "699.88"
}
})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error('error:' + err));
import requests
import base64
import json
url = "https://api.blixo.com/v1/coupons"
api_key = "{API_KEY}"
headers = {
"Authorization": "Basic " + base64.b64encode((api_key + ":").encode()).decode(),
"Content-Type": "application/json"
}
data = {
"name": "TEAM YEARLY PLAN UPDATE",
"amount": {
"unit": "$",
"currency": "USD",
"value": "699.88"
}
}
response = requests.post(url, headers=headers, data=json.dumps(data))
print(response.text)
require 'uri'
require 'net/http'
require 'base64'
require 'json'
url = URI("https://api.blixo.com/v1/coupons")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic ' + Base64.strict_encode64('{API_KEY}:')
request["Content-Type"] = 'application/json'
request.body = {
name: "TEAM YEARLY PLAN UPDATE",
amount: {
unit: "$",
currency: "USD",
value: "699.88"
}
}.to_json
response = http.request(request)
puts response.read_body
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.blixo.com/v1/coupons",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => array(
"Authorization: Basic " . base64_encode("{API_KEY}:"),
"Content-Type: application/json"
),
CURLOPT_POSTFIELDS => json_encode(array(
"name" => "TEAM YEARLY PLAN UPDATE",
"amount" => array(
"unit" => "$",
"currency" => "USD",
"value" => "699.88"
)
))
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
?>
package main
import (
"fmt"
"net/http"
"bytes"
"encoding/base64"
"encoding/json"
)
func main() {
url := "https://api.blixo.com/v1/coupons"
var jsonData = []byte(`{
"name": "TEAM YEARLY PLAN UPDATE",
"amount": {
"unit": "$",
"currency": "USD",
"value": "699.88"
}
}`)
req, _ := http.NewRequest("POST", url, bytes.NewBuffer(jsonData))
req.Header.Add("Authorization", "Basic " + base64.StdEncoding.EncodeToString([]byte("{API_KEY}:")))
req.Header.Add("Content-Type", "application/json")
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/coupons"),
Content = new StringContent(
"{\"name\":\"TEAM YEARLY PLAN UPDATE\",\"amount\":{\"unit\":\"$\",\"currency\":\"USD\",\"value\":\"699.88\"}}",
Encoding.UTF8,
"application/json"
)
};
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.MediaType;
import okhttp3.RequestBody;
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/coupons";
String encoding = Base64.getEncoder().encodeToString(("{API_KEY}:".getBytes()));
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"name\":\"TEAM YEARLY PLAN UPDATE\",\"amount\":{\"unit\":\"$\",\"currency\":\"USD\",\"value\":\"699.88\"}}");
Request request = new Request.Builder()
.url(url)
.post(body)
.addHeader("Authorization", "Basic " + encoding)
.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": "636726e6bc92e4015ce15e83",
"name": "new coupon",
"amount": {
"_id": "636726e6bc92e4015ce15e84",
"unit": "%",
"value": 23232
},
"companyId": "622294998bec060152bcad9c",
"createdBy": "6222930b8bec060152bcad67",
"updatedBy": "6222930b8bec060152bcad67",
"createdAt": "2022-11-06T03:15:50.114Z",
"updatedAt": "2022-11-06T03:15:50.114Z"
}
}
This API endpoint allows you to create a new coupon in the database. It's as simple as sending a POST request to https://api.blixo.com/v1/coupons
. Think of it as telling the server, "Hey, I have a new coupon to add." And the server responds by creating the coupon with the information you provided!
HTTP Request
POST https://api.blixo.com/v1/coupons
Headers
Key | Value |
---|---|
Authorization | Basic {API_KEY} |
Parameters
Parameter | Type | Description |
---|---|---|
name | string | (required) Name of the coupon |
amount[unit] | string | (required) The unit of the amount. E.g. $ , % |
amount[currency] | string | (required) The currency of the amount. E.g. USD , EUR |
amount[value] | Number | (required) The value of the amount. |
Example
To create a new coupon, you would send a POST request to https://api.blixo.com/v1/coupons
. Remember to replace {API_KEY}
with your actual API key.
Response
The response will be a JSON object with a data
key containing the created coupon. 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.
Update a coupon
curl "https://api.blixo.com/v1/coupons/:couponId" \
-u {API_KEY}: \
-d name="TEAM YEARLY PLAN UPDATE" \
-d amount[unit]="$" \
-d amount[currency]="USD" \
-d amount[value]="699.88" \
-X PATCH
const fetch = require('node-fetch');
const url = 'https://api.blixo.com/v1/coupons/:couponId';
const options = {
method: 'PATCH',
headers: {
'Authorization': 'Basic ' + Buffer.from('{API_KEY}:').toString('base64')
},
body: JSON.stringify({
name: "TEAM YEARLY PLAN UPDATE",
amount: {
unit: "$",
currency: "USD",
value: "699.88"
}
})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error('error:' + err));
import requests
import base64
import json
url = "https://api.blixo.com/v1/coupons/:couponId"
api_key = "{API_KEY}"
headers = {
"Authorization": "Basic " + base64.b64encode((api_key + ":").encode()).decode()
}
data = {
"name": "TEAM YEARLY PLAN UPDATE",
"amount": {
"unit": "$",
"currency": "USD",
"value": "699.88"
}
}
response = requests.patch(url, headers=headers, data=json.dumps(data))
print(response.text)
require 'uri'
require 'net/http'
require 'base64'
require 'json'
url = URI("https://api.blixo.com/v1/coupons/:couponId")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Basic ' + Base64.strict_encode64('{API_KEY}:')
request.body = {
name: "TEAM YEARLY PLAN UPDATE",
amount: {
unit: "$",
currency: "USD",
value: "699.88"
}
}.to_json
response = http.request(request)
puts response.read_body
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.blixo.com/v1/coupons/:couponId",
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => array(
"Authorization: Basic " . base64_encode("{API_KEY}:")
),
CURLOPT_POSTFIELDS => json_encode(array(
"name" => "TEAM YEARLY PLAN UPDATE",
"amount" => array(
"unit" => "$",
"currency" => "USD",
"value" => "699.88"
)
))
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
?>
package main
import (
"fmt"
"net/http"
"io/ioutil"
"encoding/base64"
"strings"
)
func main() {
url := "https://api.blixo.com/v1/coupons/:couponId"
payload := strings.NewReader(`{
"name": "TEAM YEARLY PLAN UPDATE",
"amount": {
"unit": "$",
"currency": "USD",
"value": "699.88"
}
}`)
req, _ := http.NewRequest("PATCH", url, payload)
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 = new HttpMethod("PATCH"),
RequestUri = new Uri("https://api.blixo.com/v1/coupons/:couponId"),
Content = new StringContent(
"{\"name\":\"TEAM YEARLY PLAN UPDATE\",\"amount\":{\"unit\":\"$\",\"currency\":\"USD\",\"value\":\"699.88\"}}",
Encoding.UTF8,
"application/json"
)
};
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.RequestBody;
import okhttp3.MediaType;
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/coupons/:couponId";
String encoding = Base64.getEncoder().encodeToString(("{API_KEY}:".getBytes()));
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"name\":\"TEAM YEARLY PLAN UPDATE\",\"amount\":{\"unit\":\"$\",\"currency\":\"USD\",\"value\":\"699.88\"}}");
Request request = new Request.Builder()
.url(url)
.patch(body)
.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": "636726e6bc92e4015ce15e83",
"name": "new coupon 222",
"amount": {
"_id": "636726e6bc92e4015ce15e84",
"unit": "%",
"value": 23232
},
"companyId": "622294998bec060152bcad9c",
"createdBy": "6222930b8bec060152bcad67",
"updatedBy": "6222930b8bec060152bcad67",
"createdAt": "2022-11-06T03:15:50.114Z",
"updatedAt": "2022-11-06T03:21:46.671Z"
}
}
This API endpoint allows you to modify an existing coupon in the database. It's as simple as sending a PATCH request to https://api.blixo.com/v1/coupons/:couponId
. Think of it as telling the server, "Hey, I have some changes to make to this coupon." And the server responds by updating the coupon with the information you provided!
HTTP Request
PATCH https://api.blixo.com/v1/coupons/:couponId
Headers
Key | Value |
---|---|
Authorization | Basic {API_KEY} |
Parameters
Parameter | Type | Description |
---|---|---|
name | string | (required) New name of the coupon |
amount[unit] | string | (required) The new unit of the amount. E.g. $ , % |
amount[currency] | string | (required) The new currency of the amount. E.g. USD , EUR |
amount[value] | Number | (required) The new value of the amount. |
Example
To update a coupon, you would send a PATCH request to https://api.blixo.com/v1/coupons/:couponId
. Remember to replace {API_KEY}
and :couponId
with your actual API key and the ID of the coupon you want to update, respectively.
Response
The response will be a JSON object with a data
key containing the updated coupon. 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 coupon
curl "https://api.blixo.com/v1/coupons/:couponId" \
-u {API_KEY}: \
-X DELETE
const fetch = require('node-fetch');
const url = 'https://api.blixo.com/v1/coupons/:couponId';
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/coupons/:couponId",
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'
require 'base64'
url = URI("https://api.blixo.com/v1/coupons/:couponId")
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
import base64
url = "https://api.blixo.com/v1/coupons/:couponId"
api_key = "{API_KEY}"
headers = {
"Authorization": "Basic " + base64.b64encode((api_key + ":").encode()).decode()
}
response = requests.delete(url, headers=headers)
print(response.text)
package main
import (
"fmt"
"net/http"
"io/ioutil"
"encoding/base64"
)
func main() {
url := "https://api.blixo.com/v1/coupons/:couponId"
req, _ := http.NewRequest("DELETE", 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.Delete,
RequestUri = new Uri("https://api.blixo.com/v1/coupons/:couponId"),
};
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/coupons/:couponId";
String encoding = Base64.getEncoder().encodeToString(("{API_KEY}:".getBytes()));
Request request = new Request.Builder()
.url(url)
.delete()
.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": "611d4216a747250146ade2cf"
}
This API endpoint allows you to remove a coupon from the database. It's as simple as sending a DELETE request to https://api.blixo.com/v1/coupons/:couponId
. Think of it as telling the server, "Hey, I don't need this coupon anymore." And the server responds by removing the coupon from the database!
HTTP Request
DELETE https://api.blixo.com/v1/coupons/:couponId
Headers
Key | Value |
---|---|
Authorization | Basic {API_KEY} |
Parameters
Parameter | Type | Description |
---|---|---|
:couponId | string | (required) The ID of the coupon you want to delete. |
Example
To delete a coupon, you would send a DELETE request to https://api.blixo.com/v1/coupons/:couponId
. Remember to replace {API_KEY}
and :couponId
with your actual API key and the ID of the coupon you want to delete, respectively.
Response
The response will be a JSON object with a data
key containing the ID of the deleted coupon. 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.
Members
Member object
Attribute | Type | Description |
---|---|---|
id | ObjectId | The ID of the member. |
roleId | ObjectId | The ID of the role. |
userId | ObjectId | The ID of the user. |
companyId | ObjectId | The ID of the company. |
enabled | Boolean | Whether the member is enabled. |
isOwner | Boolean | Whether the member is an owner. |
List all members
curl "https://api.blixo.com/v1/members" \
-u {API_KEY}:
const fetch = require('node-fetch');
const url = 'https://api.blixo.com/v1/members';
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/members",
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/members")
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/members"
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/members"
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/members"),
};
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/members";
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": [
{
"name": "Spencer Steffen",
"email": "spencer@oatsovernight.com",
"id": "622294a28bec060152bcae82",
"roleId": "622294a08bec060152bcadeb",
"userId": "6222930b8bec060152bcad67",
"companyId": "622294998bec060152bcad9c",
"enabled": true,
"isOwner": true
}
],
"pagination": {
"total": 7
}
}
This API endpoint allows you to retrieve a list of all members in the database. It's as simple as sending a GET request to https://api.blixo.com/v1/members
. Think of it as asking the server, "Hey, can I get a list of all your members?" And the server responds with the information you asked for!
HTTP Request
GET https://api.blixo.com/v1/members
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 members to retrieve per page. Default is 100 . |
Example
To list all members, you would send a GET request to https://api.blixo.com/v1/members
. Remember to replace {API_KEY}
with your actual API key.
Response
The response will be a JSON object with a data
key containing an array of all the members. Each member is represented as an object with keys like name
, email
, id
, roleId
, userId
, companyId
, enabled
, and isOwner
. 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.
Invite a member
curl "https://api.blixo.com/v1/members" \
-u {API_KEY}: \
-d companyId="622294998bec060152bcad9c" \
-d email="customer@blixo.com" \
-d roleId="622294a08bec060152bcadee" \
-X POST
const fetch = require('node-fetch');
const url = 'https://api.blixo.com/v1/members';
const options = {
method: 'POST',
headers: {
'Authorization': 'Basic ' + Buffer.from('{API_KEY}:').toString('base64')
},
body: JSON.stringify({
companyId: "622294998bec060152bcad9c",
email: "customer@blixo.com",
roleId: "622294a08bec060152bcadee"
})
};
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/members",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => array(
'companyId' => '622294998bec060152bcad9c',
'email' => 'customer@blixo.com',
'roleId' => '622294a08bec060152bcadee'
),
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'
require 'json'
url = URI("https://api.blixo.com/v1/members")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request.body = JSON.generate({
companyId: "622294998bec060152bcad9c",
email: "customer@blixo.com",
roleId: "622294a08bec060152bcadee"
})
request["Authorization"] = 'Basic ' + Base64.strict_encode64('{API_KEY}:')
response = http.request(request)
puts response.read_body
import requests
import base64
import json
url = "https://api.blixo.com/v1/members"
api_key = "{API_KEY}"
headers = {
"Authorization": "Basic " + base64.b64encode((api_key + ":").encode()).decode()
}
data = {
"companyId": "622294998bec060152bcad9c",
"email": "customer@blixo.com",
"roleId": "622294a08bec060152bcadee"
}
response = requests.post(url, headers=headers, data=json.dumps(data))
print(response.text)
package main
import (
"fmt"
"net/http"
"io/ioutil"
"encoding/base64"
"strings"
)
func main() {
url := "https://api.blixo.com/v1/members"
payload := strings.NewReader(`{"companyId":"622294998bec060152bcad9c","email":"customer@blixo.com","roleId":"622294a08bec060152bcadee"}`)
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic " + base64.StdEncoding.EncodeToString([]byte("{API_KEY}:")))
req.Header.Add("Content-Type", "application/json")
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/members"),
Content = new StringContent("{\"companyId\":\"622294998bec060152bcad9c\",\"email\":\"customer@blixo.com\",\"roleId\":\"622294a08bec060152bcadee\"}", Encoding.UTF8, "application/json")
};
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.MediaType;
import okhttp3.RequestBody;
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/members";
String encoding = Base64.getEncoder().encodeToString(("{API_KEY}:".getBytes()));
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"companyId\":\"622294998bec060152bcad9c\",\"email\":\"customer@blixo.com\",\"roleId\":\"622294a08bec060152bcadee\"}");
Request request = new Request.Builder()
.url(url)
.post(body)
.addHeader("Authorization", "Basic " + encoding)
.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": "63672f60bc92e4015ce18004",
"name": "",
"isGetStarted": false,
"email": "customer@blixo.com",
"enabled": false,
"onboarded": false,
"isIndividual": false,
"publicUser": false,
"paymentSources": [],
"paymentSourceRefs": [],
"isTest": false
}
}
Inviting a member to your team is a breeze with our API. All you need to do is send a POST request to https://api.blixo.com/v1/members
. It's like saying to the server, "Hey, I want this person to join my team!" And the server will take care of the rest.
HTTP Request
POST https://api.blixo.com/v1/members
Headers
Key | Value |
---|---|
Authorization | Basic {API_KEY} |
Parameters
Parameter | Type | Description |
---|---|---|
companyId | string | The ID of your company |
string | (required) The email of the person you want to invite | |
roleId | objectId | (required) The role you want to assign to the person |
Example
To invite a new member, you would send a POST request to https://api.blixo.com/v1/members
. Remember to replace {API_KEY}
with your actual API key.
Response
The response will be a JSON object with a data
key containing the details of the invited member. 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.
Update a member
curl "https://api.blixo.com/v1/members/:memberId" \
-u {API_KEY}: \
-d companyId="622294998bec060152bcad9c" \
-d roleId="622294a08bec060152bcadee" \
-X PATCH
const fetch = require('node-fetch');
const url = 'https://api.blixo.com/v1/members/:memberId';
const options = {
method: 'PATCH',
headers: {
'Authorization': 'Basic ' + Buffer.from('{API_KEY}:').toString('base64')
},
body: JSON.stringify({
companyId: "622294998bec060152bcad9c",
roleId: "622294a08bec060152bcadee"
})
};
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/members/:memberId",
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => array(
'companyId' => '622294998bec060152bcad9c',
'roleId' => '622294a08bec060152bcadee'
),
CURLOPT_HTTPHEADER => array(
"Authorization: Basic " . base64_encode("{API_KEY}:")
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
?>
import requests
import base64
url = "https://api.blixo.com/v1/members/:memberId"
api_key = "{API_KEY}"
headers = {
"Authorization": "Basic " + base64.b64encode((api_key + ":").encode()).decode()
}
data = {
"companyId": "622294998bec060152bcad9c",
"roleId": "622294a08bec060152bcadee"
}
response = requests.patch(url, headers=headers, data=data)
print(response.text)
require 'uri'
require 'net/http'
require 'base64'
url = URI("https://api.blixo.com/v1/members/:memberId")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Basic ' + Base64.strict_encode64('{API_KEY}:')
request.set_form_data({
"companyId" => "622294998bec060152bcad9c",
"roleId" => "622294a08bec060152bcadee"
})
response = http.request(request)
puts response.read_body
package main
import (
"fmt"
"net/http"
"io/ioutil"
"strings"
"encoding/base64"
)
func main() {
url := "https://api.blixo.com/v1/members/:memberId"
payload := strings.NewReader("companyId=622294998bec060152bcad9c&roleId=622294a08bec060152bcadee")
req, _ := http.NewRequest("PATCH", url, payload)
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.Patch,
RequestUri = new Uri("https://api.blixo.com/v1/members/:memberId"),
Content = new StringContent("companyId=622294998bec060152bcad9c&roleId=622294a08bec060152bcadee", Encoding.UTF8, "application/x-www-form-urlencoded")
};
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.RequestBody;
import okhttp3.MediaType;
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/members/:memberId";
String encoding = Base64.getEncoder().encodeToString(("{API_KEY}:".getBytes()));
MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
RequestBody body = RequestBody.create(mediaType, "companyId=622294998bec060152bcad9c&roleId=622294a08bec060152bcadee");
Request request = new Request.Builder()
.url(url)
.patch(body)
.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": "6358f59417320f015d7a2c5f",
"name": "Customer",
"isGetStarted": false,
"email": "Customer@blixo.com",
"firstName": "Customer",
"lastName": "Customer",
"enabled": true,
"onboarded": true,
"isIndividual": false,
"publicUser": false,
"paymentSources": [],
"paymentSourceRefs": [],
"defaultCompanyId": "63590b9417320f015d7ad1be",
"isTest": false
}
}
This API endpoint allows you to update an existing member's details. It's as simple as sending a PATCH request to https://api.blixo.com/v1/members/:memberId
. Remember to replace {API_KEY}
with your actual API key and :memberId
with the ID of the member you want to update. Think of it as telling the server, "Hey, I want to update this member's details." And the server responds with the updated details of the member!
HTTP Request
PATCH https://api.blixo.com/v1/members/:memberId
Headers
Key | Value |
---|---|
Authorization | Basic {API_KEY} |
Parameters
Parameter | Type | Description |
---|---|---|
name | string | The updated name of the member |
string | The updated email of the member | |
roleId | objectId | The updated role ID of the member |
Example
To update a member, you would send a PATCH request to https://api.blixo.com/v1/members/:memberId
. Remember to replace {API_KEY}
with your actual API key and :memberId
with the ID of the member you want to update.
Response
The response will be a JSON object with a data
key containing the updated details of the member. 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 member
curl "https://api.blixo.com/v1/members/:memberId" \
-u {API_KEY}: \
-X DELETE
const fetch = require('node-fetch');
const url = 'https://api.blixo.com/v1/members/:memberId';
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/members/:memberId",
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'
require 'base64'
url = URI("https://api.blixo.com/v1/members/:memberId")
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
import base64
url = "https://api.blixo.com/v1/members/:memberId"
api_key = "{API_KEY}"
headers = {
"Authorization": "Basic " + base64.b64encode((api_key + ":").encode()).decode()
}
response = requests.delete(url, headers=headers)
print(response.text)
package main
import (
"fmt"
"net/http"
"io/ioutil"
"encoding/base64"
)
func main() {
url := "https://api.blixo.com/v1/members/:memberId"
req, _ := http.NewRequest("DELETE", 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.Delete,
RequestUri = new Uri("https://api.blixo.com/v1/members/:memberId"),
};
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/members/:memberId";
String encoding = Base64.getEncoder().encodeToString(("{API_KEY}:".getBytes()));
Request request = new Request.Builder()
.url(url)
.delete()
.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": "611d4216a747250146ade2cf"
}
This API endpoint allows you to remove a member from the database. It's as simple as sending a DELETE request to https://api.blixo.com/v1/members/:memberId
. Think of it as telling the server, "Hey, I want to remove this member." And the server responds by deleting the member!
HTTP Request
DELETE https://api.blixo.com/v1/members/:memberId
Headers
Key | Value |
---|---|
Authorization | Basic {API_KEY} |
Parameters
Parameter | Type | Description |
---|---|---|
:memberId | string | The ID of the member you want to delete |
Example
To delete a member, you would send a DELETE request to https://api.blixo.com/v1/members/:memberId
. Remember to replace {API_KEY}
with your actual API key and :memberId
with the ID of the member you want to delete.
Response
The response will be a JSON object with a data
key containing the ID of the deleted member. 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.
Roles
Role object
Attribute | Type | Description |
---|---|---|
id | ObjectId | The ID of the role. |
name | String | The name of the role. |
description | String | The description of the role. |
type | String | The type of the role, either system or custom . |
permissionIds | Array | The IDs of the permissions associated with the role. |
createdBy | ObjectId | The ID of the user who created the role. |
updatedBy | ObjectId | The ID of the user who last updated the role. |
createdAt | Date | The date when the role was created. |
updatedAt | Date | The date when the role was last updated. |
companyId | ObjectId | The ID of the company that the role belongs to. |
List all roles
curl "https://api.blixo.com/v1/roles" \
-u {API_KEY}:
const fetch = require('node-fetch');
const url = 'https://api.blixo.com/v1/roles';
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/roles",
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/roles")
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/roles"
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/roles"
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/roles"),
};
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/roles";
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": "6359092e17320f015d7accc6",
"name": "Test",
"type": "CUSTOM",
"permissionIds": [],
"createdBy": "6222930b8bec060152bcad67",
"updatedBy": "6222930b8bec060152bcad67",
"createdAt": "2022-10-26T10:17:18.881Z",
"updatedAt": "2022-10-26T10:25:24.676Z",
"companyId": "622294998bec060152bcad9c"
}
],
"pagination": {
"total": 5
}
}
This API endpoint allows you to retrieve a list of all roles in the database. It's as simple as sending a GET request to https://api.blixo.com/v1/roles
. Think of it as asking the server, "Hey, can I get a list of all your roles?" And the server responds with the information you asked for!
HTTP Request
GET https://api.blixo.com/v1/roles
Headers
Key | Value |
---|---|
Authorization | Basic {API_KEY} |
Parameters
Parameter | Type | Description |
---|---|---|
companyId | objectId | The ID of the company. This is a required parameter. |
page | Integer | The page number to retrieve. Default is 1 . |
perPage | Integer | The number of roles to retrieve per page. Default is 100 . |
Example
To list all roles, you would send a GET request to https://api.blixo.com/v1/roles
. Remember to replace {API_KEY}
with your actual API key.
If you want to retrieve the third page of roles, with 50 roles per page, you would send a GET request to https://api.blixo.com/v1/roles?page=3&perPage=50
.
Response
The response will be a JSON object with a data
key containing an array of roles. Each role will be an object with the following keys:
id
: The unique identifier of the role.name
: The name of the role.type
: The type of the role.permissionIds
: The permission IDs of the role.createdBy
: The ID of the user who created the role.updatedBy
: The ID of the user who last updated the role.createdAt
: The creation date of the role.updatedAt
: The last update date of the role.companyId
: The ID of the company.
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 role
curl "https://api.blixo.com/v1/roles" \
-u {API_KEY}: \
-d name="role name" \
-d permissionIds[0]="603c8a32027d216fa09dd8d9" \
-d permissionIds[1]="603c8a32027d216fa09dd8d9" \
-d permissionIds[2]="603c8a32027d216fa09dd8d9" \
-d type="CUSTOM" \
-X POST
const fetch = require('node-fetch');
const url = 'https://api.blixo.com/v1/roles';
const options = {
method: 'POST',
headers: {
'Authorization': 'Basic ' + Buffer.from('{API_KEY}:').toString('base64'),
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: "role name",
permissionIds: ["603c8a32027d216fa09dd8d9", "603c8a32027d216fa09dd8d9", "603c8a32027d216fa09dd8d9"],
type: "CUSTOM"
})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error('error:' + err));
import requests
import json
url = "https://api.blixo.com/v1/roles"
payload = {
"name": "role name",
"permissionIds": ["603c8a32027d216fa09dd8d9", "603c8a32027d216fa09dd8d9", "603c8a32027d216fa09dd8d9"],
"type": "CUSTOM"
}
headers = {
"Authorization": "Basic " + base64.b64encode(("{API_KEY}:" + ":").encode()).decode(),
"Content-Type": "application/json"
}
response = requests.request("POST", url, headers=headers, data=json.dumps(payload))
print(response.text)
require 'uri'
require 'net/http'
require 'json'
require 'base64'
url = URI("https://api.blixo.com/v1/roles")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic ' + Base64.strict_encode64('{API_KEY}:')
request["Content-Type"] = 'application/json'
request.body = JSON.dump({
"name" => "role name",
"permissionIds" => ["603c8a32027d216fa09dd8d9", "603c8a32027d216fa09dd8d9", "603c8a32027d216fa09dd8d9"],
"type" => "CUSTOM"
})
response = http.request(request)
puts response.read_body
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.blixo.com/v1/roles",
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(
'name' => 'role name',
'permissionIds[0]' => '603c8a32027d216fa09dd8d9',
'permissionIds[1]' => '603c8a32027d216fa09dd8d9',
'permissionIds[2]' => '603c8a32027d216fa09dd8d9',
'type' => 'CUSTOM'
),
CURLOPT_HTTPHEADER => array(
"Authorization: Basic " . base64_encode("{API_KEY}:"),
"Content-Type: application/json"
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
?>
package main
import (
"fmt"
"net/http"
"io/ioutil"
"encoding/base64"
"strings"
)
func main() {
url := "https://api.blixo.com/v1/roles"
method := "POST"
payload := strings.NewReader(`{
"name": "role name",
"permissionIds": ["603c8a32027d216fa09dd8d9", "603c8a32027d216fa09dd8d9", "603c8a32027d216fa09dd8d9"],
"type": "CUSTOM"
}`)
client := &http.Client {}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Authorization", "Basic " + base64.StdEncoding.EncodeToString([]byte("{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))
}
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/roles"),
Content = new StringContent("{\"name\":\"role name\",\"permissionIds\":[\"603c8a32027d216fa09dd8d9\", \"603c8a32027d216fa09dd8d9\", \"603c8a32027d216fa09dd8d9\"],\"type\":\"CUSTOM\"}", Encoding.UTF8, "application/json")
};
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.MediaType;
import okhttp3.RequestBody;
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/roles";
String encoding = Base64.getEncoder().encodeToString(("{API_KEY}:".getBytes()));
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"name\":\"role name\",\"permissionIds\":[\"603c8a32027d216fa09dd8d9\", \"603c8a32027d216fa09dd8d9\", \"603c8a32027d216fa09dd8d9\"],\"type\":\"CUSTOM\"}");
Request request = new Request.Builder()
.url(url)
.method("POST", body)
.addHeader("Authorization", "Basic " + encoding)
.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": "636735c9bc92e4015ce2309a",
"name": "test add role",
"type": "CUSTOM",
"permissionIds": [
"603c8a32027d216fa09dd8d9",
"618f2b1d13b687341e02ec1d",
"603c8a32027d216fa09dd8e7"
],
"createdBy": "6222930b8bec060152bcad67",
"updatedBy": "6222930b8bec060152bcad67",
"createdAt": "2022-11-06T04:19:21.296Z",
"updatedAt": "2022-11-06T04:19:21.296Z",
"companyId": "622294998bec060152bcad9c"
}
}
This API endpoint allows you to create a new role in the database. It's as simple as sending a POST request to https://api.blixo.com/v1/roles
. Think of it as telling the server, "Hey, I have a new role to add." And the server responds by creating the role with the information you provided!
HTTP Request
POST https://api.blixo.com/v1/roles
Headers
Key | Value |
---|---|
Authorization | Basic {API_KEY} |
Parameters
Parameter | Type | Description |
---|---|---|
name | string | (required) Name of role |
permissionIds | array | List of permission ID |
type | string | Type of role |
Example
To create a role, you would send a POST request to https://api.blixo.com/v1/roles
. 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 role. 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.
Update a role
curl "https://api.blixo.com/v1/roles/:roleId" \
-u {API_KEY}: \
-d name="role name" \
-d permissionIds[0]="603c8a32027d216fa09dd8d9" \
-d permissionIds[1]="603c8a32027d216fa09dd8d9" \
-d permissionIds[2]="603c8a32027d216fa09dd8d9" \
-d type="CUSTOM" \
-X PATCH
const fetch = require('node-fetch');
const url = 'https://api.blixo.com/v1/roles/:roleId';
const options = {
method: 'PATCH',
headers: {
'Authorization': 'Basic ' + Buffer.from('{API_KEY}:').toString('base64'),
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: "role name",
permissionIds: ["603c8a32027d216fa09dd8d9", "603c8a32027d216fa09dd8d9", "603c8a32027d216fa09dd8d9"],
type: "CUSTOM"
})
};
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/roles/:roleId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode(array(
"name" => "role name",
"permissionIds" => array("603c8a32027d216fa09dd8d9", "603c8a32027d216fa09dd8d9", "603c8a32027d216fa09dd8d9"),
"type" => "CUSTOM"
)),
CURLOPT_HTTPHEADER => array(
"Authorization: Basic " . base64_encode("{API_KEY}:"),
"Content-Type: application/json"
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
?>
require 'uri'
require 'net/http'
require 'base64'
require 'json'
url = URI("https://api.blixo.com/v1/roles/:roleId")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Basic ' + Base64.strict_encode64('{API_KEY}:')
request["Content-Type"] = 'application/json'
request.body = JSON.generate({
"name" => "role name",
"permissionIds" => ["603c8a32027d216fa09dd8d9", "603c8a32027d216fa09dd8d9", "603c8a32027d216fa09dd8d9"],
"type" => "CUSTOM"
})
response = http.request(request)
puts response.read_body
import requests
import base64
import json
url = "https://api.blixo.com/v1/roles/:roleId"
api_key = "{API_KEY}"
headers = {
"Authorization": "Basic " + base64.b64encode((api_key + ":").encode()).decode(),
"Content-Type": "application/json"
}
data = {
"name": "role name",
"permissionIds": ["603c8a32027d216fa09dd8d9", "603c8a32027d216fa09dd8d9", "603c8a32027d216fa09dd8d9"],
"type": "CUSTOM"
}
response = requests.patch(url, headers=headers, data=json.dumps(data))
print(response.text)
package main
import (
"fmt"
"net/http"
"io/ioutil"
"strings"
"encoding/base64"
)
func main() {
url := "https://api.blixo.com/v1/roles/:roleId"
method := "PATCH"
payload := strings.NewReader(`{
"name": "role name",
"permissionIds": ["603c8a32027d216fa09dd8d9", "603c8a32027d216fa09dd8d9", "603c8a32027d216fa09dd8d9"],
"type": "CUSTOM"
}`)
client := &http.Client {}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Authorization", "Basic " + base64.StdEncoding.EncodeToString([]byte("{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))
}
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.Patch,
RequestUri = new Uri("https://api.blixo.com/v1/roles/:roleId"),
Content = new StringContent("{\"name\":\"role name\",\"permissionIds\":[\"603c8a32027d216fa09dd8d9\", \"603c8a32027d216fa09dd8d9\", \"603c8a32027d216fa09dd8d9\"],\"type\":\"CUSTOM\"}", Encoding.UTF8, "application/json")
};
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.MediaType;
import okhttp3.RequestBody;
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/roles/:roleId";
String encoding = Base64.getEncoder().encodeToString(("{API_KEY}:".getBytes()));
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"name\":\"role name\",\"permissionIds\":[\"603c8a32027d216fa09dd8d9\", \"603c8a32027d216fa09dd8d9\", \"603c8a32027d216fa09dd8d9\"],\"type\":\"CUSTOM\"}");
Request request = new Request.Builder()
.url(url)
.method("PATCH", body)
.addHeader("Authorization", "Basic " + encoding)
.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": "636735c9bc92e4015ce2309a",
"name": "test add role",
"type": "CUSTOM",
"permissionIds": [
"603c8a32027d216fa09dd8d9",
"618f2b1d13b687341e02ec1d",
"603c8a32027d216fa09dd8e7",
"603c8a32027d216fa09dd8df"
],
"createdBy": "6222930b8bec060152bcad67",
"updatedBy": "6222930b8bec060152bcad67",
"createdAt": "2022-11-06T04:19:21.296Z",
"updatedAt": "2022-11-06T08:16:48.626Z",
"companyId": "622294998bec060152bcad9c"
}
}
This API endpoint allows you to modify an existing role in the database. It's as simple as sending a PATCH request to https://api.blixo.com/v1/roles/:roleId
. Think of it as telling the server, "Hey, I need to make some changes to this role." And the server responds by updating the role with the information you provided!
HTTP Request
PATCH https://api.blixo.com/v1/roles/:roleId
Headers
Key | Value |
---|---|
Authorization | Basic {API_KEY} |
Parameters
Parameter | Type | Description |
---|---|---|
name | string | (required) Name of role |
permissionIds | array | List of permission ID |
type | string | Type of role |
Example
To update a role, you would send a PATCH request to https://api.blixo.com/v1/roles/:roleId
. Remember to replace {API_KEY}
and :roleId
with your actual API key and the ID of the role you want to update, respectively.
Response
The response will be a JSON object with a data
key containing the updated role. 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 role
curl "https://api.blixo.com/v1/roles/:roleId" \
-u {API_KEY}: \
-X DELETE
const fetch = require('node-fetch');
const url = 'https://api.blixo.com/v1/roles/:roleId';
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/roles/:roleId",
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'
require 'base64'
url = URI("https://api.blixo.com/v1/roles/:roleId")
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
import base64
url = "https://api.blixo.com/v1/roles/:roleId"
api_key = "{API_KEY}"
headers = {
"Authorization": "Basic " + base64.b64encode((api_key + ":").encode()).decode()
}
response = requests.delete(url, headers=headers)
print(response.text)
package main
import (
"fmt"
"net/http"
"io/ioutil"
"encoding/base64"
)
func main() {
url := "https://api.blixo.com/v1/roles/:roleId"
req, _ := http.NewRequest("DELETE", 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.Delete,
RequestUri = new Uri("https://api.blixo.com/v1/roles/:roleId"),
};
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/roles/:roleId";
String encoding = Base64.getEncoder().encodeToString(("{API_KEY}:".getBytes()));
Request request = new Request.Builder()
.url(url)
.delete()
.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": "611d4216a747250146ade2cf"
}
This API endpoint allows you to remove a role from the database. It's as simple as sending a DELETE request to https://api.blixo.com/v1/roles/:roleId
. Think of it as telling the server, "Hey, I don't need this role anymore." And the server responds by deleting the role for you!
HTTP Request
DELETE https://api.blixo.com/v1/roles/:roleId
Headers
Key | Value |
---|---|
Authorization | Basic {API_KEY} |
Parameters
Parameter | Type | Description |
---|---|---|
roleId | string | (required) ID of role |
Example
To delete a role, you would send a DELETE request to https://api.blixo.com/v1/roles/:roleId
. Remember to replace {API_KEY}
and :roleId
with your actual API key and the ID of the role you want to delete, respectively.
Response
The response will be a JSON object with a data
key containing the ID of the deleted role. 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.
Email Templates
Email Template object
Attribute | Type | Description |
---|---|---|
id | ObjectId | The ID of the email template. |
name | String | The name of the email template. |
group | String | The group of the email template. |
type | String | The type of the email template. |
isSystemTemplate | Boolean | Whether the email template is a system template. |
options | Object | The options of the email template, includes btnText , attachPdf . |
subject | String | The subject of the email template. |
message | String | The message of the email template. |
companyId | ObjectId | The ID of the company. |
createdBy | ObjectId | The ID of the user who created the email template. |
updatedBy | ObjectId | The ID of the user who last updated the email template. |
createdAt | Date | The date when the email template was created. |
updatedAt | Date | The date when the email template was last updated. |
List all email templates
curl "https://api.blixo.com/v1/emailTemplates" \
-u {API_KEY}:
const fetch = require('node-fetch');
const url = 'https://api.blixo.com/v1/emailTemplates';
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/emailTemplates",
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/emailTemplates")
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/emailTemplates"
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/emailTemplates"
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/emailTemplates"),
};
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/emailTemplates";
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": "6287ac1a90df3fa0dca3dd2d",
"name": "Subscription Activation",
"group": "SUBSCRIPTION",
"type": "SUBSCRIPTION_BILLED_ACTIVATION",
"isSystemTemplate": true,
"subject": "Your recurring order purchase confirmation from {{store_name}}",
"message": "Hi {{customer_contact_name}},\n\nThank you for your purchase.\nPlease review your subscription details below.",
"companyId": "622294998bec060152bcad9c",
"createdAt": "2022-05-20T14:56:26.537Z",
"updatedAt": "2022-05-20T14:56:26.537Z",
"options": {
"btnText": "View Subscription",
"attachPdf": true
}
}
],
"pagination": {
"total": 21
}
}
This API endpoint allows you to retrieve a list of all email templates. It's as simple as sending a GET request to https://api.blixo.com/v1/emailTemplates
. Think of it as asking the server, "Hey, can I get a list of all your email templates?" And the server responds with the information you asked for!
HTTP Request
GET https://api.blixo.com/v1/emailTemplates
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 email templates to retrieve per page. Default is 100 . |
Example
To list all email templates, you would send a GET request to https://api.blixo.com/v1/emailTemplates
. Remember to replace {API_KEY}
with your actual API key.
If you want to retrieve the third page of email templates, with 50 templates per page, you would send a GET request to https://api.blixo.com/v1/emailTemplates?page=3&perPage=50
.
Response
The response will be a JSON object with a data
key containing an array of email templates. Each template will be an object with the following keys:
id
: The unique identifier of the email template.name
: The name of the email template.group
: The group of the email template.type
: The type of the email template.isSystemTemplate
: Whether the template is a system template.subject
: The subject of the email template.message
: The message of the email template.companyId
: The ID of the company.createdAt
: The creation date of the email template.updatedAt
: The last update date of the email template.options
: The options of the email template.
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 an email template
curl "https://api.blixo.com/v1/emailTemplates" \
-u {API_KEY}: \
-d name="email name" \
-d companyId="622294998bec060152bcad9c" \
-d group="INVOICE" \
-d message="{{customer_contact_name}}" \
-d options[btnText]="View Invoice" \
-d subject="{{customer_number}}" \
-d type="INVOICE_VIEW" \
-X POST
const fetch = require('node-fetch');
const url = 'https://api.blixo.com/v1/emailTemplates';
const options = {
method: 'POST',
headers: {
'Authorization': 'Basic ' + Buffer.from('{API_KEY}:').toString('base64'),
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: "email name",
companyId: "622294998bec060152bcad9c",
group: "INVOICE",
message: "{{customer_contact_name}}",
options: {
btnText: "View Invoice"
},
subject: "{{customer_number}}",
type: "INVOICE_VIEW"
})
};
fetch(url, options)
.then(res => res.json())
.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/emailTemplates",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => json_encode(array(
"name" => "email name",
"companyId" => "622294998bec060152bcad9c",
"group" => "INVOICE",
"message" => "{{customer_contact_name}}",
"options" => array(
"btnText" => "View Invoice"
),
"subject" => "{{customer_number}}",
"type" => "INVOICE_VIEW"
)),
CURLOPT_HTTPHEADER => array(
"Authorization: Basic " . base64_encode("{API_KEY}:"),
"Content-Type: application/json"
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
?>
require 'uri'
require 'net/http'
require 'base64'
require 'json'
url = URI("https://api.blixo.com/v1/emailTemplates")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url, {
'Content-Type' => 'application/json',
'Authorization' => 'Basic ' + Base64.strict_encode64('{API_KEY}:')
})
request.body = JSON.generate({
name: "email name",
companyId: "622294998bec060152bcad9c",
group: "INVOICE",
message: "{{customer_contact_name}}",
options: {
btnText: "View Invoice"
},
subject: "{{customer_number}}",
type: "INVOICE_VIEW"
})
response = http.request(request)
puts response.read_body
import requests
import base64
import json
url = "https://api.blixo.com/v1/emailTemplates"
api_key = "{API_KEY}"
headers = {
"Authorization": "Basic " + base64.b64encode((api_key + ":").encode()).decode(),
"Content-Type": "application/json"
}
data = {
"name": "email name",
"companyId": "622294998bec060152bcad9c",
"group": "INVOICE",
"message": "{{customer_contact_name}}",
"options": {
"btnText": "View Invoice"
},
"subject": "{{customer_number}}",
"type": "INVOICE_VIEW"
}
response = requests.post(url, headers=headers, data=json.dumps(data))
print(response.text)
package main
import (
"fmt"
"net/http"
"io/ioutil"
"encoding/base64"
"strings"
)
func main() {
url := "https://api.blixo.com/v1/emailTemplates"
payload := strings.NewReader(`{
"name": "email name",
"companyId": "622294998bec060152bcad9c",
"group": "INVOICE",
"message": "{{customer_contact_name}}",
"options": {
"btnText": "View Invoice"
},
"subject": "{{customer_number}}",
"type": "INVOICE_VIEW"
}`)
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic " + base64.StdEncoding.EncodeToString([]byte("{API_KEY}:")))
req.Header.Add("Content-Type", "application/json")
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/emailTemplates"),
Content = new StringContent(
"{\"name\":\"email name\",\"companyId\":\"622294998bec060152bcad9c\",\"group\":\"INVOICE\",\"message\":\"{{customer_contact_name}}\",\"options\":{\"btnText\":\"View Invoice\"},\"subject\":\"{{customer_number}}\",\"type\":\"INVOICE_VIEW\"}",
Encoding.UTF8,
"application/json"
)
};
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.MediaType;
import okhttp3.RequestBody;
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/emailTemplates";
String encoding = Base64.getEncoder().encodeToString(("{API_KEY}:".getBytes()));
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"name\":\"email name\",\"companyId\":\"622294998bec060152bcad9c\",\"group\":\"INVOICE\",\"message\":\"{{customer_contact_name}}\",\"options\":{\"btnText\":\"View Invoice\"},\"subject\":\"{{customer_number}}\",\"type\":\"INVOICE_VIEW\"}");
Request request = new Request.Builder()
.url(url)
.post(body)
.addHeader("Authorization", "Basic " + encoding)
.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": "6367bb1fbc92e4015ce4f5f5",
"name": "test",
"group": "INVOICE",
"type": "INVOICE_VIEW",
"isSystemTemplate": false,
"subject": "{{customer_number}}",
"message": "{{customer_contact_name}}",
"companyId": "622294998bec060152bcad9c",
"createdBy": "6222930b8bec060152bcad67",
"updatedBy": "6222930b8bec060152bcad67",
"createdAt": "2022-11-06T13:48:15.739Z",
"updatedAt": "2022-11-06T13:48:15.739Z",
"options": {
"btnText": "View Invoice"
}
}
}
This API endpoint allows you to create a new email template. It's as simple as sending a POST request to https://api.blixo.com/v1/emailTemplates
. Think of it as telling the server, "Hey, I want to create a new email template." And the server responds by creating the template!
HTTP Request
POST https://api.blixo.com/v1/emailTemplates
Headers
Key | Value |
---|---|
Authorization | Basic {API_KEY} |
Parameters
Parameter | Type | Description |
---|---|---|
name | string | The name of the email template. |
companyId | string | The ID of the company. |
group | string | The group of the email template. |
message | string | The message of the email template. |
options[btnText] | string | The text of the button in the email template. |
subject | string | The subject of the email template. |
type | string | The type of the email template. |
Example
To create a new email template, you would send a POST request to https://api.blixo.com/v1/emailTemplates
. Remember to replace {API_KEY}
with your actual API key.
If you want to create an email template with specific parameters, you would send a POST request to https://api.blixo.com/v1/emailTemplates
with the parameters in the body of the request.
Response
The response will be a JSON object with a data
key containing the new email template. 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.
Update an email template
curl "https://api.blixo.com/v1/emailTemplates/:emailTemplateId" \
-u {API_KEY}: \
-d name="email template name" \
-d companyId="622294998bec060152bcad9c" \
-d group="INVOICE" \
-d message="{{customer_contact_name}}" \
-d subject="{{customer_number}}" \
-d options[btnText]="View Invoice" \
-X PATCH
const fetch = require('node-fetch');
const url = 'https://api.blixo.com/v1/emailTemplates/:emailTemplateId';
const options = {
method: 'PATCH',
headers: {
'Authorization': 'Basic ' + Buffer.from('{API_KEY}:').toString('base64'),
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: "email template name",
companyId: "622294998bec060152bcad9c",
group: "INVOICE",
message: "{{customer_contact_name}}",
subject: "{{customer_number}}",
options: {
btnText: "View Invoice"
}
})
};
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/emailTemplates/:emailTemplateId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => array(
'name' => 'email template name',
'companyId' => '622294998bec060152bcad9c',
'group' => 'INVOICE',
'message' => '{{customer_contact_name}}',
'subject' => '{{customer_number}}',
'options[btnText]' => 'View Invoice'
),
CURLOPT_HTTPHEADER => array(
"Authorization: Basic " . base64_encode("{API_KEY}:"),
"Content-Type: application/x-www-form-urlencoded"
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
?>
require 'uri'
require 'net/http'
require 'base64'
require 'json'
url = URI("https://api.blixo.com/v1/emailTemplates/:emailTemplateId")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Basic ' + Base64.strict_encode64('{API_KEY}:')
request["Content-Type"] = 'application/json'
request.body = JSON.generate({
name: "email template name",
companyId: "622294998bec060152bcad9c",
group: "INVOICE",
message: "{{customer_contact_name}}",
subject: "{{customer_number}}",
options: {
btnText: "View Invoice"
}
})
response = http.request(request)
puts response.read_body
import requests
import base64
import json
url = "https://api.blixo.com/v1/emailTemplates/:emailTemplateId"
api_key = "{API_KEY}"
headers = {
"Authorization": "Basic " + base64.b64encode((api_key + ":").encode()).decode(),
"Content-Type": "application/json"
}
data = {
"name": "email template name",
"companyId": "622294998bec060152bcad9c",
"group": "INVOICE",
"message": "{{customer_contact_name}}",
"subject": "{{customer_number}}",
"options": {
"btnText": "View Invoice"
}
}
response = requests.patch(url, headers=headers, data=json.dumps(data))
print(response.text)
package main
import (
"fmt"
"net/http"
"io/ioutil"
"encoding/base64"
"strings"
)
func main() {
url := "https://api.blixo.com/v1/emailTemplates/:emailTemplateId"
payload := strings.NewReader(`{
"name": "email template name",
"companyId": "622294998bec060152bcad9c",
"group": "INVOICE",
"message": "{{customer_contact_name}}",
"subject": "{{customer_number}}",
"options": {
"btnText": "View Invoice"
}
}`)
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Basic " + base64.StdEncoding.EncodeToString([]byte("{API_KEY}:")))
req.Header.Add("Content-Type", "application/json")
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;
using Newtonsoft.Json;
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.Patch,
RequestUri = new Uri("https://api.blixo.com/v1/emailTemplates/:emailTemplateId"),
Content = new StringContent(JsonConvert.SerializeObject(new
{
name = "email template name",
companyId = "622294998bec060152bcad9c",
group = "INVOICE",
message = "{{customer_contact_name}}",
subject = "{{customer_number}}",
options = new { btnText = "View Invoice" }
}), Encoding.UTF8, "application/json")
};
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.MediaType;
import okhttp3.RequestBody;
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/emailTemplates/:emailTemplateId";
String encoding = Base64.getEncoder().encodeToString(("{API_KEY}:".getBytes()));
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, `{
"name": "email template name",
"companyId": "622294998bec060152bcad9c",
"group": "INVOICE",
"message": "{{customer_contact_name}}",
"subject": "{{customer_number}}",
"options": {
"btnText": "View Invoice"
}
}`);
Request request = new Request.Builder()
.url(url)
.patch(body)
.addHeader("Authorization", "Basic " + encoding)
.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": "6367bb1fbc92e4015ce4f5f5",
"name": "test 222",
"group": "INVOICE",
"type": "INVOICE_VIEW",
"isSystemTemplate": false,
"subject": "{{customer_number}}",
"message": "{{customer_contact_name}}",
"companyId": "622294998bec060152bcad9c",
"createdBy": "6222930b8bec060152bcad67",
"updatedBy": "6222930b8bec060152bcad67",
"createdAt": "2022-11-06T13:48:15.739Z",
"updatedAt": "2022-11-06T14:06:50.218Z",
"options": {
"btnText": "View Invoice"
}
}
}
This API endpoint allows you to update an existing email template. It's as simple as sending a PATCH request to https://api.blixo.com/v1/emailTemplates/:emailTemplateId
. Think of it as telling the server, "Hey, I want to update this email template." And the server responds by updating the template!
HTTP Request
PATCH https://api.blixo.com/v1/emailTemplates/:emailTemplateId
Headers
Key | Value |
---|---|
Authorization | Basic {API_KEY} |
Parameters
Parameter | Type | Description |
---|---|---|
name | string | The new name of the email template. |
companyId | string | The new ID of the company. |
group | string | The new group of the email template. |
message | string | The new message of the email template. |
options[btnText] | string | The new text of the button in the email template. |
subject | string | The new subject of the email template. |
type | string | The new type of the email template. |
Example
To update an email template, you would send a PATCH request to https://api.blixo.com/v1/emailTemplates/:emailTemplateId
. Remember to replace {API_KEY}
with your actual API key and :emailTemplateId
with the ID of the email template you want to update.
If you want to update an email template with specific parameters, you would send a PATCH request to https://api.blixo.com/v1/emailTemplates/:emailTemplateId
with the parameters in the body of the request.
Response
The response will be a JSON object with a data
key containing the updated email template. 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 an email template
curl "https://api.blixo.com/v1/emailTemplates/:emailTemplateId" \
-u {API_KEY}: \
-X DELETE
const fetch = require('node-fetch');
const url = 'https://api.blixo.com/v1/emailTemplates/:emailTemplateId';
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/emailTemplates/:emailTemplateId",
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'
require 'base64'
url = URI("https://api.blixo.com/v1/emailTemplates/:emailTemplateId")
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
import base64
url = "https://api.blixo.com/v1/emailTemplates/:emailTemplateId"
api_key = "{API_KEY}"
headers = {
"Authorization": "Basic " + base64.b64encode((api_key + ":").encode()).decode()
}
response = requests.delete(url, headers=headers)
print(response.text)
package main
import (
"fmt"
"net/http"
"io/ioutil"
"encoding/base64"
)
func main() {
url := "https://api.blixo.com/v1/emailTemplates/:emailTemplateId"
req, _ := http.NewRequest("DELETE", 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.Delete,
RequestUri = new Uri("https://api.blixo.com/v1/emailTemplates/:emailTemplateId"),
};
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/emailTemplates/:emailTemplateId";
String encoding = Base64.getEncoder().encodeToString(("{API_KEY}:".getBytes()));
Request request = new Request.Builder()
.url(url)
.delete()
.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": "611d4216a747250146ade2cf"
}
This API endpoint allows you to delete an existing email template. It's as simple as sending a DELETE request to https://api.blixo.com/v1/emailTemplates/:emailTemplateId
. Think of it as telling the server, "Hey, I want to delete this email template." And the server responds by deleting the template!
HTTP Request
DELETE https://api.blixo.com/v1/emailTemplates/:emailTemplateId
Headers
Key | Value |
---|---|
Authorization | Basic {API_KEY} |
Example
To delete an email template, you would send a DELETE request to https://api.blixo.com/v1/emailTemplates/:emailTemplateId
. Remember to replace {API_KEY}
with your actual API key and :emailTemplateId
with the ID of the email template you want to delete.
Response
The response will be a JSON object with a data
key containing the ID of the deleted email template. 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.