Pagar uma reserva com cartão de crédito¶
Permitir que o usuário possa paga a reserva via cartão de crédito
Verificar parcelas¶
Utilize caso a pessoa indique que quer parcelar. Campo amount é o total da compra que quer ver parcelas disponíveis.
POST /bookings/stone/installments
Request
{
"bookingId": 5,
"installmentIni": 2,
"installmentEnd": 12,
"amount": 800,
"brand": null
}
Response
{
"installments": [
{
"installment": 2,
"amount": 400,
"tax": 0,
"totalWithTax": 800,
"brand": null
},
{
"installment": 3,
"amount": 266.6666666666667,
"tax": 0,
"totalWithTax": 800,
"brand": null
},
{
"installment": 4,
"amount": 211.87999999999997,
"tax": 5.94,
"totalWithTax": 847.5199999999999,
"brand": null
},
{
"installment": 5,
"amount": 172.70399999999998,
"tax": 7.94,
"totalWithTax": 863.5199999999999,
"brand": null
},
{
"installment": 6,
"amount": 145.25333333333333,
"tax": 8.94,
"totalWithTax": 871.52,
"brand": null
},
{
"installment": 7,
"amount": 123.18857142857145,
"tax": 7.79,
"totalWithTax": 862.3200000000002,
"brand": null
},
{
"installment": 8,
"amount": 108.49,
"tax": 8.49,
"totalWithTax": 867.92,
"brand": null
}
]
}
Emissão do token do cartão¶
POST /bookings/payment/stone/creditcard_token
Request
{
"type": "card",
"card": {
"number": "4000000000000010",
"holder_name": "Glauber P O Melo",
"exp_month": 10,
"exp_year": 2030,
"cvv": "123"
}
}
Response
{
"success": true,
"data": {
"id": "token_BeE94pRcXGt6VNwQ",
"type": "card",
"created_at": "2025-12-07T01:05:44Z",
"expires_at": "2025-12-07T01:06:44Z",
"card": {
"first_six_digits": "400000",
"last_four_digits": "0010",
"holder_name": "Glauber P O Melo",
"exp_month": 10,
"exp_year": 2030,
"brand": "Visa"
}
}
}
Pagar com o Token do cartão¶
Request
POST /bookings/payment/stone/creditcard_with_token/execute_payment
{
"bookingId": "22717",
"coupon": null,
"affiliate": {
"id": null,
"feeType": "gross"
},
"isDownPaymentPrice": false,
"provider": {
"customer": {
"name": "Glauber P O Melo",
"email": "qa@theifriend.com",
"document": "057.710.956-13",
"document_type": "CPF",
"address": {
"line_1": "40,Rua dos Alvarengas,Aarão Reis",
"line_2": "",
"zip_code": "31814500",
"city": "Belo Horizonte",
"state": "MG",
"country": "BR"
},
"phones": {
"mobile_phone": {
"country_code": "55",
"area_code": "31",
"number": "992468610"
}
}
},
"items": [
{
"amount": 80474,
"description": "Agendamento ID 22717",
"qantity": 1,
"code": 22717
}
],
"payments": [
{
"amount": 80474,
"payment_method": "credit_card",
"credit_card": {
"operation_type": "auth_and_capture",
"installments": 4,
"statement_descriptor": "THEIFRIEND",
"card_token": "token_nEg6jL1UVTBOlBd9",
"card_bin": "4000 0",
"card_last4": "0010",
"billing_address": {
"line_1": "40,Rua dos Alvarengas,Aarão Reis",
"line_2": "",
"zip_code": "31814500",
"city": "Belo Horizonte",
"state": "MG",
"country": "BR"
}
}
}
]
}
}
Response
{
"coupon": null,
"booking": {
"id": 22716,
"city": "Santiago",
"state": "Santiago Metropolitan Region",
"country": "Chile",
"countryCode": null,
"latitude": null,
"longitude": null,
"dollarQuotation": 5.5165,
"price": "149.800000",
"currencyCode": "USD",
"ifriendPrice": null,
"confirmStatus": 0,
"confirmStatusDate": "2025-12-07T01:11:26+00:00",
"paymentStatus": 4,
"paymentStatusDate": "2025-12-07T01:05:47+00:00",
"statusReason": null,
"paymentMethod": "stone",
"payerId": null,
"paymentId": "ch_0J3jkbCJECQyBKp6",
"transactionId": "tran_yolWq2zTwiNnZPe6",
"installments": 1,
"ifriendEmail": "gl-tours@theifriend.com",
"customerEmail": "qa@theifriend.com",
"createdAt": "2025-12-06T14:53:08+00:00",
"isDone": false,
"serviceTax": "0.00000",
"platformTax": "0.25000",
"userRated": false,
"ifriendRated": false,
"customer": {
"id": 13020,
"userEmail": "qa@theifriend.com",
"firstname": "Equipe",
"lastname": "QA iFriend",
"fullname": "Equipe QA iFriend",
"nickname": null,
"birthday": "1982-01-12T00:00:00+00:00",
"role": "user",
"userRoles": [
{
"id": 3,
"name": "ROLE_USER"
}
],
"phoneCountryCode": "BR",
"phone": "31955555555",
"phoneFormatted": "+55 31 95555-5555",
"phone2CountryCode": null,
"phone2": null,
"phone2Formatted": null,
"skype": null,
"messenger": null,
"whatsappCountryCode": null,
"whatsapp": null,
"whatsappFormatted": null,
"gender": null,
"avatar": null,
"rating": 0,
"roles": [
"ROLE_USER"
]
},
"ifriend": {
"id": 23497,
"user": {
"id": 28564,
"userEmail": "gl-tours@theifriend.com",
"firstname": "Greyline",
"lastname": "Tours",
"fullname": "Greyline Tours",
"nickname": null,
"birthday": null,
"role": "user",
"userRoles": [
{
"id": 3,
"name": "ROLE_USER"
},
{
"id": 4,
"name": "ROLE_AFFILIATED"
},
{
"id": 14,
"name": "ROLE_AFFILIATED_PARENT"
},
{
"id": 16,
"name": "ROLE_AGENCY"
},
{
"id": 17,
"name": "ROLE_RECEPTIVE"
}
],
"phoneCountryCode": "AR",
"phone": "9 11 41936473",
"phoneFormatted": "+54 9 11 4193-6473",
"phone2CountryCode": null,
"phone2": null,
"phone2Formatted": null,
"skype": null,
"messenger": null,
"whatsappCountryCode": null,
"whatsapp": null,
"whatsappFormatted": null,
"gender": null,
"avatar": null,
"rating": 0,
"roles": [
"ROLE_USER",
"ROLE_AFFILIATED",
"ROLE_AFFILIATED_PARENT",
"ROLE_AGENCY",
"ROLE_RECEPTIVE"
]
},
"placeId": null,
"places": [],
"city": null,
"state": null,
"country": null,
"countryCode": null,
"latitude": null,
"longitude": null,
"pro": false,
"car": false,
"isMaster": null,
"quote": null,
"bio": null,
"price": null,
"customPrice": null,
"occupation": null,
"interests": [],
"languages": [],
"photos": [],
"rating": 4,
"recommended": 0,
"cityPhoto": null,
"plannerRoom": null,
"fullPrice": null,
"paymentModulePromo": null,
"profileUrl": null,
"thumbnails": []
},
"dates": [
{
"id": 30866,
"hours": 10,
"period": "M",
"numAdult": 1,
"numChild": 0,
"numHalfPrice": 0,
"isIfriendCar": false,
"price": 0,
"dayPrice": null,
"description": null,
"type": null,
"day": "2025-12-20"
}
],
"checkin": null,
"customerDeclineReason": null,
"ifriendDeclineReason": null,
"doneAt": null,
"experience": {
"id": 11452,
"title": "Meio dia nas Termas do Vale da Colina a partir de Santiago",
"price": "45.39",
"currencyCode": "USD",
"shelfExperience": false,
"fullPrice": null,
"paymentModulePromo": null,
"profileUrl": null
},
"experienceServiceItems": [],
"type": "experience",
"callLink": null,
"affiliateBooking": null,
"couponUsage": [],
"providerData": {
"add_cart": {
"request": {
"id": "22322",
"cro": 22716,
"lang": "pt",
"pick": null,
"qtyA": 1,
"qtyC": 1,
"qtyI": 1,
"optional": null,
"schedule": "3479749",
"tourDate": "2025-12-20"
},
"response": {
"user": "user3979081349",
"cartId": "807861",
"process": "OK"
}
},
"provider": "greyline",
"variations": [
{
"id": 1194,
"mode": "person",
"name": "Meio dia nas Termas do Vale da Colina a partir de Santiago",
"type": "privative",
"quantity": 1,
"tariffItem": {
"id": 2327,
"price": "79.89",
"dateEnd": "2026-09-22",
"dateIni": "2025-11-14",
"priceNet": "45.39",
"currencyCode": "USD"
},
"agePolicies": [
{
"id": 2336,
"name": "adult",
"discount": "0.00",
"quantity": 1
},
{
"id": 2337,
"name": "child",
"discount": "12.49",
"quantity": 1
},
{
"id": 2338,
"name": "infant",
"discount": "100.00",
"quantity": 1
}
],
"provider_sku": "0",
"currency_code": "USD",
"allowPaxQuantity": true
}
],
"schedule_id": "3479749"
},
"pax": [
{
"fullname": "Equipe QA iFriend",
"firstname": "Equipe",
"lastname": "QA iFriend",
"doc": "057.710.956-13",
"gender": null,
"birthday": null,
"age": null,
"email": "qa@theifriend.com",
"phone": "31955555555",
"obs": null,
"ticketPriceType": null,
"ticketPriceNetAmount": null,
"ticketPriceAmount": null,
"ticketPriceCurrency": null,
"ticketId": null,
"ticketCategory": null,
"ticketCategoryName": null,
"rg": null
}
],
"integrator": null,
"ifriendComission": 0,
"platformComission": 149.8,
"ifriendConfirmedAt": null,
"virtualGuideLeadId": null,
"customIfriendComission": null,
"affiliateComission": null,
"place": null,
"downPaymentPrice": null,
"paidTheDownPrice": false,
"soldByManagerUser": null,
"experienceNetPrice": "45.39",
"experienceMetadata": null,
"transfer": null,
"isSingle": false,
"serviceProvider": null,
"items": [],
"voucher": null,
"needsAcceptance": false,
"hasAccepted": null,
"discountAmount": null,
"discountType": null,
"checkoutDiscountCouponCode": null,
"payment": null,
"grossPrice": "149.800000",
"integratorAgencyName": null,
"apiClient": null,
"uuid": null,
"totalPrice": "149.800000",
"salesforceRecordId": null,
"salesforceSynced": false,
"salesforceSyncedAt": "2025-12-07T01:09:55+00:00",
"salesforceAccountId": null,
"salesforceRelatedOpportunityId": null,
"salesforceOpportunityId": null,
"paymentToken": "1ab58aff-9617-4d61-a09c-89b3e4dbdc4b",
"cancellationRuleText": "75% de reembolso de 10 a 13 dias antes do tour",
"tickets": [],
"cancellationRefund": null,
"providerIsAware": false,
"providerAwareAt": null,
"promo": null,
"withdrawalExpiredAt": null,
"integratorAgencyKey": null,
"integratorAgencyContactName": null,
"integratorAgencyContactEmail": null,
"integratorAgencyContactPhone": null,
"receptiveHasAcceptedAt": null,
"hasAcceptedReceptiveId": null,
"validatorQRCode": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAOEAAADhCAIAAACx0UUtAAAABnRSTlMA/wD/AP83WBt9AAAACXBIWXMAAA7EAAAOxAGVKw4bAAAFdklEQVR4nO3dy47jOBBFwfFg/v+Xa/ZasCHwdbocsS1bkl0XhBMkk5+fn59/IOzf2w8AfyCj1MkodTJKnYxSJ6PUySh1MkqdjFIno9TJKHUySp2MUiej1MkodTJKnYxSJ6PUySh1/828+fP5rHqOscemq/F9F+7QWnijme9q/PFnPu+t/+ArxlHqZJQ6GaVORqmbqpkemsXKvvtGSreFms9sHKVORqmTUepklLqVNdPDq1/NM3M24/fuKzhmKoxjc1Qz9v0HXzGOUiej1MkodTJK3caa6ZhXJdTClWyvarVXc1QzT/XwC3rJG0epk1HqZJQ6GaXuN9RMD6/KkX311syLFy4RXLj56RbjKHUySp2MUiej1G2smfb9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iej1MkodTJK3VTNdOyQ01t95I51T5+58sKqqHnirXGUOhmlTkapk1HqKr3GH441jhvbt3Bx35rAW1uUzDPxvWSUOhmlTkap27g279h+l33L/B6ONQifue9MN/GxfdNdY8ZR6mSUOhmlTkap21gz7bNvydzMjcZXntnANP7rwjWBx3ptvGIcpU5GqZNR6mSUur+yZho71rd7pnaZeYxXL751/pZ5Jr6IjFIno9TJKHXX+uYdc6v39sK/Phxr3HBs8eGYcZQ6GaVORqmTUepW1ky3flM/7Jt32Xem7fi9D8fOdlo4N2ZtHr+ZjFIno9TJKHUbz7SFJYyj1MkodTJKnYxSJ6PUySh1MkqdjFIno9TJKHUySp2MUiej1MkodTJKnYxSJ6PUySh1Mkrd/xHUrPywi3vlAAAAAElFTkSuQmCC",
"priceWithoutCurrencyExchange": "149.800000",
"confirmedStatusName": "Aguardando iFriend",
"paymentStatusName": "Pagamento Concluído",
"canStart": false,
"allowedPaymentTypeCodes": [
"stone-creditcard",
"paypal",
"stone-pix"
],
"allowedPaymentTypeCodeInstallments": {
"stone-creditcard": {
"installmentsIni": 4,
"installmentsEnd": 10,
"withInterest": true,
"label": {
"pt": "(4 a 10x c/ juros)",
"en": "(4 to 10x with interest)",
"es": "(4 a 10x con intereses)"
}
},
"paypal": {
"installmentsIni": 1,
"installmentsEnd": 3,
"withInterest": false,
"label": {
"pt": "(1 a 3x)",
"en": "(1 to 3x)",
"es": "(1 a 3x)"
}
}
},
"fromAffiliate": false,
"exclusiveProductBooking": false,
"needsExtraDataForBooking": false,
"currencyQuotation": 5.5165,
"completeToday": false,
"priceWithDiscount": "149.800000",
"cancellationRuleDescription": {
"pt": "O reembolso pode ser solicitado até dias antes do passeio.",
"en": "The refund can be requested up to days before the tour.",
"es": "El reembolso se puede solicitar hasta días antes del tour."
},
"freeCancellationTill": "no_refund",
"moreThan15Days": false,
"customerBookingStatus": {
"en": "Waiting iFriend",
"pt": "Aguardando iFriend",
"es": "Esperando iFriend"
},
"ifriendBookingStatus": {
"en": "Waiting for your acceptance",
"pt": "Aguardando seu aceite",
"es": "Esperando su Aceptación"
},
"gclid": null,
"lastPayment": {
"statusLabel": "Concluído"
},
"allowCheckout": false,
"customerLocale": "pt",
"ifriendLocale": "en",
"confirmationDeadline": "2025-12-17",
"free": false
},
"payment": {
"id": "or_lWZ57JDf5HqyPNDn",
"code": "22716",
"amount": 82637,
"currency": "BRL",
"closed": true,
"items": [
{
"id": "oi_mX4wolMuETEBVGQq",
"type": "product",
"description": "Agendamento ID 22716",
"amount": 82637,
"quantity": 1,
"category": "experience",
"code": "22716",
"status": "active",
"created_at": "2025-12-07T01:11:25+00:00",
"updated_at": "2025-12-07T01:11:25+00:00"
}
],
"customer": {
"id": "cus_L2NVM51ulueM5O7j",
"name": "Glauber P O Melo",
"email": "qa@theifriend.com",
"delinquent": false,
"created_at": "2024-03-10T22:41:54+00:00",
"updated_at": "2025-08-20T14:19:49+00:00",
"document": "05771095613",
"type": "individual",
"address": {
"id": "addr_9gezWvGU8UKN3nRV",
"zip_code": "31814500",
"city": "Belo Horizonte",
"state": "MG",
"country": "BR",
"status": "active",
"created_at": "2024-05-11T13:00:01+00:00",
"updated_at": "2025-08-20T14:19:49+00:00",
"line_1": "40,Rua dos Alvarengas,Aarão Reis",
"line_2": ""
},
"metadata": {
"id": "13020",
"orderId": "16"
},
"phones": {
"mobile_phone": {
"country_code": "55",
"number": "992468610",
"area_code": "31"
}
},
"code": "13020"
},
"status": "paid",
"created_at": "2025-12-07T01:11:25+00:00",
"updated_at": "2025-12-07T01:11:26+00:00",
"closed_at": "2025-12-07T01:11:25+00:00",
"charges": [
{
"id": "ch_0J3jkbCJECQyBKp6",
"code": "22716",
"gateway_id": "2212340296",
"amount": 82637,
"status": "paid",
"currency": "BRL",
"payment_method": "credit_card",
"created_at": "2025-12-07T01:11:25+00:00",
"updated_at": "2025-12-07T01:11:26+00:00",
"last_transaction": {
"statement_descriptor": "THEIFRIEND",
"acquirer_name": "pagarme",
"acquirer_tid": "2212340296",
"acquirer_nsu": "2212340296",
"acquirer_auth_code": "233899",
"operation_type": "auth_and_capture",
"card": {
"id": "card_z50O7GMiriZj389Z",
"last_four_digits": "0010",
"brand": "Visa",
"holder_name": "Glauber P O Melo",
"exp_month": 10,
"exp_year": 2030,
"status": "active",
"created_at": "2024-03-10T22:41:54+00:00",
"updated_at": "2025-12-07T01:11:25+00:00",
"billing_address": {
"street": "Rua dos Alvarengas",
"number": "40",
"zip_code": "31814500",
"neighborhood": "Aarão Reis",
"city": "Belo Horizonte",
"state": "MG",
"country": "BR",
"complement": "",
"line_1": "40,Rua dos Alvarengas,Aarão Reis",
"line_2": ""
},
"type": "credit",
"first_six_digits": "400000"
},
"acquirer_message": "Transação aprovada com sucesso",
"acquirer_return_code": "0000",
"installments": 1,
"funding_source": "credit",
"gateway_id": "2212340296",
"amount": 82637,
"status": "captured",
"success": true,
"created_at": "2025-12-07T01:11:25+00:00",
"updated_at": "2025-12-07T01:11:25+00:00",
"transaction_type": "credit_card",
"id": "tran_yolWq2zTwiNnZPe6",
"gateway_response": {
"code": "200",
"errors": []
},
"antifraud_response": {
"status": "approved",
"provider_name": "pagarme",
"score": "moderated"
},
"metadata": []
},
"customer": {
"id": "cus_L2NVM51ulueM5O7j",
"name": "Glauber P O Melo",
"email": "qa@theifriend.com",
"delinquent": false,
"created_at": "2024-03-10T22:41:54+00:00",
"updated_at": "2025-08-20T14:19:49+00:00",
"document": "05771095613",
"type": "individual",
"address": {
"id": "addr_9gezWvGU8UKN3nRV",
"zip_code": "31814500",
"city": "Belo Horizonte",
"state": "MG",
"country": "BR",
"status": "active",
"created_at": "2024-05-11T13:00:01+00:00",
"updated_at": "2025-08-20T14:19:49+00:00",
"line_1": "40,Rua dos Alvarengas,Aarão Reis",
"line_2": ""
},
"metadata": {
"id": "13020",
"orderId": "16"
},
"phones": {
"mobile_phone": {
"country_code": "55",
"number": "992468610",
"area_code": "31"
}
},
"code": "13020"
},
"paid_at": "2025-12-07T01:11:26+00:00",
"paid_amount": 82637
}
],
"checkouts": []
},
"status": "paid",
"errors": []
}