# MD for: https://www.mercadopago.com.uy/developers/pt/docs/mp-cli/commands.md \# Commands The Mercado Pago CLI provides commands to operate our main integrable products directly from the terminal. Check the commands available by product, how to use them, and the complete reference for each one. ## Commands by product | Command | Availability by product(s) | |---|---| | \`mpcli payments\`, \`mpcli cards\` | Checkout API | | \`mpcli advanced-payments\` | Checkout API | | \`mpcli preferences\` | Checkout Pro | | \`mpcli orders\` | Checkout Pro Checkout API | | \`mpcli merchant-orders\` | Marketplace | | \`mpcli subscriptions\`, \`mpcli subscription-plans\` | Subscriptions | | \`mpcli pos\`, \`mpcli stores\` | Point QR code | | \`mpcli shipping\` | Shipping | | \`mpcli chargebacks\` | All products. | | \`mpcli reports releases\`, \`mpcli reports settlements\` | All products. | | \`mpcli oauth\` | All products. | ## How to use commands All CLI commands follow the pattern \`mpcli \[resource\] \[action\] \[flags\]\`. You can check the available options for any command using the \`--help\` flag: \`\`\`bash mpcli --help mpcli payments --help \`\`\` ### Output format By default, all commands return a \`JSON\`: \`\`\`bash mpcli payments list # { "status": "success", "data": { "results": \[...\] } } \`\`\` For a readable tabular output, use the \`--table\` flag. See an example below: \`\`\`text $ mpcli payments list --table ID STATUS AMOUNT METHOD DATE 12345678 approved $ 99.90 account\_money 2025-01-01T... \`\`\` ### Global flags Any command accepts the following flags to control output format, authentication, or specific interactive behavior. See the details for each one below: | Flag | Shortcut | Description | |---|---|---| | \`--table\` | — | Formatted tabular output. | | \`--silent\` | \`-s\` | Suppress spinners and ANSI colors. | | \`--verbose\` | \`-v\` | Display HTTP headers. | | \`--profile\` | \`-p\` | Credentials profile to use. | | \`--idempotency-key\` | — | Idempotency key for POST/PUT. | | \`--data\` | — | Request body via \`JSON\` file (\`@payload.json\`). | | \`--no-interactive\` | — | Disable prompts (CI/CD). | | \`--no-color\` | — | Disable colored output. | ### Exit codes In scripts and pipelines, the Mercado Pago CLI returns an exit code at the end of each execution. Use these values to handle errors programmatically: | Code | Meaning | |---|---| | \`0\` | Success. | | \`1\` | General error. | | \`2\` | Authentication error. | | \`3\` | Validation error. | | \`4\` | Rate limit. | > NOTE > > To open the \*\*API Reference\*\* for any product directly in the browser, use \`mpcli docs \[product\]\` — for example, \`mpcli docs payments\`. ## Command reference :::::AccordionComponent{title="Payments" pill="1"} Manages the full payment lifecycle, from creation to capture, cancellation, and update. \`\`\`bash mpcli payments list mpcli payments get mpcli payments search --status approved mpcli payments search --payment-method-id pix mpcli payments search --external-reference "ORDER-001" mpcli payments create --data @payment.json mpcli payments cancel mpcli payments capture mpcli payments update \--data @update.json \`\`\` ::::: :::::AccordionComponent{title="Refunds" pill="2"} Queries the history and details of refunds associated with a payment, and creates full or partial refunds. You must provide the original payment ID to use this command. \`\`\`bash mpcli refunds create mpcli refunds create \--amount 50.00 mpcli refunds list mpcli refunds get \`\`\` ::::: :::::AccordionComponent{title="Advanced Payments" pill="3"} Creates and manages advanced payment flows with split payments and disbursements. \`\`\`bash mpcli advanced-payments create --data @advanced\_payment.json mpcli advanced-payments get mpcli advanced-payments search --external-reference ORDER-001 mpcli advanced-payments update \--data @update.json mpcli advanced-payments refund mpcli advanced-payments refund \--amount 100.00 \`\`\` ::::: :::::AccordionComponent{title="Checkout Pro Payment Preferences" pill="4"} Creates and manages \[payment preferences\](https://www.mercadopago.com.uy/developers/en/docs/checkout-pro/integrate-preferences) that configure Checkout Pro behavior for each transaction. \`\`\`bash mpcli preferences list mpcli preferences get mpcli preferences create --data @pref.json mpcli preferences update \--data @pref.json \`\`\` ::::: :::::AccordionComponent{title="Customers and Cards" pill="5"} Manages customer profiles and their tokenized cards, enabling recurring charges and payment flows with saved data. ::::TabsComponent :::TabComponent{title="Customers"} \`\`\`bash mpcli customers list mpcli customers get mpcli customers create --email user@example.com mpcli customers update \--data @customer.json mpcli customers delete \`\`\` ::: :::TabComponent{title="Cards"} \`\`\`bash mpcli cards list mpcli cards get mpcli cards create \--data @card.json mpcli cards delete \`\`\` ::: :::: ::::: :::::AccordionComponent{title="Subscription Management" pill="6"} Creates and manages recurring plans and subscriptions for periodic charges. See the \[subscription plans documentation\](https://www.mercadopago.com.uy/developers/en/docs/subscription-plans/create-subscription-plan) for more information. ::::TabsComponent :::TabComponent{title="Subscriptions"} \`\`\`bash mpcli subscriptions list mpcli subscriptions get mpcli subscriptions create --data @subscription.json mpcli subscriptions update \--data @sub.json \`\`\` ::: :::TabComponent{title="Subscription plans"} \`\`\`bash mpcli subscription-plans list mpcli subscription-plans get mpcli subscription-plans create --data @plan.json \`\`\` ::: :::: ::::: :::::AccordionComponent{title="Stores and Points of Sale (POS)" pill="7"} Creates and configures physical stores and points of sale (POS) to process in-person payments with Point and QR Code. See the \[QR Code documentation\](https://www.mercadopago.com.uy/developers/en/docs/qr-code/payment-processing) for details on payment processing with orders. ::::TabsComponent :::TabComponent{title="Stores"} \`\`\`bash mpcli stores search mpcli stores get mpcli stores create --name "Main Store" --external-id MY\_STORE mpcli stores update \--data @store.json mpcli stores delete \`\`\` ::: :::TabComponent{title="Points of Sale"} \`\`\`bash mpcli pos list mpcli pos get mpcli pos create --name "Register 1" --store-id mpcli pos update \--name "New Name" mpcli pos delete mpcli pos qr \`\`\` ::: :::: ::::: :::::AccordionComponent{title="Orders" pill="8"} Queries orders automatically generated by Mercado Pago when processing a payment via Checkout Pro or Checkout API. \`\`\`bash mpcli orders get \`\`\` ::::: :::::AccordionComponent{title="Merchant Orders" pill="9"} Groups payments and shipments in Marketplace flows. Requires Marketplace integration to be configured. \`\`\`bash mpcli merchant-orders create --preference-id mpcli merchant-orders create --data @order.json mpcli merchant-orders get mpcli merchant-orders search --external-reference "REF-001" mpcli merchant-orders update \--data @update.json \`\`\` ::::: :::::AccordionComponent{title="Shipping" pill="10"} Creates and tracks shipping associated with orders. \`\`\`bash mpcli shipping create --data @shipment.json mpcli shipping get mpcli shipping list mpcli shipping cancel mpcli shipping track \`\`\` ::::: :::::AccordionComponent{title="Chargebacks" pill="11"} Queries and tracks chargebacks opened against charges made by your integration. \`\`\`bash mpcli chargebacks list mpcli chargebacks get mpcli chargebacks search --payment-id \`\`\` ::::: :::::AccordionComponent{title="Financial Reports" pill="12"} Generates and queries financial reports for releases and account money for transaction reconciliation and auditing. See the \[reports documentation\](https://www.mercadopago.com.uy/developers/en/docs/reports/introduction) for more information. > WARNING > > The \*\*Financial Reports\*\* module must be enabled in the Mercado Pago account. Check the available commands by report type: ::::TabsComponent :::TabComponent{title="Releases"} \`\`\`bash mpcli reports releases list mpcli reports releases create --date-from 2025-01-01 --date-to 2025-01-31 \`\`\` ::: :::TabComponent{title="Account money"} \`\`\`bash mpcli reports settlements list mpcli reports settlements create --date-from 2025-01-01 --date-to 2025-01-31 \`\`\` ::: :::: ::::: :::::AccordionComponent{title="Payment Methods and Identification Types" pill="13"} Queries the payment methods and identity document types available for the country configured in the account. \`\`\`bash mpcli payment-methods list mpcli identification-types list \`\`\` ::::: :::::AccordionComponent{title="OAuth" pill="14"} Manages the exchange of authorization codes and renewal of access tokens via OAuth 2.0\. See the \[OAuth documentation\](https://www.mercadopago.com.uy/developers/en/docs/security/oauth) for more information. \`\`\`bash mpcli oauth url --client-id \--redirect-uri https://myapp.com/callback mpcli oauth token --client-id \--client-secret \--code \--redirect-uri https://myapp.com/callback mpcli oauth refresh --token \`\`\` ::::: :::::AccordionComponent{title="Config" pill="15"} Manages named credential profiles to switch between accounts and environments without re-authenticating. \`\`\`bash mpcli config set --profile sandbox --token TEST-... --environment sandbox mpcli config use sandbox mpcli config list mpcli config get environment \`\`\` ::::: :::::AccordionComponent{title="Sandbox and Testing" pill="16"} Creates and configures test users, virtual balance, and test cards to simulate payment scenarios in the sandbox environment. \*\*Create test user\*\* \`\`\`bash mpcli tester create \`\`\` \*\*Set virtual balance\*\* \`\`\`bash mpcli tester balance set --user-id \--amount 10000 \`\`\` \*\*Provision test card\*\* The \`--scenario\` defines the simulated behavior: \`\`\`bash mpcli tester card create --user-id \--scenario approved mpcli tester card create --user-id \--scenario insufficient\_funds mpcli tester card create --user-id \--scenario stolen\_card mpcli tester card create --user-id \--scenario high\_risk \`\`\` | Scenario | Behavior | |---|---| | \`approved\` | Card always approved. | | \`insufficient\_funds\` | Declined due to insufficient balance. | | \`stolen\_card\` | Declined due to invalid security code. | | \`high\_risk\` | Enters fraud review. | :::::