DocsOrdersCreate

Create Order

Create a new order.

Endpoint

POST ${baseUrl}/orders

Request Body

interface CreateOrderRequest {
  fileIds: string[]
  orderType: 'TRANSCRIPTION' | 'TRANSCRIPTION_FORMATTING'
}

Response

interface CreateOrderResponse {
  success: boolean
  data: {
    orderId: string
    transactionId: string
    paymentMethod: 'CREDITCARD' | 'PAYPAL'
    pp_account?: string
    cc_last4?: string
  }
}

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()

Error Codes

Status CodeDescription
201Order Created Successfully
400Invalid Request
401Unauthorized
404Files Not Found
500Server Error