{"openapi":"3.1.0","info":{"description":"REST API for transfering invoices to 24SO","version":"1.2.1","title":"24SO REST API","contact":{"email":"kjellmorten@integreat.io"},"license":{"name":"Apache 2.0","url":"http://www.apache.org/licenses/LICENSE-2.0.html"}},"tags":[{"name":"admins","description":"Secured Admin-only calls"},{"name":"developers","description":"Operations available to regular developers"}],"paths":{"/invoices":{"post":{"tags":["developers"],"summary":"Adds an invoice to 24SO","operationId":"addInvoice","description":"Adds an invoice to 24SO","responses":{"200":{"description":"Request is accepted and invoice will be created, or it has already been transferred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Response"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Response"}}}},"401":{"description":"No access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Response"}}}}},"requestBody":{"description":"Invoice to add","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Invoice"}}}},"security":[{"api_token":["write:data"]}]}}},"components":{"schemas":{"Address":{"type":"object","properties":{"name":{"type":"string","description":"Alternative name for address","examples":["Company AS"]},"addressLine1":{"type":"string","examples":["Billingsgaten 18"]},"addressLine2":{"type":"string","examples":[""]},"zipCode":{"type":"string","examples":["0154"]},"city":{"type":"string","examples":["Oslo"]},"region":{"type":"string","description":"Region or state where applicable. Please use state codes for US and Canada","examples":[""]},"countryCode":{"type":"string","description":"Two letter ISO code for country","examples":["NO"]}}},"Contact":{"type":"object","required":["id","name"],"properties":{"id":{"type":"string","description":"Contact id","examples":[1001]},"type":{"type":"string","enum":["business","consumer"]},"name":{"type":"string","description":"Full name of contact","examples":["Company AS"]},"email":{"type":"string","description":"Contact's email, may be used to send invoice to","examples":["billing@company.as"]},"orgno":{"type":"string","description":"Organization number for contact when applicable. Should be the Brreg number for Norwegian customers","examples":["999111222"]},"invoiceAddress":{"$ref":"#/components/schemas/Address"},"deliveryAddress":{"$ref":"#/components/schemas/Address"}}},"Invoice":{"type":"object","required":["status","title","orderedAt","invoicedAt","amount","paymentMethod","contact","rows"],"properties":{"id":{"type":"string","description":"A unique id that will be stored as a reference in 24SO","examples":[31001]},"status":{"type":"string","enum":["draft","ordered","invoiced","paid","cancelled"],"description":"The state of the order / invoice","examples":["invoiced"]},"title":{"type":"string","description":"A short title for the invoice","examples":["Invoice #31001"]},"description":{"type":"string","description":"A longer description for the invoice","examples":["Order from pantshop.com"]},"orderedAt":{"type":"string","format":"date-time","examples":["2021-08-29T09:12:33.001Z"]},"invoicedAt":{"type":"string","format":"date-time","examples":["2021-08-29T09:12:33.001Z"]},"deliveredAt":{"type":"string","format":"date-time","examples":["2021-08-29T09:12:33.001Z"]},"paidAt":{"type":"string","format":"date-time","examples":["2021-08-29T09:12:33.001Z"]},"updatedAt":{"type":"string","format":"date-time","examples":["2021-08-29T09:12:33.001Z"]},"amount":{"type":"number","description":"The total invoice amount in cents, including VAT","examples":[337500]},"vatAmount":{"type":"number","description":"The total VAT amount in cents","examples":[67500]},"paidAmount":{"type":"number","description":"Prepaid amount in cents, when applicable","examples":[0]},"currencySymbol":{"type":"string","description":"Three letter code for the currency","examples":["NOK"]},"paymentDays":{"type":"integer","description":"The number of days before the due date","examples":[14]},"paymentMethod":{"type":"string","description":"A keyword specifying the payment method","examples":["invoice"]},"paymentReference":{"type":"string","description":"A reference from the payment gateway, that will be used to match the invoice with the payment in 24SO","examples":["chekfjepfhwopefhpiweh"]},"distributeInvoice":{"type":"boolean","description":"When this is true, the invoice will be automatically sent to the recipient"},"ourReference":{"type":"string","examples":[""]},"yourReference":{"type":"string","examples":["Rolf Midttun"]},"contact":{"$ref":"#/components/schemas/Contact"},"rows":{"type":"array","items":{"$ref":"#/components/schemas/Row"}}}},"Response":{"type":"object","required":["status"],"properties":{"status":{"type":"string","enum":["ok","noaction","queued","error","badrequest","timeout","noaccess"]},"error":{"type":"string"},"warning":{"type":"string"}}},"Row":{"type":"object","required":["name"],"properties":{"id":{"type":"string","description":"Row id. Must be unique within the invoice","examples":["1"]},"productId":{"type":"string","description":"A product id for the invoice row, e.g. a SKU","examples":["PANT001-BLUE"]},"text":{"type":"string","description":"Invoice row text","examples":["Blue pants"]},"price":{"type":"number","description":"Price per item in cents","examples":[90000]},"quantity":{"type":"number","description":"Number of items","examples":[3]},"taxPercent":{"type":"number","description":"Tax rate in percentage","examples":[25]},"discountPercent":{"type":"number","description":"Discount rate in percentage","examples":[50]},"accrualDate":{"type":"string","format":"date","description":"The start date of the accrual period","examples":["2021-11-01"]},"accrualMonths":{"type":"number","description":"The number of months the accural period spans","examples":[1]}}}},"securitySchemes":{"api_token":{"type":"http","name":"Bearer token","scheme":"bearer"}}}}