Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
4.3 kB
2
Indexable
Never
Segue um exemplo que fiz aqui, acredito que possa ajudá-lo:

{
    "closed": true,
    "items": [
        {
            "amount": 2990,
            "description": "Teste Pagar.me",
            "quantity": 1,
            "code": "123"
        }
    ],
    "customer": {
        "name": "Teste Pagarme",
        "email": "teste@pagar.me",
        "code": "MY_CUSTOMER_001",
        "document": "55194958072",
        "type": "individual",
        "document_type": "CPF",
        "gender": "male",
        "address": {
            "line_1": "501, Rua três",
            "zip_code": "29302841",
            "city": "Cachoeiro de Itapemirim",
            "state": "ES",
            "country": "BR"
        },
        "birthdate": "04/22/1955",
        "phones": {
            "home_phone": {
                "country_code": "55",
                "area_code": "85",
                "number": "000000000"
            },
            "mobile_phone": {
                "country_code": "55",
                "area_code": "85",
                "number": "000000000"
            }
        },
        "metadata": {
            "company": "Pagar.me"
        }
    },
    "shipping": {
        "amount": 83880,
        "description": "Teste Pagar.me",
        "recipient_name": "Teste Pagar.me",
        "address": {
            "country": "BR",
            "state": "ES",
            "city": "Cachoeiro de Itapemirim",
            "zip_code": "29302841",
            "line_1": "501, Rua três"
        }
    },
    "payments": [
        {
            "payment_method": "checkout",
            "checkout": {
                "customer_editable": false,
                "skip_checkout_success_page": true,
                "accepted_payment_methods": [
                    "credit_card",
                    "boleto",
                    "pix"
                ],
                "success_url": "https://www.pagar.me",
                "credit_card": {
                    "capture": true,
                    "operation_type": "auth_and_capture",
                    "statement_descriptor": "13caracteres",
                    "installments": [
                        {
                            "number": 1,
                            "total": 2990
                        },
                        {
                            "number": 2,
                            "total": 2990
                        },
                        {
                            "number": 3,
                            "total": 2990
                        },
                        {
                            "number": 4,
                            "total": 2990
                        },
                        {
                            "number": 5,
                            "total": 2990
                        },
                        {
                            "number": 6,
                            "total": 2990
                        },
                        {
                            "number": 7,
                            "total": 2990
                        },
                        {
                            "number": 8,
                            "total": 2990
                        },
                        {
                            "number": 9,
                            "total": 2990
                        },
                        {
                            "number": 10,
                            "total": 2990
                        },
                        {
                            "number": 11,
                            "total": 2990
                        },
                        {
                            "number": 12,
                            "total": 2990
                        }
                    ]
                },
                "boleto": {
                    "instructions": "Pagar até o vencimento",
                    "due_at": "2022-12-31",
                    "document_number": "123"
                },
                "pix": {
                    "expires_at": "2022-12-31",
                    "additional_information": [
                        {
                            "name": "information",
                            "value": "number"
                        }
                    ]
                }
            }
        }
    ]
}