---
title: "Create an order"
method: POST
path: "/v4/orders"
tags: ["Orders"]
---

# Create an order

`POST /v4/orders`

Creates a new order for checkout. Returns both a code for Slope.JS widget and full URL for redirect flow

## Headers

- `Slope-Access-Token` string, required

## Request body

- CreateOrderV4RequestDto
  - `total` number, required — Total amount of the order, in cents. Must be greater than 0
  - `currency` 'mxn' | 'usd', required
  - `externalId` string, required — The external ID of the order, used for merchant reference. Must be unique.
  - `items` CreateOrderItemV4RequestDto[], required — The line items in the order.
    - `quantity` number, required — The quantity of this item in the order
    - `unitPrice` number, required — The price per single unit of this item in cents
    - `price` number, required — The total price of this item in cents
    - `type` 'lineItem' | 'tax' | 'shipping' | 'discount' | 'adjustment'
    - `name` string — The name of the item
    - `sku` string — The SKU aka Stock Keeping Unit number of the item
    - `externalId` string
    - `description` string
    - `url` string
    - `imageUrl` string
    - `metadata` object
    - `payee` OrderItemPayeeSharedDto
      - `name` string, required
      - `province` string, required
      - `country` string, required
  - `customerId` string — Optional: The Slope customer ID for this order. If set, only this Slope customer will be able to access the order.
  - `contactBusinessName` string — The customer business name
  - `contactEmail` string — The customer email address
  - `contactFirstName` string — The customer first name
  - `contactLastName` string — The customer last name
  - `contactDesiredLimit` string — The desired funding limit for the customer, in cents.
  - `contactPhone` string — The customer phone number in E.164 format.
  - `billingAddress` AddressSharedDto
    - `line1` string, required — The first line of the address
    - `line2` string
    - `city` string, required
    - `country` string, required — ISO31661 Alpha2 code for the country
    - `state` string, required — 2-letter US state abbreviation
    - `postalCode` string, required — 5-digit US postal code
  - `taxId` string — The Federal EIN / Tax ID of this business. Must be 9 digits.
  - `payoutAccountId` string — If provided, overrides the default payout account for this order
  - `payeeExternalId` string — The external ID of the payee receiving the payout for this order
  - `payeeName` string — The name of the payee receiving the payout for this order
  - `resumeUrl` string — (Optional) The URL to redirect the user if an order is approved offline. Relevant only if an order transitions from "pending" to "approved" status.
  - `cancelUrl` string — (Optional) The URL to redirect to if the user cancels the checkout. Relevant for redirect flow only
  - `successUrl` string — (Optional) The URL to redirect to if the user completes the checkout. Relevant for redirect flow only
  - `metadata` object — Any additional metadata to attach to the order. This takes in a object
  - `uiType` 'composable'

## Response `201`

The created order. Returns either a standard order or a composable order depending on the uiType.

- union
  - OrderEntityV4ResponseDto
    - `id` string, required — Slope Unique Order ID
    - `externalId` string — Unique merchant generated external ID
    - `customerId` string — Slope Customer ID, null until order is claimed by customer
    - `number` string, required — Unique short & friendly order number
    - `checkoutCode` string, required — Unique code for Slope.JS widget
    - `checkoutUrl` string, required — Full URL for redirect flow
    - `total` number, required — Order total before customer fees
    - `totalFinalized` number — Total amount finalized for multi-finalization, null if not in finalizing/finalized state
    - `merchantFee` number, required — Merchant fees
    - `customerFee` number, required — Customer fees
    - `customerFeePercentage` number, required — Customer fee percentage
    - `totalWithFees` number, required — Order total with customer fees
    - `amountCanceledPrincipal` number, required — Amount canceled, in cents.
    - `amountCanceledFee` number, required — Amount canceled, in cents.
    - `status` 'pending' | 'approved' | 'submitted' | 'opening' | 'open' | 'finalizing' | 'finalized' | 'unpaid' | 'partiallyPaid' | 'complete' | 'defaulted' | 'rejected' | 'canceled' | 'refunded' | 'repayment', required
    - `finalizedAt` string, date-time, required — Time when order was finalized, null if not finalized yet
    - `openedAt` string, date-time, required — Time when order was opened, null if not open yet
    - `currency` 'mxn' | 'usd', required
    - `selectedTermName` string — The selected payment term name. Null if not selected yet.
    - `selectedPaymentType` 'ach' | 'card' | 'oxxo' | 'spei' | 'wire' | 'rtp' | 'customer_wallet' | 'virtual_card' | 'virtual_account'
    - `selectedTermDays` number — The selected payment term days. Null if not selected yet.
    - `paymentSchedule` OrderPaymentScheduleV4ResponseDto[] — The payment schedules for the order
      - `amount` number, required — The amount due for this payment for the order
      - `date` string, date-time, required — The date the payment is due for the order in the format ISO-8601 (YYYY-MM-DD)
    - `metadata` object — Any additional metadata to attach to the order
    - `amountOutstanding` number, required — Current amount outstanding on the order
    - `apr` number — Annual percentage rate from the selected quote. Null if no quote is selected yet.
    - `quotes` QuoteV4ResponseDto[] — Quotes available for this order
      - `id` string, required
      - `name` string, required
      - `expiresAt` string, required
      - `status` 'approved' | 'rejected', required
      - `processingFeeTotal` number, required
      - `totalWithFinancingFees` number, required
      - `totalWithFees` number, required
      - `financingFeePct` number, required
      - `financingFeeTotal` number, required
      - `apr` number, required
      - `payments` SchedulePaymentSharedDto[], required
        - `number` number, required — The payment number in the schedule sequence
        - `date` string, date-time, required — The due date for this payment
        - `principal` number, required — The principal amount of this payment, in cents
        - `customerFee` number, required — The customer fee for this payment, in cents
        - `amount` number, required — The total amount due for this payment, in cents
        - `financingFee` number, required — The financing fee for this payment, in cents
  - ComposableOrderV4ResponseDto
    - `id` string, required — Order ID
    - `currency` string, required
    - `total` number, required — The total amount of the order, in cents
    - `externalId` string, required — The external ID of the order, used for merchant reference. Must be unique.
    - `quotes` ComposableQuoteV4ResponseDto[], required — Available quotes for this order
      - `id` string, required
      - `name` string, required
      - `expiresAt` string, required
      - `status` 'approved' | 'rejected', required
      - `processingFeeTotal` number, required
      - `totalWithFinancingFees` number, required
      - `totalWithFees` number, required
      - `financingFeePct` number, required
      - `financingFeeTotal` number, required
      - `apr` number, required
      - `payments` SchedulePaymentSharedDto[], required
        - `number` number, required — The payment number in the schedule sequence
        - `date` string, date-time, required — The due date for this payment
        - `principal` number, required — The principal amount of this payment, in cents
        - `customerFee` number, required — The customer fee for this payment, in cents
        - `amount` number, required — The total amount due for this payment, in cents
        - `financingFee` number, required — The financing fee for this payment, in cents
      - `originalTotalWithFees` number, required
      - `originalFinancingFeeTotal` number, required
      - `originalFinancingFeePct` number, required
    - `selectedQuoteId` string, required — The ID of the selected quote
    - `iframeUrls` IframeUrlsDto, required
      - `checkbox` string, required
      - `expiresAt` string, date-time, required

## Other responses

- `400` — Bad Request - Invalid request format or validation errors
- `409` — Conflict - Request conflicts with current state of the resource
- `422` — Unprocessable Entity - Request validation failed
- `500` — Internal Server Error - An unexpected error occurred

---

[API](https://skmtc.net/slopepay/apis/slope-v4-api.md) · [All operations](https://skmtc.net/slopepay/apis/slope-v4-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/slopepay/slope-v4-api/revisions/cbdbc861073b/schema)
