# Create Order Request **Note:** This request is only used in **full integration mode**. BRIJ sends this request to create an order in full integration mode. Unlike the [Redirect Order Request](/docs/webhooks-and-requests/redirect-order-request) used for Tier 1 partners, this request is used when the partner handles the full transaction flow without redirecting the customer. ## Endpoint ``` POST https://api.yourplatform.com/create-order Content-Type: application/json ``` ## Request Body ```json { "orderId": "order_abc123", "customerId": "cust_xyz789", "fromCurrency": "USD", "toCurrency": "SOLANA_SOL", "fromAmount": "100.50", "type": "ONRAMP", "paymentMethod": "USA_ACH", "customerPaymentDetailsDataId": "cpd_def456", "customerWalletDataId": "cwd_ghi012", "network": "SOLANA" } ``` ### Request Parameters | Field | Type | Required | Description | | ------------------------------ | ------ | -------- | -------------------------------------------------------------------------------- | | `orderId` | string | Yes | BRIJ's unique identifier for this order | | `customerId` | string | Yes | BRIJ's unique identifier for the customer | | `fromCurrency` | string | Yes | Source currency code (see [Currency Codes](/docs/reference/currency-codes)) | | `toCurrency` | string | Yes | Destination currency code (see [Currency Codes](/docs/reference/currency-codes)) | | `fromAmount` | string | Yes | Amount in source currency (decimal as string, e.g., "100.50") | | `type` | string | Yes | Transaction type: `"ONRAMP"` (buy crypto) or `"OFFRAMP"` (sell crypto) | | `paymentMethod` | string | Yes | Payment method code (see [Payment Methods](/docs/reference/payment-methods)) | | `customerPaymentDetailsDataId` | string | Yes | Data ID for customer's payment details (bank account, card, etc.) | | `customerWalletDataId` | string | Yes | Data ID for customer's crypto wallet | | `network` | string | Yes | Blockchain network (see [Networks](/docs/reference/networks)) | **Note:** - For ONRAMP: `fromCurrency` is fiat (e.g., "USD"), `toCurrency` is crypto (e.g., "SOLANA\_SOL") * For OFFRAMP: `fromCurrency` is crypto (e.g., "SOLANA\_SOL"), `toCurrency` is fiat (e.g., "USD") ## Response Body ### Success Response ```json { "externalOrderId": "partner_order_12345", "status": "AWAITING_FUNDS", "toAmount": "1.5234", "depositInstructions": { "paymentMethod": "USA_ACH", "amount": "100.50", "currency": "USD", "bankName": "Partner Bank", "bankRoutingNumber": "123456789", "bankAccountNumber": "9876543210", "bankBeneficiaryName": "Partner Inc.", "depositMessage": "Order order_abc123" } } ``` ### Response Parameters | Field | Type | Required | Description | | --------------------- | ------ | -------- | --------------------------------------------------------------------------------------------------------- | | `externalOrderId` | string | Yes | Your platform's unique identifier for this order | | `status` | string | Yes | Initial order status (see `GetOrderDetails` in [API Reference](/api-reference)) | | `toAmount` | string | Yes | Amount customer will receive (decimal as string) | | `depositInstructions` | object | No[^1] | Instructions for the customer to deposit funds (see `GetOrderDetails` in [API Reference](/api-reference)) | [^1]: Required when `status` is `AWAITING_FUNDS`. ## Error Response Return an error response when the order cannot be created: ```json { "error": { "reason": "insufficient_data", "customerFacingReason": "Unable to process order at this time. Please try again later." } } ``` ### Error Fields | Field | Type | Description | | ---------------------- | ------ | ------------------------------------------------------- | | `reason` | string | Internal error reason (for logging and debugging) | | `customerFacingReason` | string | User-friendly message that can be shown to the customer | ### HTTP Status Codes | Status Code | Description | | ----------- | ----------------------------------------------- | | `400` | Invalid request parameters | | `422` | Business rule violation (e.g., limits exceeded) | | `503` | Service temporarily unavailable |