POST
/
buy
Buy Item
curl --request POST \
  --url https://api.buybase.ai/buy \
  --header 'Content-Type: application/json' \
  --header 'authorization: <authorization>' \
  --data '{
  "items": [
    {}
  ],
  "user_id": "<string>",
  "store_id": "<string>"
}'
{
  "message": "Order created successfully",
  "code": "ORDER_CREATED"
}

Headers

authorization
string
required
Your API key for authentication.

Body

items
array
required
Array of items to purchase.
[
  {
    "variant_id": "string", // Shopify variant ID
    "quantity": 1 // Must be at least 1
  }
]
user_id
string
required
The unique identifier for the user.
store_id
string
required
The unique identifier for the store.

Response

message
string
A message indicating the result of the purchase operation.
code
string
A code indicating the result of the purchase operation. Possible values:
  • ORDER_CREATED: Order created successfully
  • AUTH_MISSING: No API key provided
  • INVALID_KEY: Invalid API key
  • BAD_REQUEST_ERROR: Invalid request parameters
  • STORE_NOT_FOUND: Store ID not found
  • USER_NOT_FOUND: User ID not found
  • STORE_NOT_VERIFIED: Store is not verified yet
  • FORBIDDEN: Not authorized to access store
  • INTERNAL_ERROR: Server error occurred
error
string
Error message if the request fails.
{
  "message": "Order created successfully",
  "code": "ORDER_CREATED"
}