# Billing

Billing is triggered for each of the B2B endpoints in different ways, depending on what the endpoint does and what it returns.

A general rule is that B2B sends one billing message per signing/sealing operation. That includes messages for signing data which was given as a parameter as well as signing ("sealing") SDO files that are returned by an endpoint.

## Overview by endpoint

| Endpoint                                                                                                                       | Description                                                                    | Billings triggered                                                       |
| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------ |
| [`POST /v0/b2b/sdo_from_text`](https://docs.stoe.no/bankid-esign-provider/apis/b2b/v0/b2b-bankid-signer-api.md)                | Signs a single given text and returns one SDO file                             | 1x for signing text 1x for sealing SDO                                   |
| [`POST /v0/b2b/sdo_from_cmses`](https://docs.stoe.no/bankid-esign-provider/apis/b2b/v0/b2b-bankid-signer-api.md)               | Packs a number of given CMSes and returns one SDO file                         | 1x for sealing SDO                                                       |
| [`POST /v0/b2b/sdos_from_docs`](https://docs.stoe.no/bankid-esign-provider/apis/b2b/v0/b2b-bankid-signer-api.md)               | Signs a number of given documents and returns that number of SDO files         | #-of-documents x for signing documents #-of-documents x for sealing SDOs |
| [`POST /v0/b2b/cmses_from_hashes`](https://docs.stoe.no/bankid-esign-provider/apis/b2b/v0/b2b-bankid-signer-api.md)            | Signs a number of given hashes and returns that number of CMSes                | #-of-hashes x for signing hashes                                         |
| [`POST /v0/b2b/pades/cmses_from_hashes`](https://docs.stoe.no/bankid-esign-provider/apis/b2b/v0/b2b-bankid-signer-api.md)      | Signs a number of given hashes and returns that number of CMSes (PAdES format) | #-of-hashes x for signing hashes                                         |
| [`POST /v0/b2b/sdo_from_hash`](https://docs.stoe.no/bankid-esign-provider/apis/b2b/v0/b2b-bankid-signer-api.md)                | Signs a single given hash and returns a single SDO file                        | 1x for signing hash 1x for sealing SDO                                   |
| [`POST /v0/b2b/sdos_from_hashes`](https://docs.stoe.no/bankid-esign-provider/apis/b2b/v0/b2b-bankid-signer-api.md)             | Signs a number of given hashes and returns that number of SDO files            | #-of-hashes x for signing hashes #-of-hashes x for sealing SDOs          |
| [`POST /v0/b2b/csc/v2/signatures/signHash`](https://docs.stoe.no/bankid-esign-provider/apis/b2b/csc/b2b-bankid-signing-csc.md) | Signs a number of given hashes and returns that number of PKCS#1 signatures    | #-of-hashes x for signing hashes                                         |
| [`POST /v0/b2b/ades/xades`](https://docs.stoe.no/bankid-esign-provider/apis/b2b/v0/b2b-bankid-signer-api.md)                   | Uses the B2B CSC functions internally to build XAdES-BASELINE-LT               | 1x for sign 1x for timestamp                                             |
| [`POST /v0/b2b/ades/pades`](https://docs.stoe.no/bankid-esign-provider/apis/b2b/v0/b2b-bankid-signer-api.md)                   | Uses the B2B CSC functions internally to build PAdES-BASELINE-LT               | 1x for sign 1x for timestamp                                             |
