Cofactr Platform API
  1. Purchases
Cofactr Platform API
  • BOMs
    • Gets Boms that user has read access to
      GET
    • Creates a Bom using Cofactr Data
      POST
    • Creates a Bom using raw bomline data and performs searches to convert into Cofactr Data
      POST
    • Gets a Bom
      GET
    • Upsert BOM Async
      PUT
    • Updates a Bom
      PATCH
    • Deletes a Bom if still unapproved. Archives a bom if approved.
      DELETE
    • Approves an unapproved Bom.
      POST
    • Gets Bom Lines on a Bom.
      GET
    • Creates a new bomline on a Bom using Cofactr data. If a bomline with the provided part exists it will sum the quants instead of duplicating lines.
      POST
    • Gets a BomLine
      GET
    • Updates a BomLine
      PATCH
    • Removes a Bomline from a Bom.
      DELETE
    • Attempts to create a new Bomline using raw data and performs searches to convert into Cofactr Data. If a Bomline with the same part and refdes exists it will sum the quants instead of duplicating lines.
      POST
  • Programs
    • Gets Programs
    • Creates a Program
    • Gets a Program
    • Updates a Program
    • Deletes a Program
    • Gets Program Availabilities
    • Gets Program Availabilities Async
    • Gets Program Reference Pricing
    • Get Programs Lines
    • Get Programs Line
    • Update Programs Line
    • Delete Programs Line
    • Create Programs Lines
    • Get Program Part Overrides
    • Create Program Part Overrides
    • Get Program Part Override
    • Update Program Part Override
    • Delete Program Part Override
  • Account
    • Sub Org
      • List Sub Orgs
      • Get Sub Org
      • Update Sub Org
      • Create Sub Org
    • Get Org
    • Get Users
    • Get User
  • Reporting
    • Customer SQL Query
  • Email
    • Mark Outbound Email as Sent
    • Create Outbound Email
    • Get Outbound Email
  • Auth
    • Update API Key
  • Async Jobs
    • Get Async Job Status
  • Stock Documents
    • List StockDocuments
    • Get StockDocument
    • Download StockDocument
    • Create StockDocument
  • Suppliers
    • Create Supplier
    • Update Supplier
    • Get Supplier
    • Get Suppliers
  • Parts
    • Async Create Parts
    • Async Upsert Parts
    • Get Part
  • Purchases
    • Get Purchase Order
      GET
    • Create Purchase Order
      POST
    • Update Purchase Order
      PATCH
    • Delete Purchase Order
      DELETE
    • Get Purchase Lines
      GET
    • Get Purchase Line
      GET
    • Create Purchase Line
      POST
    • Update Many Purchase Lines
      PATCH
    • Delete Purchase Line
      DELETE
    • Get NoPart Purchase Lines
      GET
    • Create NoPart Purchase Line
      POST
    • Update Many NoPart Purchase Lines
      PATCH
    • Delete NoPart Purchase Line
      DELETE
    • Create Purchase Event
      POST
    • Update Supplier Bill
      PATCH
    • Update Supplier Bill Line
      PATCH
    • Create Supplier Bill
      POST
    • Create Supplier Bill Line
      POST
  • Teams
    • Get Teams
    • Create Team
    • Get Team
    • Update Team
    • Delete Team
    • Archive Team
    • Unarchive Team
    • Get Team Types
    • Create Team Type
    • Get Team Type
    • Update Team Type
    • Delete Team Type
  • Custom Properties
    • Get Custom Properties
    • Create Custom Property
    • Update Custom Property
    • Get Custom Property
  • Stock Lots
    • Updates a StockLot
    • Upsert Part Stock
  • Tags
    • Get tags
    • Create tag
    • Get tag
    • Update tag
  • Rfqs
    • Create Rfq
    • Update Rfq
  • RfqLines
    • Create RfqLine
    • Update RfqLine
  • SupplierQuote
    • Create Supplier Quote
    • Update Supplier Quote
  • SupplierQuoteLines
    • Create Supplier Quote Line
    • Update Supplier Quote Line
  1. Purchases

Create Purchase Event

Testing
POST
/v1/purchase_events/
Creates purchase events for Customer API

Request

Authorization
Add parameter in header
Authorization
Example:
Authorization: ********************
Header Params
x-org-id
string 
optional
Body Params application/json
synced_from_integration
boolean 
Synced from integration
optional
integration_source_name
string 
Integration source name
optional
integration_record_id
string 
Integration record id
optional
synced_from_integration_at
string <date-time>
Synced from integration at
optional
purchase_lines
array[string <uuid>]
required
quantity
integer 
Quantity
optional
notes
string 
Notes
optional
tracking_number
string 
Tracking number
optional
line_total_paid
string <decimal>
Line total paid
optional
sales_tax_paid
string <decimal>
Sales tax paid
optional
shipping_paid
string <decimal>
Shipping paid
optional
other_total_paid
string <decimal>
Other total paid
optional
duties_paid
string <decimal>
Duties paid
optional
estimated_delivery
string <date>
Estimated delivery
optional
expected_ship_by
string <date>
Expected ship by
optional
snoozed_until
string <date>
Snoozed until
optional
coo
string 
Coo
optional
date_code
string 
Date code
optional
mfg_lot
string 
Mfg lot
optional
cofactr_invoice_number
string 
Cofactr invoice number
optional
cofactr_invoice_amount
string <decimal>
Cofactr invoice amount
optional
event_type
enum<string> 
Event type
required
Allowed values:
shippedvoidedcanceledadjustedimporteddelayednotereturn_requestreturnconfirmtrackdividecombineinvoiceddelivereddelivery_attemptreschedule_requestreschedulereceivedignoredsnoozed
divide_quant
integer 
Divide quant
optional
send_alerts
boolean 
Send alerts
optional
Default:
true
Example
{
  "synced_from_integration": true,
  "integration_source_name": "string",
  "integration_record_id": "string",
  "synced_from_integration_at": "2019-08-24T14:15:22Z",
  "purchase_lines": [
    "497f6eca-6276-4993-bfeb-53cbbbba6f08"
  ],
  "quantity": 0,
  "notes": "string",
  "tracking_number": "string",
  "line_total_paid": "string",
  "sales_tax_paid": "string",
  "shipping_paid": "string",
  "other_total_paid": "string",
  "duties_paid": "string",
  "estimated_delivery": "2019-08-24",
  "expected_ship_by": "2019-08-24",
  "snoozed_until": "2019-08-24",
  "coo": "string",
  "date_code": "string",
  "mfg_lot": "string",
  "cofactr_invoice_number": "string",
  "cofactr_invoice_amount": "string",
  "event_type": "shipped",
  "divide_quant": 0,
  "send_alerts": true
}

Request samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST '/v1/purchase_events/' \
--header 'x-org-id;' \
--header 'Content-Type: application/json' \
--header 'Authorization;' \
--data-raw '{
    "synced_from_integration": true,
    "integration_source_name": "string",
    "integration_record_id": "string",
    "synced_from_integration_at": "2019-08-24T14:15:22Z",
    "purchase_lines": [
        "497f6eca-6276-4993-bfeb-53cbbbba6f08"
    ],
    "quantity": 0,
    "notes": "string",
    "tracking_number": "string",
    "line_total_paid": "string",
    "sales_tax_paid": "string",
    "shipping_paid": "string",
    "other_total_paid": "string",
    "duties_paid": "string",
    "estimated_delivery": "2019-08-24",
    "expected_ship_by": "2019-08-24",
    "snoozed_until": "2019-08-24",
    "coo": "string",
    "date_code": "string",
    "mfg_lot": "string",
    "cofactr_invoice_number": "string",
    "cofactr_invoice_amount": "string",
    "event_type": "shipped",
    "divide_quant": 0,
    "send_alerts": true
}'

Responses

🟢200Success
application/json
Body
id
string <uuid>
Id
read-onlyoptional
synced_from_integration
boolean 
Synced from integration
read-onlyoptional
synced_from_integration_at
string <date-time>
Synced from integration at
read-onlyoptional
integration_source_name
string 
Integration source name
read-onlyoptional
>= 1 characters
integration_record_id
string 
Integration record id
read-onlyoptional
>= 1 characters
quantity
integer 
Quantity
required
cofactr_invoice_number
string 
Cofactr invoice number
required
>= 1 characters
cofactr_invoice_amount
string <decimal>
Cofactr invoice amount
required
created_at
string <date-time>
Created at
read-onlyoptional
updated_at
string <date-time>
Updated at
read-onlyoptional
deleted_at
string <date-time>
Deleted at
optional
internal_metadata
object 
Internal metadata
optional
external_metadata
object 
External metadata
optional
ext_data_source_id
string 
Ext data source id
optional
The ID of this record in the external system.
<= 255 characters
data_source
string 
Data source
optional
Where this record originated from. Null indicates normal Flagship operation, otherwise refers to input integration source.
<= 255 characters
data_source_synced_at
string <date-time>
Data source synced at
optional
When this record was last synced with the data source.
externally_synced
boolean 
Externally synced
optional
Whether this record has been synced with an external system. If true, this record cannot be edited in Flagship.
quant
integer 
Quant
optional
>= -2147483648<= 2147483647
notes
string 
Notes
optional
timestamp
string <date-time>
Timestamp
required
tracking_number
string 
Tracking number
optional
<= 255 characters
carrier
string 
Carrier
optional
<= 255 characters
invoice_number
string 
Invoice number
optional
<= 255 characters
invoice_amount
string <decimal>
Invoice amount
optional
line_total_paid
string <decimal>
Line total paid
optional
sales_tax_paid
string <decimal>
Sales tax paid
optional
shipping_paid
string <decimal>
Shipping paid
optional
other_total_paid
string <decimal>
Other total paid
optional
duties_paid
string <decimal>
Duties paid
optional
estimated_delivery
string <date>
Estimated delivery
optional
snoozed_until
string <date>
Snoozed until
optional
event_type
enum<string> 
Event type
required
Allowed values:
shippedvoidedcanceledadjustedimporteddelayednotereturn_requestreturnconfirmtrackdividecombineinvoiceddelivereddelivery_attemptreschedule_requestreschedulereceivedignoredsnoozed
tracking_status
string 
Tracking status
optional
<= 32 characters
purchase
string <uuid>
Purchase
required
org
string <uuid>
Org
optional
created_by
string <uuid>
Created by
optional
purchase_lines
array[string <uuid>]
optional
Example
{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "synced_from_integration": true,
  "synced_from_integration_at": "2019-08-24T14:15:22Z",
  "integration_source_name": "string",
  "integration_record_id": "string",
  "quantity": 0,
  "cofactr_invoice_number": "string",
  "cofactr_invoice_amount": "string",
  "created_at": "2019-08-24T14:15:22Z",
  "updated_at": "2019-08-24T14:15:22Z",
  "deleted_at": "2019-08-24T14:15:22Z",
  "internal_metadata": {},
  "external_metadata": {},
  "ext_data_source_id": "string",
  "data_source": "string",
  "data_source_synced_at": "2019-08-24T14:15:22Z",
  "externally_synced": true,
  "quant": -2147483648,
  "notes": "string",
  "timestamp": "2019-08-24T14:15:22Z",
  "tracking_number": "string",
  "carrier": "string",
  "invoice_number": "string",
  "invoice_amount": "string",
  "line_total_paid": "string",
  "sales_tax_paid": "string",
  "shipping_paid": "string",
  "other_total_paid": "string",
  "duties_paid": "string",
  "estimated_delivery": "2019-08-24",
  "snoozed_until": "2019-08-24",
  "event_type": "shipped",
  "tracking_status": "string",
  "purchase": "ca27f506-c3a4-4924-9878-316d53640467",
  "org": "3b4eb1f5-aaca-43c1-9ccf-5bbd44308aba",
  "created_by": "ee824cad-d7a6-4f48-87dc-e8461a9201c4",
  "purchase_lines": [
    "497f6eca-6276-4993-bfeb-53cbbbba6f08"
  ]
}
Modified at 2024-09-26 00:10:05
Previous
Delete NoPart Purchase Line
Next
Update Supplier Bill
Built with