---
updatedAt: 2025-06-12T21:05:29.000Z
agentTools:
  projectIndex: https://docs.deliverysolutions.co/llms.txt
---

# Create Invoice

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "delivery-solutions-v2",
    "version": "2.0.39"
  },
  "servers": [
    {
      "url": "https://sandbox.api.deliverysolutions.co/api/v2"
    }
  ],
  "components": {
    "securitySchemes": {
      "sec0": {
        "type": "apiKey",
        "in": "header",
        "name": "x-api-key",
        "x-default": "YOUR_API_KEY"
      },
      "sec1": {
        "type": "apiKey",
        "in": "header",
        "name": "tenantId",
        "x-default": "YOUR_TENANT_ID"
      }
    }
  },
  "security": [
    {
      "sec0": [],
      "sec1": []
    }
  ],
  "paths": {
    "/returns/invoice": {
      "post": {
        "summary": "Create Invoice",
        "description": "",
        "operationId": "create-invoice",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "orderExternalId",
                  "customer",
                  "orderInfo",
                  "brandExternalId",
                  "createdDate",
                  "timeZone"
                ],
                "properties": {
                  "itemList": {
                    "type": "array",
                    "items": {
                      "properties": {
                        "sku": {
                          "type": "string",
                          "description": "An ID that indicate/identify the product/variant from the brand’s catalog."
                        },
                        "upc": {
                          "type": "string",
                          "description": "Universal Product Code for the item"
                        },
                        "quantity": {
                          "type": "integer",
                          "description": "Number of items of the SKU",
                          "default": 1,
                          "format": "int32"
                        },
                        "size": {
                          "type": "object",
                          "description": "Dimensions of the item. If not provided value will be considered as null to indicate not provided.",
                          "required": [
                            "height",
                            "width",
                            "length"
                          ],
                          "properties": {
                            "height": {
                              "type": "number",
                              "description": "Height (in inches)",
                              "format": "double"
                            },
                            "width": {
                              "type": "number",
                              "description": "Width (in inches)",
                              "format": "double"
                            },
                            "length": {
                              "type": "number",
                              "description": "Length (in inches)",
                              "format": "double"
                            }
                          }
                        },
                        "weight": {
                          "type": "number",
                          "description": "Weight in pounds (lbs) of an item. If not provided ,value will be considered as null to indicate not provided.",
                          "format": "double"
                        },
                        "price": {
                          "type": "number",
                          "description": "Retail price of the item. If not provided , value will be considered as null to indicate not provided.",
                          "format": "double"
                        },
                        "sale_price": {
                          "type": "number",
                          "description": "Sale price of the item that can be used to indicate a different price from theprice. If not provided, will inherit the price. If not provided and can’t be inherited from price, value will be considered as null to indicate not provided.",
                          "format": "double"
                        },
                        "image": {
                          "type": "string",
                          "description": "Link to the image file of the item. Should be full public URL. File types accepted are JPG and PNG. If not provided, will inherit from catalog. If not provided and can’t be inherited from catalog, value will be considered as null to indicate not provided."
                        },
                        "title": {
                          "type": "string",
                          "description": "Title of the item. If not available , value will be considered as null to indicate not provided."
                        },
                        "description": {
                          "type": "string",
                          "description": "Description of the item. If not provided , value will be considered as null to indicate not provided."
                        },
                        "itemAttributes": {
                          "type": "string",
                          "description": "Custom item attributes. If not provided , value will be assigned as null.",
                          "format": "json"
                        },
                        "tags": {
                          "type": "array",
                          "description": "Addiitonal information, related to the item, can be added here",
                          "default": [],
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "sku"
                      ],
                      "type": "object"
                    }
                  },
                  "groupId": {
                    "type": "string",
                    "description": "E-commerce order id should be mapped to groupId field so that tracking and returns can be utilise efficiently."
                  },
                  "orderExternalId": {
                    "type": "string",
                    "description": "Order Id by which retailer can refer the Invoice's order."
                  },
                  "customer": {
                    "type": "object",
                    "description": "Customer Information for the invoice",
                    "required": [
                      "name",
                      "phone"
                    ],
                    "properties": {
                      "name": {
                        "type": "string",
                        "description": "Individual's full name."
                      },
                      "phone": {
                        "type": "string",
                        "description": "Phone. Format: <code>+12142342232</code>"
                      },
                      "email": {
                        "type": "string",
                        "description": "Email address."
                      },
                      "userExternalId": {
                        "type": "string",
                        "description": "Id assigned to the customer."
                      }
                    }
                  },
                  "orderInfo": {
                    "type": "object",
                    "description": "Subset of Order Object to control the rules.",
                    "required": [
                      "orderValue",
                      "status"
                    ],
                    "properties": {
                      "type": {
                        "type": "string",
                        "description": "Type of the order e.g shipping, delivery, curbside."
                      },
                      "amount": {
                        "type": "integer",
                        "description": "Any delivery or shipping charges applicable for the invoice",
                        "format": "int32"
                      },
                      "orderValue": {
                        "type": "number",
                        "description": "Cost of the order in major units. e.g $10.43",
                        "format": "float"
                      },
                      "orderAttributes": {
                        "type": "string",
                        "description": "Key Value Pairs of attributes that you want to associate to the order.",
                        "format": "json"
                      },
                      "status": {
                        "type": "string",
                        "description": "Status associated with the Order if any."
                      },
                      "actualDeliveryTime": {
                        "type": "string",
                        "description": "The time at which the order was delivered",
                        "format": "date-time"
                      }
                    }
                  },
                  "deliveryAddress": {
                    "type": "object",
                    "description": "Customer delivery address at which Order being return was delivered or Customer address from which returns might get picked up",
                    "required": [
                      "street",
                      "city",
                      "state",
                      "zipcode"
                    ],
                    "properties": {
                      "street": {
                        "type": "string",
                        "description": "Address Line 1 (Street Number and Street Name)"
                      },
                      "street2": {
                        "type": "string",
                        "description": "Address Line 2 (not to be used for apartment / suite #)"
                      },
                      "apartmentNumber": {
                        "type": "string",
                        "description": "Apartment / Suite #"
                      },
                      "city": {
                        "type": "string",
                        "description": "City"
                      },
                      "state": {
                        "type": "string",
                        "description": "State"
                      },
                      "zipcode": {
                        "type": "string",
                        "description": "Zip or postal code."
                      },
                      "country": {
                        "type": "string",
                        "description": "2-letter country code in ISO 3166-1 alpha-2 format. If not provided defaults to 'US'"
                      },
                      "latitude": {
                        "type": "number",
                        "description": "Latitude coordinates of the address",
                        "format": "double"
                      },
                      "longitude": {
                        "type": "number",
                        "description": "Longitude coordinates of the address",
                        "format": "double"
                      }
                    }
                  },
                  "brandExternalId": {
                    "type": "string",
                    "description": "Brand External Id for which the Invoice is being created."
                  },
                  "createdDate": {
                    "type": "integer",
                    "description": "The date at which the original order was created",
                    "format": "int64"
                  },
                  "timeZone": {
                    "type": "string",
                    "description": "The timezone in which the original order was created"
                  },
                  "storeExternalId": {
                    "type": "string",
                    "description": "Store External Id from where the Order was dispatched."
                  }
                }
              },
              "examples": {
                "Primary Example": {
                  "value": {
                    "itemList": [
                      {
                        "sku": "sku89",
                        "quantity": 5,
                        "size": {
                          "length": 2,
                          "width": 2,
                          "height": 2
                        },
                        "weight": 2,
                        "price": 200,
                        "sale_price": 100,
                        "image": "https://qa.files.deliverysolutions.co/zebra/items/%5Bdeliverysolutions123456%5D/zebra/sku89_1665035377206.png",
                        "title": "demo",
                        "description": "demodesc"
                      },
                      {
                        "sku": "sku90",
                        "quantity": 1,
                        "size": {
                          "length": 3,
                          "width": 3,
                          "height": 3
                        },
                        "weight": 7,
                        "price": 300,
                        "sale_price": 250,
                        "image": "https://qa.files.deliverysolutions.co/zebra/items/%5Bdeliverysolutions123456%5D/zebra/sku90_1665035534831.png",
                        "title": "dmeotitle",
                        "description": "demodescription"
                      }
                    ],
                    "groupId": "GAKunalA0089",
                    "orderExternalId": "AKunalA0089",
                    "customer": {
                      "name": "Nupur",
                      "userExternalId": "nupur123",
                      "phone": "+14343424224",
                      "email": "nupur@deliverysolutions.co"
                    },
                    "orderInfo": {
                      "type": "delivery",
                      "amount": 300,
                      "orderValue": 100,
                      "tips": 10,
                      "orderAttributes": {
                        "key": "value"
                      },
                      "status": "ORDER_DISPATCHED"
                    },
                    "deliveryAddress": {
                      "street": "508 S Vine St",
                      "street2": "",
                      "city": "Atlanta",
                      "state": "IL",
                      "zipcode": "61723",
                      "country": "US",
                      "latitude": 40.2587474,
                      "longitude": -89.2294067
                    },
                    "brandExternalId": "kunal",
                    "timeZone": "America/Los_Angeles",
                    "createdDate": 1707356123000
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n     \"_id\": \"656eb9dd180d13598624a50b\",\n    \"groupId\": \"GAKunalA0089\",\n    \"tenantId\": \"kunal\",\n    \"orderExternalId\": \"AKunalA0089\",\n    \"deliveryAddress\": {\n        \"street\": \"508 S Vine St\",\n        \"street2\": \"\",\n        \"city\": \"Atlanta\",\n        \"state\": \"IL\",\n        \"zipcode\": \"61723\",\n        \"country\": \"US\",\n        \"latitude\": 40.2587474,\n        \"longitude\": -89.2294067\n    },\n    \"customer\": {\n        \"email\": \"nupur@deliverysolutions.co\",\n        \"phone\": \"+14343424224\",\n        \"name\": \"Nupur\",\n        \"userExternalId\": \"nupur123\"\n    },\n    \"brandExternalId\": \"kunal\",\n    \"storeExternalId\":\"store001\",\n    \"timeZone\": \"America/Los_Angeles\",\n    \"createdAt\": \"2024-07-23T10:34:01.695Z\",\n    \"createdDate\": 1709231400000,\n    \"itemList\": [\n        {\n            \"sku\": \"sku89\",\n            \"quantity\": 5,\n            \"size\": {\n                \"length\": 2,\n                \"width\": 2,\n                \"height\": 2,\n                \"_id\": \"63ea84197afb7569bf4bc6ec\"\n            },\n            \"weight\": 2,\n            \"price\": 200,\n            \"sale_price\": 100,\n            \"image\": \"https://qa.files.deliverysolutions.co/zebra/items/%5Bdeliverysolutions123456%5D/zebra/sku89_1665035377206.png\",\n            \"title\": \"demo\",\n            \"description\": \"demodesc\",\n            \"tags\": []\n        },\n        {\n            \"sku\": \"sku90\",\n            \"quantity\": 1,\n            \"size\": {\n                \"length\": 3,\n                \"width\": 3,\n                \"height\": 3,\n                \"_id\": \"63ea84197afb7569bf4bc6ed\"\n            },\n            \"weight\": 7,\n            \"price\": 300,\n            \"sale_price\": 250,\n            \"image\": \"https://qa.files.deliverysolutions.co/zebra/items/%5Bdeliverysolutions123456%5D/zebra/sku90_1665035534831.png\",\n            \"title\": \"dmeotitle\",\n            \"description\": \"demodescription\",\n            \"tags\": []\n        }\n    ],\n    \"orderInfo\": {\n        \"type\": \"delivery\",\n        \"amount\": 300,\n        \"orderValue\": 100,\n        \"tips\": 10,\n        \"orderAttributes\": {\n            \"key\": \"value\"\n        },\n        \"status\": \"ORDER_DISPATCHED\"\n    },\n      \"returnsUrl\": \"https://s.dl-s.co/0ShUHqCjvQS\"\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "_id": {
                      "type": "string",
                      "example": "656eb9dd180d13598624a50b"
                    },
                    "groupId": {
                      "type": "string",
                      "example": "GAKunalA0089"
                    },
                    "tenantId": {
                      "type": "string",
                      "example": "kunal"
                    },
                    "orderExternalId": {
                      "type": "string",
                      "example": "AKunalA0089"
                    },
                    "deliveryAddress": {
                      "type": "object",
                      "properties": {
                        "street": {
                          "type": "string",
                          "example": "508 S Vine St"
                        },
                        "street2": {
                          "type": "string",
                          "example": ""
                        },
                        "city": {
                          "type": "string",
                          "example": "Atlanta"
                        },
                        "state": {
                          "type": "string",
                          "example": "IL"
                        },
                        "zipcode": {
                          "type": "string",
                          "example": "61723"
                        },
                        "country": {
                          "type": "string",
                          "example": "US"
                        },
                        "latitude": {
                          "type": "number",
                          "example": 40.2587474,
                          "default": 0
                        },
                        "longitude": {
                          "type": "number",
                          "example": -89.2294067,
                          "default": 0
                        }
                      }
                    },
                    "customer": {
                      "type": "object",
                      "properties": {
                        "email": {
                          "type": "string",
                          "example": "nupur@deliverysolutions.co"
                        },
                        "phone": {
                          "type": "string",
                          "example": "+14343424224"
                        },
                        "name": {
                          "type": "string",
                          "example": "Nupur"
                        },
                        "userExternalId": {
                          "type": "string",
                          "example": "nupur123"
                        }
                      }
                    },
                    "brandExternalId": {
                      "type": "string",
                      "example": "kunal"
                    },
                    "storeExternalId": {
                      "type": "string",
                      "example": "store001"
                    },
                    "timeZone": {
                      "type": "string",
                      "example": "America/Los_Angeles"
                    },
                    "createdAt": {
                      "type": "string",
                      "example": "2024-07-23T10:34:01.695Z"
                    },
                    "createdDate": {
                      "type": "integer",
                      "example": 1709231400000,
                      "default": 0
                    },
                    "itemList": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "sku": {
                            "type": "string",
                            "example": "sku89"
                          },
                          "quantity": {
                            "type": "integer",
                            "example": 5,
                            "default": 0
                          },
                          "size": {
                            "type": "object",
                            "properties": {
                              "length": {
                                "type": "integer",
                                "example": 2,
                                "default": 0
                              },
                              "width": {
                                "type": "integer",
                                "example": 2,
                                "default": 0
                              },
                              "height": {
                                "type": "integer",
                                "example": 2,
                                "default": 0
                              },
                              "_id": {
                                "type": "string",
                                "example": "63ea84197afb7569bf4bc6ec"
                              }
                            }
                          },
                          "weight": {
                            "type": "integer",
                            "example": 2,
                            "default": 0
                          },
                          "price": {
                            "type": "integer",
                            "example": 200,
                            "default": 0
                          },
                          "sale_price": {
                            "type": "integer",
                            "example": 100,
                            "default": 0
                          },
                          "image": {
                            "type": "string",
                            "example": "https://qa.files.deliverysolutions.co/zebra/items/%5Bdeliverysolutions123456%5D/zebra/sku89_1665035377206.png"
                          },
                          "title": {
                            "type": "string",
                            "example": "demo"
                          },
                          "description": {
                            "type": "string",
                            "example": "demodesc"
                          },
                          "tags": {
                            "type": "array"
                          }
                        }
                      }
                    },
                    "orderInfo": {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "example": "delivery"
                        },
                        "amount": {
                          "type": "integer",
                          "example": 300,
                          "default": 0
                        },
                        "orderValue": {
                          "type": "integer",
                          "example": 100,
                          "default": 0
                        },
                        "tips": {
                          "type": "integer",
                          "example": 10,
                          "default": 0
                        },
                        "orderAttributes": {
                          "type": "object",
                          "properties": {
                            "key": {
                              "type": "string",
                              "example": "value"
                            }
                          }
                        },
                        "status": {
                          "type": "string",
                          "example": "ORDER_DISPATCHED"
                        }
                      }
                    },
                    "returnsUrl": {
                      "type": "string",
                      "example": "https://s.dl-s.co/0ShUHqCjvQS"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {}
                }
              }
            }
          }
        },
        "deprecated": false
      }
    }
  },
  "x-readme": {
    "headers": [
      {
        "key": "x-compression",
        "value": "true"
      }
    ],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true
}
```