@lap v0.3
# Machine-readable API spec. Each @endpoint block is one API call.
@api Storecove API
@base https://api.storecove.com/api/v2
@version 2.0.1
@auth ApiKey Authorization in header
@endpoints 37
@hint download_for_search
@toc invoice_submissions(3), document_submissions(2), legal_entities(15), purchase_invoices(3), webhook_instances(2), discovery(3), received_documents(1), api(8)

@group invoice_submissions
@endpoint GET /invoice_submissions/{guid}/evidence
@desc DEPRECATED. Get InvoiceSubmission Evidence
@required {guid: any # InvoiceSubmission GUID}
@returns(200) Success
@errors {401: Unauthorized, 403: Forbidden, 404: Not Found}

@endpoint POST /invoice_submissions
@desc DEPRECATED. Submit a new invoice
@required {invoice_submission: map # Invoice to submit}
@returns(200) Success
@errors {401: Unauthorized, 403: Forbidden, 422: Unprocessable Entity}

@endgroup

@group document_submissions
@endpoint POST /document_submissions
@desc Submit a new document.
@required {document_submission: map # Document to submit}
@returns(200) Success
@errors {401: Unauthorized, 403: Forbidden, 422: Unprocessable Entity}

@endpoint GET /document_submissions/{guid}/evidence/{evidence_type}
@desc Get DocumentSubmission Evidence
@required {guid: any # DocumentSubmission GUID}
@optional {evidence_type: any # Type of evidence requested}
@returns(200) Success
@errors {401: Unauthorized, 403: Forbidden, 404: Not Found}

@endgroup

@group invoice_submissions
@endpoint POST /invoice_submissions/preflight
@desc DEPRECATED. Preflight an invoice recipient
@required {invoice_recipient_preflight: map # The invoice recipient to preflight}
@returns(200) Success
@errors {401: Unauthorized, 403: Forbidden, 422: Unprocessable Entity}

@endgroup

@group legal_entities
@endpoint POST /legal_entities
@desc Create a new LegalEntity
@required {legal_entity: any # LegalEntity to create}
@returns(200) Success
@errors {401: Unauthorized, 403: Forbidden, 422: Unprocessable Entity}

@endpoint GET /legal_entities/{id}
@desc Get LegalEntity
@required {id: any # legal_entity id}
@returns(200) Success
@errors {401: Unauthorized, 403: Forbidden, 404: Not Found}

@endpoint DELETE /legal_entities/{id}
@desc Delete LegalEntity
@required {id: any # legal_entity id}
@returns(204) Success
@errors {401: Unauthorized, 403: Forbidden, 404: Not Found}

@endpoint PATCH /legal_entities/{id}
@desc Update LegalEntity
@required {id: any # legal_entity id, legal_entity: any # LegalEntity updates}
@returns(200) Success
@errors {401: Unauthorized, 403: Forbidden, 404: Not Found, 422: Unprocessable Entity}

@endpoint POST /legal_entities/{legal_entity_id}/peppol_identifiers
@desc Create a new PeppolIdentifier
@required {legal_entity_id: any # The id of the LegalEntity for which to create the PeppolIdentifier, peppol_identifier: any # PeppolIdentifier to create}
@returns(200) Success
@errors {401: Unauthorized, 403: Forbidden, 404: Not Found, 422: Unprocessable Entity}

@endpoint DELETE /legal_entities/{legal_entity_id}/peppol_identifiers/{superscheme}/{scheme}/{identifier}
@desc Delete PeppolIdentifier
@required {legal_entity_id: any # The id of the LegalEntity this PeppolIdentifier belongs to, superscheme: any # The superscheme of the identifier. Should always be "iso6523-actorid-upis"., scheme: any # PEPPOL identifier scheme id, e.g. "DE:VAT". For a full list see >., identifier: any # PEPPOL identifier}
@returns(204) Success
@errors {401: Unauthorized, 403: Forbidden, 404: Not Found}

@endpoint POST /legal_entities/{legal_entity_id}/administrations
@desc DEPRECATED. Create a new Administration
@required {legal_entity_id: any # The id of the LegalEntity for which to create the Administration, administration: any # Administration to create}
@returns(200) Success
@errors {401: Unauthorized, 403: Forbidden, 404: Not Found, 422: Unprocessable Entity}

@endpoint GET /legal_entities/{legal_entity_id}/administrations/{id}
@desc DEPRECATED. Get Administration
@required {legal_entity_id: any # The id of the LegalEntity the Administration belongs to, id: any # The id of the Administration}
@returns(200) Success
@errors {401: Unauthorized, 403: Forbidden, 404: Not Found}

@endpoint DELETE /legal_entities/{legal_entity_id}/administrations/{id}
@desc DEPRECATED. Delete Administration
@required {legal_entity_id: any # The id of the LegalEntity the Administration belongs to, id: any # The id of the Administration}
@returns(204) Success
@errors {401: Unauthorized, 403: Forbidden, 404: Not Found}

@endpoint PATCH /legal_entities/{legal_entity_id}/administrations/{id}
@desc DEPRECATED. Update Administration
@required {legal_entity_id: any # The id of the LegalEntity the Administration belongs to, id: any # The id of the Administration to be updated, administration: any # Administration to update}
@returns(200) Success
@errors {401: Unauthorized, 403: Forbidden, 404: Not Found}

@endpoint POST /legal_entities/{legal_entity_id}/additional_tax_identifiers
@desc Create a new AdditionalTaxIdentifier
@required {legal_entity_id: any # The id of the LegalEntity for which to create the AdditionalTaxIdentifier, additional_tax_identifier: any # AdditionalTaxIdentifier to create}
@returns(200) Success
@errors {401: Unauthorized, 403: Forbidden, 404: Not Found, 422: Unprocessable Entity}

@endpoint GET /legal_entities/{legal_entity_id}/additional_tax_identifiers/{id}
@desc Get AdditionalTaxIdentifier
@required {legal_entity_id: any # The id of the LegalEntity the AdditionalTaxIdentifier belongs to, id: any # The id of the AdditionalTaxIdentifier}
@returns(200) Success
@errors {401: Unauthorized, 403: Forbidden, 404: Not Found}

@endpoint DELETE /legal_entities/{legal_entity_id}/additional_tax_identifiers/{id}
@desc Delete AdditionalTaxIdentifier
@required {legal_entity_id: any # The id of the LegalEntity the AdditionalTaxIdentifier belongs to, id: any # The id of the AdditionalTaxIdentifier}
@returns(204) Success
@errors {401: Unauthorized, 403: Forbidden, 404: Not Found}

@endpoint PATCH /legal_entities/{legal_entity_id}/additional_tax_identifiers/{id}
@desc Update AdditionalTaxIdentifier
@required {legal_entity_id: any # The id of the LegalEntity the AdditionalTaxIdentifier belongs to, id: any # The id of the AdditionalTaxIdentifier to be updated, additional_tax_identifier: any # AdditionalTaxIdentifier to update}
@returns(200) Success
@errors {401: Unauthorized, 403: Forbidden, 404: Not Found}

@endgroup

@group purchase_invoices
@endpoint GET /purchase_invoices/{guid}
@desc DEPRECATED. Get Purchase invoice data as JSON
@required {guid: any # The guid of the purchase invoice, from the webhook.}
@optional {pmv: any # DEPRECATED. The PaymentMeans version. The default (and deprecated) version 1.0 will give BankPaymentMean, DirectDebitPaymentMean, CardPaymentMean, NppPaymentMean, SeBankGiroPaymentMean, SePlusGiroPaymentMean, SgCardPaymentMean, SgGiroPaymentMean, SgPaynowPaymentMean.  Version 2.0 deprecates BankPaymentMean (now CreditTransferPaymentMean), CardPaymentMean (now CreditCardPaymentMean), NppPaymentMean (now AunzNppPayidPaymentMean), SeBankGiroPaymentMean (now SeBankgiroPaymentMean  -- note the lower 'g' in 'bankgiro'). It also adds OnlinePaymentServicePaymentMean, StandingAgreementPaymentMean, AunzNppPaytoPaymentMean, AunzBpayPaymentMean, AunzPostbillpayPaymentMean, AunzUriPaymentMean., version: any # The JSON content version date. The default is '1970-01-01' meaning you get all deprecated elements since nothing was deprecated before that ;). If you do not want deprecated elements, use a later date. Do not use a dynamic date, because that means when we deprecate elements they will disappear from our responses.}
@returns(200) Success
@errors {401: Unauthorized, 403: Forbidden, 404: Not Found}

@endpoint GET /purchase_invoices/{guid}/{packaging}
@desc DEPRECATED. Get Purchase invoice data in a selectable format
@required {guid: any # purchase invoice guid, packaging: any # How to package the purchase invoice. Note that "ubl" is deprecated.}
@optional {pmv: any # DEPRECATED. The PaymentMeans version. The default (and deprecated) version 1.0 will give BankPaymentMean, DirectDebitPaymentMean, CardPaymentMean, NppPaymentMean, SeBankGiroPaymentMean, SePlusGiroPaymentMean, SgCardPaymentMean, SgGiroPaymentMean, SgPaynowPaymentMean.  Version 2.0 deprecates BankPaymentMean (now CreditTransferPaymentMean), CardPaymentMean (now CreditCardPaymentMean), NppPaymentMean (now AunzNppPayidPaymentMean), SeBankGiroPaymentMean (now SeBankgiroPaymentMean  -- note the lower 'g' in 'bankgiro'). It also adds OnlinePaymentServicePaymentMean, StandingAgreementPaymentMean, AunzNppPaytoPaymentMean, AunzBpayPaymentMean, AunzPostbillpayPaymentMean, AunzUriPaymentMean., version: any # The JSON content version date. The default is '1970-01-01' meaning you get all deprecated elements since nothing was deprecated before that ;). If you do not want deprecated elements, use a later date. Do not use a dynamic date, because that means when we deprecate elements they will disappear from our responses. Only used for 'json' packaging, not for 'original'.}
@returns(200) Success
@errors {401: Unauthorized, 403: Forbidden, 404: Not Found}

@endpoint GET /purchase_invoices/{guid}/{packaging}/{package_version}
@desc DEPRECATED. Get Purchase invoice data as JSON with a Base64-encoded UBL string in the specified version
@required {guid: any # purchase invoice guid, packaging: any # How to package the purchase invoice., package_version: any # The version of the package.}
@returns(200) Success
@errors {401: Unauthorized, 403: Forbidden, 404: Not Found}

@endgroup

@group webhook_instances
@endpoint GET /webhook_instances/
@desc GET a WebhookInstance
@returns(200) Success
@returns(204) Success
@errors {401: Unauthorized, 403: Forbidden, 404: Not Found}

@endpoint DELETE /webhook_instances/{guid}
@desc DELETE a WebhookInstance
@required {guid: any # WebhookInstance guid}
@returns(204) Success
@errors {401: Unauthorized, 403: Forbidden, 404: Not Found}

@endgroup

@group discovery
@endpoint POST /discovery/receives
@desc Discover Network Participant Capabilites
@required {discoverable_participant: map # The participant to check}
@returns(200) Success
@errors {401: Unauthorized, 403: Forbidden, 422: Unprocessable Entity}

@endpoint POST /discovery/exists
@desc Discover Network Participant Existence
@required {discoverable_participant: map # The participant to check}
@returns(200) Success
@errors {401: Unauthorized, 403: Forbidden, 422: Unprocessable Entity}

@endpoint GET /discovery/identifiers
@desc Discover Country Identifiers ** EXPERIMENTAL
@returns(200) Success
@errors {401: Unauthorized, 403: Forbidden}

@endgroup

@group legal_entities
@endpoint POST /legal_entities/{legal_entity_id}/received_documents
@desc Receive a new Document
@required {legal_entity_id: any # The id of the LegalEntity for which the document was received., received_document: any # Received document to process.}
@returns(200) Success
@errors {401: Unauthorized, 403: Forbidden, 404: Not Found, 422: Unprocessable Entity}

@endgroup

@group received_documents
@endpoint GET /received_documents/{guid}/{format}
@desc Get a new ReceivedDocument
@required {guid: any # The guid of the document that was received. This is the "document_guid" property of the "received_document" webhook.}
@optional {format: any # The format in which to receive the received document., version: any # The JSON content version date. The default is '1970-01-01' meaning you get all deprecated elements since nothing was deprecated before that ;). If you do not want deprecated elements, use a later date. Do not use a dynamic date, because that means when we deprecate elements they will disappear from our responses. Only used for 'json' packaging, not for 'original'. Not currently used for invoices, only for orders.}
@returns(200) Success
@errors {400: Bad Request, 401: Unauthorized, 403: Forbidden, 404: Not Found}

@endgroup

@group api
@endpoint POST /api/v2/legal_entities/{legal_entity_id}/c5/iras/email/activate
@desc Request a new C5 Email Activation
@required {legal_entity_id: any # The id of the LegalEntity for which to create the C5EmailRequest, c5_email_request: map # The C5EmailRequest to initiate}
@returns(204) Empty success response
@errors {401: Unauthorized, 403: Forbidden, 404: Not Found, 422: Unprocessable Entity}

@endpoint POST /api/v2/legal_entities/{legal_entity_id}/c5/iras/email/deactivate
@desc Request a new C5 Email Deactivation
@required {legal_entity_id: any # The id of the LegalEntity for which to create the C5EmailRequest, c5_email_request: map # The C5EmailRequest to initiate}
@returns(204) Empty success response
@errors {401: Unauthorized, 403: Forbidden, 404: Not Found, 422: Unprocessable Entity}

@endpoint PUT /api/v2/legal_entities/{legal_entity_id}/c5/iras/email/cancel
@desc Cancel a C5 email activation or deactivation
@required {legal_entity_id: any # Legal entity ID, c5_email_cancellation_request: map # The C5EmailCancellationRequest to cancel}
@returns(204) If cancellation of a initiated C5 activation / C5 deactivation is successful.
@errors {422: The C5 activation/deactivation is in an incorrect state and can not be cancelled.}

@endpoint POST /api/v2/legal_entities/{legal_entity_id}/c5/iras/redirect/activate
@desc Request a new C5 Redirect Activation
@required {legal_entity_id: any # The id of the LegalEntity for which to create the C5RedirectRequest, c5_redirect_request: map # The C5RedirectRequest to initiate}
@returns(200) Success response
@errors {401: Unauthorized, 403: Forbidden, 404: Not Found, 422: Unprocessable Entity}

@endpoint POST /api/v2/legal_entities/{legal_entity_id}/c5/iras/redirect/deactivate
@desc Request a new C5 Redirect Deactivation
@required {legal_entity_id: any # The id of the LegalEntity for which to create the C5RedirectRequest, c5_redirect_request: map # The C5RedirectRequest to initiate}
@returns(200) Success response
@errors {401: Unauthorized, 403: Forbidden, 404: Not Found, 422: Unprocessable Entity}

@endpoint PUT /api/v2/legal_entities/{legal_entity_id}/c5/iras/redirect/cancel
@desc Cancel a C5 redirect activation or deactivation
@required {legal_entity_id: any # Legal entity ID, c5_redirect_cancellation_request: map # The C5RedirectCancellationRequest to cancel}
@returns(204) If cancellation of a initiated C5 activation / C5 deactivation is successful.
@errors {422: The C5 activation/deactivation is in an incorrect state and can not be cancelled.}

@endpoint POST /api/v2/legal_entities/{legal_entity_id}/c5_activation/activate
@desc DEPRECATED. Request a new C5 Activation
@required {legal_entity_id: any # The id of the LegalEntity for which to create the C5ActivationRequest, c5_activation_request: map # The C5ActivationRequest to initiate}
@returns(200) Success
@errors {401: Unauthorized, 403: Forbidden, 404: Not Found, 422: Unprocessable Entity}

@endpoint POST /api/v2/legal_entities/{legal_entity_id}/c5_deactivation/deactivate
@desc DEPRECATED. Request a new C5 Deactivation
@required {legal_entity_id: any # The id of the LegalEntity for which to create the C5DeactivationRequest, c5_deactivation_request: map # The C5DeactivationRequest to initiate}
@returns(200) Success
@errors {401: Unauthorized, 403: Forbidden, 404: Not Found, 422: Unprocessable Entity}

@endgroup

@end
