{"method":"POST","path":"https://api.revcent.com/v2/invoices","summary":"Create An Invoice","description":"Create an invoice.","operationId":"CreateInvoice","requestBody":{"content":{"application/json":{"schema":{"title":"Invoice Create Object","description":"You must have createde an invoice profile prior to creating an invoice.","allOf":[{"properties":{"campaign":{"type":"string","title":"Campaign ID","description":"A 20 character campaign ID.","minLength":20,"maxLength":20},"invoice_profile":{"type":"string","description":"A 20 character invoice profile ID.","minLength":20,"maxLength":20},"invoice_type":{"type":"string","description":"The invoice type. Only accepted value at this time is 'sale_create'.","enum":["sale_create"]},"iso_currency":{"description":"The three digit ISO 4217 currency code.","type":"string","minLength":3,"maxLength":3},"customer":{"description":"The customer object receives first priority as details when creating a new customer.","additionalProperties":false,"properties":{"first_name":{"type":"string","description":"The customer first name."},"last_name":{"type":"string","description":"The customer last name."},"address_line_1":{"type":"string","description":"The customer first address line."},"address_line_2":{"type":"string","description":"The customer second address line."},"city":{"type":"string","description":"The customer city."},"state":{"type":"string","description":"The customer state."},"zip":{"type":"string","description":"The customer ZIP and or postal code."},"country":{"type":"string","description":"The customer country in three letter ISO 3166-1 alpha-3 format."},"company":{"type":"string","description":"The customer company."},"email":{"type":"string","format":"email","description":"The customer email."},"phone":{"type":"string","description":"The customer phone."}},"type":"object","required":["first_name","last_name","email"]},"product":{"description":"The products to include in the sale request.","items":{"description":"An individual product","additionalProperties":false,"properties":{"id":{"title":"Product ID","type":"string","description":"A 20 character product ID.","minLength":20,"maxLength":20},"quantity":{"description":"The quantity being purchased. Default is 1.","type":"integer"},"price":{"description":"The price you wish to charge, if different from the product default price in RevCent.","type":"number","format":"float"}},"type":"object","required":["id"]},"type":"array"},"shipping":{"description":"Shipping to include in the sale request. Please refer to our <a href=\"https://kb.revcent.com/en/revenue/shipping#provider-method-table\" target=\"_blank\">Provider Method Table</a> at our knowledge base for the provider and method IDs.","items":{"description":"An individual shipping entry.","additionalProperties":false,"properties":{"amount":{"description":"The amount to charge for the specific shipping entry. A shipping amount can be 0.","type":"number","format":"float"},"provider":{"description":"The shipping provider. This will be included when creating a shipment at a fulfillment center. Please refer to our <a href=\"https://kb.revcent.com/en/revenue/shipping#provider-method-table\" target=\"_blank\">Provider Method Table</a> at our knowledge base for the correct provider id.","type":"string"},"provider_method":{"description":"The shipping provider method. This will be included when creating a shipment at a fulfillment center. Please refer to our <a href=\"https://kb.revcent.com/en/revenue/shipping#provider-method-table\" target=\"_blank\">Provider Method Table</a> at our knowledge base for the correct method id corresponding to the provider.","type":"string"},"name":{"description":"An optional name for the shipping entry.","type":"string"},"description":{"description":"An optional description for the shipping entry.","type":"string"}},"type":"object","required":["amount"]},"type":"array"},"tax":{"description":"Tax to charge in the sale request. Can create multiple tax entries to itemize separate taxes.","items":{"description":"An individual tax entry.","additionalProperties":false,"properties":{"amount":{"description":"The amount to charge for the specific tax entry.","type":"number","format":"float"},"name":{"description":"An optional name for the tax entry.","type":"string"},"description":{"description":"An optional description for the tax entry.","type":"string"}},"type":"object","required":["amount"]},"type":"array"},"coupon":{"description":"Include one or more coupon codes which will be used to automatically apply discounts to a sale.","items":{"description":"An individual tax entry.","additionalProperties":false,"properties":{"coupon_code":{"description":"A coupon code which exists in RevCent.","type":"string"}},"type":"object","required":["coupon_code"]},"type":"array"},"discount":{"description":"Include one or more discount entries which will be used to automatically apply discounts to a sale. Can be a fixed amount or a percentage of the sales total.","items":{"description":"An individual discount entry.","additionalProperties":false,"properties":{"discount_value":{"description":"The coupon discount value relative to the discount_type.","type":"number","format":"float"},"discount_type":{"description":"The coupon discount type, either percent or amount. RevCent will calculate the discount if percent.","type":"string","enum":["percent","amount"]},"name":{"description":"An optional name for the discount entry.","type":"string"},"description":{"description":"An optional description for the discount entry.","type":"string"},"apply_to_product":{"description":"Whether to apply the discount to products purchased. Default is true. Set to false if discount should only apply to shipping.","type":"boolean"},"apply_to_shipping":{"description":"Whether to apply the discount to shipping. Default is true. Set to false if discount should only apply to products purchased.","type":"boolean"}},"type":"object","required":["discount_value","discount_type"]},"type":"array"},"metadata":{"items":{"additionalProperties":false,"properties":{"name":{"type":"string","description":"A name paired to the value for the metadata object. Limited to 100 characters in length.","minLength":1,"maxLength":100},"value":{"type":"string","description":"A value paired to the name for the metadata object. Limited to 255 characters in length.","minLength":1,"maxLength":255}},"type":"object","required":["name","value"]},"type":"array","description":"An array of metadata objects, each metadata object being a name and value pair."}},"type":"object","additionalProperties":false,"required":["campaign","invoice_profile","invoice_type","product"]}]}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"description":"","properties":{"api_call_id":{"type":"string","description":"A 20 character API call ID.","minLength":20,"maxLength":20},"api_call_unix":{"description":"Unix timestamp of when the API call was initiated.","type":"integer","format":"unix-time"},"code":{"description":"API call response code.","type":"integer","format":"int32","enum":[1]},"customer_id":{"title":"Customer ID","type":"string","description":"A 20 character customer ID.","minLength":20,"maxLength":20},"invoice_id":{"type":"string","description":"A 20 character invoice ID.","minLength":20,"maxLength":20},"sale_id":{"type":"string","description":"A 20 character sale ID.","minLength":20,"maxLength":20},"invoice_url":{"type":"string","description":"The invoice URL is a hosted page meant for a customer to pay the invoice online."},"result":{"type":"string"}},"type":"object","additionalProperties":false}}},"description":"Successful response."},"default":{"content":{"application/json":{"schema":{"description":"","properties":{"api_call_id":{"type":"string","description":"A 20 character API call ID.","minLength":20,"maxLength":20},"api_call_unix":{"description":"Unix timestamp of when the API call was initiated.","type":"integer","format":"unix-time"},"code":{"description":"This value indicates that there is an error. Will always be 0.","type":"integer","enum":[0]},"error_code":{"description":"The specific error code.","type":"string"},"message":{"description":"A human readable description of the error.","type":"string"},"result":{"description":"A description of the API call result.","type":"string"}},"title":"APIStandardErrors","type":"object","additionalProperties":false}}},"description":"Error response."}}}