codespar charges
Charges: issue one, read it, list them, withdraw one
Charges: issue one, read it, list them, withdraw one
5 commands in @codespar/cli 0.16.0.
Each one prints what its operation answered. What a command prints has the rule, and Configuration has the exit codes and the shape of a failure.
codespar charges list
List charges
codespar charges list| option | what it does |
|---|---|
-q, --query <key=value> | Query parameter (repeatable) (default: []) |
--timeout <ms> | Per-request timeout in milliseconds |
GET /v1/charges · parameters, responses and refusals
codespar charges create
Issue a charge
codespar charges create --input-file body.json{
"amount": 1000,
"currency": "BRL",
"method": "string",
"consumer_id": "csm_0000000000000000",
"description": "string",
"buyer": {},
"due_date": "string",
"idempotency_key": "string",
"country": "string",
"metadata": {}
}| option | what it does |
|---|---|
-q, --query <key=value> | Query parameter (repeatable) (default: []) |
--timeout <ms> | Per-request timeout in milliseconds |
-i, --input <json> | Request body as a JSON string |
-f, --input-file <path> | Request body from a JSON file |
POST /v1/charges · parameters, responses and refusals
codespar charges get
Read a charge
codespar charges get charge_0000000000000000| argument | what it is |
|---|---|
<chargeId> | String. |
| option | what it does |
|---|---|
-q, --query <key=value> | Query parameter (repeatable) (default: []) |
--timeout <ms> | Per-request timeout in milliseconds |
GET /v1/charges/{chargeId} · parameters, responses and refusals
codespar charges cancel
Withdraw a charge
codespar charges cancel charge_0000000000000000| argument | what it is |
|---|---|
<chargeId> | String. |
| option | what it does |
|---|---|
-q, --query <key=value> | Query parameter (repeatable) (default: []) |
--timeout <ms> | Per-request timeout in milliseconds |
POST /v1/charges/{chargeId}/cancel · parameters, responses and refusals
codespar charges sandbox-pay
Pay a charge in the sandbox (alias path)
Deprecated route. The served document marks this operation as dead. The command still answers today and will go; the HTTP reference below names what took its place.
codespar charges sandbox-pay charge_0000000000000000 --input '{"amount_minor":1000}'| argument | what it is |
|---|---|
<chargeId> | String. |
| option | what it does |
|---|---|
-q, --query <key=value> | Query parameter (repeatable) (default: []) |
--timeout <ms> | Per-request timeout in milliseconds |
-i, --input <json> | Request body as a JSON string |
-f, --input-file <path> | Request body from a JSON file |
POST /v1/charges/{chargeId}/sandbox/pay · parameters, responses and refusals