{"openapi":"3.1.0","info":{"title":"AbaNinja Accounting API - Assignments","version":"3.0.0","x-domain-id":"accounting"},"servers":[{"url":"https://api.abaninja.ch","description":"The AbaNinja API server"}],"tags":[{"name":"accounting-assignments","description":"Manage accounting assignments","x-displayName":"Accounting Assignments"}],"security":[{"ApiToken":[]}],"paths":{"/accounts/{accountUuid}/accounting/v2/account-assignments":{"get":{"tags":["accounting-assignments"],"summary":"Get all assignments","description":"Get all assignments","operationId":"accounting_list_account_assignments","parameters":[{"name":"accountUuid","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"properties":{"data":{"type":"array","items":{"title":"Accounting Account Assignment with Details","properties":{"uuid":{"type":"string","format":"uuid"},"type":{"type":"string","enum":["PAYMENT_TYPE","COLLECT_INVOICE","COLLECT_RECEIPT","VAT_REVENUE","VAT_EFFORTS","VAT_INPUT","VAT_EXPORT","VAT_ACQUISITION","ON_ACCOUNT","CLOSING_INCOME","CLOSING_PASSIVE","DEFAULT_REVENUE","DEFAULT_EFFORTS","FOREX_REVENUE","FOREX_EFFORTS","ROUNDING_INVOICE","ROUNDING_RECEIPT","CREDIT_NOTE_OFFSET_DEBITOR","CREDIT_NOTE_OFFSET_CREDITOR","DUNNING_FEES"]},"accAccount":{"properties":{"exists":{"type":"boolean"},"uuid":{"type":["string","null"],"format":"uuid"},"number":{"type":["string","null"]},"name":{"type":["string","null"]}},"type":"object"},"currencyCode":{"type":["string","null"],"format":"iso-4217","maxLength":3,"minLength":3},"paymentMethod":{"type":["string","null"],"enum":["BANK","BITPAY","CARD_TERMINAL","CASH","CASH_ON_DELIVERY","INSTANT_TRANSFER","PAYPAL","TWINT","WIR","VOUCHER_OWN","VOUCHER_THIRD_PARTY","CREDIT_NOTE_OFFSET","DISCOUNT","CASH_DISCOUNT","DEBIT_LOSS","DEBIT_CREDIT_CARD","DONATION","CARD_COMMISSIONS","CURRENT_ACCOUNT","PREPAYMENT","PRIVATE","MAESTRO","MASTERCARD","VISA","AMEX","POSTFINANCE","DINERS_CARD","DUNNING_REMISSION"]},"direction":{"type":["string","null"],"enum":["IN","OUT"]},"taxRateUuid":{"type":["string","null"],"format":"uuid"},"bankAccountUuid":{"type":["string","null"],"format":"uuid"},"paymentCardUuid":{"type":["string","null"],"format":"uuid"},"flags":{"properties":{"isGenerated":{"type":"boolean"},"isRequired":{"type":"boolean"},"isComplete":{"type":"boolean"},"isSystem":{"type":"boolean"}},"type":"object"}},"type":"object"}},"message":{"title":"message","type":"string"},"status":{"example":200},"meta":{"title":"meta","type":["object","null"]}},"required":["data","message","status"]}}}}},"security":[{"ApiToken":["https://api.abaninja.ch/auth/accounting"]}],"x-legacy-operation-id":"156043603836d5e9c1ba6bfc1e344421","x-required-scopes":["accounting"]},"post":{"tags":["accounting-assignments"],"summary":"Create assignment","description":"Create a new assignment","operationId":"accounting_create_account_assignments","parameters":[{"name":"accountUuid","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"description":"Create assignment","required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://api.abaninja.ch/schemas/2.0.0/account-assignment.create.schema.json","description":"A Schema for creating an accounting account assignment","type":"object","properties":{"type":{"type":"string","enum":["PAYMENT_TYPE","COLLECT_INVOICE","COLLECT_RECEIPT","VAT_REVENUE","VAT_EFFORTS","VAT_INPUT","VAT_EXPORT","VAT_ACQUISITION","ON_ACCOUNT","CLOSING_INCOME","CLOSING_PASSIVE","DEFAULT_REVENUE","DEFAULT_EFFORTS","FOREX_REVENUE","FOREX_EFFORTS","ROUNDING_INVOICE","ROUNDING_RECEIPT","CREDIT_NOTE_OFFSET_DEBITOR","CREDIT_NOTE_OFFSET_CREDITOR","DUNNING_FEES"],"description":"The type of accounting assignment. Dictates further validation."},"accAccountUuid":{"type":"string","format":"uuid","description":"The UUID of the AccAccount, that should be used when booking."},"currencyCode":{"type":["null","string"],"pattern":"^[A-Z]{3}$","description":"ISO code of the currency. When set, the assignment is only getting used, when a booking in the set currency is being booked."},"taxRateUuid":{"type":["null","string"],"format":"uuid","description":"UUID of a tax rate. When set, the assignment is only getting used, when a booking with the set tax rate is being booked."},"paymentMethod":{"type":["null","string"],"enum":[null,"BANK","BITPAY","CARD_TERMINAL","CASH","CASH_ON_DELIVERY","INSTANT_TRANSFER","PAYPAL","TWINT","WIR","VOUCHER_OWN","VOUCHER_THIRD_PARTY","CREDIT_NOTE_OFFSET","DISCOUNT","CASH_DISCOUNT","DEBIT_LOSS","DEBIT_CREDIT_CARD","DONATION","CARD_COMMISSIONS","CURRENT_ACCOUNT","PREPAYMENT","PRIVATE","MAESTRO","MASTERCARD","VISA","AMEX","POSTFINANCE","DUNNING_REMISSION"],"description":"Method of a Payment. When set, the assignment is only getting used, when a payment with the set payment method is being booked."},"direction":{"type":["null","string"],"enum":[null,"IN","OUT"],"description":"Direction of a Payment. When set, the assignment is only getting used, when a payment with the set direction is being booked."},"bankAccountUuid":{"type":["null","string"],"format":"uuid","description":"UUID of a bank account. Only applies to Type PAYMENT_TYPE with Payment Method BANK."},"paymentCardUuid":{"type":["null","string"],"format":"uuid","description":"UUID of a payment card. Only applies to Type PAYMENT_TYPE with Payment Method DEBIT_CREDIT_CARD."}},"required":["type","accAccountUuid"],"additionalProperties":false}}}},"responses":{"201":{"description":"Successful response","content":{"application/json":{"schema":{"properties":{"data":{"title":"Accounting Account Assignment with Details","properties":{"uuid":{"type":"string","format":"uuid"},"type":{"type":"string","enum":["PAYMENT_TYPE","COLLECT_INVOICE","COLLECT_RECEIPT","VAT_REVENUE","VAT_EFFORTS","VAT_INPUT","VAT_EXPORT","VAT_ACQUISITION","ON_ACCOUNT","CLOSING_INCOME","CLOSING_PASSIVE","DEFAULT_REVENUE","DEFAULT_EFFORTS","FOREX_REVENUE","FOREX_EFFORTS","ROUNDING_INVOICE","ROUNDING_RECEIPT","CREDIT_NOTE_OFFSET_DEBITOR","CREDIT_NOTE_OFFSET_CREDITOR","DUNNING_FEES"]},"accAccount":{"properties":{"exists":{"type":"boolean"},"uuid":{"type":["string","null"],"format":"uuid"},"number":{"type":["string","null"]},"name":{"type":["string","null"]}},"type":"object"},"currencyCode":{"type":["string","null"],"format":"iso-4217","maxLength":3,"minLength":3},"paymentMethod":{"type":["string","null"],"enum":["BANK","BITPAY","CARD_TERMINAL","CASH","CASH_ON_DELIVERY","INSTANT_TRANSFER","PAYPAL","TWINT","WIR","VOUCHER_OWN","VOUCHER_THIRD_PARTY","CREDIT_NOTE_OFFSET","DISCOUNT","CASH_DISCOUNT","DEBIT_LOSS","DEBIT_CREDIT_CARD","DONATION","CARD_COMMISSIONS","CURRENT_ACCOUNT","PREPAYMENT","PRIVATE","MAESTRO","MASTERCARD","VISA","AMEX","POSTFINANCE","DINERS_CARD","DUNNING_REMISSION"]},"direction":{"type":["string","null"],"enum":["IN","OUT"]},"taxRateUuid":{"type":["string","null"],"format":"uuid"},"bankAccountUuid":{"type":["string","null"],"format":"uuid"},"paymentCardUuid":{"type":["string","null"],"format":"uuid"},"flags":{"properties":{"isGenerated":{"type":"boolean"},"isRequired":{"type":"boolean"},"isComplete":{"type":"boolean"},"isSystem":{"type":"boolean"}},"type":"object"}},"type":"object"},"message":{"title":"message","type":"string"},"status":{"example":201},"meta":{"title":"meta","type":["object","null"]}},"required":["data","message","status"]}}}},"400":{"description":"Bad request or validation error","content":{"application/json":{"schema":{"properties":{"detail":{"title":"details"},"type":{"title":"type","type":"string"},"requestUuid":{"title":"requestUuid","type":"string","format":"uuid"},"path":{"title":"path","type":"string"},"message":{"title":"message","type":["string","null"]},"status":{"title":"status","description":"HTTP status code","type":"integer"}},"required":["detail","type","message","status"]}}}}},"security":[{"ApiToken":["https://api.abaninja.ch/auth/accounting"]}],"x-legacy-operation-id":"49fbd5712c34b61d08dd3e276a94db9c","x-required-scopes":["accounting"]}},"/accounts/{accountUuid}/accounting/v2/account-assignments/{assignmentUuid}":{"get":{"tags":["accounting-assignments"],"summary":"Get single assignment","description":"Get a single assignment","operationId":"accounting_get_account_assignments","parameters":[{"name":"accountUuid","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"assignmentUuid","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"properties":{"data":{"title":"Accounting Account Assignment with Details","properties":{"uuid":{"type":"string","format":"uuid"},"type":{"type":"string","enum":["PAYMENT_TYPE","COLLECT_INVOICE","COLLECT_RECEIPT","VAT_REVENUE","VAT_EFFORTS","VAT_INPUT","VAT_EXPORT","VAT_ACQUISITION","ON_ACCOUNT","CLOSING_INCOME","CLOSING_PASSIVE","DEFAULT_REVENUE","DEFAULT_EFFORTS","FOREX_REVENUE","FOREX_EFFORTS","ROUNDING_INVOICE","ROUNDING_RECEIPT","CREDIT_NOTE_OFFSET_DEBITOR","CREDIT_NOTE_OFFSET_CREDITOR","DUNNING_FEES"]},"accAccount":{"properties":{"exists":{"type":"boolean"},"uuid":{"type":["string","null"],"format":"uuid"},"number":{"type":["string","null"]},"name":{"type":["string","null"]}},"type":"object"},"currencyCode":{"type":["string","null"],"format":"iso-4217","maxLength":3,"minLength":3},"paymentMethod":{"type":["string","null"],"enum":["BANK","BITPAY","CARD_TERMINAL","CASH","CASH_ON_DELIVERY","INSTANT_TRANSFER","PAYPAL","TWINT","WIR","VOUCHER_OWN","VOUCHER_THIRD_PARTY","CREDIT_NOTE_OFFSET","DISCOUNT","CASH_DISCOUNT","DEBIT_LOSS","DEBIT_CREDIT_CARD","DONATION","CARD_COMMISSIONS","CURRENT_ACCOUNT","PREPAYMENT","PRIVATE","MAESTRO","MASTERCARD","VISA","AMEX","POSTFINANCE","DINERS_CARD","DUNNING_REMISSION"]},"direction":{"type":["string","null"],"enum":["IN","OUT"]},"taxRateUuid":{"type":["string","null"],"format":"uuid"},"bankAccountUuid":{"type":["string","null"],"format":"uuid"},"paymentCardUuid":{"type":["string","null"],"format":"uuid"},"flags":{"properties":{"isGenerated":{"type":"boolean"},"isRequired":{"type":"boolean"},"isComplete":{"type":"boolean"},"isSystem":{"type":"boolean"}},"type":"object"}},"type":"object"},"message":{"title":"message","type":"string"},"status":{"example":200},"meta":{"title":"meta","type":["object","null"]}},"required":["data","message","status"]}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"properties":{"detail":{"title":"details"},"type":{"title":"type","type":"string"},"requestUuid":{"title":"requestUuid","type":"string","format":"uuid"},"path":{"title":"path","type":"string"},"message":{"title":"message","type":["string","null"]},"status":{"title":"status","description":"HTTP status code","type":"integer"}},"required":["detail","type","message","status"]}}}}},"security":[{"ApiToken":["https://api.abaninja.ch/auth/accounting"]}],"x-legacy-operation-id":"befda99174e4cf3a142859aaf7011891","x-required-scopes":["accounting"]},"patch":{"tags":["accounting-assignments"],"summary":"Update assignment","description":"Update an existing assignment","operationId":"accounting_update_account_assignments","parameters":[{"name":"accountUuid","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"assignmentUuid","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"description":"Update assignment","required":false,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://api.abaninja.ch/schemas/2.0.0/account-assignment.update.schema.json","description":"A Schema for updating an accounting account assignment","type":"object","properties":{"accAccountUuid":{"type":"string","format":"uuid","description":"The UUID of the AccAccount, that should be used when booking."},"currencyCode":{"type":["null","string"],"pattern":"^[A-Z]{3}$","description":"ISO code of the currency. When set, the assignment is only getting used, when a booking in the set currency is being booked."},"taxRateUuid":{"type":["null","string"],"format":"uuid","description":"UUID of a tax rate. When set, the assignment is only getting used, when a booking with the set tax rate is being booked."},"paymentMethod":{"type":["null","string"],"enum":[null,"BANK","BITPAY","CARD_TERMINAL","CASH","CASH_ON_DELIVERY","INSTANT_TRANSFER","PAYPAL","TWINT","WIR","VOUCHER_OWN","VOUCHER_THIRD_PARTY","CREDIT_NOTE_OFFSET","DISCOUNT","CASH_DISCOUNT","DEBIT_LOSS","DEBIT_CREDIT_CARD","DONATION","CARD_COMMISSIONS","CURRENT_ACCOUNT","PREPAYMENT","PRIVATE","MAESTRO","MASTERCARD","VISA","AMEX","POSTFINANCE","DUNNING_REMISSION"],"description":"Method of a Payment. When set, the assignment is only getting used, when a payment with the set payment method is being booked."},"direction":{"type":["null","string"],"enum":[null,"IN","OUT"],"description":"Direction of a Payment. When set, the assignment is only getting used, when a payment with the set direction is being booked."},"bankAccountUuid":{"type":["null","string"],"format":"uuid","description":"UUID of a bank account. Only applies to Type PAYMENT_TYPE with Payment Method BANK."},"paymentCardUuid":{"type":["null","string"],"format":"uuid","description":"UUID of a payment card. Only applies to Type PAYMENT_TYPE with Payment Method DEBIT_CREDIT_CARD."}},"additionalProperties":false}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"properties":{"data":{"title":"Accounting Account Assignment with Details","properties":{"uuid":{"type":"string","format":"uuid"},"type":{"type":"string","enum":["PAYMENT_TYPE","COLLECT_INVOICE","COLLECT_RECEIPT","VAT_REVENUE","VAT_EFFORTS","VAT_INPUT","VAT_EXPORT","VAT_ACQUISITION","ON_ACCOUNT","CLOSING_INCOME","CLOSING_PASSIVE","DEFAULT_REVENUE","DEFAULT_EFFORTS","FOREX_REVENUE","FOREX_EFFORTS","ROUNDING_INVOICE","ROUNDING_RECEIPT","CREDIT_NOTE_OFFSET_DEBITOR","CREDIT_NOTE_OFFSET_CREDITOR","DUNNING_FEES"]},"accAccount":{"properties":{"exists":{"type":"boolean"},"uuid":{"type":["string","null"],"format":"uuid"},"number":{"type":["string","null"]},"name":{"type":["string","null"]}},"type":"object"},"currencyCode":{"type":["string","null"],"format":"iso-4217","maxLength":3,"minLength":3},"paymentMethod":{"type":["string","null"],"enum":["BANK","BITPAY","CARD_TERMINAL","CASH","CASH_ON_DELIVERY","INSTANT_TRANSFER","PAYPAL","TWINT","WIR","VOUCHER_OWN","VOUCHER_THIRD_PARTY","CREDIT_NOTE_OFFSET","DISCOUNT","CASH_DISCOUNT","DEBIT_LOSS","DEBIT_CREDIT_CARD","DONATION","CARD_COMMISSIONS","CURRENT_ACCOUNT","PREPAYMENT","PRIVATE","MAESTRO","MASTERCARD","VISA","AMEX","POSTFINANCE","DINERS_CARD","DUNNING_REMISSION"]},"direction":{"type":["string","null"],"enum":["IN","OUT"]},"taxRateUuid":{"type":["string","null"],"format":"uuid"},"bankAccountUuid":{"type":["string","null"],"format":"uuid"},"paymentCardUuid":{"type":["string","null"],"format":"uuid"},"flags":{"properties":{"isGenerated":{"type":"boolean"},"isRequired":{"type":"boolean"},"isComplete":{"type":"boolean"},"isSystem":{"type":"boolean"}},"type":"object"}},"type":"object"},"message":{"title":"message","type":"string"},"status":{"example":200},"meta":{"title":"meta","type":["object","null"]}},"required":["data","message","status"]}}}},"400":{"description":"Bad request or validation error","content":{"application/json":{"schema":{"properties":{"detail":{"title":"details"},"type":{"title":"type","type":"string"},"requestUuid":{"title":"requestUuid","type":"string","format":"uuid"},"path":{"title":"path","type":"string"},"message":{"title":"message","type":["string","null"]},"status":{"title":"status","description":"HTTP status code","type":"integer"}},"required":["detail","type","message","status"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"properties":{"detail":{"title":"details"},"type":{"title":"type","type":"string"},"requestUuid":{"title":"requestUuid","type":"string","format":"uuid"},"path":{"title":"path","type":"string"},"message":{"title":"message","type":["string","null"]},"status":{"title":"status","description":"HTTP status code","type":"integer"}},"required":["detail","type","message","status"]}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"properties":{"detail":{"title":"details"},"type":{"title":"type","type":"string"},"requestUuid":{"title":"requestUuid","type":"string","format":"uuid"},"path":{"title":"path","type":"string"},"message":{"title":"message","type":["string","null"]},"status":{"title":"status","description":"HTTP status code","type":"integer"}},"required":["detail","type","message","status"]}}}}},"security":[{"ApiToken":["https://api.abaninja.ch/auth/accounting"]}],"x-legacy-operation-id":"ac2396fd7e63e17d0d1a9202e80e4825","x-required-scopes":["accounting"]},"delete":{"tags":["accounting-assignments"],"summary":"Delete assignment","description":"Delete an assignment","operationId":"accounting_delete_account_assignments","parameters":[{"name":"accountUuid","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"assignmentUuid","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"properties":{"data":{},"message":{"title":"message","type":"string"},"status":{"example":200},"meta":{"title":"meta","type":["object","null"]}},"required":["data","message","status"]}}}},"400":{"description":"Bad request or validation error","content":{"application/json":{"schema":{"properties":{"detail":{"title":"details"},"type":{"title":"type","type":"string"},"requestUuid":{"title":"requestUuid","type":"string","format":"uuid"},"path":{"title":"path","type":"string"},"message":{"title":"message","type":["string","null"]},"status":{"title":"status","description":"HTTP status code","type":"integer"}},"required":["detail","type","message","status"]}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"properties":{"detail":{"title":"details"},"type":{"title":"type","type":"string"},"requestUuid":{"title":"requestUuid","type":"string","format":"uuid"},"path":{"title":"path","type":"string"},"message":{"title":"message","type":["string","null"]},"status":{"title":"status","description":"HTTP status code","type":"integer"}},"required":["detail","type","message","status"]}}}}},"security":[{"ApiToken":["https://api.abaninja.ch/auth/accounting"]}],"x-legacy-operation-id":"9d1adbdf86885fc8563fbfd574bd5cc0","x-required-scopes":["accounting"]}},"/accounts/{accountUuid}/accounting/v2/account-assignments/bank-account/{bankAccountUuid}":{"post":{"tags":["accounting-assignments"],"summary":"Create bank assignment","description":"Create a new banking assignment","operationId":"accounting_create_bank_account","parameters":[{"name":"accountUuid","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"bankAccountUuid","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"description":"Create banking assignment","required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://api.abaninja.ch/schemas/2.0.0/account-assignment-bank.create.schema.json","description":"A Schema for creating a bank accounting assignment","type":"object","properties":{"accAccountUuid":{"type":"string","format":"uuid","description":"The UUID of the AccAccount, that should be used when booking."}},"required":["accAccountUuid"],"additionalProperties":false}}}},"responses":{"201":{"description":"Successful response","content":{"application/json":{"schema":{"properties":{"data":{"title":"Bank Assignment Account Resource","properties":{"accAccountUuid":{"type":"string","format":"uuid"}},"type":"object"},"message":{"title":"message","type":"string"},"status":{"example":201},"meta":{"title":"meta","type":["object","null"]}},"required":["data","message","status"]}}}},"400":{"description":"Bad request or validation error","content":{"application/json":{"schema":{"properties":{"detail":{"title":"details"},"type":{"title":"type","type":"string"},"requestUuid":{"title":"requestUuid","type":"string","format":"uuid"},"path":{"title":"path","type":"string"},"message":{"title":"message","type":["string","null"]},"status":{"title":"status","description":"HTTP status code","type":"integer"}},"required":["detail","type","message","status"]}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"properties":{"detail":{"title":"details"},"type":{"title":"type","type":"string"},"requestUuid":{"title":"requestUuid","type":"string","format":"uuid"},"path":{"title":"path","type":"string"},"message":{"title":"message","type":["string","null"]},"status":{"title":"status","description":"HTTP status code","type":"integer"}},"required":["detail","type","message","status"]}}}}},"security":[{"ApiToken":["https://api.abaninja.ch/auth/accounting"]}],"x-legacy-operation-id":"8e67dc3cc128156796bc0f29ca967a51","x-required-scopes":["accounting"]}}},"components":{"securitySchemes":{"ApiToken":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer token authentication. Create tokens in Settings > API Token."}}}}