/create-sched/

Purpose
Allows users to create a schedule, and the invoices that make up the schedule.
Header Information
The following Authorization keys need to be added to any API call header.
Auth-FactorID: an ID provided by FactorCloud to the Factor who owns the instance of FactorCloud.
Auth-SystemKey: A Key to Identify the specific system.
Auth-APIKey: An API password.
HTTP Methods
Accepts POST requests.
URI
/api_factor/create-sched/
Body Information
The body is a JSON Object with the following paramaters:
Main Schedule:
Variable Name Type Required Purpose
ClientKey String Y The unique identifier for a client in system.
Amount Float Y The sum of Invoices for the schedule, must be >0
InvoiceArray JSON[] Y An array of at least one invoice object. The Invoice Object is described in the table below.
Label String Optional space to include a label.
Notes String Optional space to include extra information
PaymentMethod String Y The method the schedule’s advance should be paid by, either by ACH “A”, Wire “W”, or Check “C”
IntegrationBatchId String Y The unique Identifier for the schedule.
Invoice Objects:
Variable Name Type Required Purpose
DebtorKey String Y The unique identifier for a debtor in system
InvoiceDate Date The date on which the invoice was created, accepts date in YYYY-MM-DD format, if no date is provided it defaults to today’s date.
InvoiceNumber String Y A unique identifier for an invoice, typically provided with the invoice documentation
InvoiceAr Float Y The AR value of the invoice
RefNum String An optional identifier; could be a BOL reference number or the reference number in a different system.
DueDate Date The date on which the invoice is due; specific due date depends on terms, though is generally 30 days, accepts date in YYYY-MM-DD format, if no date is provided it defaults to today’s date.
InvoiceIntegrationId String Y A unique identifier for an invoice.
DocBase64 String An encoded PDF file, typically invoice documents related to the invoice.
PickupLocation Array An array with the following string values: pickup_location, pickup_address1, pickup_address2, pickup_city, pickup_state, pickup_zip.
AdditionalStops Array An array of arrays, where each field is a string. The fields are "stop_number","stop_classification","location","address1","address2","city","state","zip". Stop number is an incrementing number for each entry in the array, and Stop_classification can either be 'D' for delivery and 'P' for Pickup. Location is an alias for the stop.
DeliveryLocation Array An array with the following string values: dest_location, dest_address1, dest_address2, dest_city, dest_state, dest_zip.
Expected Return
Expected Output: An echo JSON object with the in-system information, this may be different then the information in the API call; and reflects the formatting applied to it when entered into the database. The DocBase64 field will return the length of the String.
Curl Example
Request:
<<<<<<< HEAD
curl -H 'Auth-FactorId: FACTORID' -H 'Auth-SystemKey: SYSTEMKEY' -H 'Auth-ApiKey: APIKEY' --data '{"ClientKey":"EXAMPLE_CLIENT","Amount":"100","InvoiceArray":[{"DebtorKey":"EXAMPLE_DEBTOR","InvoiceDate":"2020-01-01","InvoiceNumber":"Example_1","RefNum":"ExampleA","DueDate":"2020-01-30","InvoiceAr":"100","InvoiceIntegrationId":"ExampleInvoice1"},{"DebtorKey":"EXAMPLE_DEBTOR","InvoiceNumber":"Example_2","InvoiceAr":"250","InvoiceIntegrationId":"ExampleInvoice2"},{"DebtorKey":"EXAMPLE_DEBTOR2","InvoiceNumber":"Example_3","InvoiceAr":"375","InvoiceIntegrationId":"ExampleInvoice3"}],"Label":"Example Label","Notes":"Example Notes","PaymentMethod":"W","IntegrationBatchId":"Example1"}' https://wstest.factorcloud.com/api_factor/create-sched/
=======
{
   curl --location --request POST 'https://EXAMPLE.factorcloud.comapi_factor/create-sched/' \
--header 'Auth-Factorid: EXAMPLE' \
--header 'Auth-Apikey: EXAMPLE' \
--header 'Auth-SystemKey: 1' \
--header 'Content-Type: text/plain' \
--data-raw '{"ClientKey": "EXAMPLE_CLIENT","Amount": "100","InvoiceArray":[{"DebtorKey": "EXAMPLE_DEBTOR","InvoiceDate": "2020-01-01","InvoiceNumber": "Example_1","RefNum": "ExampleA","DueDate": "2020-01-30","InvoiceAr": "100","InvoiceIntegrationId": "ExampleInvoice1"},{"DebtorKey": "EXAMPLE_DEBTOR","InvoiceNumber": "Example_2","InvoiceAr": "250","InvoiceIntegrationId": "ExampleInvoice2"},{"DebtorKey": "EXAMPLE_DEBTOR2","InvoiceNumber": "Example_3","InvoiceAr": "375","InvoiceIntegrationId": "ExampleInvoice3"}],"Label": "Example Label","Notes": "Example Notes","PaymentMethod": "W","IntegrationBatchId": "Example1"}'
}
>>>>>>> 2newcalls
Response:
Header for updated schedule: Status OK 200
Header for newly created schedule: Status Created 201
{
   "message": "200"
}