Orders
Create an order for a customer
Create a buy-it-now order on behalf of a customer. Works for both auction products and standalone products.
POST
/
alpha
/
merchant
/
customers
/
{customerId}
/
orders
Create an order for a customer
curl --request POST \
--url https://api.auctionnow.io/api/alpha/merchant/customers/{customerId}/orders \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"data": {
"productId": "<string>",
"quantity": 2
}
}
'import requests
url = "https://api.auctionnow.io/api/alpha/merchant/customers/{customerId}/orders"
payload = { "data": {
"productId": "<string>",
"quantity": 2
} }
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({data: {productId: '<string>', quantity: 2}})
};
fetch('https://api.auctionnow.io/api/alpha/merchant/customers/{customerId}/orders', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.auctionnow.io/api/alpha/merchant/customers/{customerId}/orders",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'data' => [
'productId' => '<string>',
'quantity' => 2
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.auctionnow.io/api/alpha/merchant/customers/{customerId}/orders"
payload := strings.NewReader("{\n \"data\": {\n \"productId\": \"<string>\",\n \"quantity\": 2\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.auctionnow.io/api/alpha/merchant/customers/{customerId}/orders")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"data\": {\n \"productId\": \"<string>\",\n \"quantity\": 2\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.auctionnow.io/api/alpha/merchant/customers/{customerId}/orders")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"data\": {\n \"productId\": \"<string>\",\n \"quantity\": 2\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"ok": true,
"orderId": "<string>",
"state": "<string>",
"reason": "<string>",
"idempotent": true
},
"timestamp": 123,
"message": "<string>"
}{
"message": "<string>",
"error": "<string>"
}{
"error": "<string>",
"reason": "<string>"
}{
"error": "<string>",
"reason": "<string>"
}{
"error": "<string>",
"reason": "<string>"
}{
"error": "<string>"
}Headers
Your Auction Now API key as a Bearer token
Example:
"Bearer ak_XXXXXXX"
Path Parameters
The unique ID of the customer
Body
application/json
Input data for creating an order
Show child attributes
Show child attributes
Previous
Get customer payment statusCheck whether a customer has a valid payment method set up in Stripe
Next
⌘I
Create an order for a customer
curl --request POST \
--url https://api.auctionnow.io/api/alpha/merchant/customers/{customerId}/orders \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"data": {
"productId": "<string>",
"quantity": 2
}
}
'import requests
url = "https://api.auctionnow.io/api/alpha/merchant/customers/{customerId}/orders"
payload = { "data": {
"productId": "<string>",
"quantity": 2
} }
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({data: {productId: '<string>', quantity: 2}})
};
fetch('https://api.auctionnow.io/api/alpha/merchant/customers/{customerId}/orders', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.auctionnow.io/api/alpha/merchant/customers/{customerId}/orders",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'data' => [
'productId' => '<string>',
'quantity' => 2
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.auctionnow.io/api/alpha/merchant/customers/{customerId}/orders"
payload := strings.NewReader("{\n \"data\": {\n \"productId\": \"<string>\",\n \"quantity\": 2\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.auctionnow.io/api/alpha/merchant/customers/{customerId}/orders")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"data\": {\n \"productId\": \"<string>\",\n \"quantity\": 2\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.auctionnow.io/api/alpha/merchant/customers/{customerId}/orders")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"data\": {\n \"productId\": \"<string>\",\n \"quantity\": 2\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"ok": true,
"orderId": "<string>",
"state": "<string>",
"reason": "<string>",
"idempotent": true
},
"timestamp": 123,
"message": "<string>"
}{
"message": "<string>",
"error": "<string>"
}{
"error": "<string>",
"reason": "<string>"
}{
"error": "<string>",
"reason": "<string>"
}{
"error": "<string>",
"reason": "<string>"
}{
"error": "<string>"
}