Post more than reachable tokens

To request a number of tokens that can be generated with a preset alphabet for a number of digits, all of these values MUST be sent as data attributes together with the data type: tokens in the JSON request body. The data relationships payment data value in the JSON request body MUST contain the type: transaction, a valid transaction id according to the schema XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX and a valid payment intent ident according to the schema pi_XXXXXXXXXXXXXXXXXXXXXXXX. Here the API remote service is attacked by trying to get a number of tokens more than the agreement-related maximum in the HTTP request body.

The errors status: 402 is returned from the remote service together with the errors detail: Out of limit. in the JSON response body.

Agreement-related limits

The basic agreement-related limits restrict each part of each production line to (included) 1,000 ... 100,000 tokens and 3 ... 100 digits. These values can also be restricted by algorithm-related limits. The smallest of the three restrictions applies.

Request endpoint

DELETE SERVER:PORT/api/tokens

Response status

201

Request headers

Accept:application/vnd.api+json
Content-Type:application/vnd.api+json
Session-Key:SSSSSSSS-SSSS-SSSS-SSSS-SSSSSSSSSSSS

Response headers

Transfer-Encoding:chunked
Connection:keep-alive
Accept:application/vnd.api+json
Cache-Control:no-cache
Date:Tue, 19 Mar 2024 12:57:41 GMT
Content-Type:application/vnd.api+json
Server:nginx/1.25.4

Request body

{
    "data": {
        "attributes": {
            "size": 17477,
            "digits": 20,
            "alphabet": "DICE"
        },
        "type": "tokens",
        "relationships": {
            "payment": {
                "data": {
                    "id": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
                    "ident": "pi_XXXXXXXXXXXXXXXXXXXXXXXX",
                    "type": "transaction"
                }
            }
        }
    }
}

Response body

{
    "errors": [
        {
            "status": 402,
            "detail": "Out of limit.",
            "source": {
                "parameter": "size",
                "pointer": "/data/attributes/size"
            },
            "title": "Tokens not requested"
        }
    ],
    "links": {
        "self": "/api/tokens"
    }
}

HTTPie example

$ http delete SERVER:PORT/api/tokens Accept:application/vnd.api+json Content-Type:application/vnd.api+json Session-Key:SSSSSSSS-SSSS-SSSS-SSSS-SSSSSSSSSSSS << JSON
{
    "data": {
        "attributes": {
            "size": 17477,
            "digits": 20,
            "alphabet": "DICE"
        },
        "type": "tokens",
        "relationships": {
            "payment": {
                "data": {
                    "id": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
                    "ident": "pi_XXXXXXXXXXXXXXXXXXXXXXXX",
                    "type": "transaction"
                }
            }
        }
    }
}
JSON