POST
/
purchases
cURL
curl --request POST \
  --url https://api.daraa.io/purchases \
  --header 'Content-Type: application/json' \
  --data '{
  "shopperId": "<string>",
  "items": [
    {
      "sku": "<string>",
      "name": "<string>",
      "quantity": 123,
      "unitPrice": 123,
      "totalPrice": 123
    }
  ],
  "shippingAddress": {
    "name": "<string>",
    "street1": "<string>",
    "city": "<string>",
    "state": "<string>",
    "zip": "<string>",
    "country": "<string>"
  },
  "billingAddress": {
    "name": "<string>",
    "street1": "<string>",
    "city": "<string>",
    "state": "<string>",
    "zip": "<string>",
    "country": "<string>"
  },
  "paymentMethod": {
    "type": "credit_card",
    "lastFour": "<string>",
    "brand": "<string>",
    "expiryMonth": 123,
    "expiryYear": 123
  }
}'
{
  "identifiers": [
    {}
  ],
  "generatedMaps": [
    {}
  ],
  "raw": "<any>"
}

Body

application/json
shopperId
string
required
items
object[]
required
shippingAddress
object
required
paymentMethod
object
required
billingAddress
object

Response

200 - application/json

Ok

Result object returned by InsertQueryBuilder execution.

identifiers
object[]
required

Contains inserted entity id. Has entity-like structure (not just column database name and values).

generatedMaps
object[]
required

Generated values returned by a database. Has entity-like structure (not just column database name and values).

raw
any
required

Raw SQL result returned by executed query.