openapi: 3.2.0 info: title: LeafLink Sales Invoices API version: '2022-10-31' description: 'This reference specification outlines all the available HTTP operations of the LeafLink API. See the [LeafLink Developer Hub](/api) for guides, how-to, and general information of the API. ' termsOfService: https://www.leaflink.com/terms-and-conditions/ contact: email: support@leaflink.com servers: - url: https://api.leaflink.com description: LeafLink API production URL. - url: https://staging-api.leaflink.com description: LeafLink API staging URL. security: - bearerAuth: [] tags: - name: sales_invoices paths: /sales_invoices: get: operationId: sales_invoices_list parameters: - in: query name: created_date_from schema: type: string format: date - in: query name: created_date_to schema: type: string format: date - name: ordering required: false in: query description: Which field to use when ordering the results. schema: type: string - name: page required: false in: query description: A page number within the paginated result set. schema: type: integer - name: page_size required: false in: query description: Number of results to return per page. schema: type: integer - name: search required: false in: query description: A search term. schema: type: string - name: LeafLink-Version description: '[API version docs](/api/getting-started/#versioning)' required: false in: header schema: type: string format: date tags: - sales_invoices security: - bearerAuth: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/PaginatedUnifiedOrderAsSalesInvoiceList' description: '' headers: RateLimit-Limit: schema: type: integer description: The requests quota in the time window. RateLimit-Remaining: schema: type: integer description: The remaining requests quota in the current window. RateLimit-Reset: schema: type: integer description: The time remaining in the current window, specified in seconds. RateLimit-Policy: schema: type: string description: The quota policy information. '429': description: Rate Limit Error headers: Retry-After: schema: type: integer description: The time remaining before the rejected request can be tried again, specified in seconds. /sales_invoices/{id}: get: operationId: sales_invoices_retrieve parameters: - in: path name: id schema: type: integer description: A unique integer value identifying this order. required: true - name: LeafLink-Version description: '[API version docs](/api/getting-started/#versioning)' required: false in: header schema: type: string format: date tags: - sales_invoices security: - bearerAuth: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/UnifiedOrderAsSalesInvoice' description: '' headers: RateLimit-Limit: schema: type: integer description: The requests quota in the time window. RateLimit-Remaining: schema: type: integer description: The remaining requests quota in the current window. RateLimit-Reset: schema: type: integer description: The time remaining in the current window, specified in seconds. RateLimit-Policy: schema: type: string description: The quota policy information. '429': description: Rate Limit Error headers: Retry-After: schema: type: integer description: The time remaining before the rejected request can be tried again, specified in seconds. components: schemas: PaginatedUnifiedOrderAsSalesInvoiceList: type: object required: - count - results properties: count: type: integer example: 123 next: type: - string - 'null' format: uri example: http://api.example.org/accounts/?page=4 previous: type: - string - 'null' format: uri example: http://api.example.org/accounts/?page=2 results: type: array items: $ref: '#/components/schemas/UnifiedOrderAsSalesInvoice' UnifiedOrderedProductAsInvoiceLineItem: type: object properties: description: type: string name: type: string quantity: type: string format: decimal pattern: ^-?\d{0,16}(?:\.\d{0,4})?$ description: The number of units ordered ordered_unit_price: type: string format: decimal pattern: ^-?\d{0,8}(?:\.\d{0,2})?$ description: The price at the time of order. required: - description - name - quantity UnifiedOrderAsSalesInvoice: type: object description: 'Base serializer class to rename created_on and modified fields to follow new naming standard of created_date and modified_date' properties: id: type: integer readOnly: true created_date: type: string format: date-time readOnly: true description: Date and time the resource was created modified_date: type: string format: date-time readOnly: true description: Date and time of the last edit paid_date: type: - string - 'null' format: date description: Date the Order is fully paid buyer: $ref: '#/components/schemas/UnifiedInvoiceCustomer' total: type: string format: decimal pattern: ^-?\d{0,8}(?:\.\d{0,2})?$ description: Order total order: type: string payment_due_date: type: - string - 'null' format: date-time description: Date that the Payment is due ship_date: type: - string - 'null' format: date-time description: Date the Order is shipped balance: type: string format: decimal pattern: ^-?\d{0,10}(?:\.\d{0,2})?$ line_items: type: array items: $ref: '#/components/schemas/UnifiedOrderedProductAsInvoiceLineItem' required: - balance - buyer - created_date - id - line_items - modified_date - order UnifiedInvoiceCustomer: type: object properties: name: type: string description: Name of Company (Note this is not the same as Brand) maxLength: 400 id: type: integer readOnly: true required: - id - name securitySchemes: bearerAuth: type: http scheme: bearer bearerFormat: JWT description: 'Authentication is done via access tokens (JWTs). See the [API authentication doc](/api/getting-started/#authentication) for more information. ' tokenAuth: type: apiKey in: header name: Authorization description: Token-based authentication with required prefix "Token"