> ## Documentation Index
> Fetch the complete documentation index at: https://partners.ladder.africa/llms.txt
> Use this file to discover all available pages before exploring further.

# Place an order (buy or sell)

> **Buy** (`side=buy`, default): `investment_id`, `amount`, `currency`. `payment_mode=wallet` debits the wallet in `currency` immediately (402 if short). `payment_mode=checkout` returns `payment` instructions; the order executes when that funding settles. `currency` must equal the investment's currency. Live orders move to `pending_fulfilment` until the position is placed with the provider, then `completed` with a holding.

**Sell** (`side=sell`): `holding_id` and optional `units` (default: everything not already in a pending sell). `amount` is indicative (units × current price) and `currency` is the holding's. The request waits in `pending_fulfilment`; when Ladder redeems the units the wallet is credited with `proceeds` and the holding's units fall (it closes at zero). Test keys settle immediately at the indicative value.



## OpenAPI

````yaml /openapi.json post /partner/v1/orders
openapi: 3.0.3
info:
  title: Ladder Partner API
  version: v1
  description: >-
    Server-to-server API for licensed partner organisations: KYB, NGN/GHS/USD
    wallets, funding rails, investments and NGX market data, buy and sell
    orders, holdings and webhooks. Every request is HMAC-signed; see the
    Authentication guide.
  contact:
    email: partners@myladder.africa
servers:
  - url: https://api.myladder.africa
    description: Production
  - url: https://api-dev.myladder.africa
    description: UAT (integration and acceptance testing)
security:
  - LadderKey: []
    LadderTimestamp: []
    LadderSignature: []
tags:
  - name: Organisation
    description: The calling organisation and what KYB still needs.
  - name: KYB
    description: >-
      Business information, people, documents, settlement accounts and
      submission.
  - name: Wallets
    description: >-
      Balances, funding requests on every rail, direct-debit mandates and the
      ledger statement.
  - name: Investments
    description: What a partner can buy.
  - name: Market data
    description: >-
      Nigerian Exchange instruments, quotes, bars, indices, FX, calendar and
      disclosures.
  - name: Orders
    description: Buy and sell orders and their lifecycle.
  - name: Holdings
    description: Positions created by completed buys.
  - name: Webhooks
    description: Endpoints, deliveries and retries.
  - name: Sandbox
    description: Test-key only helpers.
paths:
  /partner/v1/orders:
    parameters: []
    post:
      tags:
        - Orders
      summary: Place an order (buy or sell)
      description: >-
        **Buy** (`side=buy`, default): `investment_id`, `amount`, `currency`.
        `payment_mode=wallet` debits the wallet in `currency` immediately (402
        if short). `payment_mode=checkout` returns `payment` instructions; the
        order executes when that funding settles. `currency` must equal the
        investment's currency. Live orders move to `pending_fulfilment` until
        the position is placed with the provider, then `completed` with a
        holding.


        **Sell** (`side=sell`): `holding_id` and optional `units` (default:
        everything not already in a pending sell). `amount` is indicative (units
        × current price) and `currency` is the holding's. The request waits in
        `pending_fulfilment`; when Ladder redeems the units the wallet is
        credited with `proceeds` and the holding's units fall (it closes at
        zero). Test keys settle immediately at the indicative value.
      operationId: orders_create
      parameters:
        - name: Idempotency-Key
          in: header
          description: >-
            Unique per logical request (max 255 chars). A retry with the same
            key and body returns the original response with
            `Idempotent-Replayed: true`; a different body returns 409.
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PartnerCreateOrder'
        required: true
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PartnerOrderResponse'
        '400':
          description: Validation or business-rule error (see `error.code`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PartnerError'
        '401':
          description: Missing/invalid signature, stale timestamp, unknown or revoked key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PartnerError'
        '402':
          description: Insufficient wallet balance (`insufficient_funds`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PartnerError'
        '403':
          description: IP not allowlisted, or action not allowed for this key/environment.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PartnerError'
        '404':
          description: Not found (or belongs to another organisation/environment).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PartnerError'
        '409':
          description: >-
            Conflict: state does not allow this action, duplicate reference, or
            Idempotency-Key reuse.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PartnerError'
        '429':
          description: Rate limited (120 requests/min per key). See `Retry-After`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PartnerError'
        '502':
          description: Upstream payment provider unavailable.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PartnerError'
components:
  schemas:
    PartnerCreateOrder:
      type: object
      properties:
        side:
          title: Side
          type: string
          enum:
            - buy
            - sell
          default: buy
        investment_id:
          title: Investment id
          type: string
          format: uuid
        amount:
          title: Amount
          type: string
          format: decimal
        currency:
          title: Currency
          type: string
          enum:
            - GHS
            - USD
            - NGN
        payment_mode:
          title: Payment mode
          type: string
          enum:
            - wallet
            - checkout
          default: wallet
        holding_id:
          title: Holding id
          type: string
          format: uuid
        units:
          title: Units
          type: string
          format: decimal
        client_reference:
          title: Client reference
          type: string
          maxLength: 100
        customer:
          $ref: '#/components/schemas/PartnerCustomer'
        metadata:
          title: Metadata
          type: object
          additionalProperties:
            type: string
            nullable: true
    PartnerOrderResponse:
      required:
        - data
      type: object
      properties:
        data:
          $ref: '#/components/schemas/PartnerOrder'
    PartnerError:
      required:
        - error
      type: object
      properties:
        error:
          $ref: '#/components/schemas/PartnerErrorBody'
    PartnerCustomer:
      type: object
      properties:
        reference:
          title: Reference
          type: string
          maxLength: 100
        name:
          title: Name
          type: string
          maxLength: 255
        email:
          title: Email
          type: string
          format: email
    PartnerOrder:
      required:
        - investment_id
        - investment_name
        - amount
        - currency
        - payment_mode
        - status
      type: object
      properties:
        id:
          title: Id
          type: string
          format: uuid
          readOnly: true
        reference:
          title: Reference
          type: string
          maxLength: 64
          minLength: 1
        client_reference:
          title: Client reference
          type: string
          maxLength: 100
        side:
          title: Side
          type: string
          enum:
            - buy
            - sell
        investment_id:
          title: Investment id
          type: string
          format: uuid
        investment_name:
          title: Investment name
          type: string
          minLength: 1
        amount:
          title: Amount
          type: string
          format: decimal
        currency:
          title: Currency
          type: string
          enum:
            - GHS
            - USD
            - NGN
        units:
          title: Units
          type: string
          format: decimal
          nullable: true
        proceeds:
          title: Proceeds
          type: string
          format: decimal
          nullable: true
        payment_mode:
          title: Payment mode
          type: string
          enum:
            - wallet
            - checkout
        status:
          title: Status
          type: string
          enum:
            - awaiting_payment
            - pending_fulfilment
            - completed
            - failed
            - cancelled
        customer:
          title: Customer
          type: string
          readOnly: true
        metadata:
          title: Metadata
          type: object
        failure_reason:
          title: Failure reason
          type: string
        payment:
          title: Payment
          type: string
          readOnly: true
        holding_id:
          title: Holding id
          type: string
          readOnly: true
        paid_at:
          title: Paid at
          type: string
          format: date-time
          nullable: true
        completed_at:
          title: Completed at
          type: string
          format: date-time
          nullable: true
        cancelled_at:
          title: Cancelled at
          type: string
          format: date-time
          nullable: true
        created_at:
          title: Created_at
          type: string
          format: date-time
          readOnly: true
        updated_at:
          title: Updated at
          type: string
          format: date-time
          readOnly: true
    PartnerErrorBody:
      required:
        - code
        - message
        - details
      type: object
      properties:
        code:
          title: Code
          description: Stable machine-readable code, e.g. `insufficient_funds`.
          type: string
          minLength: 1
        message:
          title: Message
          type: string
          minLength: 1
        details:
          title: Details
          description: Code-specific context (validation errors, balances, …).
          type: object
          additionalProperties:
            type: string
            nullable: true
  securitySchemes:
    LadderKey:
      type: apiKey
      in: header
      name: X-Ladder-Key
      description: 'Your key id: `pk_test_…` (sandbox) or `pk_live_…` (live).'
    LadderTimestamp:
      type: apiKey
      in: header
      name: X-Ladder-Timestamp
      description: Unix seconds, as a string; must be within 5 minutes of server time.
    LadderSignature:
      type: apiKey
      in: header
      name: X-Ladder-Signature
      description: >-
        Lower-case hex HMAC-SHA512 over timestamp, method, path+query and the
        SHA-256 of the body. See Authentication.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.