API Documentation

API Endpoint

Bills

Bills

Supported filter params

  • purchase_order_id (array)

  • invoice_number

  • description

  • date

  • due_date

  • total_cost_cents

  • total_received_cents

Supported sort params

  • purchase_order_id

  • invoice_number

  • description

  • date

  • due_date

  • created_at

  • total_cost

  • total_received

Filter operations are supported on this endpoint.

GET /api/v2/bills/1
Requestsreturns purchase orders

GET  /api/v2/bills/2

Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "2",
    "type": "bills",
    "attributes": {
      "date": "2025-08-01",
      "due_date": "2025-08-02",
      "deleted_at": null,
      "invoice_number": "Invoice 2",
      "description": "Bill description",
      "created_at": "2025-08-01T06:03:14.566+02:00",
      "currency": "EUR",
      "currency_default": "USD",
      "currency_normalized": "EUR",
      "total_received": 0,
      "total_received_default": 0,
      "total_received_normalized": 0,
      "total_cost": 0,
      "total_cost_default": 0,
      "total_cost_normalized": 0
    },
    "relationships": {
      "organization": {
        "data": {
          "type": "organizations",
          "id": "78"
        }
      },
      "purchase_order": {
        "meta": {
          "included": false
        }
      },
      "creator": {
        "meta": {
          "included": false
        }
      },
      "deal": {
        "meta": {
          "included": false
        }
      },
      "attachment": {
        "meta": {
          "included": false
        }
      }
    }
  },
  "meta": {}
}

Gets a bill
GET/api/v2/bills/{id}

URI Parameters
HideShow
id
number (required) Example: 1

purchase order id


POST /api/v2/bills
Requestscreates purchase orderreturns error

POST  /api/v2/bills

Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "bills",
    "attributes": {},
    "relationships": {
      "purchase_order": {
        "data": {
          "type": "purchase_orders",
          "id": "3"
        }
      }
    }
  }
}
Responses201
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "4",
    "type": "bills",
    "attributes": {
      "date": null,
      "due_date": null,
      "deleted_at": null,
      "invoice_number": null,
      "description": null,
      "created_at": "2025-08-01T06:03:14.703+02:00",
      "currency": "EUR",
      "currency_default": "USD",
      "currency_normalized": "EUR",
      "total_received": 0,
      "total_received_default": 0,
      "total_received_normalized": 0,
      "total_cost": 0,
      "total_cost_default": 0,
      "total_cost_normalized": 0
    },
    "relationships": {
      "organization": {
        "data": {
          "type": "organizations",
          "id": "79"
        }
      },
      "purchase_order": {
        "meta": {
          "included": false
        }
      },
      "creator": {
        "meta": {
          "included": false
        }
      },
      "deal": {
        "meta": {
          "included": false
        }
      },
      "attachment": {
        "meta": {
          "included": false
        }
      }
    }
  },
  "meta": {}
}

POST  /api/v2/bills

Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "bills",
    "attributes": {},
    "relationships": {
      "deal": {
        "data": {
          "type": "purchase_orders",
          "id": "0"
        }
      }
    }
  }
}
Responses422
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "errors": [
    {
      "status": "422",
      "code": "invalid_attribute",
      "title": "Invalid Attribute",
      "detail": "can't be blank",
      "source": {
        "pointer": "data/attributes/purchase_order"
      }
    }
  ]
}

Create a bill
POST/api/v2/bills


PATCH /api/v2/bills/1
Requestsupdates billreturns error

PATCH  /api/v2/bills/6

Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "bills",
    "attributes": {},
    "relationships": {
      "purchase_order": {
        "data": {
          "type": "purchase_orders",
          "id": "6"
        }
      }
    }
  }
}
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "6",
    "type": "bills",
    "attributes": {
      "date": "2025-08-01",
      "due_date": "2025-08-02",
      "deleted_at": null,
      "invoice_number": "Invoice 5",
      "description": "Bill description",
      "created_at": "2025-08-01T06:03:14.957+02:00",
      "currency": "EUR",
      "currency_default": "USD",
      "currency_normalized": "EUR",
      "total_received": 0,
      "total_received_default": 0,
      "total_received_normalized": 0,
      "total_cost": 0,
      "total_cost_default": 0,
      "total_cost_normalized": 0
    },
    "relationships": {
      "organization": {
        "data": {
          "type": "organizations",
          "id": "81"
        }
      },
      "purchase_order": {
        "meta": {
          "included": false
        }
      },
      "creator": {
        "meta": {
          "included": false
        }
      },
      "deal": {
        "meta": {
          "included": false
        }
      },
      "attachment": {
        "meta": {
          "included": false
        }
      }
    }
  },
  "meta": {}
}

PATCH  /api/v2/bills/7

Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "purchase_order",
    "attributes": {},
    "relationships": {
      "purchase_order": {
        "data": {
          "type": "purchase_orders",
          "id": "0"
        }
      }
    }
  }
}
Responses422
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "errors": [
    {
      "status": "422",
      "code": "invalid_attribute",
      "title": "Invalid Attribute",
      "detail": "attribute is invalid",
      "source": {
        "pointer": "data/attributes/purchase_order"
      }
    }
  ]
}

Update a bill
PATCH/api/v2/bills/{id}

URI Parameters
HideShow
id
number (required) Example: 1

purchase order id


DELETE /api/v2/bills/1
Requestsdeletes bill

DELETE  /api/v2/bills/8

Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Responses204
This response has no content.

Deletes a bill
DELETE/api/v2/bills/{id}

URI Parameters
HideShow
id
number (required) Example: 1

purchase order id


Generated by aglio on 01 Aug 2025