NAV
shell

Introduction

Welcome to the Quick Organics API.

The root url is https://api.quickorganics.com/v2/

Authentication

To authorize, use this code:

curl https://api.quickorganics.com/v2/endpoint \
  -H "Authorization: Bearer TOKEN"

Make sure to replace TOKEN with generated JWT

Quick Organics uses JSON Web Tokens for authentication. The API expects a valid JWT in the header for most requests. The header must look like the following:

Authorization: Bearer TOKEN

Access tokens are valid for 10 minutes while refresh tokens are valid for 30 days.

Create JWT

Create an access and refresh JWT with the following code:

curl -X POST https://api.quickorganics.com/v2/token \
  -d "email=EMAIL&password=PASSWORD"

Replace EMAIL and PASSWORD wtih User credentials

If successful, will return the following:

{
  "refresh": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbl90eXBlIjoicmVmcmVzaCIsImV4cCI6MTY0NzU5ODgxOSwiaWF0IjoxNjQ1MDA2ODE5LCJqdGkiOiJkNDQ0YWZjOTYyYmM0ZjE3OTYwMmYxZDM1Zjg2YTAyNiIsImVtYWlsIjoidGVzdEB0ZXN0LmNvbSIsInV1aWQiOiI3NjIxYWViZC02MzM1LTQyMmQtOTBiOC1jYmFmZmRiY2NlYWUifQ.wPQrIvK_MPr00rmv4ESkU3iJ_NrHvexmBUoHhhYDl34",
  "access": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNjQ1MDA3NDE5LCJpYXQiOjE2NDUwMDY4MTksImp0aSI6IjRlOTc4NDUwMDk4NjQ5Zjc4NGIxNTJmMWNiMjMxZDU4IiwiZW1haWwiOiJ0ZXN0QHRlc3QuY29tIiwidXVpZCI6Ijc2MjFhZWJkLTYzMzUtNDIyZC05MGI4LWNiYWZmZGJjY2VhZSJ9.RFSZ2LybJmTs6Cj-PFktVO812AIiCm289Yjn7eAb7u4"
}

Creating a JWT is the equivalent of logging in.

HTTP Request

POST https://api.quickorganics.com/v2/token

Arguments

Parameter Type Required Description
email string required user email address
password string required user password

Refresh JWT

Generate a new access token

curl -X PUT https://api.quickorganics.com/v2/token \
  -d "refresh=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbl90eXBlIjoicmVmcmVzaCIsImV4cCI6MTY0NzU5ODgxOSwiaWF0IjoxNjQ1MDA2ODE5LCJqdGkiOiJkNDQ0YWZjOTYyYmM0ZjE3OTYwMmYxZDM1Zjg2YTAyNiIsImVtYWlsIjoidGVzdEB0ZXN0LmNvbSIsInV1aWQiOiI3NjIxYWViZC02MzM1LTQyMmQtOTBiOC1jYmFmZmRiY2NlYWUifQ.wPQrIvK_MPr00rmv4ESkU3iJ_NrHvexmBUoHhhYDl34"

Assuming a valid refresh token, the API should return a new access token:

{
  "access": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNjQ1MDEwNTg1LCJpYXQiOjE2NDUwMDY4MTksImp0aSI6IjllYjQzMDdiOTQ2MDRiYzhhZmQ2YjVhYzBlYTdhOTM3IiwiZW1haWwiOiJ0ZXN0QHRlc3QuY29tIiwidXVpZCI6Ijc2MjFhZWJkLTYzMzUtNDIyZC05MGI4LWNiYWZmZGJjY2VhZSJ9.ZYqlx3zZCYBZe3k9S_mhvK8OTfBWobQblJIjYHRbZMU"
}

As mentioned earlier, access tokens are short lived, while refresh tokens have a much longer lifetime. If the refresh token has expired, the User will have to create a fresh JWT pair.

HTTP Request

PUT https://api.quickorganics.com/v2/token

Arguments

Parameter Type Required Description
refresh string required refresh token

Destroy JWT

Destroy JWT

curl -X DELETE https://api.quickorganics.com/v2/token \
  -d "refresh=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbl90eXBlIjoicmVmcmVzaCIsImV4cCI6MTY0NzU5ODgxOSwiaWF0IjoxNjQ1MDA2ODE5LCJqdGkiOiJkNDQ0YWZjOTYyYmM0ZjE3OTYwMmYxZDM1Zjg2YTAyNiIsImVtYWlsIjoidGVzdEB0ZXN0LmNvbSIsInV1aWQiOiI3NjIxYWViZC02MzM1LTQyMmQtOTBiOC1jYmFmZmRiY2NlYWUifQ.wPQrIvK_MPr00rmv4ESkU3iJ_NrHvexmBUoHhhYDl34"

On success, the API will return an empty response with HTTP status code 205

Destroying a JWT is the equivalent of logging out.

Since refresh tokens are valid for 30 days, it is considered standard practice to destroy the refresh token if it is no longer needed.

HTTP Request

DELETE https://api.quickorganics.com/v2/token

Arguments

Parameter Type Required Description
refresh string required refresh token

Users

Field Type Description
name string User's name
uuid UUID Unique identifier
email string
receive_task_notifications boolean
receive_osp_notifications boolean
is_verified boolean Whether user email has been verified
is_active boolean If user's account is active
organizations array

Create User

curl -X POST https://api.quickorganics.com/v2/users \
  -d "email=test@quickorganics.com&name=Test&password=hunter2&organization_name=TestOrg"

User's created via this endpoint will also be created with an organization. The user will be the primary admin of the organization.

HTTP Request

POST https://api.quickorganics.com/v2/users

Arguments

Parameter Type Required Description
email string required
name string required
password string required
organization_name string required

Get User

curl -X GET https://api.quickorganics.com/v2/users/7621aebd-6335-422d-90b8-cbaffdbcceae
  -H "Authorization: Bearer TOKEN"

If the UUID matches the currently authenticated user, the following will be returned:

{
  "name": "Test Account",
  "uuid": "7621aebd-6335-422d-90b8-cbaffdbcceae",
  "email": "test@test.com",
  "receive_task_notifications": false,
  "receive_osp_notifications": true,
  "is_verified": false,
  "is_active": true,
  "organizations": [
    {
      "name": "Test Organization",
      "uuid": "5fd95977-7494-4864-90ad-26c1d3219e65",
      "role": "primary_admin"
    }
  ]
}

HTTP Request

GET https://api.quickorganics.com/v2/users/<user_uuid>

Query Parameters

Parameter Type Required Description
user_uuid UUID required User UUID

Verify User Account

When a user account is created, the account is not verified. The Quick Organics API will send an email with a verification link to confirm ownership of the email address.

HTTP Request

POST https://api.quickorganics.com/v2/user/acitvate

Arguments

Parameter Type Required Description
activation_key string required activation key from verfication email link

Change Password

Reset Password

Organizations

Users are grouped into organizations. A single user can be a member of multiple organizations.

Field Type Description
name string
uuid UUID Unique identifier
module_names array List of enabled modules

Get Organization

curl -X GET https://api.quickorganics.com/v2/organization/5fd95977-7494-4864-90ad-26c1d3219e65 \
  -H "Authorization: Bearer TOKEN"
{
  "name": "Test Organization",
  "uuid": "5fd95977-7494-4864-90ad-26c1d3219e65",
  "module_names": [
    "operation-information",
    "aqua-greenhouse",
    "land-history",
    "seed-planting",
    "crop-fertility",
    "pest-disease",
    "biodiversity",
    "harvest-storage",
    "labeling-sales",
    "contamination-prevention",
    "materials-list",
    "record-keeping",
    "wild-crop"
  ]
}

HTTP Request

GET https://api.quickorganics.com/v2/organizations/<organization_uuid>

Query Parameters

Parameter Type Required Description
organization_uuid UUID required

Update Organization

curl -X PATCH https://api.quickorganics.com/v2/organization/5fd95977-7494-4864-90ad-26c1d3219e65 \
  -H "Authorization: Bearer TOKEN"
  -d "module_names=['wild-crop']"
{
  "name": "Test Organization",
  "uuid": "5fd95977-7494-4864-90ad-26c1d3219e65",
  "module_names": [
    "wild-crop"
  ]
}

Invalid module names will be ignored.

Valid Module Names

Name
operation-information
aqua-greenhouse
land-history
seed-planting
crop-fertility
pest-disease
biodiversity
harvest-storage
labeling-sales
contamination-prevention
materials-list
record-keeping
wild-crop

HTTP Request

PATCH https://api.quickorganics.com/v2/organizations/<organization_uuid>

Query Parameters

Parameter Type Required Description
organization_uuid UUID required

Arguments

Parameter Type Required Description
name string optional
module_names array optional list of enabled modules

Invite User to Organization

Remove User from Organization

Modules

The Quick Organics OSP consists of thirteen distinct modules.

Field Type Description
name string
uuid UUID
tasks array List of tasks associated with this module

Get Modules

curl -X GET https://api.quickorganics.com/v2/organizations/5fd95977-7494-4864-90ad-26c1d3219e65/modules \
  -H "Authorization: Bearer TOKEN"
[
  {
    "name": "operation-information",
    "uuid": "4833ac90-127c-4075-a02e-6959ef898678",
    "tasks": [
      {
        "name": "operation-information",
        "uuid": "d50637b5-e7bb-4bcf-acd0-a273b2695295",
        "status": "new",
        "operation_name": null,
        "entity_type": null,
        "certification_deadline": null,
        "organic_only": false,
        "dba": []
      },
      {
        "name": "contact-information",
        "uuid": "e11623cd-b892-40fc-8f3d-9bb177975f72",
        "status": "new",
        "primary_address": null,
        "billing_same_as_mailing": false,
        "operating_same_as_mailing": false,
        "contact_is_primary": false,
        "communication_preference": []
      },
      {
        "name": "background-information",
        "uuid": "7b81bc06-1cb0-4676-934e-2da8aafd66ee",
        "status": "new",
        "certification_applications": [],
        "reviewed_nop": false,
        "reviewed_international": false,
        "regulatory_agency": null,
        "negative_scoring": false
      },
      {
        "name": "certification-history",
        "uuid": "7826d3cd-a0b8-4167-a8b3-5c320223fd13",
        "status": "new",
        "previous_certification": false,
        "current_cerification": false,
        "maintaining_certification": false,
        "agency_name": null,
        "certification_start": null,
        "certification_end": null,
        "noncompliance": false,
        "suspended": false,
        "suspended_description": null,
        "revoked": false,
        "revoked_description": null,
        "surrendered": false,
        "surrendered_description": null,
        "denied": false,
        "denied_description": null,
        "withdrawn": false,
        "withdrawn_description": null
      },
      {
        "name": "california-organic-registration",
        "uuid": "7269c1ef-5949-4a6a-a4eb-885f33250b4f",
        "status": "new",
        "located_in_california": false,
        "cdfa_registration_number": null
      }
    ]
  },
  {
    "name": "aqua-greenhouse",
    "uuid": "e5dd3b6d-b361-4cf8-9721-c7a5bca4cdd9",
    "tasks": [
      {
        "name": "site-location",
        "uuid": "99e49c27-36c3-4b8c-943a-001411623758",
        "status": "new",
        "site_name": null,
        "address": null,
        "total_area": null
      },
      {
        "name": "map",
        "uuid": "9dcc6406-4f2f-4e02-b367-7d4f2da4c672",
        "status": "new"
      },
      {
        "name": "production",
        "uuid": "7c6d2fc3-6f45-42e1-b32d-42f16f75cbb5",
        "status": "new",
        "description": null,
        "media": [],
        "support_pollinators": [],
        "biodiversity": []
      },
      {
        "name": "aquaponics",
        "uuid": "cc03daf4-9aa2-49ac-9fa5-412dd3fe0b11",
        "status": "new",
        "use_aquaponics": false,
        "chemicals": [],
        "support_systems": [],
        "fish": false,
        "fish_description": null,
        "fish_chemicals": false,
        "fish_chemicals_description": null,
        "dispose_water": false,
        "dispose_water_description": null,
        "contamination_description": null
      }
    ]
  },
  {
    "name": "land-history",
    "uuid": "16438c81-152b-4227-a7d0-01e670901923",
    "tasks": []
  },
  {
    "name": "seed-planting",
    "uuid": "1002ac98-f9ad-43d0-9a88-a7c2bce15404",
    "tasks": [
      {
        "name": "purchased-stock",
        "uuid": "b6ca60ab-e89e-4f3c-a6a5-4860ec5d85e9",
        "status": "new",
        "obtain_seeds": false,
        "seed_types": [],
        "obtain_seedlings": false,
        "obtain_stock": false,
        "stock_type": [],
        "other_stock": false,
        "other_stock_type": [],
        "contract": false,
        "documentation": false
      },
      {
        "name": "farm-grown",
        "uuid": "815c84f5-75c9-4bc8-9af4-f8a51a419bff",
        "status": "new",
        "farm_grown": false,
        "addresses": [],
        "farm_grown_choices": [],
        "contract": false,
        "processing_description": null
      },
      {
        "name": "commercial-availability",
        "uuid": "70711506-3dfb-4c95-9eb2-c463fb876598",
        "status": "new",
        "certified_organic": false,
        "characteristics": [],
        "description": null,
        "contract": false,
        "documents_maintained": []
      },
      {
        "name": "genetic-modification",
        "uuid": "0681c14e-f843-458e-954f-772559b04a34",
        "status": "new",
        "organic": false,
        "documentation": []
      },
      {
        "name": "seed-treatments",
        "uuid": "cb9042a5-165c-410b-86e6-4281b768de36",
        "status": "new",
        "use_treatments": false
      }
    ]
  },
  {
    "name": "crop-fertility",
    "uuid": "edf4d819-9695-486c-9a08-7297d0392c24",
    "tasks": [
      {
        "name": "tillage-cultivation",
        "uuid": "76151afa-cebb-4f81-a6ff-95c0ff95fe18",
        "status": "new",
        "tillage_practices": [],
        "soil_practices": []
      },
      {
        "name": "crop-rotation",
        "uuid": "cac4d1b6-4c16-4151-a115-d7d9da2f9e20",
        "status": "new",
        "description": null,
        "biodiversity_practices": []
      },
      {
        "name": "manure",
        "uuid": "c39d6029-a91c-4f60-bfcd-433b346abf34",
        "status": "new",
        "use_manure": false,
        "human_consumption": false,
        "uncomposted_manure": [],
        "contamination_description": null
      },
      {
        "name": "compost",
        "uuid": "21a12ae6-8301-406c-a4ce-7efdfbfb96ed",
        "status": "new",
        "production": [],
        "production_method": [],
        "documentation": null
      },
      {
        "name": "micronutrients",
        "uuid": "be1d9319-ccdc-4127-805b-0667e6d9b543",
        "status": "new",
        "apply": false,
        "description": null
      },
      {
        "name": "crop-monitoring",
        "uuid": "f30928bc-3945-4f2f-9a9c-c3cd2baf2791",
        "status": "new",
        "method": [],
        "lab_analysis": false,
        "frequency": null
      }
    ]
  },
  {
    "name": "pest-disease",
    "uuid": "09da844d-99bb-4fd1-ad98-ef0ecd91737b",
    "tasks": [
      {
        "name": "strategies",
        "uuid": "6cfec95c-1250-4eed-abeb-7961c94163d5",
        "status": "new",
        "threats": [],
        "preventative_practices": [],
        "use_materials": false,
        "conditions": [],
        "physical_barriers": false
      },
      {
        "name": "burning-crop-residue",
        "uuid": "76c06c5a-5214-4e9a-a266-3b2cc3ba3c6a",
        "status": "new",
        "burn_crop_residue": false,
        "diseases": []
      },
      {
        "name": "disease-monitoring",
        "uuid": "01dc25df-a66c-468b-8c29-9253c026436d",
        "status": "new",
        "method": []
      }
    ]
  },
  {
    "name": "biodiversity",
    "uuid": "553522e1-18c3-49d7-9fd6-7b34eb42329b",
    "tasks": [
      {
        "name": "biodiversity",
        "uuid": "677f2174-e44b-4d12-9ff9-aac9a7f822e7",
        "status": "new",
        "conservation_plan": false,
        "coservation_practice": [],
        "conserve_water": [],
        "share_water": [],
        "resources": [],
        "habitat": [],
        "invasive": [],
        "restrict_wildlife": [],
        "restrict_wildlife_explanation": null,
        "additional_measures": null,
        "monitoring": []
      }
    ]
  },
  {
    "name": "harvest-storage",
    "uuid": "2005b3f4-8e98-4e4e-a6a7-899eb9c91d27",
    "tasks": []
  },
  {
    "name": "labeling-sales",
    "uuid": "b2d721c7-b6c0-42bf-9de6-b7a5c0dce5b1",
    "tasks": [
      {
        "name": "non-retail-identification",
        "uuid": "05bc6eb5-d3e0-4522-9734-68a840d80c22",
        "status": "new",
        "wholesale": false,
        "description": null
      },
      {
        "name": "retail-package",
        "uuid": "3e347513-edd6-4f52-a09d-1e6e5e7a87cf",
        "status": "new",
        "use_labels": false
      },
      {
        "name": "labels",
        "uuid": "327d4994-28b7-430e-abed-a0fd83ca1fed",
        "status": "new",
        "compliant_labels": [],
        "other_company": false,
        "other_company_organic": false,
        "verify": null
      },
      {
        "name": "packaging-container",
        "uuid": "c0302a96-3133-436e-9101-b5ad27a897fe",
        "status": "new",
        "use_packaging": false,
        "packaging_description": null,
        "reuse_packaging": false,
        "contain_nonorganic": false,
        "residue_description": null
      }
    ]
  },
  {
    "name": "contamination-prevention",
    "uuid": "b685129c-5b16-435d-9de8-f61a8b5e23e4",
    "tasks": [
      {
        "name": "equipment-use",
        "uuid": "71d7e25c-290d-43ba-adc4-4b74ffa35217",
        "status": "new",
        "shared_equipment": false
      },
      {
        "name": "water-use",
        "uuid": "73ed0426-0e94-4c2a-a2cb-3137c88f2b90",
        "status": "new",
        "irrigate": false,
        "water_source": [],
        "contaminants": null,
        "additives": false
      },
      {
        "name": "borders",
        "uuid": "7e99ca5c-0851-4286-a2a7-05e44a2bb037",
        "status": "new",
        "drift_risk": false,
        "drift_risk_description": null,
        "runoff_risk": false,
        "runoff_risk_description": null,
        "public_road": false,
        "prevention": [],
        "lumber": false
      },
      {
        "name": "split-parallel",
        "uuid": "66bdf22e-e7bf-4d91-98ec-a9f353ba173a",
        "status": "new",
        "dual_production": false,
        "visually_identical": false,
        "visually_identical_description": null,
        "contamination_description": null,
        "runoff": false,
        "runoff_description": null,
        "materials": [],
        "materials_description": null
      }
    ]
  },
  {
    "name": "materials-list",
    "uuid": "96091671-5307-4982-bf90-bcd64e6db7ab",
    "tasks": [
      {
        "name": "input-materials-list",
        "uuid": "bac61f5f-ae55-4703-bbe8-d2aa1150cd6e",
        "status": "new"
      }
    ]
  },
  {
    "name": "record-keeping",
    "uuid": "3aaf5a3d-2ff5-43b6-9c9c-aefb6f0b29f1",
    "tasks": []
  },
  {
    "name": "wild-crop",
    "uuid": "f6af1bfa-4a15-492f-bcc3-e6e762351565",
    "tasks": [
      {
        "name": "wild-crop",
        "uuid": "bdf61ca0-bfd1-4eec-be7c-037f76f06853",
        "status": "new",
        "approval": false,
        "agency_name": null,
        "environmental_description": null,
        "percent_harvested": null,
        "health_description": null,
        "monitoring_description": null,
        "endangered_species": false,
        "endangered_species_description": null,
        "contract": false,
        "contract_description": null
      }
    ]
  }
]

Return a list of modules associated with an organization.

HTTP Request

GET https://api.quickorganics.com/v2/organizations/<organization_uuid>/modules

Query Parameter

Parameter Type Required Description
organization_uuid UUID required

Get Individual Module

Return a single module.

HTTP Request

GET https://api.quickorganics.com/v2/organizations/<organization_uuid>/modules/<module_name>

Query Parameters

Parameter Type Required Description
organization_uuid UUID required
module_name string required Must be a valid module_name as described above

Tasks

Each module consists of a number of unique tasks.

Task fields are primarily three types: Array, Text, and Boolean. Since the copy for each Task has not been determined, the API does not enforce specific options, that responsibility is up to the client.

Each Task will have specific fields. Examples can be seen in the Module section above.

Get Task

Return a specific Task.

curl -X GET https://api.quickorganics.com/v2/organizations/5fd95977-7494-4864-90ad-26c1d3219e65/tasks/wild-crop \
  -H "Authorization: Bearer TOKEN"
{
  "name": "wild-crop",
  "uuid": "bdf61ca0-bfd1-4eec-be7c-037f76f06853",
  "status": "new",
  "approval": false,
  "agency_name": null,
  "environmental_description": null,
  "percent_harvested": null,
  "health_description": null,
  "monitoring_description": null,
  "endangered_species": false,
  "endangered_species_description": null,
  "contract": false,
  "contract_description": null
}

HTTP Request

GET https://api.quickorganics.com/v2/organizations/<organization_uuid>/tasks/<task_name>

Query Parameters

Parameter Type Required Description
organization_uuid UUID required
task_name string required

Update Task

curl -X PATCH https://api.quickorganics.com/v2/organizations/5fd95977-7494-4864-90ad-26c1d3219e65/tasks/wild-crop \
  -H "Authorization: Bearer TOKEN"
  -d "name=wild-crop&contract=true&contract_description=foobar"
{
  "name": "wild-crop",
  "uuid": "bdf61ca0-bfd1-4eec-be7c-037f76f06853",
  "status": "new",
  "approval": false,
  "agency_name": null,
  "environmental_description": null,
  "percent_harvested": null,
  "health_description": null,
  "monitoring_description": null,
  "endangered_species": false,
  "endangered_species_description": null,
  "contract": true,
  "contract_description": "foobar"
}

A complete list of tasks and fields are listed above.

HTTP Request

Query Parameters

Parameter Type Required Description
organization_uuid UUID required
task_name string required

Arguments

Parameter Type Required Description
name string required Must match name of Task

Most of the fields depend on the specific Task. See above for all fields.