> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://dev.admoji.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://dev.admoji.com/_mcp/server.

# Add order

POST https://openapi.admoji.com/api/v2/open/orders
Content-Type: application/json

Run a transaction against an existing customer. A customer record must exist first. Pass `OrderID` from a previous signup call to upsells to tie them together.


Reference: https://dev.admoji.com/api-reference/admoji-crm-api/orders/add-order

## Authentication

- `Authorization` header (required) — Format: `ApiKey <your_key>`

## Servers

- `https://openapi.admoji.com` (Live, default)
- `https://openapi.staging.admoji.com` (Test)

## Request

### Headers

- `Idempotency-Key` (string, required) — UUID to prevent duplicate POST operations

### Body (application/json)

This endpoint expects an object.

- `CustomerID` (integer, required)
- `IpAddress` (string, required)
- `BillingAddress` (Address, required)
- `PaymentInformation` (PaymentInformation, required)
- `Products` (list of OrderProduct, required)
- `OrderID` (integer, optional) — Order ID from a previously approved signup to tie upsells together
- `CouponCode` (string, optional)
- `MerchantDefined` (map from string to string, optional) — Key-value pairs (key length 3-50 chars)

## Response

### 200

Order created

- `Status` (integer, optional)
- `Transaction` (ApiV2OpenOrdersPostResponsesContentApplicationJsonSchemaTransaction, optional)

## Types

### Address

- `FirstName` (string, optional)
- `LastName` (string, optional)
- `Address1` (string, optional)
- `Address2` (string, optional)
- `City` (string, optional)
- `State` (string, optional)
- `Zipcode` (string, optional)
- `Country` (string, optional)
- `CountryISO` (string, optional) — ISO 2-letter country code (e.g. "us")
- `ZipCode` (string, optional)
- `Phone` (string, optional)

### PaymentInformation

- `ExpMonth` (string, optional) — Expiration month (MM)
- `ExpYear` (string, optional) — Expiration year (YYYY)
- `CCNumber` (string, optional) — Credit card number
- `NameOnCard` (string, optional)
- `CVV` (string, optional)
- `SquareCardNonce` (string, optional) — Card nonce from Square Payment Form
- `ThreeDs` (ThreeDs, optional)
- `ThreeDsRecurring` (ThreeDs, optional)
- `AchAba` (string, optional) — 9-digit ACH routing number
- `AchAccountNumber` (string, optional) — 16-digit ACH account number
- `AccountType` (enum, optional)
  - Allowed values: `Checking`, `Savings`
- `CheckIban` (string, optional) — SEPA IBAN
- `CheckName` (string, optional) — SEPA account holder name
- `SepaPhoneToken` (string, optional)
- `SepaPhonePin` (string, optional)
- `PaymentMethodToken` (PaymentMethodToken, optional)
- `ProcessorID` (integer, optional) — Force a specific processor
- `GatewayOrderID` (string, optional) — External order ID sent to the gateway

### OrderProduct

- `ProductID` (integer, required)
- `VariantProductID` (integer, optional) — Variant ID from Create Variants call
- `Amount` (double, optional) — Override amount (auto-populated from variant if VariantProductID set)
- `Quantity` (integer, optional)
- `IsPricePerPackage` (boolean, optional) — Set true to override quantity without auto-calculating order amount
- `ShipAmount` (double, optional) — Override shipping cost
- `Sku` (string, optional)
- `Options` (list of OrderProductOptionsItems, optional)

### ApiV2OpenOrdersPostResponsesContentApplicationJsonSchemaTransaction

- `CustomerInfo` (ApiV2OpenOrdersPostResponsesContentApplicationJsonSchemaTransactionCustomerInfo, optional)
- `OrderInfo` (ApiV2OpenOrdersPostResponsesContentApplicationJsonSchemaTransactionOrderInfo, optional)

### ThreeDs

- `XID` (string, optional) — 3DS V1: XID value. 3DS V2: dsTransId value
- `CAVV` (string, optional) — 3DS V1: CAVV value. 3DS V2: authenticationValue
- `ECI` (string, optional) — Electronic Commerce Indicator
- `Status` (string, optional)
- `Version` (string, optional)

### PaymentMethodToken

- `Source` (enum, required) — Gateway that generated the token
  - Allowed values: `GoDaddy`, `Stripe`, `Nmi`, `FluidpayCard`, `FluidpayGooglePay`, `FluidpayApplePay`, `Linked2PayCC`, `Linked2PayACH`, `Finix`, `ShiftstackGooglePay`, `ShiftstackApplePay`, `Whop`
- `OneTimeCardToken` (string, required) — Token from the gateway JS plugin

### OrderProductOptionsItems

- `Variant` (string, optional)
- `Option` (string, optional)

### ApiV2OpenOrdersPostResponsesContentApplicationJsonSchemaTransactionCustomerInfo

- `FirstName` (string, optional)
- `LastName` (string, optional)
- `Email` (string, optional)
- `IsProcessingFilter` (boolean, optional)

### ApiV2OpenOrdersPostResponsesContentApplicationJsonSchemaTransactionOrderInfo

- `OrderID` (integer, optional)
- `TransactionID` (string, optional)
- `CustomerID` (integer, optional)
- `Response` (string, optional) — 1 = Approved, 2 = Declined, 3 = Error
- `ResponseText` (string, optional)
- `TotalAmount` (double, optional)
- `ProcessorID` (integer, optional)
- `Descriptor` (string, optional)

## Examples

**Request**

```json
{
  "CustomerID": 1,
  "IpAddress": "string",
  "Products": [
    {
      "ProductID": 1
    }
  ]
}
```

**Response**

```json
{
  "Status": 1,
  "Transaction": {
    "CustomerInfo": {
      "FirstName": "string",
      "LastName": "string",
      "Email": "string",
      "IsProcessingFilter": true
    },
    "OrderInfo": {
      "OrderID": 1,
      "TransactionID": "string",
      "CustomerID": 1,
      "Response": "string",
      "ResponseText": "string",
      "TotalAmount": 1.1,
      "ProcessorID": 1,
      "Descriptor": "string"
    }
  }
}
```

**SDK Code**

```python
import requests

url = "https://openapi.admoji.com/api/v2/open/orders"

payload = {
    "CustomerID": 1,
    "IpAddress": "string",
    "Products": [{ "ProductID": 1 }]
}
headers = {
    "Idempotency-Key": "Idempotency-Key",
    "Authorization": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://openapi.admoji.com/api/v2/open/orders';
const options = {
  method: 'POST',
  headers: {
    'Idempotency-Key': 'Idempotency-Key',
    Authorization: '<apiKey>',
    'Content-Type': 'application/json'
  },
  body: '{"CustomerID":1,"IpAddress":"string","Products":[{"ProductID":1}]}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://openapi.admoji.com/api/v2/open/orders"

	payload := strings.NewReader("{\n  \"CustomerID\": 1,\n  \"IpAddress\": \"string\",\n  \"Products\": [\n    {\n      \"ProductID\": 1\n    }\n  ]\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Idempotency-Key", "Idempotency-Key")
	req.Header.Add("Authorization", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://openapi.admoji.com/api/v2/open/orders")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = 'Idempotency-Key'
request["Authorization"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"CustomerID\": 1,\n  \"IpAddress\": \"string\",\n  \"Products\": [\n    {\n      \"ProductID\": 1\n    }\n  ]\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://openapi.admoji.com/api/v2/open/orders")
  .header("Idempotency-Key", "Idempotency-Key")
  .header("Authorization", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"CustomerID\": 1,\n  \"IpAddress\": \"string\",\n  \"Products\": [\n    {\n      \"ProductID\": 1\n    }\n  ]\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://openapi.admoji.com/api/v2/open/orders', [
  'body' => '{
  "CustomerID": 1,
  "IpAddress": "string",
  "Products": [
    {
      "ProductID": 1
    }
  ]
}',
  'headers' => [
    'Authorization' => '<apiKey>',
    'Content-Type' => 'application/json',
    'Idempotency-Key' => 'Idempotency-Key',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://openapi.admoji.com/api/v2/open/orders");
var request = new RestRequest(Method.POST);
request.AddHeader("Idempotency-Key", "Idempotency-Key");
request.AddHeader("Authorization", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"CustomerID\": 1,\n  \"IpAddress\": \"string\",\n  \"Products\": [\n    {\n      \"ProductID\": 1\n    }\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Idempotency-Key": "Idempotency-Key",
  "Authorization": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "CustomerID": 1,
  "IpAddress": "string",
  "Products": [["ProductID": 1]]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://openapi.admoji.com/api/v2/open/orders")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```