Create Order Request

View as Markdown

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

1{
2 "orderId": "order_abc123",
3 "customerId": "cust_xyz789",
4 "fromCurrency": "USD",
5 "toCurrency": "SOLANA_SOL",
6 "fromAmount": "100.50",
7 "type": "ONRAMP",
8 "paymentMethod": "USA_ACH",
9 "customerPaymentDetailsDataId": "cpd_def456",
10 "customerWalletDataId": "cwd_ghi012",
11 "network": "SOLANA"
12}

Request Parameters

FieldTypeRequiredDescription
orderIdstringYesBRIJ’s unique identifier for this order
customerIdstringYesBRIJ’s unique identifier for the customer
fromCurrencystringYesSource currency code (see Currency Codes)
toCurrencystringYesDestination currency code (see Currency Codes)
fromAmountstringYesAmount in source currency (decimal as string, e.g., “100.50”)
typestringYesTransaction type: "ONRAMP" (buy crypto) or "OFFRAMP" (sell crypto)
paymentMethodstringYesPayment method code (see Payment Methods)
customerPaymentDetailsDataIdstringYesData ID for customer’s payment details (bank account, card, etc.)
customerWalletDataIdstringYesData ID for customer’s crypto wallet
networkstringYesBlockchain network (see 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

1{
2 "externalOrderId": "partner_order_12345",
3 "status": "AWAITING_FUNDS",
4 "toAmount": "1.5234",
5 "depositInstructions": {
6 "paymentMethod": "USA_ACH",
7 "amount": "100.50",
8 "currency": "USD",
9 "bankName": "Partner Bank",
10 "bankRoutingNumber": "123456789",
11 "bankAccountNumber": "9876543210",
12 "bankBeneficiaryName": "Partner Inc.",
13 "depositMessage": "Order order_abc123"
14 }
15}

Response Parameters

FieldTypeRequiredDescription
externalOrderIdstringYesYour platform’s unique identifier for this order
statusstringYesInitial order status (see GetOrderDetails in API Reference)
toAmountstringYesAmount customer will receive (decimal as string)
depositInstructionsobjectNo1Instructions for the customer to deposit funds (see GetOrderDetails in API Reference)

Error Response

Return an error response when the order cannot be created:

1{
2 "error": {
3 "reason": "insufficient_data",
4 "customerFacingReason": "Unable to process order at this time. Please try again later."
5 }
6}

Error Fields

FieldTypeDescription
reasonstringInternal error reason (for logging and debugging)
customerFacingReasonstringUser-friendly message that can be shown to the customer

HTTP Status Codes

Status CodeDescription
400Invalid request parameters
422Business rule violation (e.g., limits exceeded)
503Service temporarily unavailable

Footnotes

  1. Required when status is AWAITING_FUNDS.