Agicap Purchase Orders API

The Purchase Orders API from Agicap — 3 operation(s) for purchase orders.

OpenAPI Specification

agicap-purchase-orders-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  contact: {}
  title: Clients AR Account reports Purchase Orders API
  version: v1
servers:
- url: https://api.agicap.com
- url: https://api.agicap.internal
tags:
- name: Purchase Orders
paths:
  /public/business-documents/v1/entities/{entityid}/connections/{connectionid}/purchase-orders:
    get:
      operationId: PurchaseOrder_GetPurchaseOrders
      parameters:
      - description: Agicap entity unique identifier
        in: path
        name: entityid
        required: true
        schema:
          description: Agicap entity unique identifier
          type: string
      - description: The connection unique identifier
        in: path
        name: connectionid
        required: true
        schema:
          description: The connection unique identifier
          format: uuid
          type: string
      - description: Number of items per page (max 10 000)
        in: query
        name: pagesize
        schema:
          description: Number of items per page (max 10 000)
          format: int32
          type: integer
      - description: Page index
        in: query
        name: pageindex
        schema:
          description: Page index
          format: int32
          type: integer
      - description: Unique identifier of the document in the data source
        explode: false
        in: query
        name: externalids
        schema:
          description: Unique identifier of the document in the data source
          items:
            type: string
          type: array
        style: form
      - description: Will return only documents updated **after** this date
        in: query
        name: updatedsince
        schema:
          description: Will return only documents updated **after** this date
          format: date-time
          type: string
      - description: 'Filter on status. Possible values : draft, sent, accepted, refused, expired, partiallyinvoiced, invoiced, cancelled, deleted'
        explode: false
        in: query
        name: status
        schema:
          description: 'Filter on status. Possible values : draft, sent, accepted, refused, expired, partiallyinvoiced, invoiced, cancelled, deleted'
          items:
            type: string
          type: array
        style: form
      responses:
        '200':
          content:
            application/json:
              example:
                items:
                - amounts:
                    remainingAmount: 80
                    taxesAmount: 20
                    totalAmount: 200
                  counterParty:
                    id: id
                    name: counter party name
                  currency: EUR
                  deliveryDate: null
                  dueDate: '2025-03-07T14:30:10+00:00'
                  erpIdentificationFields:
                    erp field 1: value 1
                    erp field 2: value 2
                  externalId: Some External Id
                  id: d062b351-99ac-413a-9bf9-509498499a18
                  issueDate: '2024-02-06T14:30:10+00:00'
                  label: purchase order label
                  metadata:
                    additional field: additional info
                  purchaseOrderNumber: '00341001'
                  status: accepted
                pagination:
                  pageIndex: 1
                  pageItemsCount: 7
                  pageSize: 10
                  totalItemsCount: 7
              schema:
                $ref: '#/components/schemas/PurchaseOrderDtoPageDto'
          description: Purchase orders
        '401':
          description: Unauthorized request.
        '403':
          description: Forbidden request.
        '429':
          description: Too many requests. Please try again later.
        '500':
          content:
            application/problem+json:
              schema:
                properties:
                  detail:
                    description: Details of the error
                    nullable: true
                    type: string
                  instance:
                    nullable: true
                    type: string
                  status:
                    description: Code status
                    nullable: true
                    type: integer
                  title:
                    description: Name of the error
                    nullable: true
                    type: string
                  type:
                    description: Type of error
                    nullable: true
                    type: string
                type: object
          description: An internal server occurred.
      security:
      - bearer_client_credentials:
        - agicap:public-api
      - bearer_client_credentials:
        - agicap:public-api
      - bearerAuth: []
      summary: Get purchase orders
      tags:
      - Purchase Orders
    post:
      operationId: PurchaseOrder_CreatePurchaseOrders
      parameters:
      - description: Agicap entity unique identifier
        in: path
        name: entityid
        required: true
        schema:
          description: Agicap entity unique identifier
          type: string
      - description: The connection unique identifier
        in: path
        name: connectionid
        required: true
        schema:
          description: The connection unique identifier
          format: uuid
          type: string
      requestBody:
        content:
          application/*+json:
            example:
            - amounts:
                remainingAmount: 80
                taxesAmount: 20
                totalAmount: 200
              counterParty:
                id: id
                name: counter party name
              currency: EUR
              deliveryDate: null
              dueDate: '2025-03-07T14:30:10+00:00'
              erpIdentificationFields:
                erp field 1: value 1
                erp field 2: value 2
              externalId: Some External Id
              issueDate: '2024-02-06T14:30:10+00:00'
              label: purchase order label
              metadata:
                additional field: additional info
              purchaseOrderNumber: '00341001'
              status: accepted
            schema:
              items:
                $ref: '#/components/schemas/CreatePurchaseOrderDto'
              type: array
          application/json:
            example:
            - amounts:
                remainingAmount: 80
                taxesAmount: 20
                totalAmount: 200
              counterParty:
                id: id
                name: counter party name
              currency: EUR
              deliveryDate: null
              dueDate: '2025-03-07T14:30:10+00:00'
              erpIdentificationFields:
                erp field 1: value 1
                erp field 2: value 2
              externalId: Some External Id
              issueDate: '2024-02-06T14:30:10+00:00'
              label: purchase order label
              metadata:
                additional field: additional info
              purchaseOrderNumber: '00341001'
              status: accepted
            schema:
              items:
                $ref: '#/components/schemas/CreatePurchaseOrderDto'
              type: array
          text/json:
            example:
            - amounts:
                remainingAmount: 80
                taxesAmount: 20
                totalAmount: 200
              counterParty:
                id: id
                name: counter party name
              currency: EUR
              deliveryDate: null
              dueDate: '2025-03-07T14:30:10+00:00'
              erpIdentificationFields:
                erp field 1: value 1
                erp field 2: value 2
              externalId: Some External Id
              issueDate: '2024-02-06T14:30:10+00:00'
              label: purchase order label
              metadata:
                additional field: additional info
              purchaseOrderNumber: '00341001'
              status: accepted
            schema:
              items:
                $ref: '#/components/schemas/CreatePurchaseOrderDto'
              type: array
      responses:
        '201':
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/CreatedDocumentDto'
                type: array
          description: Ids of the created documents, associated with the provided external identifiers
        '401':
          description: Unauthorized request.
        '403':
          description: Forbidden request.
        '429':
          description: Too many requests. Please try again later.
        '500':
          content:
            application/problem+json:
              schema:
                properties:
                  detail:
                    description: Details of the error
                    nullable: true
                    type: string
                  instance:
                    nullable: true
                    type: string
                  status:
                    description: Code status
                    nullable: true
                    type: integer
                  title:
                    description: Name of the error
                    nullable: true
                    type: string
                  type:
                    description: Type of error
                    nullable: true
                    type: string
                type: object
          description: An internal server occurred.
      security:
      - bearer_client_credentials:
        - agicap:public-api
      - bearer_client_credentials:
        - agicap:public-api
      - bearerAuth: []
      summary: Create purchase orders
      tags:
      - Purchase Orders
    put:
      operationId: PurchaseOrder_UpdatePurchaseOrders
      parameters:
      - description: Agicap entity unique identifier
        in: path
        name: entityid
        required: true
        schema:
          description: Agicap entity unique identifier
          type: string
      - description: The connection unique identifier
        in: path
        name: connectionid
        required: true
        schema:
          description: The connection unique identifier
          format: uuid
          type: string
      requestBody:
        content:
          application/*+json:
            schema:
              items:
                $ref: '#/components/schemas/UpdatePurchaseOrderDto'
              type: array
          application/json:
            schema:
              items:
                $ref: '#/components/schemas/UpdatePurchaseOrderDto'
              type: array
          text/json:
            schema:
              items:
                $ref: '#/components/schemas/UpdatePurchaseOrderDto'
              type: array
      responses:
        '401':
          description: Unauthorized request.
        '403':
          description: Forbidden request.
        '429':
          description: Too many requests. Please try again later.
        '500':
          content:
            application/problem+json:
              schema:
                properties:
                  detail:
                    description: Details of the error
                    nullable: true
                    type: string
                  instance:
                    nullable: true
                    type: string
                  status:
                    description: Code status
                    nullable: true
                    type: integer
                  title:
                    description: Name of the error
                    nullable: true
                    type: string
                  type:
                    description: Type of error
                    nullable: true
                    type: string
                type: object
          description: An internal server occurred.
      security:
      - bearer_client_credentials:
        - agicap:public-api
      - bearer_client_credentials:
        - agicap:public-api
      - bearerAuth: []
      summary: Update purchase orders
      tags:
      - Purchase Orders
  /public/business-documents/v2/entities/{entityid}/connections/{connectionid}/purchase-orders:
    get:
      operationId: PurchaseOrder_GetPurchaseOrdersV2
      parameters:
      - description: Agicap entity unique identifier
        in: path
        name: entityid
        required: true
        schema:
          description: Agicap entity unique identifier
          type: string
      - description: The connection unique identifier
        in: path
        name: connectionid
        required: true
        schema:
          description: The connection unique identifier
          format: uuid
          type: string
      - description: Number of items per page (max 10 000)
        in: query
        name: pagesize
        schema:
          description: Number of items per page (max 10 000)
          format: int32
          type: integer
      - description: Page index
        in: query
        name: pageindex
        schema:
          description: Page index
          format: int32
          type: integer
      - description: Unique identifier of the document in the data source
        explode: false
        in: query
        name: externalids
        schema:
          description: Unique identifier of the document in the data source
          items:
            type: string
          type: array
        style: form
      - description: Will return only documents updated **after** this date
        in: query
        name: updatedsince
        schema:
          description: Will return only documents updated **after** this date
          format: date-time
          type: string
      - description: 'Filter on status. Possible values : draft, sent, accepted, refused, expired, partiallyinvoiced, invoiced, cancelled, deleted'
        explode: false
        in: query
        name: status
        schema:
          description: 'Filter on status. Possible values : draft, sent, accepted, refused, expired, partiallyinvoiced, invoiced, cancelled, deleted'
          items:
            type: string
          type: array
        style: form
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PurchaseOrderDtoV2PageDto'
          description: Purchase orders
        '401':
          description: Unauthorized request.
        '403':
          description: Forbidden request.
        '429':
          description: Too many requests. Please try again later.
        '500':
          content:
            application/problem+json:
              schema:
                properties:
                  detail:
                    description: Details of the error
                    nullable: true
                    type: string
                  instance:
                    nullable: true
                    type: string
                  status:
                    description: Code status
                    nullable: true
                    type: integer
                  title:
                    description: Name of the error
                    nullable: true
                    type: string
                  type:
                    description: Type of error
                    nullable: true
                    type: string
                type: object
          description: An internal server occurred.
      security:
      - bearer_client_credentials:
        - agicap:public-api
      - bearer_client_credentials:
        - agicap:public-api
      - bearerAuth: []
      summary: Get purchase orders
      tags:
      - Purchase Orders
    post:
      operationId: PurchaseOrder_CreatePurchaseOrdersV2
      parameters:
      - description: Agicap entity unique identifier
        in: path
        name: entityid
        required: true
        schema:
          description: Agicap entity unique identifier
          type: string
      - description: The connection unique identifier
        in: path
        name: connectionid
        required: true
        schema:
          description: The connection unique identifier
          format: uuid
          type: string
      requestBody:
        content:
          application/*+json:
            example:
            - amounts:
                remainingAmount: 80
                taxesAmount: 20
                totalAmount: 200
              counterParty:
                id: id
                name: counter party name
              currency: EUR
              deliveryDate: null
              dueDate: '2025-03-07T14:30:10+00:00'
              erpIdentificationFields:
                erp field 1: value 1
                erp field 2: value 2
              externalId: Some External Id
              issueDate: '2024-02-06T14:30:10+00:00'
              label: purchase order label
              lineItems: null
              metadata:
                additional field: additional info
              purchaseOrderNumber: '00341001'
              status: accepted
            schema:
              items:
                $ref: '#/components/schemas/CreatePurchaseOrderDtoV2'
              type: array
          application/json:
            example:
            - amounts:
                remainingAmount: 80
                taxesAmount: 20
                totalAmount: 200
              counterParty:
                id: id
                name: counter party name
              currency: EUR
              deliveryDate: null
              dueDate: '2025-03-07T14:30:10+00:00'
              erpIdentificationFields:
                erp field 1: value 1
                erp field 2: value 2
              externalId: Some External Id
              issueDate: '2024-02-06T14:30:10+00:00'
              label: purchase order label
              lineItems: null
              metadata:
                additional field: additional info
              purchaseOrderNumber: '00341001'
              status: accepted
            schema:
              items:
                $ref: '#/components/schemas/CreatePurchaseOrderDtoV2'
              type: array
          text/json:
            example:
            - amounts:
                remainingAmount: 80
                taxesAmount: 20
                totalAmount: 200
              counterParty:
                id: id
                name: counter party name
              currency: EUR
              deliveryDate: null
              dueDate: '2025-03-07T14:30:10+00:00'
              erpIdentificationFields:
                erp field 1: value 1
                erp field 2: value 2
              externalId: Some External Id
              issueDate: '2024-02-06T14:30:10+00:00'
              label: purchase order label
              lineItems: null
              metadata:
                additional field: additional info
              purchaseOrderNumber: '00341001'
              status: accepted
            schema:
              items:
                $ref: '#/components/schemas/CreatePurchaseOrderDtoV2'
              type: array
      responses:
        '201':
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/CreatedDocumentDto'
                type: array
          description: Ids of the created documents, associated with the provided external identifiers
        '401':
          description: Unauthorized request.
        '403':
          description: Forbidden request.
        '429':
          description: Too many requests. Please try again later.
        '500':
          content:
            application/problem+json:
              schema:
                properties:
                  detail:
                    description: Details of the error
                    nullable: true
                    type: string
                  instance:
                    nullable: true
                    type: string
                  status:
                    description: Code status
                    nullable: true
                    type: integer
                  title:
                    description: Name of the error
                    nullable: true
                    type: string
                  type:
                    description: Type of error
                    nullable: true
                    type: string
                type: object
          description: An internal server occurred.
      security:
      - bearer_client_credentials:
        - agicap:public-api
      - bearer_client_credentials:
        - agicap:public-api
      - bearerAuth: []
      summary: Create purchase orders
      tags:
      - Purchase Orders
    put:
      operationId: PurchaseOrder_UpdatePurchaseOrdersV2
      parameters:
      - description: Agicap entity unique identifier
        in: path
        name: entityid
        required: true
        schema:
          description: Agicap entity unique identifier
          type: string
      - description: The connection unique identifier
        in: path
        name: connectionid
        required: true
        schema:
          description: The connection unique identifier
          format: uuid
          type: string
      requestBody:
        content:
          application/*+json:
            example:
            - amounts:
                remainingAmount: 80
                taxesAmount: 20
                totalAmount: 200
              counterParty:
                id: id
                name: counter party name
              currency: EUR
              deliveryDate: null
              dueDate: '2025-03-07T14:30:10+00:00'
              erpIdentificationFields:
                erp field 1: value 1
                erp field 2: value 2
              externalId: Some External Id
              id: d062b351-99ac-413a-9bf9-509498499a18
              issueDate: '2024-02-06T14:30:10+00:00'
              label: purchase order label
              lineItems: null
              metadata:
                additional field: additional info
              purchaseOrderNumber: '00341001'
              status: accepted
            schema:
              items:
                $ref: '#/components/schemas/UpdatePurchaseOrderDtoV2'
              type: array
          application/json:
            example:
            - amounts:
                remainingAmount: 80
                taxesAmount: 20
                totalAmount: 200
              counterParty:
                id: id
                name: counter party name
              currency: EUR
              deliveryDate: null
              dueDate: '2025-03-07T14:30:10+00:00'
              erpIdentificationFields:
                erp field 1: value 1
                erp field 2: value 2
              externalId: Some External Id
              id: d062b351-99ac-413a-9bf9-509498499a18
              issueDate: '2024-02-06T14:30:10+00:00'
              label: purchase order label
              lineItems: null
              metadata:
                additional field: additional info
              purchaseOrderNumber: '00341001'
              status: accepted
            schema:
              items:
                $ref: '#/components/schemas/UpdatePurchaseOrderDtoV2'
              type: array
          text/json:
            example:
            - amounts:
                remainingAmount: 80
                taxesAmount: 20
                totalAmount: 200
              counterParty:
                id: id
                name: counter party name
              currency: EUR
              deliveryDate: null
              dueDate: '2025-03-07T14:30:10+00:00'
              erpIdentificationFields:
                erp field 1: value 1
                erp field 2: value 2
              externalId: Some External Id
              id: d062b351-99ac-413a-9bf9-509498499a18
              issueDate: '2024-02-06T14:30:10+00:00'
              label: purchase order label
              lineItems: null
              metadata:
                additional field: additional info
              purchaseOrderNumber: '00341001'
              status: accepted
            schema:
              items:
                $ref: '#/components/schemas/UpdatePurchaseOrderDtoV2'
              type: array
      responses:
        '401':
          description: Unauthorized request.
        '403':
          description: Forbidden request.
        '429':
          description: Too many requests. Please try again later.
        '500':
          content:
            application/problem+json:
              schema:
                properties:
                  detail:
                    description: Details of the error
                    nullable: true
                    type: string
                  instance:
                    nullable: true
                    type: string
                  status:
                    description: Code status
                    nullable: true
                    type: integer
                  title:
                    description: Name of the error
                    nullable: true
                    type: string
                  type:
                    description: Type of error
                    nullable: true
                    type: string
                type: object
          description: An internal server occurred.
      security:
      - bearer_client_credentials:
        - agicap:public-api
      - bearer_client_credentials:
        - agicap:public-api
      - bearerAuth: []
      summary: Update purchase orders
      tags:
      - Purchase Orders
  /public/invoices-management/v1/entities/{entityId}/purchase-orders:
    post:
      description: 'Use this endpoint to retrieve the full details of purchase orders linked to invoices, from a list of purchase order IDs. It returns header information, order and delivery statuses, line items with ordered, delivered and billed quantities, and the list of associated delivery notes.

        This data is typically used alongside the invoice export to provide ERPs with the delivery references needed to finalize the 3-way matching and close orders upon invoice creation.'
      operationId: post_public-api/invoices-management/v1/entities/{entityid}/purchase-orders
      parameters:
      - description: The entity identifier.
        in: path
        name: entityId
        required: true
        schema:
          format: int32
          type: integer
      requestBody:
        content:
          application/*+json:
            schema:
              allOf:
              - $ref: '#/components/schemas/InvoicesManagement.Web.Controllers.PublicApi.Dto.PurchaseOrderQueryDto'
          application/json:
            schema:
              allOf:
              - $ref: '#/components/schemas/InvoicesManagement.Web.Controllers.PublicApi.Dto.PurchaseOrderQueryDto'
          text/json:
            schema:
              allOf:
              - $ref: '#/components/schemas/InvoicesManagement.Web.Controllers.PublicApi.Dto.PurchaseOrderQueryDto'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InvoicesManagement.Web.Controllers.PublicApi.Responses.PurchaseOrdersResponse'
          description: Your request has been successfully processed.
        '400':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
          description: Your request is invalid.
        '401':
          description: Unauthorized request.
        '403':
          description: Forbidden request.
        '429':
          description: Too many requests. Please try again later.
        '500':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
          description: An internal server occurred.
      security:
      - bearerAuth: []
      summary: List purchase orders
      tags:
      - Purchase Orders
components:
  schemas:
    UpdatePurchaseOrderDto:
      additionalProperties: false
      properties:
        amounts:
          $ref: '#/components/schemas/AmountsWithRemainingAmountDto'
        counterParty:
          $ref: '#/components/schemas/CounterPartyDto'
        currency:
          description: Currency code in ISO 4217 format
          minLength: 1
          type: string
        deliveryDate:
          description: Delivery date in ISO 8601 format
          format: date-time
          nullable: true
          type: string
        dueDate:
          description: Due date in ISO 8601 format
          format: date-time
          nullable: true
          type: string
        erpIdentificationFields:
          additionalProperties:
            type: string
          nullable: true
          type: object
        externalId:
          description: Unique identifier of the document in the source data
          minLength: 1
          type: string
        id:
          description: Unique identifier generated by Agicap
          format: uuid
          type: string
        issueDate:
          description: Issue date in ISO 8601 format
          format: date-time
          nullable: true
          type: string
        label:
          description: Label of the order
          nullable: true
          type: string
        metadata:
          additionalProperties:
            type: string
          description: Additional metadata as a JSON Object
          nullable: true
          type: object
        purchaseOrderNumber:
          description: Document number in the source data
          nullable: true
          type: string
        status:
          description: 'Possible values : draft, sent, accepted, refused, expired, partiallyinvoiced, invoiced, cancelled, deleted'
          minLength: 1
          type: string
      required:
      - amounts
      - currency
      - externalId
      - id
      - status
      title: UpdatePurchaseOrder
      type: object
    InvoicesManagement.Web.Controllers.PublicApi.Dto.PurchaseOrderQueryDto:
      additionalProperties: false
      properties:
        purchaseOrderIds:
          items:
            format: uuid
            type: string
          type: array
      required:
      - purchaseOrderIds
      type: object
    CounterPartyDtoV2:
      additionalProperties: false
      properties:
        id:
          description: Unique identifier of the linked Counterpart (Supplier / Client) in the source data
          minLength: 1
          type: string
        name:
          description: Name of the linked Counterpart (Supplier / Client)
          minLength: 1
          type: string
      required:
      - id
      - name
      title: CounterParty
      type: object
    PurchaseOrderDtoV2PageDto:
      additionalProperties: false
      properties:
        items:
          items:
            $ref: '#/components/schemas/PurchaseOrderDtoV2'
          type: array
        pagination:
          $ref: '#/components/schemas/PaginationMetadataDto'
      title: Page
      type: object
    CreatedDocumentDto:
      additionalProperties: false
      properties:
        externalId:
          type: string
        id:
          format: uuid
          type: string
      title: CreatedDocument
      type: object
    CreatePurchaseOrderDtoV2:
      additionalProperties: false
      properties:
        amounts:
          $ref: '#/components/schemas/AmountsWithRemainingAmountDtoV2'
        counterParty:
          $ref: '#/components/schemas/CounterPartyDtoV2'
        currency:
          description: Currency code in ISO 4217 format
          minLength: 1
          type: string
        deliveryDate:
          description: Delivery date in ISO 8601 format
          format: date-time
          nullable: true
          type: string
        dueDate:
          description: Due date in ISO 8601 format
          format: date-time
          type: string
        erpIdentificationFields:
          additionalProperties:
            type: string
          nullable: true
          type: object
        externalId:
          description: Unique identifier of the document in the source data
          minLength: 1
          type: string
        issueDate:
          description: Issue date in ISO 8601 format
          format: date-time
          type: string
        label:
          description: Label of the document
          nullable: true
          type: string
        lineItems:
          description: Article line items of the purchase order. Optional.
          items:

# --- truncated at 32 KB (51 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/agicap/refs/heads/main/openapi/agicap-purchase-orders-api-openapi.yml