Consumer Mandates
Generated HTTP reference for the 2 operations the published OpenAPI document describes under consumer-mandates.
2 min read
Consumer Mandates
This page is generated from the published OpenAPI document. It is complete with respect to that document and says nothing about surfaces the document does not describe yet. See what is generated here for what that means.
Base URL: https://api.codespar.dev
Every operation below requires a Bearer token. See Authentication.
GET /v1/consumers/mandates/{id}/card
GET
https://api.codespar.dev/v1/consumers/mandates/{id}/cardThe card bound to a mandate, and its recent authorizations
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | yes | The mandate id. |
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
limit | integer | no | Authorizations to return. Default 20, clamped to the range 1 to 100. |
Responses
| Status | Body | Description |
|---|---|---|
200 | object | OK |
404 | object | No such mandate for this organization. A mandate another organization holds answers the same way. |
Response 200
| Field | Type | Required | Description |
|---|---|---|---|
authorizations | array of object | yes | Newest first. Empty when no card is bound. |
card | object,null | yes | Null when the mandate exists and has no active card binding. |
mandate_id | string | yes | — |
Example request
curl -X GET https://api.codespar.dev/v1/consumers/mandates/{id}/card \
-H "Authorization: Bearer $CODESPAR_API_KEY"const res = await fetch("https://api.codespar.dev/v1/consumers/mandates/{id}/card", {
method: "GET",
headers: {
Authorization: `Bearer ${process.env.CODESPAR_API_KEY}`,
},
});
const data = await res.json();Example response 200
{
"mandate_id": "mandate_0000000000000000",
"card": {
"card_id": "card_0000000000000000",
"consumer_id": "csm_0000000000000000",
"status": "string",
"bound_at": "2026-01-15T12:00:00.000Z"
},
"authorizations": [
{
"transaction_id": "transaction_0000000000000000",
"amount_minor": "1000",
"currency": "BRL",
"decision": "string",
"at": "2026-01-15T12:00:00.000Z"
}
]
}DELETE /v1/consumers/mandates/{id}/card
DELETE
https://api.codespar.dev/v1/consumers/mandates/{id}/cardUnbind the card from a mandate
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | yes | The mandate id. |
Responses
| Status | Body | Description |
|---|---|---|
200 | object | OK |
404 | object | mandate_not_found: no such mandate for this organization, which is also the answer for another organization's mandate. no_active_card: the mandate exists and has no active card binding to revoke. |
Response 200
| Field | Type | Required | Description |
|---|---|---|---|
card_id | string | yes | — |
mandate_id | string | yes | — |
revoked | true | yes | — |
Example request
curl -X DELETE https://api.codespar.dev/v1/consumers/mandates/{id}/card \
-H "Authorization: Bearer $CODESPAR_API_KEY"const res = await fetch("https://api.codespar.dev/v1/consumers/mandates/{id}/card", {
method: "DELETE",
headers: {
Authorization: `Bearer ${process.env.CODESPAR_API_KEY}`,
},
});
const data = await res.json();Example response 200
{
"mandate_id": "mandate_0000000000000000",
"card_id": "card_0000000000000000",
"revoked": true
}