Wallet

This page presents examples of requests and responses for creating payments using the Create Payment endpoint and Payment Link as payment method.

To test the creation of each payment, you can copy the content from the request code and use it on your machine or paste it on the Create Payment endpoint to test using Readme.

Wallet available examples

Mercado Pago Checkout Pro
Astropay

Mercado Pago Checkout Pro

Example of a request for a payment using Mercado Pago Checkout Pro. Below are examples of a request and the received response for successful payment creation. The request is presented using the cURL format, and the response is a JSON object.

curl --request POST \
     --url https://api-sandbox.y.uno/v1/payments \
     --header 'X-Idempotency-Key: <Your idempotency-key>' \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --header 'private-secret-key: <Your private-secret-key>' \
     --header 'public-api-key: <Your public-api-key>' \
     --data '
{
    "description": "Test MP Checkout pro",
    "account_id": "{{account-code}}",
    "merchant_order_id": "0000023",
    "country": "CO",
    "merchant_reference": "reference-{{$randomUUID}}",
    "additional_data": {
        "order": {
            "items": [
                {
                    "id": "123AD",
                    "name": "Skirt",
                    "quantity": 1,
                    "unit_amount": 3000
                }
            ]
        }
    },
    "amount": {
        "currency": "COP",
        "value": 3000
    },
    "customer_payer": {
        "email": "[email protected]",
        "first_name": "Pepito",
        "last_name": "Perez"
    },
    "payment_method": {
        "type": "MERCADO_PAGO_CHECKOUT_PRO"
    },
    "workflow": "REDIRECT",
    "callback_url":"www.y.uno"
}
'
{
    "id": "d0ff19c2-cf55-4015-a613-e35f22da0233",
    "account_id": "{{account-code}}",
    "description": "Test MP Checkout pro",
    "country": "CO",
    "status": "READY_TO_PAY",
    "sub_status": "CREATED",
    "merchant_order_id": "0000023",
    "created_at": "2023-07-23T23:02:39.401790Z",
    "updated_at": "2023-07-23T23:02:40.312593Z",
    "amount": {
        "captured": 0.00,
        "currency": "COP",
        "refunded": 0.00,
        "value": 3000.00
    },
    "checkout": {
        "session": "b7e15362-4ac0-4e23-886e-329695933ecb",
        "sdk_action_required": true
    },
    "payment_method": {
        "vaulted_token": "",
        "type": "MERCADO_PAGO_CHECKOUT_PRO",
        "vault_on_success": false,
        "token": "",
        "payment_method_detail": {
            "wallet": {
                "verify": false,
                "capture": false,
                "installments": null,
                "payment_method_id": null,
                "payment_method_detail": null,
                "date_of_expiration": null,
                "money_release_date": null,
                "sponsor_id": null,
                "authorization_code": null,
                "customer_data": null,
                "card_data": null,
                "redirect_url": "https://checkout.sandbox.y.uno/payment?session=e93d8431-f55c-43a3-a4e4-0c7a4bcc7e27"
            }
        }
    },
    "customer_payer": {
        "id": null,
        "merchant_customer_id": null,
        "first_name": "Pepito",
        "last_name": "Perez",
        "gender": null,
        "date_of_birth": null,
        "email": "[email protected]",
        "nationality": null,
        "ip_address": null,
        "device_fingerprint": null,
        "browser_info": {
            "user_agent": "",
            "accept_header": "",
            "accept_content": null,
            "accept_browser": null,
            "color_depth": "",
            "screen_height": "",
            "screen_width": "",
            "javascript_enabled": null,
            "java_enabled": null,
            "browser_time_difference": null,
            "language": ""
        },
        "document": null,
        "phone": null,
        "billing_address": null,
        "shipping_address": null
    },
    "additional_data": {
        "airline": null,
        "order": {
            "fee_amount": null,
            "shipping_amount": null,
            "items": [
                {
                    "id": "123AD",
                    "name": "Skirt",
                    "quantity": 1,
                    "unit_amount": 3000,
                    "category": null,
                    "brand": null,
                    "sku_code": null,
                    "manufacture_part_number": null
                }
            ]
        },
        "seller_details": null
    },
    "taxes": null,
    "transactions": {
        "id": "286ad833-7cbc-4e66-92f9-01019eb7d7a3",
        "type": "PURCHASE",
        "status": "CREATED",
        "category": "WALLET",
        "amount": 3000.00,
        "provider_id": "MERCADO_PAGO",
        "payment_method": {
            "vaulted_token": "",
            "type": "MERCADO_PAGO_CHECKOUT_PRO",
            "vault_on_success": false,
            "token": "",
            "detail": {
                "wallet": {
                    "verify": false,
                    "capture": false,
                    "installments": null,
                    "payment_method_id": null,
                    "payment_method_detail": null,
                    "date_of_expiration": null,
                    "money_release_date": null,
                    "sponsor_id": null,
                    "authorization_code": null,
                    "customer_data": null,
                    "card_data": null,
                    "redirect_url": "https://checkout.sandbox.y.uno/payment?session=e93d8431-f55c-43a3-a4e4-0c7a4bcc7e27"
                }
            }
        },
        "response_code": "SUCCEEDED",
        "response_message": "Transaction successful",
        "reason": null,
        "description": "Test MP Checkout pro",
        "merchant_reference": "reference-d2b08e8e-c87a-4806-b1ea-b35a19a36a6d",
        "provider_data": {
            "id": "MERCADO_PAGO",
            "transaction_id": "",
            "account_id": "",
            "status": "",
            "sub_status": "",
            "status_detail": "",
            "response_message": "",
            "raw_response": {
                "value":"{\"additional_info\":\"\",\"auto_return\":\"approved\",\"back_urls\":{\"failure\":\"http://www.y.uno\",\"pending\":\"http://www.y.uno\",\"success\":\"http://www.y.uno\"},\"binary_mode\":true,\"client_id\":\"3615163740385056\",\"collector_id\":1131498549,\"coupon_code\":null,\"coupon_labels\":null,\"date_created\":\"2023-07-23T19:02:40.082-04:00\",\"date_of_expiration\":null,\"expiration_date_from\":null,\"expiration_date_to\":null,\"expires\":false,\"external_reference\":\"286ad833-7cbc-4e66-92f9-01019eb7d7a3\",\"id\":\"1131498549-ef2fc547-72b3-4e19-acce-83f94c70609a\",\"init_point\":\"https://www.mercadopago.com.ar/checkout/v1/redirect?pref_id=1131498549-ef2fc547-72b3-4e19-acce-83f94c70609a\",\"internal_metadata\":null,\"items\":[{\"id\":\"123AD\",\"category_id\":\"others\",\"currency_id\":\"ARS\",\"description\":\"\",\"title\":\"Skirt\",\"quantity\":1,\"unit_price\":3000}],\"marketplace\":\"MP-MKT-3615163740385056\",\"marketplace_fee\":0,\"metadata\":{},\"notification_url\":\"https://sandbox.y.uno/mercadopago-webhook/v1/checkout-pro/events?source_news=webhooks\&transaction=286ad833-7cbc-4e66-92f9-01019eb7d7a3\",\"operation_type\":\"regular_payment\",\"payer\":{\"phone\":{\"area_code\":\"\",\"number\":\"\"},\"address\":{\"zip_code\":\"\",\"street_name\":\"\",\"street_number\":null},\"email\":\"[email protected]\",\"identification\":{\"number\":\"\",\"type\":\"\"},\"name\":\"Pepito\",\"surname\":\"Perez\",\"date_created\":null,\"last_purchase\":null},\"payment_methods\":{\"default_card_id\":null,\"default_payment_method_id\":null,\"excluded_payment_methods\":[{\"id\":\"\"}],\"excluded_payment_types\":[{\"id\":\"ticket\"},{\"id\":\"atm\"}],\"installments\":null,\"default_installments\":null},\"processing_modes\":null,\"product_id\":null,\"redirect_urls\":{\"failure\":\"\",\"pending\":\"\",\"success\":\"\"},\"sandbox_init_point\":\"https://sandbox.mercadopago.com.ar/checkout/v1/redirect?pref_id=1131498549-ef2fc547-72b3-4e19-acce-83f94c70609a\",\"site_id\":\"MLA\",\"shipments\":{\"mode\":\"not_specified\",\"default_shipping_method\":null,\"cost\":0,\"receiver_address\":{\"zip_code\":\"\",\"street_name\":\"\",\"street_number\":null,\"floor\":\"\",\"apartment\":\"\",\"city_name\":null,\"state_name\":null,\"country_name\":null}},\"total_amount\":null,\"last_updated\":null}"
            },
            "third_party_transaction_id": ""
        },
        "created_at": "2023-07-23T23:02:39.582570Z",
        "updated_at": "2023-07-23T23:02:40.227158Z"
    },
    "split": [],
    "callback_url": "www.y.uno",
    "workflow": "REDIRECT",
    "metadata": []
}

Astropay

Example of a request for a payment using Astropay. Below are examples of a request and the received response for successful payment creation. The request is presented using the cURL format, and the response is a JSON object.

curl --location 'https://api-sandbox.y.uno/v1/payments' \
--header 'X-idempotency-key: ----' \
--header 'public-api-key:--- ' \
--header 'private-secret-key: ---' \
--header 'Content-Type: application/json' \
--data '{
    "account_id": {{your_account_id}},
    "amount": {
        "currency": "BRL",
        "value": 283
    },
    "checkout": {
        "session": "ce855c45-f560-4a28-8258-d765777ba485"
    },
    "payment_method": {
        "type": "ASTROPAY"
    },
    "customer_payer": {
        "id": {{your_customer_payer_id}}
    },
    "merchant_order_id": "test merchant order id",
    "country": "BR",
    "description": "test description",
    "workflow": "REDIRECT"
}'
{
    "id": "245e360c-3bd7-4a8d-9258-8a8839087f7e",
    "account_id": "{{your_account_id}}",
    "description": "test description",
    "country": "BR",
    "status": "READY_TO_PAY",
    "sub_status": "CREATED",
    "merchant_order_id": "test merchant order id",
    "created_at": "2024-03-22T11:48:45.772202Z",
    "updated_at": "2024-03-22T11:48:46.402414Z",
    "amount": {
        "captured": 0.00,
        "currency": "BRL",
        "refunded": 0.00,
        "value": 283.00
    },
    "checkout": {
        "session": "a5e36fa7-e635-417b-aa87-8cda1adbe24e",
        "sdk_action_required": true
    },
    "payment_method": {
        "vaulted_token": "",
        "type": "ASTROPAY",
        "vault_on_success": false,
        "token": "",
        "payment_method_detail": {
            "wallet": {
                "verify": false,
                "capture": false,
                "installments": null,
                "payment_method_id": null,
                "payment_method_detail": null,
                "date_of_expiration": null,
                "money_release_date": null,
                "sponsor_id": null,
                "authorization_code": null,
                "customer_data": null,
                "card_data": {
                    "holder_name": "",
                    "iin": "",
                    "lfd": "",
                    "number_length": 0,
                    "security_code_length": 0,
                    "brand": "",
                    "issuer_name": "",
                    "issuer_code": null,
                    "category": null,
                    "type": ""
                },
                "redirect_url": "https://checkout.sandbox.y.uno/payment?session=4da1aa74-a2c7-457d-8b21-f823fe8cf5b8"
            }
        }
    },
    "customer_payer": {
        "id": "{{customer_payer_id}}",
        "merchant_customer_id": "{{merchant_customer_id}}",
        "first_name": "Aaron",
        "last_name": "Heann",
        "gender": "F",
        "date_of_birth": "1990-02-28",
        "email": "[email protected]",
        "nationality": "BR",
        "ip_address": null,
        "device_fingerprint": null,
        "browser_info": {
            "user_agent": "",
            "accept_header": "",
            "accept_content": null,
            "accept_browser": null,
            "color_depth": "",
            "screen_height": "",
            "screen_width": "",
            "javascript_enabled": null,
            "java_enabled": null,
            "browser_time_difference": null,
            "language": ""
        },
        "document": {
            "document_type": "CPF",
            "document_number": "{{document_number}}"
        },
        "phone": {
            "number": "{{phone_number}}",
            "country_code": "55"
        },
        "billing_address": {
            "address_line_1": "Calle 34 # 56 - 78",
            "address_line_2": "Apartamento 502, Torre I",
            "country": "BR",
            "state": "Cundinamarca",
            "city": "Bogotá",
            "zip_code": "68890000",
            "neighborhood": null
        },
        "shipping_address": {
            "address_line_1": "Calle 34 # 56 - 78",
            "address_line_2": "Apartamento 502, Torre I",
            "country": "BR",
            "state": "Cundinamarca",
            "city": "Bogotá",
            "zip_code": "68890000",
            "neighborhood": null
        },
        "merchant_customer_created_at": null
    },
    "additional_data": null,
    "taxes": null,
    "transactions": {
        "id": "0b258b77-1785-4b64-9094-c1f7e714e460",
        "type": "PURCHASE",
        "status": "CREATED",
        "category": "WALLET",
        "amount": 283.00,
        "provider_id": "ASTROPAY",
        "payment_method": {
            "vaulted_token": "",
            "type": "ASTROPAY",
            "vault_on_success": false,
            "token": "",
            "detail": {
                "wallet": {
                    "verify": false,
                    "capture": false,
                    "installments": null,
                    "payment_method_id": null,
                    "payment_method_detail": null,
                    "date_of_expiration": null,
                    "money_release_date": null,
                    "sponsor_id": null,
                    "authorization_code": null,
                    "customer_data": null,
                    "card_data": {
                        "holder_name": "",
                        "iin": "",
                        "lfd": "",
                        "number_length": 0,
                        "security_code_length": 0,
                        "brand": "",
                        "issuer_name": "",
                        "issuer_code": null,
                        "category": null,
                        "type": ""
                    },
                    "redirect_url": "https://checkout.sandbox.y.uno/payment?session=4da1aa74-a2c7-457d-8b21-f823fe8cf5b8"
                }
            }
        },
        "response_code": "SUCCEEDED",
        "response_message": "Transaction successful",
        "reason": null,
        "description": "test description",
        "merchant_reference": "test merchant order id",
        "provider_data": {
            "id": "ASTROPAY",
            "transaction_id": "qW10WwSpwtTY8vLAqiTBY1D3FT4fTutdLCbFtiBy",
            "account_id": "",
            "status": "PENDING",
            "sub_status": "",
            "status_detail": "",
            "response_message": "",
            "response_code": "200",
            "raw_response": {
                "deposit_external_id": "{{deposit_external_id}}",
                "merchant_deposit_id": "{{merchant_deposit_id}}",
                "status": "PENDING",
                "type": "default",
                "url": "https://onetouch-sandbox.astropay.com/deposit/qW10WwSpwtTY8vLAqiTBY1D3FT4fTutdLCbFtiBy"
            },
            "third_party_transaction_id": "",
            "third_party_account_id": ""
        },
        "created_at": "2024-03-22T11:48:45.874280Z",
        "updated_at": "2024-03-22T11:48:46.361673Z"
    },
    "transactions_history": [
        {
            "id": "0b258b77-1785-4b64-9094-c1f7e714e460",
            "type": "PURCHASE",
            "status": "CREATED",
            "category": "WALLET",
            "amount": 283.00,
            "provider_id": "ASTROPAY",
            "payment_method": {
                "vaulted_token": "",
                "type": "ASTROPAY",
                "vault_on_success": false,
                "token": "",
                "detail": {
                    "wallet": {
                        "verify": false,
                        "capture": false,
                        "installments": null,
                        "payment_method_id": null,
                        "payment_method_detail": null,
                        "date_of_expiration": null,
                        "money_release_date": null,
                        "sponsor_id": null,
                        "authorization_code": null,
                        "customer_data": null,
                        "card_data": {
                            "holder_name": "",
                            "iin": "",
                            "lfd": "",
                            "number_length": 0,
                            "security_code_length": 0,
                            "brand": "",
                            "issuer_name": "",
                            "issuer_code": null,
                            "category": null,
                            "type": ""
                        },
                        "redirect_url": "https://checkout.sandbox.y.uno/payment?session=4da1aa74-a2c7-457d-8b21-f823fe8cf5b8"
                    }
                }
            },
            "response_code": "SUCCEEDED",
            "response_message": "Transaction successful",
            "reason": null,
            "description": "test description",
            "merchant_reference": "test merchant order id",
            "provider_data": {
                "id": "ASTROPAY",
                "transaction_id": "qW10WwSpwtTY8vLAqiTBY1D3FT4fTutdLCbFtiBy",
                "account_id": "",
                "status": "PENDING",
                "sub_status": "",
                "status_detail": "",
                "response_message": "",
                "response_code": "200",
                "raw_response": {
                    "deposit_external_id": "{{deposit_external_id}}",
                    "merchant_deposit_id": "{{merchant_deposit_id}}",
                    "status": "PENDING",
                    "type": "default",
                    "url": "https://onetouch-sandbox.astropay.com/deposit/qW10WwSpwtTY8vLAqiTBY1D3FT4fTutdLCbFtiBy"
                },
                "third_party_transaction_id": "",
                "third_party_account_id": ""
            },
            "created_at": "2024-03-22T11:48:45.874280Z",
            "updated_at": "2024-03-22T11:48:46.361673Z"
        }
    ],
    "split": [],
    "workflow": "REDIRECT",
    "metadata": [],
    "fraud_screening": null,
    "payment_link_id": "",
    "subscription_code": null
}