DocsOrdersCreate

Create Order

Create a new order.

Endpoint

POST ${baseUrl}/orders

Request Body

interface CreateOrderRequest {
  fileIds: string[]
  orderType: 'TRANSCRIPTION' | 'TRANSCRIPTION_FORMATTING' | 'FORMATTING'
  onlyInvoice?: boolean
  jobIds?: Array<{ fileId: string; jobId: string }>
  dueDates?: Array<{ fileId: string; dueDate: string }>
}

When onlyInvoice is true, the server creates the invoice but does not attempt payment, and returns the InvoiceOnlyResponse shape below.

jobIds is optional and applies to TRANSCRIPTION_FORMATTING and FORMATTING orders. Each entry pairs a fileId (which must be present in fileIds) with the client-supplied jobId. The jobId is persisted on the resulting order (clientJobId) and, for organizations with RIS data, used to look up the matching row in the file’s RIS CSV — analogous to entering a Job ID in the dashboard checkout. Entries whose fileId is not in fileIds are ignored.

dueDates is optional and only valid for TRANSCRIPTION_FORMATTING orders. Each entry sets the delivery deadline (deliveryTs and deadlineTs) for one file. dueDate must be an ISO 8601 string (e.g. "2026-05-10T18:00:00.000Z"). Entries whose fileId is not in fileIds are ignored. Sending dueDates with any other orderType returns 400.

Response

When payment is attempted (onlyInvoice omitted or false), the response settles via credits first, then Braintree:

interface CreateOrderResponse {
  success: boolean
  transactionId: string
  paymentMethod: 'CREDITS' | 'CREDITCARD' | 'PAYPAL'
  pp_account: string
  cc_last4: string
  invoice: {
    invoiceId: string
    type: 'TRANSCRIPT' | 'FORMATTING'
    userId: number
    amount: number
    discount: number
    creditsUsed: number
    status: 'PAID'
    transactionId: string
    paymentMethod: 'CREDITS' | 'CREDITCARD' | 'PAYPAL'
    paidBy: number
    itemNumber: string
    options: string
    instructions: string
    orderRate: number
    createdAt: string
    updatedAt: string
  }
}

When onlyInvoice: true, the response is:

interface InvoiceOnlyResponse {
  success: boolean
  message: string
  inv: string // invoiceId
  totalAmount: number
  rates: {
    vb: number // strict verbatim rate
    ro: number // rush order rate
    rd: number // rough draft rate
  }
  discount: number
}

Example Request

const response = await fetch('${baseUrl}/orders', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    Authorization: 'Basic YOUR_API_KEY',
  },
  body: JSON.stringify({
    fileIds: ['abc123', 'def456'],
    orderType: 'TRANSCRIPTION',
  }),
})
 
const data = await response.json()

Example with per-file Job IDs

const response = await fetch('${baseUrl}/orders', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    Authorization: 'Basic YOUR_API_KEY',
  },
  body: JSON.stringify({
    fileIds: ['abc123', 'def456'],
    orderType: 'TRANSCRIPTION_FORMATTING',
    jobIds: [
      { fileId: 'abc123', jobId: '1234' },
      { fileId: 'def456', jobId: '23456' },
    ],
  }),
})

Payment Failures

When payment is attempted (onlyInvoice omitted or false), the order is paid from your account credits first. If the credit balance does not cover the order total, the remaining amount is charged to the payment method on file.

If that card charge is declined, the request fails with HTTP 500 and the message explains the decline, with the reason reported by the card issuer in parentheses:

{
  "message": "Payment was declined by your card issuer (Limit Exceeded). Your card was not charged — keep enough prepaid credits or use a different card, then try again."
}

This is not a Scribie API limit or a rate limit. The parenthesised reason (e.g. Limit Exceeded) comes from the bank that issued the card — for example, the card has reached its spending or per-transaction limit. When this happens the order is not created and the card is not charged, so you can retry the same request once the payment issue is resolved.

To avoid a declined charge:

  • Keep prepaid credits on the account so the card is not charged. Check the balance with GET ${baseUrl}/users/credits before ordering, and top it up with POST ${baseUrl}/users/credits.
  • Ask your bank to raise the card’s limit, or add a different card to the account.
  • Or send onlyInvoice: true to create the invoice without paying, then settle it once credits are available.

Error Codes

Status CodeDescription
201Order Created Successfully
400Invalid Request
401Unauthorized
404Files Not Found
500Server Error, or the card payment was declined (see Payment Failures) — the message field carries the reason