API documentation

Importing data into Custobar

Written by Custobar | Jun 12, 2024 4:22:42 PM

Custobar has five built-in entity types that form the basis of the data model in Custobar. All the entity types have multiple optional fields, which are utilised in various places in Custobar.

  • Customers – The customers
  • Events – The customer events, such as mailing list subscriptions, browsing products online and participation in competitions
  • Products – The product product entities
  • Shops – The locations where products are sold such as e-commerce sites and brick and mortar stores
  • Sales – The sales

Data import formats

Custobar supports importing data using HTTP apis in JSON or CSV formats. Read about the different formats data can be imported into Custobar.

File upload

To import your data to Custobar, you can use the Custobar API. Below are examples using curl to upload the data.

In all the examples below, replace mycompany with your company name as it is used in your company's Custobar app.

Customers

curl -X POST -u USER -H "Content-Type: application/json" \
--data-binary @customers.json \
https://COMPANY.custobar.com/api/customers/upload/

Events

curl -X POST -u USER -H "Content-Type: application/json" \
--data-binary @events.json \
https://COMPANY.custobar.com/api/events/

Products

curl -X POST -u USER -H "Content-Type: application/json" \
--data-binary @products.json \
https://COMPANY.custobar.com/api/products/upload/

Shops

curl -X POST -u USER -H "Content-Type: application/json" \
--data-binary @shops.json \
https://COMPANY.custobar.com/api/shops/upload/

Sales

curl -X POST -u USER -H "Content-Type: application/json" \
--data-binary @sales.json \
https://COMPANY.custobar.com/api/sales/upload/

Secure FTP

It's also possible to use sftp to transfer the files. Files are transferred to directory /srv/sftp/mycompany/tocustobar on your Custobar server.

For further details, please contact Custobar support.