---
# System prepended metadata

title: /api/orders

---

# /api/orders 

### GET request

pass in
```
/api/orders?id=1234
```

expected response:

```
{
    "success": true,
    "data": {
        "id": "1234",
        "opportunityStatus": "",
        "subTotal": 0.00,
        "salesTax": 0.00,
        "total": 0.00,
        "lineItems": [
            {
                "id": "PLI-############",
                "name": "Product Name",
                "options": "Listed Options | Pipe Separated",
                "quantity": 12,
                "price": 0.00,
                "subtotal": 0.00,
                "status": "proof in progress, proof approved, revision needed, review ready",
                "displayProofs": false,
                "proofs": [
                    {
                        "id": "1",
                        "active": true,
                        "name": "Proof 1a",
                        "url": "https://s3link.com/image.jpeg",
                        "comments": "This is a comment"
                    }
                ]
            }
        ],
        "shipping": {
            "sameAsBilling": true,
            "firstName": "Test",
            "lastName": "Name",
            "company": "Company Name",
            "phone": "2121234567",
            "email": "name@test.com",
            "addressLine1": "123 Brooklyn St.",
            "addressLine2": "",
            "addressLine3": "",
            "city": "New York",
            "state": "NY",
            "postalCode": "12345"
        },
        "billing": {
            "firstName": "Test",
            "lastName": "Name",
            "company": "Company Name",
            "phone": "2121234567",
            "email": "name@test.com",
            "addressLine1": "123 Brooklyn St.",
            "addressLine2": "",
            "addressLine3": "",
            "city": "New York",
            "state": "NY",
            "postalCode": "12345"
        },
        "payments": [
            {
                "transactionId": "ChargentIdNumber",
                "name": "Card Name",
                "number": "************0002"
            }
        ]
    }
}
```

# /api/lineItems
### GET request

pass in
```
/api/lineItems?id=1234
```

expected response:

```
{
    "success": true,
    "data": {
        "lineItems": [
            {
                "id": "PLI-############",
                "name": "Product Name",
                "options": "Listed Options | Pipe Separated",
                "quantity": 12,
                "price": 0.00,
                "subtotal": 0.00,
                "status": "proof in progress, proof approved, revision needed, review ready",
                "displayProofs": false,
                "proofs": [
                    {
                        "id": "1",
                        "active": true,
                        "name": "Proof 1a",
                        "url": "https://s3link.com/image.jpeg",
                        "comments": "This is a comment"
                    }
                ]
            }
        ]
    }
}
```

### POST or UPDATE request

pass in
```
{
    "id": "1234",
    "lineItems": [
        {
            "id": "PLI-############",
            "name": "Product Name",
            "options": "Listed Options | Pipe Separated",
            "quantity": 12,
            "price": 0.00,
            "subtotal": 0.00,
            "status": "proof in progress, proof approved, revision needed, review ready",
            "displayProofs": false,
            "proofs": [
                {
                    "id": "1",
                    "active": true,
                    "name": "Proof 1a",
                    "url": "https://s3link.com/image.jpeg",
                    "comments": "This is a comment"
                }
            ]
        }
    ]
}
```

expected response:

```
{
    "success": true
}
```

sample response on failure:

```
{
    "success": false,
    "errors": {
        "lineItems": [
            {
                "id": "PLI-############",
                "name": "This field is required",
                "quantity": "Quantity is too low"
            }
        ]
    }
}
```

# /api/shipping
### GET request

pass in
```
/api/shipping?id=1234
```

expected response:

```
{
    "success": true,
    "data": {
        "shipping": {
            "sameAsBilling": true,
            "firstName": "Test",
            "lastName": "Name",
            "company": "Company Name",
            "phone": "2121234567",
            "email": "name@test.com",
            "addressLine1": "123 Brooklyn St.",
            "addressLine2": "",
            "addressLine3": "",
            "city": "New York",
            "state": "NY",
            "postalCode": "12345"
        }
    }
}
```

### POST or UPDATE request

pass in
```
{
    "id": "1234",
    "shipping": {
        "sameAsBilling": true,
        "firstName": "Test",
        "lastName": "Name",
        "company": "Company Name",
        "phone": "2121234567",
        "email": "name@test.com",
        "addressLine1": "123 Brooklyn St.",
        "addressLine2": "",
        "addressLine3": "",
        "city": "New York",
        "state": "NY",
        "postalCode": "12345"
    }
}
```

expected response:

```
{
    success: true
}
```

sample response on failure:

```
{
    "success": false,
    "errors": {
        "firstName": "First Name is required",
        "email": "email is not valid"
    }
}
```

# /api/billing

### GET request

pass in
```
/api/billing?id=1234
```

expected response:

```
{
    "success": true,
    "data": {
        "billing": {
            "firstName": "Test",
            "lastName": "Name",
            "company": "Company Name",
            "phone": "2121234567",
            "email": "name@test.com",
            "addressLine1": "123 Brooklyn St.",
            "addressLine2": "",
            "addressLine3": "",
            "city": "New York",
            "state": "NY",
            "postalCode": "12345"
        }
    }
}
```

### POST or UPDATE request

pass in
```
{
    "id": "1234",
    "billing": {
        "firstName": "Test",
        "lastName": "Name",
        "company": "Company Name",
        "phone": "2121234567",
        "email": "name@test.com",
        "addressLine1": "123 Brooklyn St.",
        "addressLine2": "",
        "addressLine3": "",
        "city": "New York",
        "state": "NY",
        "postalCode": "12345"
    }
}
```

expected response:

```
{
    success: true
}
```

sample response on failure:

```
{
    "success": false,
    "errors": {
        "firstName": "First Name is required",
        "email": "email is not valid"
    }
}
```

# /api/payments
### GET request

pass in
```
/api/payments?id=1234
```

expected response:

```
{
    "success": true,
    "data": [
        {
            "transactionId": "ChargentIdNumber",
            "name": "Card Name",
            "number": "************0002"
        },
        {
            "transactionId": "ChargentIdNumber",
            "name": "Card Name",
            "number": "************0002"
        }
    ]
}
```

### POST request

pass in
```
{
    "id": "1234",
    "payments": [
        {
            "cardId": 1,
            "name": "Card Name",
            "number": "4000000000000002",
            "date": "12/22",
            "cvv": "123"
        },
        {
            "cardId": 2,
            "name": "Card Name 2",
            "number": "4000000000000002",
            "date": "01/23",
            "cvv": "456"
        }
    ]
}
```

expected response:

```
{
    "success": true
}
```

sample response on failure:

```
{
    "success": false,
    "errors": {
        "payments": [
            {
                "cardId": 2,
                "number": "Card Failed Validation"
            }
        ]
    }
}
```