@codespar/sdk 0.16.5 → 0.16.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -6141,6 +6141,11 @@ export interface paths {
|
|
|
6141
6141
|
status: "active" | "blocked" | "canceled";
|
|
6142
6142
|
/** @description The card's token in the cardholder-data environment. Null until ingest lands, which is its own step after the card exists, so a freshly issued card can be readable here with no token yet. */
|
|
6143
6143
|
token_id: string | null;
|
|
6144
|
+
/**
|
|
6145
|
+
* @description Whether the cardholder-data environment holds this card's PAN. `ingested`: it does, and `token_id` names the token. `not_configured`: this deployment has no CDE, the PAN was never asked for, and no retry of the Idempotency-Key changes that — a deployment posture, not a caller fault. `not_ingested`: a CDE exists and the card has no token; on a mint that is the 502 `issuer_ingest_failed` retry contract, on a read it is a card whose ingest has not landed.
|
|
6146
|
+
* @enum {string}
|
|
6147
|
+
*/
|
|
6148
|
+
cde: "ingested" | "not_ingested" | "not_configured";
|
|
6144
6149
|
/** Format: date-time */
|
|
6145
6150
|
created_at: string;
|
|
6146
6151
|
}[];
|
|
@@ -6269,6 +6274,11 @@ export interface paths {
|
|
|
6269
6274
|
status: "active" | "blocked" | "canceled";
|
|
6270
6275
|
/** @description The card's token in the cardholder-data environment. Null until ingest lands, which is its own step after the card exists, so a freshly issued card can be readable here with no token yet. */
|
|
6271
6276
|
token_id: string | null;
|
|
6277
|
+
/**
|
|
6278
|
+
* @description Whether the cardholder-data environment holds this card's PAN. `ingested`: it does, and `token_id` names the token. `not_configured`: this deployment has no CDE, the PAN was never asked for, and no retry of the Idempotency-Key changes that — a deployment posture, not a caller fault. `not_ingested`: a CDE exists and the card has no token; on a mint that is the 502 `issuer_ingest_failed` retry contract, on a read it is a card whose ingest has not landed.
|
|
6279
|
+
* @enum {string}
|
|
6280
|
+
*/
|
|
6281
|
+
cde: "ingested" | "not_ingested" | "not_configured";
|
|
6272
6282
|
/** Format: date-time */
|
|
6273
6283
|
created_at: string;
|
|
6274
6284
|
};
|
|
@@ -6313,6 +6323,11 @@ export interface paths {
|
|
|
6313
6323
|
status: "active" | "blocked" | "canceled";
|
|
6314
6324
|
/** @description The card's token in the cardholder-data environment. Null until ingest lands, which is its own step after the card exists, so a freshly issued card can be readable here with no token yet. */
|
|
6315
6325
|
token_id: string | null;
|
|
6326
|
+
/**
|
|
6327
|
+
* @description Whether the cardholder-data environment holds this card's PAN. `ingested`: it does, and `token_id` names the token. `not_configured`: this deployment has no CDE, the PAN was never asked for, and no retry of the Idempotency-Key changes that — a deployment posture, not a caller fault. `not_ingested`: a CDE exists and the card has no token; on a mint that is the 502 `issuer_ingest_failed` retry contract, on a read it is a card whose ingest has not landed.
|
|
6328
|
+
* @enum {string}
|
|
6329
|
+
*/
|
|
6330
|
+
cde: "ingested" | "not_ingested" | "not_configured";
|
|
6316
6331
|
/** Format: date-time */
|
|
6317
6332
|
created_at: string;
|
|
6318
6333
|
} | null;
|
|
@@ -6353,6 +6368,11 @@ export interface paths {
|
|
|
6353
6368
|
status: "active" | "blocked" | "canceled";
|
|
6354
6369
|
/** @description The card's token in the cardholder-data environment. Null until ingest lands, which is its own step after the card exists, so a freshly issued card can be readable here with no token yet. */
|
|
6355
6370
|
token_id: string | null;
|
|
6371
|
+
/**
|
|
6372
|
+
* @description Whether the cardholder-data environment holds this card's PAN. `ingested`: it does, and `token_id` names the token. `not_configured`: this deployment has no CDE, the PAN was never asked for, and no retry of the Idempotency-Key changes that — a deployment posture, not a caller fault. `not_ingested`: a CDE exists and the card has no token; on a mint that is the 502 `issuer_ingest_failed` retry contract, on a read it is a card whose ingest has not landed.
|
|
6373
|
+
* @enum {string}
|
|
6374
|
+
*/
|
|
6375
|
+
cde: "ingested" | "not_ingested" | "not_configured";
|
|
6356
6376
|
/** Format: date-time */
|
|
6357
6377
|
created_at: string;
|
|
6358
6378
|
};
|
|
@@ -6406,6 +6426,11 @@ export interface paths {
|
|
|
6406
6426
|
status: "active" | "blocked" | "canceled";
|
|
6407
6427
|
/** @description The card's token in the cardholder-data environment. Null until ingest lands, which is its own step after the card exists, so a freshly issued card can be readable here with no token yet. */
|
|
6408
6428
|
token_id: string | null;
|
|
6429
|
+
/**
|
|
6430
|
+
* @description Whether the cardholder-data environment holds this card's PAN. `ingested`: it does, and `token_id` names the token. `not_configured`: this deployment has no CDE, the PAN was never asked for, and no retry of the Idempotency-Key changes that — a deployment posture, not a caller fault. `not_ingested`: a CDE exists and the card has no token; on a mint that is the 502 `issuer_ingest_failed` retry contract, on a read it is a card whose ingest has not landed.
|
|
6431
|
+
* @enum {string}
|
|
6432
|
+
*/
|
|
6433
|
+
cde: "ingested" | "not_ingested" | "not_configured";
|
|
6409
6434
|
/** Format: date-time */
|
|
6410
6435
|
created_at: string;
|
|
6411
6436
|
} | null;
|
|
@@ -6621,6 +6646,11 @@ export interface paths {
|
|
|
6621
6646
|
status: "active" | "blocked" | "canceled";
|
|
6622
6647
|
/** @description The card's token in the cardholder-data environment. Null until ingest lands, which is its own step after the card exists, so a freshly issued card can be readable here with no token yet. */
|
|
6623
6648
|
token_id: string | null;
|
|
6649
|
+
/**
|
|
6650
|
+
* @description Whether the cardholder-data environment holds this card's PAN. `ingested`: it does, and `token_id` names the token. `not_configured`: this deployment has no CDE, the PAN was never asked for, and no retry of the Idempotency-Key changes that — a deployment posture, not a caller fault. `not_ingested`: a CDE exists and the card has no token; on a mint that is the 502 `issuer_ingest_failed` retry contract, on a read it is a card whose ingest has not landed.
|
|
6651
|
+
* @enum {string}
|
|
6652
|
+
*/
|
|
6653
|
+
cde: "ingested" | "not_ingested" | "not_configured";
|
|
6624
6654
|
/** Format: date-time */
|
|
6625
6655
|
created_at: string;
|
|
6626
6656
|
} | {
|
|
@@ -6664,6 +6694,11 @@ export interface paths {
|
|
|
6664
6694
|
status: "active" | "blocked" | "canceled";
|
|
6665
6695
|
/** @description The card's token in the cardholder-data environment. Null until ingest lands, which is its own step after the card exists, so a freshly issued card can be readable here with no token yet. */
|
|
6666
6696
|
token_id: string | null;
|
|
6697
|
+
/**
|
|
6698
|
+
* @description Whether the cardholder-data environment holds this card's PAN. `ingested`: it does, and `token_id` names the token. `not_configured`: this deployment has no CDE, the PAN was never asked for, and no retry of the Idempotency-Key changes that — a deployment posture, not a caller fault. `not_ingested`: a CDE exists and the card has no token; on a mint that is the 502 `issuer_ingest_failed` retry contract, on a read it is a card whose ingest has not landed.
|
|
6699
|
+
* @enum {string}
|
|
6700
|
+
*/
|
|
6701
|
+
cde: "ingested" | "not_ingested" | "not_configured";
|
|
6667
6702
|
/** Format: date-time */
|
|
6668
6703
|
created_at: string;
|
|
6669
6704
|
} | null;
|
|
@@ -8300,6 +8335,11 @@ export interface paths {
|
|
|
8300
8335
|
status: "active" | "blocked" | "canceled";
|
|
8301
8336
|
/** @description The card-data-environment token id, null until the mint flow allocates one. Allocation happens BEFORE the card material is ingested, so a token id with no material behind it is a recorded failure rather than a silent gap. It is the handle a PCI-scoped surface exchanges for card material; no card material is reachable through this API with it. */
|
|
8302
8337
|
token_id: string | null;
|
|
8338
|
+
/**
|
|
8339
|
+
* @description Whether the cardholder-data environment holds this card's PAN. `ingested`: it does, and `token_id` names the token. `not_configured`: this deployment has no CDE, the PAN was never asked for, and no retry of the Idempotency-Key changes that — a deployment posture, not a caller fault. `not_ingested`: a CDE exists and the card has no token; on a mint that is the 502 `issuer_ingest_failed` retry contract, on a read it is a card whose ingest has not landed.
|
|
8340
|
+
* @enum {string}
|
|
8341
|
+
*/
|
|
8342
|
+
cde: "ingested" | "not_ingested" | "not_configured";
|
|
8303
8343
|
/** Format: date-time */
|
|
8304
8344
|
created_at: string;
|
|
8305
8345
|
} | {
|
|
@@ -8334,6 +8374,11 @@ export interface paths {
|
|
|
8334
8374
|
status: "active" | "blocked" | "canceled";
|
|
8335
8375
|
/** @description The card-data-environment token id, null until the mint flow allocates one. Allocation happens BEFORE the card material is ingested, so a token id with no material behind it is a recorded failure rather than a silent gap. It is the handle a PCI-scoped surface exchanges for card material; no card material is reachable through this API with it. */
|
|
8336
8376
|
token_id: string | null;
|
|
8377
|
+
/**
|
|
8378
|
+
* @description Whether the cardholder-data environment holds this card's PAN. `ingested`: it does, and `token_id` names the token. `not_configured`: this deployment has no CDE, the PAN was never asked for, and no retry of the Idempotency-Key changes that — a deployment posture, not a caller fault. `not_ingested`: a CDE exists and the card has no token; on a mint that is the 502 `issuer_ingest_failed` retry contract, on a read it is a card whose ingest has not landed.
|
|
8379
|
+
* @enum {string}
|
|
8380
|
+
*/
|
|
8381
|
+
cde: "ingested" | "not_ingested" | "not_configured";
|
|
8337
8382
|
/** Format: date-time */
|
|
8338
8383
|
created_at: string;
|
|
8339
8384
|
} | null;
|
|
@@ -8455,6 +8500,11 @@ export interface paths {
|
|
|
8455
8500
|
/** @enum {string} */
|
|
8456
8501
|
status: "active" | "blocked" | "canceled";
|
|
8457
8502
|
token_id: string | null;
|
|
8503
|
+
/**
|
|
8504
|
+
* @description Whether the cardholder-data environment holds this card's PAN. `ingested`: it does, and `token_id` names the token. `not_configured`: this deployment has no CDE, the PAN was never asked for, and no retry of the Idempotency-Key changes that — a deployment posture, not a caller fault. `not_ingested`: a CDE exists and the card has no token; on a mint that is the 502 `issuer_ingest_failed` retry contract, on a read it is a card whose ingest has not landed.
|
|
8505
|
+
* @enum {string}
|
|
8506
|
+
*/
|
|
8507
|
+
cde: "ingested" | "not_ingested" | "not_configured";
|
|
8458
8508
|
/** Format: date-time */
|
|
8459
8509
|
created_at: string;
|
|
8460
8510
|
};
|
|
@@ -8492,6 +8542,11 @@ export interface paths {
|
|
|
8492
8542
|
/** @enum {string} */
|
|
8493
8543
|
status: "active" | "blocked" | "canceled";
|
|
8494
8544
|
token_id: string | null;
|
|
8545
|
+
/**
|
|
8546
|
+
* @description Whether the cardholder-data environment holds this card's PAN. `ingested`: it does, and `token_id` names the token. `not_configured`: this deployment has no CDE, the PAN was never asked for, and no retry of the Idempotency-Key changes that — a deployment posture, not a caller fault. `not_ingested`: a CDE exists and the card has no token; on a mint that is the 502 `issuer_ingest_failed` retry contract, on a read it is a card whose ingest has not landed.
|
|
8547
|
+
* @enum {string}
|
|
8548
|
+
*/
|
|
8549
|
+
cde: "ingested" | "not_ingested" | "not_configured";
|
|
8495
8550
|
/** Format: date-time */
|
|
8496
8551
|
created_at: string;
|
|
8497
8552
|
};
|
|
@@ -15132,6 +15187,8 @@ export interface paths {
|
|
|
15132
15187
|
*
|
|
15133
15188
|
* **`idempotency_key` is REQUIRED for that combination**, and it is checked before anything reaches the issuer. A repeat with the same key returns the charge already issued, or its still-open reservation, instead of a second receivable the same debtor could pay twice. Send it as the `Idempotency-Key` header, as the body's `idempotency_key`, or as both with the SAME value; two different values are refused rather than one silently winning.
|
|
15134
15189
|
*
|
|
15190
|
+
* **`consumer_id` is REQUIRED for a `boleto` too**: it names the merchant-side consumer the receivable settles into, and its wallet is what the payment credits. Without it there is nothing to settle into and the call is refused with `consumer_id_required` before anything is sent. In a test project any stable id of your own works: the project's shared-sandbox receiver stands in for the consumer's account at the issuer (the consumer is never onboarded there), and `POST /v1/test/charges/{chargeId}/pay` settles the charge into that consumer's wallet.
|
|
15191
|
+
*
|
|
15135
15192
|
* An agreement in N instalments is N cobranças, one per parcela, each with its own `due_date` and its own key. There is no single instalment charge.
|
|
15136
15193
|
*
|
|
15137
15194
|
* **Each refusal names a `reason`, and the reason is what to branch on.** The two error `code` values (`invalid_args`, `provider_error`) are too coarse: they cover six different situations, and reading them as one would turn `not found` into `bad request`.
|
|
@@ -15140,7 +15197,9 @@ export interface paths {
|
|
|
15140
15197
|
* |---|---|---|
|
|
15141
15198
|
* | `charge_id_missing` | 400 | the call named no charge |
|
|
15142
15199
|
* | `project_scope_missing` | 400 | the credential is not project-scoped, and a charge belongs to one project |
|
|
15200
|
+
* | `consumer_id_required` | 400 | a `boleto` create named no `consumer_id`, so there is no wallet for the receivable to settle into |
|
|
15143
15201
|
* | `charge_not_found` | 404 | no charge under that id FOR THIS TENANT |
|
|
15202
|
+
* | `charge_reference_ambiguous` | 409 | the reference is one charge's id AND another's idempotency key; query by the charge id |
|
|
15144
15203
|
* | `issuance_unconfirmed` | 409 | the key holds a reservation whose create never got an answer |
|
|
15145
15204
|
* | `already_payment_notified` | 409 | the clearing house already notified a payment |
|
|
15146
15205
|
* | `not_cancellable_in_this_state` | 409 | the issuer accepts a cancellation only in some states |
|
|
@@ -15159,11 +15218,13 @@ export interface paths {
|
|
|
15159
15218
|
requestBody?: {
|
|
15160
15219
|
content: {
|
|
15161
15220
|
"application/json": {
|
|
15162
|
-
/** @description In minor units. */
|
|
15221
|
+
/** @description In MAJOR units of `currency`, NOT minor: `12.5` is R$ 12,50 and comes back as `amount_minor: 1250`. Sending `1250` here issues a R$ 1.250,00 charge. This is the one field of the charge family that takes major units; every `*_minor` field, including the response's `amount_minor`, is in centavos. */
|
|
15163
15222
|
amount: number;
|
|
15164
15223
|
currency: string;
|
|
15165
15224
|
/** @description `pix`, `boleto`, `card` or `wallet`. */
|
|
15166
15225
|
method: string;
|
|
15226
|
+
/** @description The merchant-side consumer the charge settles into: its wallet is credited when the debtor pays. REQUIRED for `boleto` (refused with `consumer_id_required` otherwise); optional for the other methods, where an absent value falls back to the session's user when there is one. */
|
|
15227
|
+
consumer_id?: string;
|
|
15167
15228
|
description?: string;
|
|
15168
15229
|
buyer?: {
|
|
15169
15230
|
[key: string]: unknown;
|
|
@@ -15189,7 +15250,11 @@ export interface paths {
|
|
|
15189
15250
|
"application/json": {
|
|
15190
15251
|
/** @description The issuer's charge id. Null while the issuance is unconfirmed. */
|
|
15191
15252
|
id: string | null;
|
|
15192
|
-
/**
|
|
15253
|
+
/**
|
|
15254
|
+
* @description The provider's state as far as we know it, normalized (`PROCESSING`, `PENDING`, `CONFIRMED`, `CANCELLED`, `EXPIRED`). Forced to PROCESSING until the issuance is confirmed.
|
|
15255
|
+
*
|
|
15256
|
+
* **A charge settled by the sandbox payer answers `CONFIRMED` here**, the same value a real payment leaves a live read answering — so a client that polls `status` sees the test payment exactly where it would see a live one. The issuer's homolog account never sees that money and keeps answering PENDING (EXPIRED after the due date); that answer stays in `raw` and is not reported as `status` or as a `status_conflict`, because for a test charge the fixture is the issuer's truth. `settlement: "confirmed"` and `local_status: "settled"` say the same thing from our side.
|
|
15257
|
+
*/
|
|
15193
15258
|
status: string;
|
|
15194
15259
|
/** @description What CodeSpar recorded, which is a different question from `status`. */
|
|
15195
15260
|
local_status: string;
|
|
@@ -15197,9 +15262,9 @@ export interface paths {
|
|
|
15197
15262
|
status_conflict: boolean;
|
|
15198
15263
|
method: string;
|
|
15199
15264
|
currency: string;
|
|
15200
|
-
/** @description In units. */
|
|
15265
|
+
/** @description In MAJOR units of `currency`: `12.5` is R$ 12,50. Always `amount_minor / 100`. */
|
|
15201
15266
|
amount: number;
|
|
15202
|
-
/** @description In minor units. */
|
|
15267
|
+
/** @description In minor units (centavos): `1250` is R$ 12,50. */
|
|
15203
15268
|
amount_minor: number;
|
|
15204
15269
|
due_date: string | null;
|
|
15205
15270
|
/** @description True only when all four hold: the issuance is confirmed, our row is still open, the provider says PENDING, and at least one document exists. This is the field to branch on, not `status`. */
|
|
@@ -15224,7 +15289,7 @@ export interface paths {
|
|
|
15224
15289
|
};
|
|
15225
15290
|
};
|
|
15226
15291
|
};
|
|
15227
|
-
/** @description The call is malformed, or the two idempotency keys disagree. */
|
|
15292
|
+
/** @description The call is malformed, names no consumer for a boleto, or the two idempotency keys disagree. */
|
|
15228
15293
|
400: {
|
|
15229
15294
|
headers: {
|
|
15230
15295
|
[name: string]: unknown;
|
|
@@ -15233,7 +15298,7 @@ export interface paths {
|
|
|
15233
15298
|
"application/json": {
|
|
15234
15299
|
error: {
|
|
15235
15300
|
/** @enum {string} */
|
|
15236
|
-
code: "charge_idempotency_key_required" | "idempotency_key_conflict";
|
|
15301
|
+
code: "charge_idempotency_key_required" | "consumer_id_required" | "idempotency_key_conflict";
|
|
15237
15302
|
message: string;
|
|
15238
15303
|
details?: {
|
|
15239
15304
|
[key: string]: unknown;
|
|
@@ -15301,7 +15366,9 @@ export interface paths {
|
|
|
15301
15366
|
};
|
|
15302
15367
|
/**
|
|
15303
15368
|
* Read a charge
|
|
15304
|
-
* @description Reads a charge this project issued. `chargeId` accepts EITHER the id the create returned OR the caller's own `idempotency_key` — the row is resolved under this credential's org and project, which is what makes another tenant's id simply not found.
|
|
15369
|
+
* @description Reads a charge this project issued. `chargeId` accepts EITHER the id the create returned (the issuer's charge transaction id) OR the caller's own `idempotency_key` — the row is resolved under this credential's org and project, which is what makes another tenant's id simply not found. A value that is one charge's id AND another charge's key is refused with `charge_reference_ambiguous` rather than answered for whichever came first; query by the charge id in that case. The Pix leg's own transaction id is not a reference here.
|
|
15370
|
+
*
|
|
15371
|
+
* **A charge the sandbox payer settled answers `status: "CONFIRMED"`** with `settlement: "confirmed"` and `local_status: "settled"` — see `status` on the response for why the issuer's own PENDING is not reported.
|
|
15305
15372
|
*
|
|
15306
15373
|
* **Branch on `payable`, not on `status`.** `payable` is true only when the issuance is confirmed, our row is still open, the provider says PENDING, and at least one payable document exists. A cobrança com vencimento answers PROCESSING with `payable: false` and no document at first, because the instrument registers with the clearing house before it can be paid.
|
|
15307
15374
|
*
|
|
@@ -15313,7 +15380,9 @@ export interface paths {
|
|
|
15313
15380
|
* |---|---|---|
|
|
15314
15381
|
* | `charge_id_missing` | 400 | the call named no charge |
|
|
15315
15382
|
* | `project_scope_missing` | 400 | the credential is not project-scoped, and a charge belongs to one project |
|
|
15383
|
+
* | `consumer_id_required` | 400 | a `boleto` create named no `consumer_id`, so there is no wallet for the receivable to settle into |
|
|
15316
15384
|
* | `charge_not_found` | 404 | no charge under that id FOR THIS TENANT |
|
|
15385
|
+
* | `charge_reference_ambiguous` | 409 | the reference is one charge's id AND another's idempotency key; query by the charge id |
|
|
15317
15386
|
* | `issuance_unconfirmed` | 409 | the key holds a reservation whose create never got an answer |
|
|
15318
15387
|
* | `already_payment_notified` | 409 | the clearing house already notified a payment |
|
|
15319
15388
|
* | `not_cancellable_in_this_state` | 409 | the issuer accepts a cancellation only in some states |
|
|
@@ -15342,7 +15411,11 @@ export interface paths {
|
|
|
15342
15411
|
"application/json": {
|
|
15343
15412
|
/** @description The issuer's charge id. Null while the issuance is unconfirmed. */
|
|
15344
15413
|
id: string | null;
|
|
15345
|
-
/**
|
|
15414
|
+
/**
|
|
15415
|
+
* @description The provider's state as far as we know it, normalized (`PROCESSING`, `PENDING`, `CONFIRMED`, `CANCELLED`, `EXPIRED`). Forced to PROCESSING until the issuance is confirmed.
|
|
15416
|
+
*
|
|
15417
|
+
* **A charge settled by the sandbox payer answers `CONFIRMED` here**, the same value a real payment leaves a live read answering — so a client that polls `status` sees the test payment exactly where it would see a live one. The issuer's homolog account never sees that money and keeps answering PENDING (EXPIRED after the due date); that answer stays in `raw` and is not reported as `status` or as a `status_conflict`, because for a test charge the fixture is the issuer's truth. `settlement: "confirmed"` and `local_status: "settled"` say the same thing from our side.
|
|
15418
|
+
*/
|
|
15346
15419
|
status: string;
|
|
15347
15420
|
/** @description What CodeSpar recorded, which is a different question from `status`. */
|
|
15348
15421
|
local_status: string;
|
|
@@ -15350,9 +15423,9 @@ export interface paths {
|
|
|
15350
15423
|
status_conflict: boolean;
|
|
15351
15424
|
method: string;
|
|
15352
15425
|
currency: string;
|
|
15353
|
-
/** @description In units. */
|
|
15426
|
+
/** @description In MAJOR units of `currency`: `12.5` is R$ 12,50. Always `amount_minor / 100`. */
|
|
15354
15427
|
amount: number;
|
|
15355
|
-
/** @description In minor units. */
|
|
15428
|
+
/** @description In minor units (centavos): `1250` is R$ 12,50. */
|
|
15356
15429
|
amount_minor: number;
|
|
15357
15430
|
due_date: string | null;
|
|
15358
15431
|
/** @description True only when all four hold: the issuance is confirmed, our row is still open, the provider says PENDING, and at least one document exists. This is the field to branch on, not `status`. */
|
|
@@ -15417,7 +15490,7 @@ export interface paths {
|
|
|
15417
15490
|
};
|
|
15418
15491
|
};
|
|
15419
15492
|
};
|
|
15420
|
-
/** @description The charge exists and is not readable in this state. */
|
|
15493
|
+
/** @description The charge exists and is not readable in this state, or the reference names two charges. */
|
|
15421
15494
|
409: {
|
|
15422
15495
|
headers: {
|
|
15423
15496
|
[name: string]: unknown;
|
|
@@ -15426,7 +15499,7 @@ export interface paths {
|
|
|
15426
15499
|
"application/json": {
|
|
15427
15500
|
error: {
|
|
15428
15501
|
/** @enum {string} */
|
|
15429
|
-
code: "issuance_unconfirmed";
|
|
15502
|
+
code: "issuance_unconfirmed" | "charge_reference_ambiguous";
|
|
15430
15503
|
message: string;
|
|
15431
15504
|
details?: {
|
|
15432
15505
|
[key: string]: unknown;
|
|
@@ -15490,7 +15563,9 @@ export interface paths {
|
|
|
15490
15563
|
* |---|---|---|
|
|
15491
15564
|
* | `charge_id_missing` | 400 | the call named no charge |
|
|
15492
15565
|
* | `project_scope_missing` | 400 | the credential is not project-scoped, and a charge belongs to one project |
|
|
15566
|
+
* | `consumer_id_required` | 400 | a `boleto` create named no `consumer_id`, so there is no wallet for the receivable to settle into |
|
|
15493
15567
|
* | `charge_not_found` | 404 | no charge under that id FOR THIS TENANT |
|
|
15568
|
+
* | `charge_reference_ambiguous` | 409 | the reference is one charge's id AND another's idempotency key; query by the charge id |
|
|
15494
15569
|
* | `issuance_unconfirmed` | 409 | the key holds a reservation whose create never got an answer |
|
|
15495
15570
|
* | `already_payment_notified` | 409 | the clearing house already notified a payment |
|
|
15496
15571
|
* | `not_cancellable_in_this_state` | 409 | the issuer accepts a cancellation only in some states |
|
|
@@ -15519,7 +15594,11 @@ export interface paths {
|
|
|
15519
15594
|
"application/json": {
|
|
15520
15595
|
/** @description The issuer's charge id. Null while the issuance is unconfirmed. */
|
|
15521
15596
|
id: string | null;
|
|
15522
|
-
/**
|
|
15597
|
+
/**
|
|
15598
|
+
* @description The provider's state as far as we know it, normalized (`PROCESSING`, `PENDING`, `CONFIRMED`, `CANCELLED`, `EXPIRED`). Forced to PROCESSING until the issuance is confirmed.
|
|
15599
|
+
*
|
|
15600
|
+
* **A charge settled by the sandbox payer answers `CONFIRMED` here**, the same value a real payment leaves a live read answering — so a client that polls `status` sees the test payment exactly where it would see a live one. The issuer's homolog account never sees that money and keeps answering PENDING (EXPIRED after the due date); that answer stays in `raw` and is not reported as `status` or as a `status_conflict`, because for a test charge the fixture is the issuer's truth. `settlement: "confirmed"` and `local_status: "settled"` say the same thing from our side.
|
|
15601
|
+
*/
|
|
15523
15602
|
status: string;
|
|
15524
15603
|
/** @description What CodeSpar recorded, which is a different question from `status`. */
|
|
15525
15604
|
local_status: string;
|
|
@@ -15527,9 +15606,9 @@ export interface paths {
|
|
|
15527
15606
|
status_conflict: boolean;
|
|
15528
15607
|
method: string;
|
|
15529
15608
|
currency: string;
|
|
15530
|
-
/** @description In units. */
|
|
15609
|
+
/** @description In MAJOR units of `currency`: `12.5` is R$ 12,50. Always `amount_minor / 100`. */
|
|
15531
15610
|
amount: number;
|
|
15532
|
-
/** @description In minor units. */
|
|
15611
|
+
/** @description In minor units (centavos): `1250` is R$ 12,50. */
|
|
15533
15612
|
amount_minor: number;
|
|
15534
15613
|
due_date: string | null;
|
|
15535
15614
|
/** @description True only when all four hold: the issuance is confirmed, our row is still open, the provider says PENDING, and at least one document exists. This is the field to branch on, not `status`. */
|
|
@@ -15603,7 +15682,7 @@ export interface paths {
|
|
|
15603
15682
|
"application/json": {
|
|
15604
15683
|
error: {
|
|
15605
15684
|
/** @enum {string} */
|
|
15606
|
-
code: "issuance_unconfirmed" | "already_payment_notified" | "not_cancellable_in_this_state";
|
|
15685
|
+
code: "issuance_unconfirmed" | "already_payment_notified" | "not_cancellable_in_this_state" | "charge_reference_ambiguous";
|
|
15607
15686
|
message: string;
|
|
15608
15687
|
details?: {
|
|
15609
15688
|
[key: string]: unknown;
|
|
@@ -15784,7 +15863,7 @@ export interface paths {
|
|
|
15784
15863
|
};
|
|
15785
15864
|
};
|
|
15786
15865
|
};
|
|
15787
|
-
/** @description The charge exists and cannot be paid: `issuance_unconfirmed` is a reservation whose create never got an answer; `charge_not_payable` is a charge already closed (expired or cancelled). */
|
|
15866
|
+
/** @description The charge exists and cannot be paid: `issuance_unconfirmed` is a reservation whose create never got an answer; `charge_not_payable` is a charge already closed (expired or cancelled); `charge_reference_ambiguous` is a reference that is one charge's id and another's idempotency key — pay by the charge id. */
|
|
15788
15867
|
409: {
|
|
15789
15868
|
headers: {
|
|
15790
15869
|
[name: string]: unknown;
|
|
@@ -15793,7 +15872,7 @@ export interface paths {
|
|
|
15793
15872
|
"application/json": {
|
|
15794
15873
|
error: {
|
|
15795
15874
|
/** @enum {string} */
|
|
15796
|
-
code: "issuance_unconfirmed" | "charge_not_payable";
|
|
15875
|
+
code: "issuance_unconfirmed" | "charge_not_payable" | "charge_reference_ambiguous";
|
|
15797
15876
|
message: string;
|
|
15798
15877
|
details?: {
|
|
15799
15878
|
[key: string]: unknown;
|
|
@@ -15977,7 +16056,7 @@ export interface paths {
|
|
|
15977
16056
|
};
|
|
15978
16057
|
};
|
|
15979
16058
|
};
|
|
15980
|
-
/** @description The charge exists and cannot be paid: `issuance_unconfirmed` is a reservation whose create never got an answer; `charge_not_payable` is a charge already closed (expired or cancelled). */
|
|
16059
|
+
/** @description The charge exists and cannot be paid: `issuance_unconfirmed` is a reservation whose create never got an answer; `charge_not_payable` is a charge already closed (expired or cancelled); `charge_reference_ambiguous` is a reference that is one charge's id and another's idempotency key — pay by the charge id. */
|
|
15981
16060
|
409: {
|
|
15982
16061
|
headers: {
|
|
15983
16062
|
[name: string]: unknown;
|
|
@@ -15986,7 +16065,7 @@ export interface paths {
|
|
|
15986
16065
|
"application/json": {
|
|
15987
16066
|
error: {
|
|
15988
16067
|
/** @enum {string} */
|
|
15989
|
-
code: "issuance_unconfirmed" | "charge_not_payable";
|
|
16068
|
+
code: "issuance_unconfirmed" | "charge_not_payable" | "charge_reference_ambiguous";
|
|
15990
16069
|
message: string;
|
|
15991
16070
|
details?: {
|
|
15992
16071
|
[key: string]: unknown;
|