{"openapi":"3.1.0","info":{"title":"Slate API","version":"1","description":"Customers, items, documents, expenses and webhooks for one business."},"servers":[{"url":"https://api.slate.co.il","description":"Live"},{"url":"https://sandbox-api.slate.co.il","description":"Sandbox"}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","description":"Authorization: Bearer slk_live_... (slk_test_... on the sandbox)"}},"schemas":{"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["type","code","message","param","requestId"],"properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"param":{"type":["string","null"]},"details":{"type":"object"},"requestId":{"type":["string","null"]}}}}},"Business":{"type":"object","properties":{"object":{"const":"business"},"id":{"type":"string"},"name":{"type":"string"},"taxId":{"type":["string","null"]},"businessType":{"type":["string","null"]},"vatExempt":{"type":"boolean"},"vatRate":{"type":"number"},"defaultCurrency":{"type":"string"},"address":{"type":["string","null"]},"city":{"type":["string","null"]},"phone":{"type":["string","null"]},"email":{"type":["string","null"]},"website":{"type":["string","null"]}}},"Customer":{"type":"object","properties":{"object":{"const":"customer"},"id":{"type":"string"},"customerNumber":{"type":"string"},"type":{"enum":["individual","company"]},"name":{"type":"string"},"taxId":{"type":["string","null"]},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"mobile":{"type":["string","null"]},"website":{"type":["string","null"]},"address":{"type":["object","null"]},"currency":{"type":"string"},"paymentTerms":{"type":["string","null"]},"notes":{"type":["string","null"]},"tags":{"type":"array","items":{"type":"string"}},"status":{"enum":["active","inactive"]},"externalSystemId":{"type":["string","null"]},"createdAt":{"type":["string","null"]},"modifiedAt":{"type":["string","null"],"format":"date-time","description":"UTC timestamp."}}},"CustomerInput":{"type":"object","additionalProperties":false,"properties":{"name":{"type":"string"},"customerNumber":{"type":"string"},"type":{"enum":["individual","company"]},"taxId":{"type":"string"},"phone":{"type":"string"},"mobile":{"type":"string"},"email":{"type":"string"},"website":{"type":"string"},"address":{"type":"object"},"currency":{"type":"string"},"paymentTerms":{"type":"string"},"defaultDiscount":{"type":"number"},"externalSystemId":{"type":"string"},"notes":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}},"status":{"enum":["active","inactive"]}}},"Product":{"type":"object","properties":{"object":{"const":"product"},"id":{"type":"string"},"sku":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"unit":{"type":"string"},"price":{"type":"number"},"vatIncluded":{"type":"boolean"},"category":{"type":["string","null"]},"active":{"type":"boolean"},"createdAt":{"type":"string"},"modifiedAt":{"type":["string","null"],"format":"date-time","description":"UTC timestamp."}}},"ProductInput":{"type":"object","additionalProperties":false,"properties":{"name":{"type":"string"},"sku":{"type":"string"},"description":{"type":"string"},"unit":{"type":"string"},"price":{"type":"number"},"vatIncluded":{"type":"boolean"},"category":{"type":"string"},"active":{"type":"boolean"}}},"LineItem":{"type":"object","additionalProperties":false,"properties":{"productName":{"type":"string"},"description":{"type":"string"},"quantity":{"type":"number"},"unit":{"type":"string"},"price":{"type":"number"},"discountType":{"enum":["percent","amount"]},"discountValue":{"type":"number"},"vatIncluded":{"type":"boolean","description":"Add VAT to this line. Defaults to true; ignored for an exempt dealer."},"isNote":{"type":"boolean"}}},"Receipt":{"type":"object","description":"One payment on a receipt or tax invoice/receipt.","properties":{"receiptType":{"enum":["cash","check","credit","transfer","bit","paybox","paypal","withholding","other"]},"date":{"type":"string","format":"date","description":"A calendar day in Israel time, YYYY-MM-DD."},"amount":{"type":"number"},"currency":{"type":"string"},"checkNumber":{"type":"string"},"bankNumber":{"type":"string"},"branchNumber":{"type":"string"},"accountNumber":{"type":"string"},"checkDueDate":{"type":"string","format":"date","description":"A calendar day in Israel time, YYYY-MM-DD."},"cardLast4":{"type":"string"},"cardProcessor":{"type":"string"},"creditTransactionType":{"type":"string"},"installments":{"type":"number"},"reference":{"type":"string"},"details":{"type":"string"}}},"Document":{"type":"object","properties":{"object":{"const":"document"},"id":{"type":"string"},"type":{"enum":["tax-invoice","tax-invoice-receipt","receipt","credit-invoice","transaction-invoice","quote","order","delivery-note","payment-request"]},"typeCode":{"type":["integer","null"],"description":"The Tax Authority document code."},"status":{"enum":["draft","issued"]},"number":{"type":["string","null"]},"documentDate":{"type":"string","format":"date","description":"A calendar day in Israel time, YYYY-MM-DD."},"customerId":{"type":["string","null"]},"customerName":{"type":"string"},"currency":{"type":"string"},"exchangeRate":{"type":["number","null"]},"amount":{"type":"number"},"vatTotal":{"type":"number"},"discountTotal":{"type":"number"},"linkedDocumentId":{"type":["string","null"]},"source":{"enum":["app","api","imported"]},"createdBy":{"type":"string"},"signedAt":{"type":["string","null"]},"cancelledAt":{"type":["string","null"]},"allocation":{"type":["object","null"],"properties":{"status":{"type":"string"},"number":{"type":["string","null"]},"decision":{"type":["string","null"]}}},"publicUrl":{"type":["string","null"],"description":"The download link the business would send its customer. Issued documents only."},"modifiedAt":{"type":["string","null"],"format":"date-time","description":"UTC timestamp."},"notes":{"type":["string","null"]},"paymentDetails":{"type":["string","null"]},"lineItems":{"type":"array","items":{"$ref":"#/components/schemas/LineItem"}},"receipts":{"type":"array","items":{"$ref":"#/components/schemas/Receipt"}},"tags":{"type":"array","items":{"type":"string"}}}},"DocumentInput":{"type":"object","additionalProperties":false,"required":["type","status"],"properties":{"type":{"enum":["tax-invoice","tax-invoice-receipt","receipt","credit-invoice","transaction-invoice","quote","order","delivery-note","payment-request"]},"status":{"enum":["draft","issued"],"description":"Required, no default. \"issued\" creates a permanent document and needs an Idempotency-Key."},"customerId":{"type":"string"},"customerName":{"type":"string","description":"For a walk-in customer with no customer record."},"currency":{"type":"string"},"exchangeRate":{"type":"number"},"documentDate":{"type":"string","format":"date","description":"A calendar day in Israel time, YYYY-MM-DD."},"lineItems":{"type":"array","items":{"$ref":"#/components/schemas/LineItem"}},"receipts":{"type":"array","items":{"$ref":"#/components/schemas/Receipt"}},"notes":{"type":"string"},"paymentDetails":{"type":"string"},"linkedDocumentId":{"type":"string","description":"The source document of a credit-invoice."},"tags":{"type":"array","items":{"type":"string"}},"hideAmounts":{"type":"boolean"},"lang":{"enum":["he","en"]},"expectedTotal":{"type":"number","description":"The total you expect. A different server total refuses the issue (409 total_mismatch)."},"issueWithoutAllocation":{"type":"boolean","description":"Issue anyway when the Tax Authority refuses an allocation number. The key must allow it."}}},"Expense":{"type":"object","properties":{"object":{"const":"expense"},"id":{"type":"string"},"expenseNumber":{"type":"string"},"status":{"type":"string"},"date":{"type":"string","format":"date","description":"A calendar day in Israel time, YYYY-MM-DD."},"supplierName":{"type":"string"},"supplierTaxId":{"type":["string","null"]},"supplierDocumentNumber":{"type":["string","null"]},"documentType":{"type":"string"},"categoryId":{"type":"string"},"description":{"type":["string","null"]},"currency":{"type":"string"},"exchangeRate":{"type":["number","null"]},"amountBeforeVat":{"type":"number"},"vatAmount":{"type":"number"},"totalAmount":{"type":"number"},"deductibleVat":{"type":"number"},"deductibleAmount":{"type":"number"},"allocationNumber":{"type":["string","null"]},"paymentMethod":{"type":["string","null"]},"hasReceipt":{"type":"boolean"},"notes":{"type":["string","null"]},"createdAt":{"type":["string","null"]}}},"ExpenseInput":{"type":"object","additionalProperties":false,"properties":{"date":{"type":"string","format":"date","description":"A calendar day in Israel time, YYYY-MM-DD."},"supplierName":{"type":"string"},"supplierTaxId":{"type":"string"},"supplierDocumentNumber":{"type":"string"},"categoryId":{"type":"string"},"description":{"type":"string"},"currency":{"type":"string"},"exchangeRate":{"type":"number"},"documentType":{"type":"string"},"amountBeforeVat":{"type":"number"},"vatRate":{"type":"number"},"allocationNumber":{"type":"string"},"paymentMethod":{"type":"string"},"isCapitalAsset":{"type":"boolean"},"notes":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}},"receipt":{"type":"object","properties":{"type":{"enum":["image/jpeg","image/png","image/webp","application/pdf"]},"data":{"type":"string","description":"Base64, up to 5MB."}}}}},"WebhookEndpoint":{"type":"object","properties":{"object":{"const":"webhook_endpoint"},"id":{"type":"string"},"url":{"type":"string"},"events":{"type":"array","items":{"type":"string"}},"status":{"enum":["active","disabled"]},"disabledAt":{"type":["string","null"]},"createdAt":{"type":"string"},"secret":{"type":"string","description":"Returned once, when the endpoint is created."}}},"Event":{"type":"object","properties":{"id":{"type":"string"},"object":{"const":"event"},"type":{"enum":["document.issued","document.allocation_updated","document.sent","customer.created","customer.updated","expense.created"]},"createdAt":{"type":"string"},"data":{"type":"object"}}},"ApiKey":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"last4":{"type":"string"},"environment":{"enum":["live","test"]},"scopes":{"type":"object"},"canIssue":{"type":"boolean"},"canIssueWithoutAllocation":{"type":"boolean"},"dailyIssueLimit":{"type":["integer","null"]},"allowedIps":{"type":"array","items":{"type":"string"}},"expiresAt":{"type":["string","null"]},"createdAt":{"type":"string"},"lastUsedAt":{"type":["string","null"]},"revokedAt":{"type":["string","null"]},"secret":{"type":"string","description":"The key itself. Returned once, when it is created; store it with the user it belongs to."}}},"ApiKeyInput":{"type":"object","properties":{"name":{"type":"string"},"scopes":{"type":"object","description":"Per resource: none, read or write. Default: everything."},"canIssue":{"type":"boolean","description":"Default true."},"canIssueWithoutAllocation":{"type":"boolean"},"dailyIssueLimit":{"type":"integer"},"allowedIps":{"type":"array","items":{"type":"string"}},"expiresAt":{"type":"string"}}},"PartnerBusiness":{"type":"object","properties":{"object":{"const":"partner_business"},"id":{"type":"string"},"externalId":{"type":["string","null"]},"businessName":{"type":"string"},"taxId":{"type":"string"},"ownerEmail":{"type":"string"},"createdAt":{"type":"string"},"apiKey":{"$ref":"#/components/schemas/ApiKey","description":"Only in the answer to opening the business."}}},"PartnerBusinessInput":{"type":"object","required":["email","ownerName","businessName","businessType","taxId","phone","city","address","acceptedTerms"],"properties":{"email":{"type":"string","description":"The owner's own address: they sign in with it, and every security notice goes there."},"ownerName":{"type":"string","description":"First and last name."},"businessName":{"type":"string"},"businessType":{"enum":["exempt-dealer","licensed-dealer","private-company","nonprofit","partnership"]},"taxId":{"type":"string"},"phone":{"type":"string"},"city":{"type":"string"},"address":{"type":"string"},"acceptedTerms":{"const":true,"description":"The owner accepted Slate's terms in your sign-up flow."},"externalId":{"type":"string","description":"Your own id for this user, unique per partner. Up to 100 characters."},"key":{"$ref":"#/components/schemas/ApiKeyInput"}}},"Client":{"type":"object","properties":{"object":{"const":"client"},"businessId":{"type":"string"},"name":{"type":"string"},"taxId":{"type":["string","null"]},"businessType":{"type":["string","null"]}}}}},"paths":{"/v1/business":{"get":{"summary":"The business the key belongs to","x-scope":"business","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Business"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, wrong or revoked key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key may not do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/customers":{"get":{"summary":"List customers","x-scope":"customers","parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100},"description":"Default 50."},{"name":"startingAfter","in":"query","schema":{"type":"string"},"description":"The last id of the previous page."},{"name":"modifiedSince","in":"query","schema":{"type":"string","format":"date-time"},"description":"Only rows changed at or after this time."},{"name":"taxId","in":"query","schema":{"type":"string"}},{"name":"email","in":"query","schema":{"type":"string"}},{"name":"externalSystemId","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["object","data","hasMore"],"properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Customer"}},"hasMore":{"type":"boolean"}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, wrong or revoked key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key may not do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"summary":"Create a customer","x-scope":"customers","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerInput"}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Customer"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, wrong or revoked key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key may not do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/customers/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"summary":"Get a customer","x-scope":"customers","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Customer"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, wrong or revoked key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key may not do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"summary":"Update a customer","x-scope":"customers","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerInput"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Customer"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, wrong or revoked key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key may not do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"summary":"Delete a customer with no documents","x-scope":"customers","responses":{"204":{"description":"Deleted"},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, wrong or revoked key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key may not do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/products":{"get":{"summary":"List items","x-scope":"products","parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100},"description":"Default 50."},{"name":"startingAfter","in":"query","schema":{"type":"string"},"description":"The last id of the previous page."},{"name":"modifiedSince","in":"query","schema":{"type":"string","format":"date-time"},"description":"Only rows changed at or after this time."},{"name":"sku","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["object","data","hasMore"],"properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Product"}},"hasMore":{"type":"boolean"}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, wrong or revoked key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key may not do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"summary":"Create an item","x-scope":"products","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductInput"}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Product"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, wrong or revoked key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key may not do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/products/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"summary":"Get an item","x-scope":"products","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Product"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, wrong or revoked key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key may not do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"summary":"Update an item","x-scope":"products","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductInput"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Product"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, wrong or revoked key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key may not do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"summary":"Delete an item","x-scope":"products","responses":{"204":{"description":"Deleted"},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, wrong or revoked key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key may not do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/documents":{"get":{"summary":"List documents","x-scope":"documents","parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100},"description":"Default 50."},{"name":"startingAfter","in":"query","schema":{"type":"string"},"description":"The last id of the previous page."},{"name":"modifiedSince","in":"query","schema":{"type":"string","format":"date-time"},"description":"Only rows changed at or after this time."},{"name":"dateFrom","in":"query","schema":{"type":"string","format":"date","description":"A calendar day in Israel time, YYYY-MM-DD."}},{"name":"dateTo","in":"query","schema":{"type":"string","format":"date","description":"A calendar day in Israel time, YYYY-MM-DD."}},{"name":"type","in":"query","schema":{"enum":["tax-invoice","tax-invoice-receipt","receipt","credit-invoice","transaction-invoice","quote","order","delivery-note","payment-request"]}},{"name":"status","in":"query","schema":{"enum":["draft","issued"]}},{"name":"customerId","in":"query","schema":{"type":"string"}},{"name":"expand","in":"query","schema":{"enum":["lineItems"]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["object","data","hasMore"],"properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Document"}},"hasMore":{"type":"boolean"}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, wrong or revoked key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key may not do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"summary":"Create a draft, or issue a document","description":"With status \"issued\" the document is issued at once and cannot be edited or deleted afterwards. The key needs the issue permission and the request needs an Idempotency-Key.","x-scope":"documents","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string"},"description":"Required when status is \"issued\"."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentInput"}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Document"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, wrong or revoked key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key may not do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/documents/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"summary":"Get a document","x-scope":"documents","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Document"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, wrong or revoked key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key may not do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"summary":"Update a draft","x-scope":"documents","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentInput"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Document"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, wrong or revoked key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key may not do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"summary":"Delete a draft","x-scope":"documents","responses":{"204":{"description":"Deleted"},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, wrong or revoked key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key may not do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/documents/{id}/issue":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"post":{"summary":"Issue a draft","x-scope":"documents","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string"},"description":"Any unique string of yours, up to 255 characters, kept 24 hours."}],"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Document"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, wrong or revoked key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key may not do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/documents/{id}/pdf":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"summary":"Download the PDF of an issued document","x-scope":"documents","responses":{"303":{"description":"Redirect to the file"},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, wrong or revoked key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key may not do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/documents/{id}/send":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"post":{"summary":"Email the customer a link to an issued document","description":"Goes to the email on the customer record, never to an address in the request.","x-scope":"documents","requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"channel":{"enum":["email"]}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"const":"document_send"},"sent":{"type":"boolean"},"channel":{"type":"string"},"to":{"type":"string"}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, wrong or revoked key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key may not do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/documents/{id}/allocation/retry":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"post":{"summary":"Ask the Tax Authority again for an allocation number","x-scope":"documents","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Document"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, wrong or revoked key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key may not do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/documents/{id}/public-url/rotate":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"post":{"summary":"Replace the public download link","x-scope":"documents","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Document"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, wrong or revoked key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key may not do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/document-numbering":{"get":{"summary":"Numbering per document type","x-scope":"documents","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, wrong or revoked key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key may not do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/document-numbering/{type}":{"parameters":[{"name":"type","in":"path","required":true,"schema":{"enum":["tax-invoice","tax-invoice-receipt","receipt","credit-invoice","transaction-invoice","quote","order","delivery-note","payment-request"]}}],"put":{"summary":"Confirm the starting number for a document type","description":"Required once per type before its first document is issued (until then issuing answers 409 numbering_not_confirmed). Can be changed until a document of that type is issued, then 409 numbering_locked.","x-scope":"documents","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["startingNumber"],"properties":{"startingNumber":{"type":"integer","minimum":1,"maximum":2099999999}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"enum":["tax-invoice","tax-invoice-receipt","receipt","credit-invoice","transaction-invoice","quote","order","delivery-note","payment-request"]},"startingNumber":{"type":"integer"},"nextNumber":{"type":"integer"},"confirmed":{"type":"boolean"}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, wrong or revoked key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key may not do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/expenses":{"get":{"summary":"List expenses","x-scope":"expenses","parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100},"description":"Default 50."},{"name":"startingAfter","in":"query","schema":{"type":"string"},"description":"The last id of the previous page."},{"name":"dateFrom","in":"query","schema":{"type":"string","format":"date","description":"A calendar day in Israel time, YYYY-MM-DD."}},{"name":"dateTo","in":"query","schema":{"type":"string","format":"date","description":"A calendar day in Israel time, YYYY-MM-DD."}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["object","data","hasMore"],"properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Expense"}},"hasMore":{"type":"boolean"}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, wrong or revoked key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key may not do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"summary":"Record an expense","x-scope":"expenses","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseInput"}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Expense"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, wrong or revoked key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key may not do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/expenses/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"summary":"Get an expense","x-scope":"expenses","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Expense"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, wrong or revoked key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key may not do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/expenses/{id}/receipt":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"summary":"Download the receipt file","x-scope":"expenses","responses":{"200":{"description":"The file"},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, wrong or revoked key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key may not do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/reports/vat":{"get":{"summary":"VAT report for a period","x-scope":"reports","parameters":[{"name":"from","in":"query","schema":{"type":"string","format":"date","description":"A calendar day in Israel time, YYYY-MM-DD."},"required":true},{"name":"to","in":"query","schema":{"type":"string","format":"date","description":"A calendar day in Israel time, YYYY-MM-DD."},"required":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, wrong or revoked key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key may not do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/webhook-endpoints":{"get":{"summary":"List webhook endpoints","x-scope":"webhooks","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["object","data","hasMore"],"properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/WebhookEndpoint"}},"hasMore":{"type":"boolean"}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, wrong or revoked key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key may not do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"summary":"Register a webhook endpoint","x-scope":"webhooks","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["url","events"],"properties":{"url":{"type":"string"},"events":{"type":"array","items":{"type":"string"}}}}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpoint"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, wrong or revoked key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key may not do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/webhook-endpoints/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"delete":{"summary":"Remove a webhook endpoint","x-scope":"webhooks","responses":{"204":{"description":"Removed"},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, wrong or revoked key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key may not do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/events":{"get":{"summary":"Events from the last 30 days","x-scope":"webhooks","parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100},"description":"Default 50."},{"name":"startingAfter","in":"query","schema":{"type":"string"},"description":"The last id of the previous page."},{"name":"type","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["object","data","hasMore"],"properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Event"}},"hasMore":{"type":"boolean"}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, wrong or revoked key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key may not do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/partner/businesses":{"get":{"summary":"Businesses you opened","x-scope":"partner","parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100},"description":"Default 50."},{"name":"startingAfter","in":"query","schema":{"type":"string"},"description":"The last id of the previous page."},{"name":"externalId","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["object","data","hasMore"],"properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/PartnerBusiness"}},"hasMore":{"type":"boolean"}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, wrong or revoked key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key may not do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"summary":"Open a business for one of your users","x-scope":"partner","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PartnerBusinessInput"}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PartnerBusiness"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, wrong or revoked key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key may not do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/partner/businesses/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"summary":"One business you opened","x-scope":"partner","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PartnerBusiness"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, wrong or revoked key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key may not do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/partner/businesses/{id}/keys":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"summary":"Keys you created for the business","x-scope":"partner","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["object","data","hasMore"],"properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/ApiKey"}},"hasMore":{"type":"boolean"}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, wrong or revoked key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key may not do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"summary":"Create another key for the business","x-scope":"partner","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyInput"}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKey"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, wrong or revoked key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key may not do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/partner/businesses/{id}/keys/{keyId}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"keyId","in":"path","required":true,"schema":{"type":"string"}}],"delete":{"summary":"Revoke a key you created","x-scope":"partner","responses":{"204":{"description":"Revoked"},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, wrong or revoked key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key may not do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}