Create Order

Query

mutation CreateOrder($input: CreateOrderInput!) {
  tenant {
    createOrder(input: $input) {
      id
      amount
      currency
      status
      tracking

      shipping {
        id
        line_1
        line_2
        state
        city
        country
      }

      items {
        id
        name
        description
        currency
        price
        qty
        total

        photo_url
        product_id
        variant_id
      }
    }
  }
}

Variables

{
  "input": {
    "currency": "BTC",
    "email": "someone@example.com",
    "status": "pending",
    "shipping": {
      "line_1": "777 Lucky street",
      "line_2": "Imaginary building",
      "state": "Fake state",
      "city": "Fake city",
      "country": "Singapore"
    },
    "items": [
      {
        "name": "iPhone",
        "description": "Silver 512GB",
        "price": 1500,
        "qty": 1
      }
    ]
  }
}

Response

{
  "data": {
    "tenant": {
      "createOrder": {
        "amount": "1500",
        "currency": "BTC",
        "id": "80",
        "items": [
          {
            "currency": null,
            "description": "Silver 512GB",
            "id": "1a5e88c5-ac22-4101-9ca7-8cace67db981",
            "name": "iPhone",
            "photo_url": null,
            "price": "1500",
            "product_id": null,
            "qty": 1,
            "total": "1500",
            "variant_id": null
          }
        ],
        "shipping": {
          "city": "Fake city",
          "country": "Singapore",
          "id": "099e54a7-ee70-45e0-914a-bcfec8fffcc5",
          "line_1": "777 Lucky street",
          "line_2": "Imaginary building",
          "state": "Fake state"
        },
        "status": "pending",
        "tracking": null
      }
    }
  }
}

Last updated

Was this helpful?