Product value in integer format, where the last 2 digits represent the cents.
For countries where cents do not apply, fill in the amount with 2 zeros to the right.
Ex: $150, send 15000
quantityintegerrequired
Quantity of the product
customerobjectrequired
Data structure containing customer details
Show customer properties
customer_idstringrequired
Customer ID.
We recommend using the customer’s document number (the same value provided in document_number) as the customer ID, for all countries. Provide only letters and numbers, without any special characters, separators or spaces (for example, a Chilean RUT 12345678-9 should be sent as 123456789).
For Brazil (BR), this value must correspond to a valid CPF. Using an invalid document may trigger fraud prevention flows that could block the payment.
first_namestringrequired
Customer’s first name
last_namestringrequired
Customer’s last name
namestringrequired
Customer’s full name
emailstring<email>required
Customer’s email address
document_typestringrequired
Type of the document used to identify the customer. The accepted value is country-specific:
Brazil (BR): CPF (individuals) or CNPJ (companies)
Argentina (AR): DNI
Chile (CL): RUT
Mexico (MX): RFC
Uruguay (UY): CI
Spain (ES): DNI
document_numberstringrequired
Document number used to identify the customer.
For Brazil (BR), this field must contain a valid CPF. Using an invalid CPF may trigger fraud prevention flows that could block the payment.
The value consists of a group of letters and/or numbers that is added to a postal address to assist in sorting the mail.
referencestring
Reference point details that can be used to help locate the address
pickup_storeboolean
Whether the order is to be picked up by the customer
shipping_methodstring
Shipping method of the order.
The value can be freely defined.
soft_descriptorstring
Payment description that appears on the customer’s receipt
dynamic_mccinteger
Merchant Category Code (MCC) for the transaction
additional_dataobject
Additional data for regional regulations and tax requirements.
This field is used in specific countries to comply with local tax and regulatory requirements (e.g., Uruguay).
Show additional_data properties
ratesobject[]
Tax rates applied to the transaction
Show rates properties
keystring
Type of tax or rate being applied
valueinteger
Tax amount in integer format (cents)
regional_regulation_codestring
Regional fiscal or regulatory code required by local authorities
configurationsobject
Additional configurations for the payment intent - 3ds, card_verification and preauthorization are not available for Argentina.
Show configurations properties
3dsboolean
Controls 3D Secure authentication.
When set to false, the merchant forces the 3DS authentication flow to be skipped for this payment intent.
preauthorizationboolean
Indicates if the payment is a pre-authorization.
When set to true, the payment will be pre-authorized and manual captures will be performed via API using the payment_id sent via webhook to the merchant.
card_verificationboolean
Indicates if this is a card verification flow.
When set to true, the checkout flow will not process a payment but will verify the card and store it in the vault. A card_id will be sent via webhook to the merchant for future charges. This allows merchants without PCI compliance infrastructure to store cards in GetNet’s vault without handling sensitive card data.
Note: When this is true, the payment and product fields must be omitted from the request.
sub_merchantobject
Data structure containing sub-merchant details.
This field is used in marketplace scenarios where the payment is processed on behalf of a sub-merchant (e.g., a seller in a marketplace platform).
Show sub_merchant properties
identification_codestring
Unique identification code for the sub-merchant
document_typestring
Type of document used to identify the sub-merchant
document_numberstring
Document number used to identify the sub-merchant
addressobject
Sub-merchant address details
Show address properties
streetstring
Name of a street or thoroughfare
numberstring
Number that identifies the position of a building on a street
URL to redirect the customer to complete the payment in the hosted checkout
Bad request.
Only required fields are validated.
codestring
Unique alphanumeric human readable error code
messagestring
Brief summary of the reported issue
detailsobject[]
Array of errors.
The object type varies depending on the error context.
Unauthorized
Forbidden
codestring
Unique alphanumeric human readable error code
messagestring
Brief summary of the reported issue
detailsobject[]
Array of errors.
The object type varies depending on the error context.
Not found
codestring
Unique alphanumeric human readable error code
messagestring
Brief summary of the reported issue
detailsobject[]
Array of errors.
The object type varies depending on the error context.
Unprocessable entity.
Potential business error.
codestring
Unique alphanumeric human readable error code
messagestring
Brief summary of the reported issue
detailsobject[]
Array of errors.
The object type varies depending on the error context.
Internal server error
messagestring
Brief summary of the reported issue
detailsobject[]
Array of errors.
The object type varies depending on the error context.
Português › Documentação › Referência da API › Pagamentos › Web Checkout › Payment intent
Request
curl -X POST "https://api-sbx.pre.globalgetnet.com/dpy/web-checkout/v1/payment-intent" \ -H "Content-Type: application/json" \ -d '{ "order_id": "ORDER_123", "payment": { "currency": "USD", "amount": 12000 }, "product": [ { "product_type": "digital_content", "title": "Toy car", "description": "Wooden toy car", "value": 1200, "quantity": 10 } ], "customer": { "customer_id": "12345678912", "first_name": "John", "last_name": "Doe Smith", "name": "John Doe Smith", "email": "customer@email.com.br", "document_type": "CPF", "document_number": "12345678912", "phone_number": "5551999887766", "gender": "Male", "checked_email": { "type": "boolean", "default": false, "description": "Whether the customer's email address was verified by the seller when they registered with the store.\n\nThe possible values are:\n- true = Email address was verified\n- false = Email address was not verified", "example": false }, "billing_address": { "type": "object", "description": "Data structure containing shipping address details", "required": [ "street", "number", "country", "postal_code" ], "properties": { "street": { "type": "string", "description": "Name of a street or thoroughfare", "maxLength": 60, "example": "Av. Brasil" }, "number": { "type": "string", "description": "Number that identifies the position of a building on a street", "maxLength": 10, "example": "1000" }, "complement": { "type": "string", "description": "Additional address information", "maxLength": 60, "example": "Sala 1" }, "district": { "type": "string", "description": "Name of a district, for example, a part of a town or region", "maxLength": 40, "example": "São Geraldo" }, "city": { "type": "string", "description": "Name of a built-up area with defined boundaries and a local government.\n\nThe value is based on the ISO 3166-2, according to the country defined within the address details.", "maxLength": 40, "example": "Porto Alegre" }, "state": { "type": "string", "description": "Name of an organized political community or area forming a part of a federation.\n\nThe value is based on the ISO 3166-2, according to the country defined within the address details.", "maxLength": 20, "example": "RS" }, "country": { "type": "string", "description": "Country code.\n\nThe value is based on the ISO 3166-1 alpha-2 (https://www.iso.org/obp/ui/#search/code/).", "maxLength": 2, "example": "BR" }, "postal_code": { "type": "string", "description": "Postal or ZIP code.\n\nThe value consists of a group of letters and/or numbers that is added to a postal address to assist in sorting the mail.", "maxLength": 8, "example": "90230060" }, "reference": { "type": "string", "description": "Reference point details that can be used to help locate the address", "maxLength": 80, "example": "Near the hospital" } } } }, "shipping": { "first_name": "John", "last_name": "Doe Smith", "name": "John Doe Smith", "phone_number": "5551999887766", "shipping_amount": 3000, "address": { "street": "Av. Brasil", "number": "1000", "complement": "Sala 1", "district": "São Geraldo", "city": "Porto Alegre", "state": "RS", "country": "BR", "postal_code": "90230060", "reference": "Near the hospital" } }, "pickup_store": true, "shipping_method": "PAC", "soft_descriptor": "Bread Store", "dynamic_mcc": 1000, "additional_data": { "rates": [ { "key": "Iva", "value": 123 } ], "regional_regulation_code": "17934" }, "configurations": { "3ds": true, "preauthorization": false, "card_verification": false }, "sub_merchant": { "identification_code": "SUB_12345", "document_type": "CNPJ", "document_number": "12345678000190", "address": { "street": "Rua das Flores", "number": "789", "complement": "Loja 2", "district": "Jardins", "city": "São Paulo", "state": "SP", "country_code": "BR", "postal_code": "01452000" } }}'
const response = await fetch(`https://api-sbx.pre.globalgetnet.com/dpy/web-checkout/v1/payment-intent`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ "order_id": "ORDER_123", "payment": { "currency": "USD", "amount": 12000 }, "product": [ { "product_type": "digital_content", "title": "Toy car", "description": "Wooden toy car", "value": 1200, "quantity": 10 } ], "customer": { "customer_id": "12345678912", "first_name": "John", "last_name": "Doe Smith", "name": "John Doe Smith", "email": "customer@email.com.br", "document_type": "CPF", "document_number": "12345678912", "phone_number": "5551999887766", "gender": "Male", "checked_email": { "type": "boolean", "default": false, "description": "Whether the customer's email address was verified by the seller when they registered with the store.\n\nThe possible values are:\n- true = Email address was verified\n- false = Email address was not verified", "example": false }, "billing_address": { "type": "object", "description": "Data structure containing shipping address details", "required": [ "street", "number", "country", "postal_code" ], "properties": { "street": { "type": "string", "description": "Name of a street or thoroughfare", "maxLength": 60, "example": "Av. Brasil" }, "number": { "type": "string", "description": "Number that identifies the position of a building on a street", "maxLength": 10, "example": "1000" }, "complement": { "type": "string", "description": "Additional address information", "maxLength": 60, "example": "Sala 1" }, "district": { "type": "string", "description": "Name of a district, for example, a part of a town or region", "maxLength": 40, "example": "São Geraldo" }, "city": { "type": "string", "description": "Name of a built-up area with defined boundaries and a local government.\n\nThe value is based on the ISO 3166-2, according to the country defined within the address details.", "maxLength": 40, "example": "Porto Alegre" }, "state": { "type": "string", "description": "Name of an organized political community or area forming a part of a federation.\n\nThe value is based on the ISO 3166-2, according to the country defined within the address details.", "maxLength": 20, "example": "RS" }, "country": { "type": "string", "description": "Country code.\n\nThe value is based on the ISO 3166-1 alpha-2 (https://www.iso.org/obp/ui/#search/code/).", "maxLength": 2, "example": "BR" }, "postal_code": { "type": "string", "description": "Postal or ZIP code.\n\nThe value consists of a group of letters and/or numbers that is added to a postal address to assist in sorting the mail.", "maxLength": 8, "example": "90230060" }, "reference": { "type": "string", "description": "Reference point details that can be used to help locate the address", "maxLength": 80, "example": "Near the hospital" } } } }, "shipping": { "first_name": "John", "last_name": "Doe Smith", "name": "John Doe Smith", "phone_number": "5551999887766", "shipping_amount": 3000, "address": { "street": "Av. Brasil", "number": "1000", "complement": "Sala 1", "district": "São Geraldo", "city": "Porto Alegre", "state": "RS", "country": "BR", "postal_code": "90230060", "reference": "Near the hospital" } }, "pickup_store": true, "shipping_method": "PAC", "soft_descriptor": "Bread Store", "dynamic_mcc": 1000, "additional_data": { "rates": [ { "key": "Iva", "value": 123 } ], "regional_regulation_code": "17934" }, "configurations": { "3ds": true, "preauthorization": false, "card_verification": false }, "sub_merchant": { "identification_code": "SUB_12345", "document_type": "CNPJ", "document_number": "12345678000190", "address": { "street": "Rua das Flores", "number": "789", "complement": "Loja 2", "district": "Jardins", "city": "São Paulo", "state": "SP", "country_code": "BR", "postal_code": "01452000" } }})});const data = await response.json();
import requestsresponse = requests.request( "POST", "https://api-sbx.pre.globalgetnet.com/dpy/web-checkout/v1/payment-intent", json={ "order_id": "ORDER_123", "payment": { "currency": "USD", "amount": 12000 }, "product": [ { "product_type": "digital_content", "title": "Toy car", "description": "Wooden toy car", "value": 1200, "quantity": 10 } ], "customer": { "customer_id": "12345678912", "first_name": "John", "last_name": "Doe Smith", "name": "John Doe Smith", "email": "customer@email.com.br", "document_type": "CPF", "document_number": "12345678912", "phone_number": "5551999887766", "gender": "Male", "checked_email": { "type": "boolean", "default": False, "description": "Whether the customer's email address was verified by the seller when they registered with the store.\n\nThe possible values are:\n- True = Email address was verified\n- False = Email address was not verified", "example": False }, "billing_address": { "type": "object", "description": "Data structure containing shipping address details", "required": [ "street", "number", "country", "postal_code" ], "properties": { "street": { "type": "string", "description": "Name of a street or thoroughfare", "maxLength": 60, "example": "Av. Brasil" }, "number": { "type": "string", "description": "Number that identifies the position of a building on a street", "maxLength": 10, "example": "1000" }, "complement": { "type": "string", "description": "Additional address information", "maxLength": 60, "example": "Sala 1" }, "district": { "type": "string", "description": "Name of a district, for example, a part of a town or region", "maxLength": 40, "example": "São Geraldo" }, "city": { "type": "string", "description": "Name of a built-up area with defined boundaries and a local government.\n\nThe value is based on the ISO 3166-2, according to the country defined within the address details.", "maxLength": 40, "example": "Porto Alegre" }, "state": { "type": "string", "description": "Name of an organized political community or area forming a part of a federation.\n\nThe value is based on the ISO 3166-2, according to the country defined within the address details.", "maxLength": 20, "example": "RS" }, "country": { "type": "string", "description": "Country code.\n\nThe value is based on the ISO 3166-1 alpha-2 (https://www.iso.org/obp/ui/#search/code/).", "maxLength": 2, "example": "BR" }, "postal_code": { "type": "string", "description": "Postal or ZIP code.\n\nThe value consists of a group of letters and/or numbers that is added to a postal address to assist in sorting the mail.", "maxLength": 8, "example": "90230060" }, "reference": { "type": "string", "description": "Reference point details that can be used to help locate the address", "maxLength": 80, "example": "Near the hospital" } } } }, "shipping": { "first_name": "John", "last_name": "Doe Smith", "name": "John Doe Smith", "phone_number": "5551999887766", "shipping_amount": 3000, "address": { "street": "Av. Brasil", "number": "1000", "complement": "Sala 1", "district": "São Geraldo", "city": "Porto Alegre", "state": "RS", "country": "BR", "postal_code": "90230060", "reference": "Near the hospital" } }, "pickup_store": True, "shipping_method": "PAC", "soft_descriptor": "Bread Store", "dynamic_mcc": 1000, "additional_data": { "rates": [ { "key": "Iva", "value": 123 } ], "regional_regulation_code": "17934" }, "configurations": { "3ds": True, "preauthorization": False, "card_verification": False }, "sub_merchant": { "identification_code": "SUB_12345", "document_type": "CNPJ", "document_number": "12345678000190", "address": { "street": "Rua das Flores", "number": "789", "complement": "Loja 2", "district": "Jardins", "city": "São Paulo", "state": "SP", "country_code": "BR", "postal_code": "01452000" } }},)data = response.json()
<?php$ch = curl_init();curl_setopt($ch, CURLOPT_URL, "https://api-sbx.pre.globalgetnet.com/dpy/web-checkout/v1/payment-intent");curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");curl_setopt($ch, CURLOPT_HTTPHEADER, ["Content-Type: application/json"]);curl_setopt($ch, CURLOPT_POSTFIELDS, '{ "order_id": "ORDER_123", "payment": { "currency": "USD", "amount": 12000 }, "product": [ { "product_type": "digital_content", "title": "Toy car", "description": "Wooden toy car", "value": 1200, "quantity": 10 } ], "customer": { "customer_id": "12345678912", "first_name": "John", "last_name": "Doe Smith", "name": "John Doe Smith", "email": "customer@email.com.br", "document_type": "CPF", "document_number": "12345678912", "phone_number": "5551999887766", "gender": "Male", "checked_email": { "type": "boolean", "default": false, "description": "Whether the customer's email address was verified by the seller when they registered with the store.\n\nThe possible values are:\n- true = Email address was verified\n- false = Email address was not verified", "example": false }, "billing_address": { "type": "object", "description": "Data structure containing shipping address details", "required": [ "street", "number", "country", "postal_code" ], "properties": { "street": { "type": "string", "description": "Name of a street or thoroughfare", "maxLength": 60, "example": "Av. Brasil" }, "number": { "type": "string", "description": "Number that identifies the position of a building on a street", "maxLength": 10, "example": "1000" }, "complement": { "type": "string", "description": "Additional address information", "maxLength": 60, "example": "Sala 1" }, "district": { "type": "string", "description": "Name of a district, for example, a part of a town or region", "maxLength": 40, "example": "São Geraldo" }, "city": { "type": "string", "description": "Name of a built-up area with defined boundaries and a local government.\n\nThe value is based on the ISO 3166-2, according to the country defined within the address details.", "maxLength": 40, "example": "Porto Alegre" }, "state": { "type": "string", "description": "Name of an organized political community or area forming a part of a federation.\n\nThe value is based on the ISO 3166-2, according to the country defined within the address details.", "maxLength": 20, "example": "RS" }, "country": { "type": "string", "description": "Country code.\n\nThe value is based on the ISO 3166-1 alpha-2 (https://www.iso.org/obp/ui/#search/code/).", "maxLength": 2, "example": "BR" }, "postal_code": { "type": "string", "description": "Postal or ZIP code.\n\nThe value consists of a group of letters and/or numbers that is added to a postal address to assist in sorting the mail.", "maxLength": 8, "example": "90230060" }, "reference": { "type": "string", "description": "Reference point details that can be used to help locate the address", "maxLength": 80, "example": "Near the hospital" } } } }, "shipping": { "first_name": "John", "last_name": "Doe Smith", "name": "John Doe Smith", "phone_number": "5551999887766", "shipping_amount": 3000, "address": { "street": "Av. Brasil", "number": "1000", "complement": "Sala 1", "district": "São Geraldo", "city": "Porto Alegre", "state": "RS", "country": "BR", "postal_code": "90230060", "reference": "Near the hospital" } }, "pickup_store": true, "shipping_method": "PAC", "soft_descriptor": "Bread Store", "dynamic_mcc": 1000, "additional_data": { "rates": [ { "key": "Iva", "value": 123 } ], "regional_regulation_code": "17934" }, "configurations": { "3ds": true, "preauthorization": false, "card_verification": false }, "sub_merchant": { "identification_code": "SUB_12345", "document_type": "CNPJ", "document_number": "12345678000190", "address": { "street": "Rua das Flores", "number": "789", "complement": "Loja 2", "district": "Jardins", "city": "São Paulo", "state": "SP", "country_code": "BR", "postal_code": "01452000" } }}');$response = curl_exec($ch);curl_close($ch);
package mainimport ( "fmt" "io" "net/http" "strings")func main() { req, _ := http.NewRequest("POST", "https://api-sbx.pre.globalgetnet.com/dpy/web-checkout/v1/payment-intent", strings.NewReader(`{ "order_id": "ORDER_123", "payment": { "currency": "USD", "amount": 12000 }, "product": [ { "product_type": "digital_content", "title": "Toy car", "description": "Wooden toy car", "value": 1200, "quantity": 10 } ], "customer": { "customer_id": "12345678912", "first_name": "John", "last_name": "Doe Smith", "name": "John Doe Smith", "email": "customer@email.com.br", "document_type": "CPF", "document_number": "12345678912", "phone_number": "5551999887766", "gender": "Male", "checked_email": { "type": "boolean", "default": false, "description": "Whether the customer's email address was verified by the seller when they registered with the store.\n\nThe possible values are:\n- true = Email address was verified\n- false = Email address was not verified", "example": false }, "billing_address": { "type": "object", "description": "Data structure containing shipping address details", "required": [ "street", "number", "country", "postal_code" ], "properties": { "street": { "type": "string", "description": "Name of a street or thoroughfare", "maxLength": 60, "example": "Av. Brasil" }, "number": { "type": "string", "description": "Number that identifies the position of a building on a street", "maxLength": 10, "example": "1000" }, "complement": { "type": "string", "description": "Additional address information", "maxLength": 60, "example": "Sala 1" }, "district": { "type": "string", "description": "Name of a district, for example, a part of a town or region", "maxLength": 40, "example": "São Geraldo" }, "city": { "type": "string", "description": "Name of a built-up area with defined boundaries and a local government.\n\nThe value is based on the ISO 3166-2, according to the country defined within the address details.", "maxLength": 40, "example": "Porto Alegre" }, "state": { "type": "string", "description": "Name of an organized political community or area forming a part of a federation.\n\nThe value is based on the ISO 3166-2, according to the country defined within the address details.", "maxLength": 20, "example": "RS" }, "country": { "type": "string", "description": "Country code.\n\nThe value is based on the ISO 3166-1 alpha-2 (https://www.iso.org/obp/ui/#search/code/).", "maxLength": 2, "example": "BR" }, "postal_code": { "type": "string", "description": "Postal or ZIP code.\n\nThe value consists of a group of letters and/or numbers that is added to a postal address to assist in sorting the mail.", "maxLength": 8, "example": "90230060" }, "reference": { "type": "string", "description": "Reference point details that can be used to help locate the address", "maxLength": 80, "example": "Near the hospital" } } } }, "shipping": { "first_name": "John", "last_name": "Doe Smith", "name": "John Doe Smith", "phone_number": "5551999887766", "shipping_amount": 3000, "address": { "street": "Av. Brasil", "number": "1000", "complement": "Sala 1", "district": "São Geraldo", "city": "Porto Alegre", "state": "RS", "country": "BR", "postal_code": "90230060", "reference": "Near the hospital" } }, "pickup_store": true, "shipping_method": "PAC", "soft_descriptor": "Bread Store", "dynamic_mcc": 1000, "additional_data": { "rates": [ { "key": "Iva", "value": 123 } ], "regional_regulation_code": "17934" }, "configurations": { "3ds": true, "preauthorization": false, "card_verification": false }, "sub_merchant": { "identification_code": "SUB_12345", "document_type": "CNPJ", "document_number": "12345678000190", "address": { "street": "Rua das Flores", "number": "789", "complement": "Loja 2", "district": "Jardins", "city": "São Paulo", "state": "SP", "country_code": "BR", "postal_code": "01452000" } }}`)) req.Header.Set("Content-Type", "application/json") resp, err := http.DefaultClient.Do(req) if err != nil { panic(err) } defer resp.Body.Close() data, _ := io.ReadAll(resp.Body) fmt.Println(string(data))}
HttpClient client = HttpClient.newHttpClient();HttpRequest request = HttpRequest.newBuilder() .uri(URI.create("https://api-sbx.pre.globalgetnet.com/dpy/web-checkout/v1/payment-intent")) .header("Content-Type", "application/json") .method("POST", HttpRequest.BodyPublishers.ofString("{\n \"order_id\": \"ORDER_123\",\n \"payment\": {\n \"currency\": \"USD\",\n \"amount\": 12000\n },\n \"product\": [\n {\n \"product_type\": \"digital_content\",\n \"title\": \"Toy car\",\n \"description\": \"Wooden toy car\",\n \"value\": 1200,\n \"quantity\": 10\n }\n ],\n \"customer\": {\n \"customer_id\": \"12345678912\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe Smith\",\n \"name\": \"John Doe Smith\",\n \"email\": \"customer@email.com.br\",\n \"document_type\": \"CPF\",\n \"document_number\": \"12345678912\",\n \"phone_number\": \"5551999887766\",\n \"gender\": \"Male\",\n \"checked_email\": {\n \"type\": \"boolean\",\n \"default\": false,\n \"description\": \"Whether the customer's email address was verified by the seller when they registered with the store.\\n\\nThe possible values are:\\n- true = Email address was verified\\n- false = Email address was not verified\",\n \"example\": false\n },\n \"billing_address\": {\n \"type\": \"object\",\n \"description\": \"Data structure containing shipping address details\",\n \"required\": [\n \"street\",\n \"number\",\n \"country\",\n \"postal_code\"\n ],\n \"properties\": {\n \"street\": {\n \"type\": \"string\",\n \"description\": \"Name of a street or thoroughfare\",\n \"maxLength\": 60,\n \"example\": \"Av. Brasil\"\n },\n \"number\": {\n \"type\": \"string\",\n \"description\": \"Number that identifies the position of a building on a street\",\n \"maxLength\": 10,\n \"example\": \"1000\"\n },\n \"complement\": {\n \"type\": \"string\",\n \"description\": \"Additional address information\",\n \"maxLength\": 60,\n \"example\": \"Sala 1\"\n },\n \"district\": {\n \"type\": \"string\",\n \"description\": \"Name of a district, for example, a part of a town or region\",\n \"maxLength\": 40,\n \"example\": \"São Geraldo\"\n },\n \"city\": {\n \"type\": \"string\",\n \"description\": \"Name of a built-up area with defined boundaries and a local government.\\n\\nThe value is based on the ISO 3166-2, according to the country defined within the address details.\",\n \"maxLength\": 40,\n \"example\": \"Porto Alegre\"\n },\n \"state\": {\n \"type\": \"string\",\n \"description\": \"Name of an organized political community or area forming a part of a federation.\\n\\nThe value is based on the ISO 3166-2, according to the country defined within the address details.\",\n \"maxLength\": 20,\n \"example\": \"RS\"\n },\n \"country\": {\n \"type\": \"string\",\n \"description\": \"Country code.\\n\\nThe value is based on the ISO 3166-1 alpha-2 (https://www.iso.org/obp/ui/#search/code/).\",\n \"maxLength\": 2,\n \"example\": \"BR\"\n },\n \"postal_code\": {\n \"type\": \"string\",\n \"description\": \"Postal or ZIP code.\\n\\nThe value consists of a group of letters and/or numbers that is added to a postal address to assist in sorting the mail.\",\n \"maxLength\": 8,\n \"example\": \"90230060\"\n },\n \"reference\": {\n \"type\": \"string\",\n \"description\": \"Reference point details that can be used to help locate the address\",\n \"maxLength\": 80,\n \"example\": \"Near the hospital\"\n }\n }\n }\n },\n \"shipping\": {\n \"first_name\": \"John\",\n \"last_name\": \"Doe Smith\",\n \"name\": \"John Doe Smith\",\n \"phone_number\": \"5551999887766\",\n \"shipping_amount\": 3000,\n \"address\": {\n \"street\": \"Av. Brasil\",\n \"number\": \"1000\",\n \"complement\": \"Sala 1\",\n \"district\": \"São Geraldo\",\n \"city\": \"Porto Alegre\",\n \"state\": \"RS\",\n \"country\": \"BR\",\n \"postal_code\": \"90230060\",\n \"reference\": \"Near the hospital\"\n }\n },\n \"pickup_store\": true,\n \"shipping_method\": \"PAC\",\n \"soft_descriptor\": \"Bread Store\",\n \"dynamic_mcc\": 1000,\n \"additional_data\": {\n \"rates\": [\n {\n \"key\": \"Iva\",\n \"value\": 123\n }\n ],\n \"regional_regulation_code\": \"17934\"\n },\n \"configurations\": {\n \"3ds\": true,\n \"preauthorization\": false,\n \"card_verification\": false\n },\n \"sub_merchant\": {\n \"identification_code\": \"SUB_12345\",\n \"document_type\": \"CNPJ\",\n \"document_number\": \"12345678000190\",\n \"address\": {\n \"street\": \"Rua das Flores\",\n \"number\": \"789\",\n \"complement\": \"Loja 2\",\n \"district\": \"Jardins\",\n \"city\": \"São Paulo\",\n \"state\": \"SP\",\n \"country_code\": \"BR\",\n \"postal_code\": \"01452000\"\n }\n }\n}")) .build();HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());System.out.println(response.body());
require "net/http"require "uri"uri = URI("https://api-sbx.pre.globalgetnet.com/dpy/web-checkout/v1/payment-intent")http = Net::HTTP.new(uri.host, uri.port)http.use_ssl = uri.scheme == "https"request = Net::HTTP::Post.new(uri)request["Content-Type"] = "application/json"request.body = "{\n \"order_id\": \"ORDER_123\",\n \"payment\": {\n \"currency\": \"USD\",\n \"amount\": 12000\n },\n \"product\": [\n {\n \"product_type\": \"digital_content\",\n \"title\": \"Toy car\",\n \"description\": \"Wooden toy car\",\n \"value\": 1200,\n \"quantity\": 10\n }\n ],\n \"customer\": {\n \"customer_id\": \"12345678912\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe Smith\",\n \"name\": \"John Doe Smith\",\n \"email\": \"customer@email.com.br\",\n \"document_type\": \"CPF\",\n \"document_number\": \"12345678912\",\n \"phone_number\": \"5551999887766\",\n \"gender\": \"Male\",\n \"checked_email\": {\n \"type\": \"boolean\",\n \"default\": false,\n \"description\": \"Whether the customer's email address was verified by the seller when they registered with the store.\\n\\nThe possible values are:\\n- true = Email address was verified\\n- false = Email address was not verified\",\n \"example\": false\n },\n \"billing_address\": {\n \"type\": \"object\",\n \"description\": \"Data structure containing shipping address details\",\n \"required\": [\n \"street\",\n \"number\",\n \"country\",\n \"postal_code\"\n ],\n \"properties\": {\n \"street\": {\n \"type\": \"string\",\n \"description\": \"Name of a street or thoroughfare\",\n \"maxLength\": 60,\n \"example\": \"Av. Brasil\"\n },\n \"number\": {\n \"type\": \"string\",\n \"description\": \"Number that identifies the position of a building on a street\",\n \"maxLength\": 10,\n \"example\": \"1000\"\n },\n \"complement\": {\n \"type\": \"string\",\n \"description\": \"Additional address information\",\n \"maxLength\": 60,\n \"example\": \"Sala 1\"\n },\n \"district\": {\n \"type\": \"string\",\n \"description\": \"Name of a district, for example, a part of a town or region\",\n \"maxLength\": 40,\n \"example\": \"São Geraldo\"\n },\n \"city\": {\n \"type\": \"string\",\n \"description\": \"Name of a built-up area with defined boundaries and a local government.\\n\\nThe value is based on the ISO 3166-2, according to the country defined within the address details.\",\n \"maxLength\": 40,\n \"example\": \"Porto Alegre\"\n },\n \"state\": {\n \"type\": \"string\",\n \"description\": \"Name of an organized political community or area forming a part of a federation.\\n\\nThe value is based on the ISO 3166-2, according to the country defined within the address details.\",\n \"maxLength\": 20,\n \"example\": \"RS\"\n },\n \"country\": {\n \"type\": \"string\",\n \"description\": \"Country code.\\n\\nThe value is based on the ISO 3166-1 alpha-2 (https://www.iso.org/obp/ui/#search/code/).\",\n \"maxLength\": 2,\n \"example\": \"BR\"\n },\n \"postal_code\": {\n \"type\": \"string\",\n \"description\": \"Postal or ZIP code.\\n\\nThe value consists of a group of letters and/or numbers that is added to a postal address to assist in sorting the mail.\",\n \"maxLength\": 8,\n \"example\": \"90230060\"\n },\n \"reference\": {\n \"type\": \"string\",\n \"description\": \"Reference point details that can be used to help locate the address\",\n \"maxLength\": 80,\n \"example\": \"Near the hospital\"\n }\n }\n }\n },\n \"shipping\": {\n \"first_name\": \"John\",\n \"last_name\": \"Doe Smith\",\n \"name\": \"John Doe Smith\",\n \"phone_number\": \"5551999887766\",\n \"shipping_amount\": 3000,\n \"address\": {\n \"street\": \"Av. Brasil\",\n \"number\": \"1000\",\n \"complement\": \"Sala 1\",\n \"district\": \"São Geraldo\",\n \"city\": \"Porto Alegre\",\n \"state\": \"RS\",\n \"country\": \"BR\",\n \"postal_code\": \"90230060\",\n \"reference\": \"Near the hospital\"\n }\n },\n \"pickup_store\": true,\n \"shipping_method\": \"PAC\",\n \"soft_descriptor\": \"Bread Store\",\n \"dynamic_mcc\": 1000,\n \"additional_data\": {\n \"rates\": [\n {\n \"key\": \"Iva\",\n \"value\": 123\n }\n ],\n \"regional_regulation_code\": \"17934\"\n },\n \"configurations\": {\n \"3ds\": true,\n \"preauthorization\": false,\n \"card_verification\": false\n },\n \"sub_merchant\": {\n \"identification_code\": \"SUB_12345\",\n \"document_type\": \"CNPJ\",\n \"document_number\": \"12345678000190\",\n \"address\": {\n \"street\": \"Rua das Flores\",\n \"number\": \"789\",\n \"complement\": \"Loja 2\",\n \"district\": \"Jardins\",\n \"city\": \"São Paulo\",\n \"state\": \"SP\",\n \"country_code\": \"BR\",\n \"postal_code\": \"01452000\"\n }\n }\n}"response = http.request(request)puts response.body
{ "code": "guid_error", "message": "x-seller-id must be a valid guid", "details": "[ {\"property\": \"x-seller-id\", \"constraint\":\"guid\"}]"}
"Invalid API Key"
{ "code": "validation_error", "message": "One or more fields failed validation", "details": "[ {\"field\": \"amount\", \"error\": \"amount is required\"} ]"}
{ "code": "validation_error", "message": "One or more fields failed validation", "details": "[ {\"field\": \"amount\", \"error\": \"amount is required\"} ]"}
{ "code": "validation_error", "message": "One or more fields failed validation", "details": "[ {\"field\": \"amount\", \"error\": \"amount is required\"} ]"}
{ "message": "Internal Server Error", "details": "[]"}
POSTCreates a payment intent.
POST
Body
Authentication
Request
curl -X POST "https://api-sbx.pre.globalgetnet.com/dpy/web-checkout/v1/payment-intent" \
-H "Content-Type: application/json" \
-d '{
"order_id": "ORDER_123",
"payment": {
"currency": "USD",
"amount": 12000
},
"product": [
{
"product_type": "digital_content",
"title": "Toy car",
"description": "Wooden toy car",
"value": 1200,
"quantity": 10
}
],
"customer": {
"customer_id": "12345678912",
"first_name": "John",
"last_name": "Doe Smith",
"name": "John Doe Smith",
"email": "customer@email.com.br",
"document_type": "CPF",
"document_number": "12345678912",
"phone_number": "5551999887766",
"gender": "Male",
"checked_email": {
"type": "boolean",
"default": false,
"description": "Whether the customer's email address was verified by the seller when they registered with the store.\n\nThe possible values are:\n- true = Email address was verified\n- false = Email address was not verified",
"example": false
},
"billing_address": {
"type": "object",
"description": "Data structure containing shipping address details",
"required": [
"street",
"number",
"country",
"postal_code"
],
"properties": {
"street": {
"type": "string",
"description": "Name of a street or thoroughfare",
"maxLength": 60,
"example": "Av. Brasil"
},
"number": {
"type": "string",
"description": "Number that identifies the position of a building on a street",
"maxLength": 10,
"example": "1000"
},
"complement": {
"type": "string",
"description": "Additional address information",
"maxLength": 60,
"example": "Sala 1"
},
"district": {
"type": "string",
"description": "Name of a district, for example, a part of a town or region",
"maxLength": 40,
"example": "São Geraldo"
},
"city": {
"type": "string",
"description": "Name of a built-up area with defined boundaries and a local government.\n\nThe value is based on the ISO 3166-2, according to the country defined within the address details.",
"maxLength": 40,
"example": "Porto Alegre"
},
"state": {
"type": "string",
"description": "Name of an organized political community or area forming a part of a federation.\n\nThe value is based on the ISO 3166-2, according to the country defined within the address details.",
"maxLength": 20,
"example": "RS"
},
"country": {
"type": "string",
"description": "Country code.\n\nThe value is based on the ISO 3166-1 alpha-2 (https://www.iso.org/obp/ui/#search/code/).",
"maxLength": 2,
"example": "BR"
},
"postal_code": {
"type": "string",
"description": "Postal or ZIP code.\n\nThe value consists of a group of letters and/or numbers that is added to a postal address to assist in sorting the mail.",
"maxLength": 8,
"example": "90230060"
},
"reference": {
"type": "string",
"description": "Reference point details that can be used to help locate the address",
"maxLength": 80,
"example": "Near the hospital"
}
}
}
},
"shipping": {
"first_name": "John",
"last_name": "Doe Smith",
"name": "John Doe Smith",
"phone_number": "5551999887766",
"shipping_amount": 3000,
"address": {
"street": "Av. Brasil",
"number": "1000",
"complement": "Sala 1",
"district": "São Geraldo",
"city": "Porto Alegre",
"state": "RS",
"country": "BR",
"postal_code": "90230060",
"reference": "Near the hospital"
}
},
"pickup_store": true,
"shipping_method": "PAC",
"soft_descriptor": "Bread Store",
"dynamic_mcc": 1000,
"additional_data": {
"rates": [
{
"key": "Iva",
"value": 123
}
],
"regional_regulation_code": "17934"
},
"configurations": {
"3ds": true,
"preauthorization": false,
"card_verification": false
},
"sub_merchant": {
"identification_code": "SUB_12345",
"document_type": "CNPJ",
"document_number": "12345678000190",
"address": {
"street": "Rua das Flores",
"number": "789",
"complement": "Loja 2",
"district": "Jardins",
"city": "São Paulo",
"state": "SP",
"country_code": "BR",
"postal_code": "01452000"
}
}
}'
const response = await fetch(`https://api-sbx.pre.globalgetnet.com/dpy/web-checkout/v1/payment-intent`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
"order_id": "ORDER_123",
"payment": {
"currency": "USD",
"amount": 12000
},
"product": [
{
"product_type": "digital_content",
"title": "Toy car",
"description": "Wooden toy car",
"value": 1200,
"quantity": 10
}
],
"customer": {
"customer_id": "12345678912",
"first_name": "John",
"last_name": "Doe Smith",
"name": "John Doe Smith",
"email": "customer@email.com.br",
"document_type": "CPF",
"document_number": "12345678912",
"phone_number": "5551999887766",
"gender": "Male",
"checked_email": {
"type": "boolean",
"default": false,
"description": "Whether the customer's email address was verified by the seller when they registered with the store.\n\nThe possible values are:\n- true = Email address was verified\n- false = Email address was not verified",
"example": false
},
"billing_address": {
"type": "object",
"description": "Data structure containing shipping address details",
"required": [
"street",
"number",
"country",
"postal_code"
],
"properties": {
"street": {
"type": "string",
"description": "Name of a street or thoroughfare",
"maxLength": 60,
"example": "Av. Brasil"
},
"number": {
"type": "string",
"description": "Number that identifies the position of a building on a street",
"maxLength": 10,
"example": "1000"
},
"complement": {
"type": "string",
"description": "Additional address information",
"maxLength": 60,
"example": "Sala 1"
},
"district": {
"type": "string",
"description": "Name of a district, for example, a part of a town or region",
"maxLength": 40,
"example": "São Geraldo"
},
"city": {
"type": "string",
"description": "Name of a built-up area with defined boundaries and a local government.\n\nThe value is based on the ISO 3166-2, according to the country defined within the address details.",
"maxLength": 40,
"example": "Porto Alegre"
},
"state": {
"type": "string",
"description": "Name of an organized political community or area forming a part of a federation.\n\nThe value is based on the ISO 3166-2, according to the country defined within the address details.",
"maxLength": 20,
"example": "RS"
},
"country": {
"type": "string",
"description": "Country code.\n\nThe value is based on the ISO 3166-1 alpha-2 (https://www.iso.org/obp/ui/#search/code/).",
"maxLength": 2,
"example": "BR"
},
"postal_code": {
"type": "string",
"description": "Postal or ZIP code.\n\nThe value consists of a group of letters and/or numbers that is added to a postal address to assist in sorting the mail.",
"maxLength": 8,
"example": "90230060"
},
"reference": {
"type": "string",
"description": "Reference point details that can be used to help locate the address",
"maxLength": 80,
"example": "Near the hospital"
}
}
}
},
"shipping": {
"first_name": "John",
"last_name": "Doe Smith",
"name": "John Doe Smith",
"phone_number": "5551999887766",
"shipping_amount": 3000,
"address": {
"street": "Av. Brasil",
"number": "1000",
"complement": "Sala 1",
"district": "São Geraldo",
"city": "Porto Alegre",
"state": "RS",
"country": "BR",
"postal_code": "90230060",
"reference": "Near the hospital"
}
},
"pickup_store": true,
"shipping_method": "PAC",
"soft_descriptor": "Bread Store",
"dynamic_mcc": 1000,
"additional_data": {
"rates": [
{
"key": "Iva",
"value": 123
}
],
"regional_regulation_code": "17934"
},
"configurations": {
"3ds": true,
"preauthorization": false,
"card_verification": false
},
"sub_merchant": {
"identification_code": "SUB_12345",
"document_type": "CNPJ",
"document_number": "12345678000190",
"address": {
"street": "Rua das Flores",
"number": "789",
"complement": "Loja 2",
"district": "Jardins",
"city": "São Paulo",
"state": "SP",
"country_code": "BR",
"postal_code": "01452000"
}
}
})
});
const data = await response.json();
import requests
response = requests.request(
"POST",
"https://api-sbx.pre.globalgetnet.com/dpy/web-checkout/v1/payment-intent",
json={
"order_id": "ORDER_123",
"payment": {
"currency": "USD",
"amount": 12000
},
"product": [
{
"product_type": "digital_content",
"title": "Toy car",
"description": "Wooden toy car",
"value": 1200,
"quantity": 10
}
],
"customer": {
"customer_id": "12345678912",
"first_name": "John",
"last_name": "Doe Smith",
"name": "John Doe Smith",
"email": "customer@email.com.br",
"document_type": "CPF",
"document_number": "12345678912",
"phone_number": "5551999887766",
"gender": "Male",
"checked_email": {
"type": "boolean",
"default": False,
"description": "Whether the customer's email address was verified by the seller when they registered with the store.\n\nThe possible values are:\n- True = Email address was verified\n- False = Email address was not verified",
"example": False
},
"billing_address": {
"type": "object",
"description": "Data structure containing shipping address details",
"required": [
"street",
"number",
"country",
"postal_code"
],
"properties": {
"street": {
"type": "string",
"description": "Name of a street or thoroughfare",
"maxLength": 60,
"example": "Av. Brasil"
},
"number": {
"type": "string",
"description": "Number that identifies the position of a building on a street",
"maxLength": 10,
"example": "1000"
},
"complement": {
"type": "string",
"description": "Additional address information",
"maxLength": 60,
"example": "Sala 1"
},
"district": {
"type": "string",
"description": "Name of a district, for example, a part of a town or region",
"maxLength": 40,
"example": "São Geraldo"
},
"city": {
"type": "string",
"description": "Name of a built-up area with defined boundaries and a local government.\n\nThe value is based on the ISO 3166-2, according to the country defined within the address details.",
"maxLength": 40,
"example": "Porto Alegre"
},
"state": {
"type": "string",
"description": "Name of an organized political community or area forming a part of a federation.\n\nThe value is based on the ISO 3166-2, according to the country defined within the address details.",
"maxLength": 20,
"example": "RS"
},
"country": {
"type": "string",
"description": "Country code.\n\nThe value is based on the ISO 3166-1 alpha-2 (https://www.iso.org/obp/ui/#search/code/).",
"maxLength": 2,
"example": "BR"
},
"postal_code": {
"type": "string",
"description": "Postal or ZIP code.\n\nThe value consists of a group of letters and/or numbers that is added to a postal address to assist in sorting the mail.",
"maxLength": 8,
"example": "90230060"
},
"reference": {
"type": "string",
"description": "Reference point details that can be used to help locate the address",
"maxLength": 80,
"example": "Near the hospital"
}
}
}
},
"shipping": {
"first_name": "John",
"last_name": "Doe Smith",
"name": "John Doe Smith",
"phone_number": "5551999887766",
"shipping_amount": 3000,
"address": {
"street": "Av. Brasil",
"number": "1000",
"complement": "Sala 1",
"district": "São Geraldo",
"city": "Porto Alegre",
"state": "RS",
"country": "BR",
"postal_code": "90230060",
"reference": "Near the hospital"
}
},
"pickup_store": True,
"shipping_method": "PAC",
"soft_descriptor": "Bread Store",
"dynamic_mcc": 1000,
"additional_data": {
"rates": [
{
"key": "Iva",
"value": 123
}
],
"regional_regulation_code": "17934"
},
"configurations": {
"3ds": True,
"preauthorization": False,
"card_verification": False
},
"sub_merchant": {
"identification_code": "SUB_12345",
"document_type": "CNPJ",
"document_number": "12345678000190",
"address": {
"street": "Rua das Flores",
"number": "789",
"complement": "Loja 2",
"district": "Jardins",
"city": "São Paulo",
"state": "SP",
"country_code": "BR",
"postal_code": "01452000"
}
}
},
)
data = response.json()
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api-sbx.pre.globalgetnet.com/dpy/web-checkout/v1/payment-intent");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_HTTPHEADER, ["Content-Type: application/json"]);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{
"order_id": "ORDER_123",
"payment": {
"currency": "USD",
"amount": 12000
},
"product": [
{
"product_type": "digital_content",
"title": "Toy car",
"description": "Wooden toy car",
"value": 1200,
"quantity": 10
}
],
"customer": {
"customer_id": "12345678912",
"first_name": "John",
"last_name": "Doe Smith",
"name": "John Doe Smith",
"email": "customer@email.com.br",
"document_type": "CPF",
"document_number": "12345678912",
"phone_number": "5551999887766",
"gender": "Male",
"checked_email": {
"type": "boolean",
"default": false,
"description": "Whether the customer's email address was verified by the seller when they registered with the store.\n\nThe possible values are:\n- true = Email address was verified\n- false = Email address was not verified",
"example": false
},
"billing_address": {
"type": "object",
"description": "Data structure containing shipping address details",
"required": [
"street",
"number",
"country",
"postal_code"
],
"properties": {
"street": {
"type": "string",
"description": "Name of a street or thoroughfare",
"maxLength": 60,
"example": "Av. Brasil"
},
"number": {
"type": "string",
"description": "Number that identifies the position of a building on a street",
"maxLength": 10,
"example": "1000"
},
"complement": {
"type": "string",
"description": "Additional address information",
"maxLength": 60,
"example": "Sala 1"
},
"district": {
"type": "string",
"description": "Name of a district, for example, a part of a town or region",
"maxLength": 40,
"example": "São Geraldo"
},
"city": {
"type": "string",
"description": "Name of a built-up area with defined boundaries and a local government.\n\nThe value is based on the ISO 3166-2, according to the country defined within the address details.",
"maxLength": 40,
"example": "Porto Alegre"
},
"state": {
"type": "string",
"description": "Name of an organized political community or area forming a part of a federation.\n\nThe value is based on the ISO 3166-2, according to the country defined within the address details.",
"maxLength": 20,
"example": "RS"
},
"country": {
"type": "string",
"description": "Country code.\n\nThe value is based on the ISO 3166-1 alpha-2 (https://www.iso.org/obp/ui/#search/code/).",
"maxLength": 2,
"example": "BR"
},
"postal_code": {
"type": "string",
"description": "Postal or ZIP code.\n\nThe value consists of a group of letters and/or numbers that is added to a postal address to assist in sorting the mail.",
"maxLength": 8,
"example": "90230060"
},
"reference": {
"type": "string",
"description": "Reference point details that can be used to help locate the address",
"maxLength": 80,
"example": "Near the hospital"
}
}
}
},
"shipping": {
"first_name": "John",
"last_name": "Doe Smith",
"name": "John Doe Smith",
"phone_number": "5551999887766",
"shipping_amount": 3000,
"address": {
"street": "Av. Brasil",
"number": "1000",
"complement": "Sala 1",
"district": "São Geraldo",
"city": "Porto Alegre",
"state": "RS",
"country": "BR",
"postal_code": "90230060",
"reference": "Near the hospital"
}
},
"pickup_store": true,
"shipping_method": "PAC",
"soft_descriptor": "Bread Store",
"dynamic_mcc": 1000,
"additional_data": {
"rates": [
{
"key": "Iva",
"value": 123
}
],
"regional_regulation_code": "17934"
},
"configurations": {
"3ds": true,
"preauthorization": false,
"card_verification": false
},
"sub_merchant": {
"identification_code": "SUB_12345",
"document_type": "CNPJ",
"document_number": "12345678000190",
"address": {
"street": "Rua das Flores",
"number": "789",
"complement": "Loja 2",
"district": "Jardins",
"city": "São Paulo",
"state": "SP",
"country_code": "BR",
"postal_code": "01452000"
}
}
}');
$response = curl_exec($ch);
curl_close($ch);
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
req, _ := http.NewRequest("POST", "https://api-sbx.pre.globalgetnet.com/dpy/web-checkout/v1/payment-intent", strings.NewReader(`{
"order_id": "ORDER_123",
"payment": {
"currency": "USD",
"amount": 12000
},
"product": [
{
"product_type": "digital_content",
"title": "Toy car",
"description": "Wooden toy car",
"value": 1200,
"quantity": 10
}
],
"customer": {
"customer_id": "12345678912",
"first_name": "John",
"last_name": "Doe Smith",
"name": "John Doe Smith",
"email": "customer@email.com.br",
"document_type": "CPF",
"document_number": "12345678912",
"phone_number": "5551999887766",
"gender": "Male",
"checked_email": {
"type": "boolean",
"default": false,
"description": "Whether the customer's email address was verified by the seller when they registered with the store.\n\nThe possible values are:\n- true = Email address was verified\n- false = Email address was not verified",
"example": false
},
"billing_address": {
"type": "object",
"description": "Data structure containing shipping address details",
"required": [
"street",
"number",
"country",
"postal_code"
],
"properties": {
"street": {
"type": "string",
"description": "Name of a street or thoroughfare",
"maxLength": 60,
"example": "Av. Brasil"
},
"number": {
"type": "string",
"description": "Number that identifies the position of a building on a street",
"maxLength": 10,
"example": "1000"
},
"complement": {
"type": "string",
"description": "Additional address information",
"maxLength": 60,
"example": "Sala 1"
},
"district": {
"type": "string",
"description": "Name of a district, for example, a part of a town or region",
"maxLength": 40,
"example": "São Geraldo"
},
"city": {
"type": "string",
"description": "Name of a built-up area with defined boundaries and a local government.\n\nThe value is based on the ISO 3166-2, according to the country defined within the address details.",
"maxLength": 40,
"example": "Porto Alegre"
},
"state": {
"type": "string",
"description": "Name of an organized political community or area forming a part of a federation.\n\nThe value is based on the ISO 3166-2, according to the country defined within the address details.",
"maxLength": 20,
"example": "RS"
},
"country": {
"type": "string",
"description": "Country code.\n\nThe value is based on the ISO 3166-1 alpha-2 (https://www.iso.org/obp/ui/#search/code/).",
"maxLength": 2,
"example": "BR"
},
"postal_code": {
"type": "string",
"description": "Postal or ZIP code.\n\nThe value consists of a group of letters and/or numbers that is added to a postal address to assist in sorting the mail.",
"maxLength": 8,
"example": "90230060"
},
"reference": {
"type": "string",
"description": "Reference point details that can be used to help locate the address",
"maxLength": 80,
"example": "Near the hospital"
}
}
}
},
"shipping": {
"first_name": "John",
"last_name": "Doe Smith",
"name": "John Doe Smith",
"phone_number": "5551999887766",
"shipping_amount": 3000,
"address": {
"street": "Av. Brasil",
"number": "1000",
"complement": "Sala 1",
"district": "São Geraldo",
"city": "Porto Alegre",
"state": "RS",
"country": "BR",
"postal_code": "90230060",
"reference": "Near the hospital"
}
},
"pickup_store": true,
"shipping_method": "PAC",
"soft_descriptor": "Bread Store",
"dynamic_mcc": 1000,
"additional_data": {
"rates": [
{
"key": "Iva",
"value": 123
}
],
"regional_regulation_code": "17934"
},
"configurations": {
"3ds": true,
"preauthorization": false,
"card_verification": false
},
"sub_merchant": {
"identification_code": "SUB_12345",
"document_type": "CNPJ",
"document_number": "12345678000190",
"address": {
"street": "Rua das Flores",
"number": "789",
"complement": "Loja 2",
"district": "Jardins",
"city": "São Paulo",
"state": "SP",
"country_code": "BR",
"postal_code": "01452000"
}
}
}`))
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
data, _ := io.ReadAll(resp.Body)
fmt.Println(string(data))
}
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api-sbx.pre.globalgetnet.com/dpy/web-checkout/v1/payment-intent"))
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"order_id\": \"ORDER_123\",\n \"payment\": {\n \"currency\": \"USD\",\n \"amount\": 12000\n },\n \"product\": [\n {\n \"product_type\": \"digital_content\",\n \"title\": \"Toy car\",\n \"description\": \"Wooden toy car\",\n \"value\": 1200,\n \"quantity\": 10\n }\n ],\n \"customer\": {\n \"customer_id\": \"12345678912\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe Smith\",\n \"name\": \"John Doe Smith\",\n \"email\": \"customer@email.com.br\",\n \"document_type\": \"CPF\",\n \"document_number\": \"12345678912\",\n \"phone_number\": \"5551999887766\",\n \"gender\": \"Male\",\n \"checked_email\": {\n \"type\": \"boolean\",\n \"default\": false,\n \"description\": \"Whether the customer's email address was verified by the seller when they registered with the store.\\n\\nThe possible values are:\\n- true = Email address was verified\\n- false = Email address was not verified\",\n \"example\": false\n },\n \"billing_address\": {\n \"type\": \"object\",\n \"description\": \"Data structure containing shipping address details\",\n \"required\": [\n \"street\",\n \"number\",\n \"country\",\n \"postal_code\"\n ],\n \"properties\": {\n \"street\": {\n \"type\": \"string\",\n \"description\": \"Name of a street or thoroughfare\",\n \"maxLength\": 60,\n \"example\": \"Av. Brasil\"\n },\n \"number\": {\n \"type\": \"string\",\n \"description\": \"Number that identifies the position of a building on a street\",\n \"maxLength\": 10,\n \"example\": \"1000\"\n },\n \"complement\": {\n \"type\": \"string\",\n \"description\": \"Additional address information\",\n \"maxLength\": 60,\n \"example\": \"Sala 1\"\n },\n \"district\": {\n \"type\": \"string\",\n \"description\": \"Name of a district, for example, a part of a town or region\",\n \"maxLength\": 40,\n \"example\": \"São Geraldo\"\n },\n \"city\": {\n \"type\": \"string\",\n \"description\": \"Name of a built-up area with defined boundaries and a local government.\\n\\nThe value is based on the ISO 3166-2, according to the country defined within the address details.\",\n \"maxLength\": 40,\n \"example\": \"Porto Alegre\"\n },\n \"state\": {\n \"type\": \"string\",\n \"description\": \"Name of an organized political community or area forming a part of a federation.\\n\\nThe value is based on the ISO 3166-2, according to the country defined within the address details.\",\n \"maxLength\": 20,\n \"example\": \"RS\"\n },\n \"country\": {\n \"type\": \"string\",\n \"description\": \"Country code.\\n\\nThe value is based on the ISO 3166-1 alpha-2 (https://www.iso.org/obp/ui/#search/code/).\",\n \"maxLength\": 2,\n \"example\": \"BR\"\n },\n \"postal_code\": {\n \"type\": \"string\",\n \"description\": \"Postal or ZIP code.\\n\\nThe value consists of a group of letters and/or numbers that is added to a postal address to assist in sorting the mail.\",\n \"maxLength\": 8,\n \"example\": \"90230060\"\n },\n \"reference\": {\n \"type\": \"string\",\n \"description\": \"Reference point details that can be used to help locate the address\",\n \"maxLength\": 80,\n \"example\": \"Near the hospital\"\n }\n }\n }\n },\n \"shipping\": {\n \"first_name\": \"John\",\n \"last_name\": \"Doe Smith\",\n \"name\": \"John Doe Smith\",\n \"phone_number\": \"5551999887766\",\n \"shipping_amount\": 3000,\n \"address\": {\n \"street\": \"Av. Brasil\",\n \"number\": \"1000\",\n \"complement\": \"Sala 1\",\n \"district\": \"São Geraldo\",\n \"city\": \"Porto Alegre\",\n \"state\": \"RS\",\n \"country\": \"BR\",\n \"postal_code\": \"90230060\",\n \"reference\": \"Near the hospital\"\n }\n },\n \"pickup_store\": true,\n \"shipping_method\": \"PAC\",\n \"soft_descriptor\": \"Bread Store\",\n \"dynamic_mcc\": 1000,\n \"additional_data\": {\n \"rates\": [\n {\n \"key\": \"Iva\",\n \"value\": 123\n }\n ],\n \"regional_regulation_code\": \"17934\"\n },\n \"configurations\": {\n \"3ds\": true,\n \"preauthorization\": false,\n \"card_verification\": false\n },\n \"sub_merchant\": {\n \"identification_code\": \"SUB_12345\",\n \"document_type\": \"CNPJ\",\n \"document_number\": \"12345678000190\",\n \"address\": {\n \"street\": \"Rua das Flores\",\n \"number\": \"789\",\n \"complement\": \"Loja 2\",\n \"district\": \"Jardins\",\n \"city\": \"São Paulo\",\n \"state\": \"SP\",\n \"country_code\": \"BR\",\n \"postal_code\": \"01452000\"\n }\n }\n}"))
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
require "net/http"
require "uri"
uri = URI("https://api-sbx.pre.globalgetnet.com/dpy/web-checkout/v1/payment-intent")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"
request = Net::HTTP::Post.new(uri)
request["Content-Type"] = "application/json"
request.body = "{\n \"order_id\": \"ORDER_123\",\n \"payment\": {\n \"currency\": \"USD\",\n \"amount\": 12000\n },\n \"product\": [\n {\n \"product_type\": \"digital_content\",\n \"title\": \"Toy car\",\n \"description\": \"Wooden toy car\",\n \"value\": 1200,\n \"quantity\": 10\n }\n ],\n \"customer\": {\n \"customer_id\": \"12345678912\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe Smith\",\n \"name\": \"John Doe Smith\",\n \"email\": \"customer@email.com.br\",\n \"document_type\": \"CPF\",\n \"document_number\": \"12345678912\",\n \"phone_number\": \"5551999887766\",\n \"gender\": \"Male\",\n \"checked_email\": {\n \"type\": \"boolean\",\n \"default\": false,\n \"description\": \"Whether the customer's email address was verified by the seller when they registered with the store.\\n\\nThe possible values are:\\n- true = Email address was verified\\n- false = Email address was not verified\",\n \"example\": false\n },\n \"billing_address\": {\n \"type\": \"object\",\n \"description\": \"Data structure containing shipping address details\",\n \"required\": [\n \"street\",\n \"number\",\n \"country\",\n \"postal_code\"\n ],\n \"properties\": {\n \"street\": {\n \"type\": \"string\",\n \"description\": \"Name of a street or thoroughfare\",\n \"maxLength\": 60,\n \"example\": \"Av. Brasil\"\n },\n \"number\": {\n \"type\": \"string\",\n \"description\": \"Number that identifies the position of a building on a street\",\n \"maxLength\": 10,\n \"example\": \"1000\"\n },\n \"complement\": {\n \"type\": \"string\",\n \"description\": \"Additional address information\",\n \"maxLength\": 60,\n \"example\": \"Sala 1\"\n },\n \"district\": {\n \"type\": \"string\",\n \"description\": \"Name of a district, for example, a part of a town or region\",\n \"maxLength\": 40,\n \"example\": \"São Geraldo\"\n },\n \"city\": {\n \"type\": \"string\",\n \"description\": \"Name of a built-up area with defined boundaries and a local government.\\n\\nThe value is based on the ISO 3166-2, according to the country defined within the address details.\",\n \"maxLength\": 40,\n \"example\": \"Porto Alegre\"\n },\n \"state\": {\n \"type\": \"string\",\n \"description\": \"Name of an organized political community or area forming a part of a federation.\\n\\nThe value is based on the ISO 3166-2, according to the country defined within the address details.\",\n \"maxLength\": 20,\n \"example\": \"RS\"\n },\n \"country\": {\n \"type\": \"string\",\n \"description\": \"Country code.\\n\\nThe value is based on the ISO 3166-1 alpha-2 (https://www.iso.org/obp/ui/#search/code/).\",\n \"maxLength\": 2,\n \"example\": \"BR\"\n },\n \"postal_code\": {\n \"type\": \"string\",\n \"description\": \"Postal or ZIP code.\\n\\nThe value consists of a group of letters and/or numbers that is added to a postal address to assist in sorting the mail.\",\n \"maxLength\": 8,\n \"example\": \"90230060\"\n },\n \"reference\": {\n \"type\": \"string\",\n \"description\": \"Reference point details that can be used to help locate the address\",\n \"maxLength\": 80,\n \"example\": \"Near the hospital\"\n }\n }\n }\n },\n \"shipping\": {\n \"first_name\": \"John\",\n \"last_name\": \"Doe Smith\",\n \"name\": \"John Doe Smith\",\n \"phone_number\": \"5551999887766\",\n \"shipping_amount\": 3000,\n \"address\": {\n \"street\": \"Av. Brasil\",\n \"number\": \"1000\",\n \"complement\": \"Sala 1\",\n \"district\": \"São Geraldo\",\n \"city\": \"Porto Alegre\",\n \"state\": \"RS\",\n \"country\": \"BR\",\n \"postal_code\": \"90230060\",\n \"reference\": \"Near the hospital\"\n }\n },\n \"pickup_store\": true,\n \"shipping_method\": \"PAC\",\n \"soft_descriptor\": \"Bread Store\",\n \"dynamic_mcc\": 1000,\n \"additional_data\": {\n \"rates\": [\n {\n \"key\": \"Iva\",\n \"value\": 123\n }\n ],\n \"regional_regulation_code\": \"17934\"\n },\n \"configurations\": {\n \"3ds\": true,\n \"preauthorization\": false,\n \"card_verification\": false\n },\n \"sub_merchant\": {\n \"identification_code\": \"SUB_12345\",\n \"document_type\": \"CNPJ\",\n \"document_number\": \"12345678000190\",\n \"address\": {\n \"street\": \"Rua das Flores\",\n \"number\": \"789\",\n \"complement\": \"Loja 2\",\n \"district\": \"Jardins\",\n \"city\": \"São Paulo\",\n \"state\": \"SP\",\n \"country_code\": \"BR\",\n \"postal_code\": \"01452000\"\n }\n }\n}"
response = http.request(request)
puts response.body