Environment | Method | Endpoint |
---|---|---|
Sandbox | post | https://apisandbox.braspag.com.br/v1/sales/ |
Produção | post | https://api.braspag.com.br/v1/sales/ |
POST /1/sales/Learn more about this feature in the documentation.
{
"MerchantOrderId":"2014111701",
"Customer":{
"Name":"Comprador crédito completo",
"Email":"[email protected]",
"Birthdate":"1991-01-02"
},
"Payment":{
"Type":"CreditCard",
"Amount":15700,
"Currency":"BRL",
"Country":"BRA",
"Installments":1,
"Capture":true,
"Authenticate":"false",
"SoftDescriptor":"123456789ABCD",
"DebitCard":{
"CardNumber":"1234123412341231",
"Holder":"Teste Holder",
"ExpirationDate":"12/2030",
"SecurityCode":"123",
"SaveCard":"false",
"Brand":"Visa",
"CardOnFile":{
"Usage": "First",
"Reason":"Recurring"
}
}
}
}
PROPERTY | TYPE | SIZE | REQUIRED | DESCRIPTION |
---|---|---|---|---|
MerchantOrderId | Text | 50 | Yes | Order identification number. Warning: Allowed characters are a-z, A-Z, 0-9. Special characters and blank spaces are not allowed. |
Customer.Name | Text | 255 | No | Customer's name. |
Customer.Status | Text | 255 | No | The customer’s registration status on the store. (NEW / EXISTING) |
Customer.Email | Text | 255 | No | Customer's email |
Customer.Birthdate | Date | 10 | No | Customer's birthdate (AAAA/MM/DD). |
Payment.Type | Text | 100 | Yes | Type of the Payment Method. |
Payment.Amount | Number | 15 | Yes | Order Amount (to be sent in cents). |
Payment.Currency | Text | 3 | No | Currency in which the payment will be made (BRL). |
Payment.Country | Text | 3 | No | Country in which the payment will be made. |
Payment.SoftDescriptor | Text | 13 | No | The store’s name that will be on the shopper’s bank invoice. Does not allow special characters. |
Payment.Installments | Number | 2 | Yes | Number of installments. If the transaction is a recurrence, the number of installments will be 1. For installment transactions, the number of installments will be greater than 1. |
Payment.Capture | Boolean | — | No (Default false) | Boolean that identifies if the authorization should be done by authomatic capture (true) or posterior capture (false). |
DebitCard.CardNumber | Text | 19 | Yes | Shopper’s card number. |
DebitCard.Holder | Text | 25 | Yes | Name of the shopper that’s printed on the card. Does not accept special characters. |
DebitCard.ExpirationDate | Text | 7 | Yes | Expiration date printed on the card. Example: MM/AAAA. |
DebitCard.SecurityCode | Text | 4 | No | Security code printed on the back of the card. |
DebitCard.SaveCard | Boolean | — | No (Default false) | Boolean that identifies if the card will be saved to generate a CardToken . Find out more about Tokenization of Cards |
DebitCard.Brand | Text | 10 | Yes | Card brand. Possible values: Visa / Master / Amex / Elo / Aura / JCB / Diners / Discover / Hipercard / Hiper. |
DebitCard.CardOnFile.Usage | Text | - | No | Valid values for acquirers: Cielo, Rede e Safra "First" if the card was stored and it’s your first use. "Used" if the card was stored and has been used for another transaction before. |
DebitCard.CardOnFile.Reason | Text | - | Conditional | Indicates the motive for card storage. Valid values for acquirers: Cielo, Rede e Safra If the CardOnFile.Usage field is “Used”.Recurring: programmed recurring transaction (e.g. Subscriptions). If it is a recurring transaction, use Payment.Recurrent = true (merchant recurrence) or Recurrent.Payment = true (scheduled recurrence).Unscheduled: recurring transaction with no fixed date (e.g. service apps). Installments: installments through recurring transactions. For the acquirer GetNet, the valid values are: NewAuthorization : new authorization; Unscheduled: unscheduled payment; DelayedCharge: delayed charge; Incremental: incremental payment; Others: other reasons; Recurring: scheduled recurring; Resubmission: resubmission; NoShow: for a hotel reservation. |
Response
{
"MerchantOrderId": "2014111701",
"Customer": {
"Name": "Comprador crédito completo",
"Email": "[email protected]",
"Birthdate": "1991-01-02"
},
"Payment": {
"ServiceTaxAmount": 0,
"Installments": 1,
"Capture": true,
"Authenticate": false,
"DebitCard": {
"CardNumber": "123412******1231",
"Holder": "Teste Holder",
"ExpirationDate": "12/2030",
"SaveCard": false,
"Brand": "Visa",
"CardOnFile": {
"Usage": "First",
"Reason": "Recurring"
},
"PaymentAccountReference": "JZHOZJHNZH87KQXM3G60B9I21GVZN"
},
"Tid": "0928084922246",
"ProofOfSale": "652515",
"AuthorizationCode": "927181",
"SoftDescriptor": "123456789ABCD",
"Provider": "Simulado",
"IsQrCode": false,
"DynamicCurrencyConversion": false,
"Amount": 15700,
"ReceivedDate": "2022-09-28 08:49:22",
"CapturedAmount": 15700,
"CapturedDate": "2022-09-28 08:49:22",
"Status": 2,
"IsSplitted": false,
"ReturnMessage": "Operation Successful",
"ReturnCode": "6",
"PaymentId": "91bad53a-9198-4738-a280-f51dddc34988",
"Type": "CreditCard",
"Currency": "BRL",
"Country": "BRA",
"Links": [
{
"Method": "GET",
"Rel": "self",
"Href": "https://apisandbox.braspag.com.br/1/sales/91bad53a-9198-4738-a280-f51dddc34988"
},
{
"Method": "PUT",
"Rel": "void",
"Href": "https://api.braspag.com.br/1/sales/91bad53a-9198-4738-a280-f51dddc34988/void"
}
]
}
}
PROPERTY | DESCRIPTION | TYPE | SIZE | FORMAT |
---|---|---|---|---|
ProofOfSale | Authorization number, identical to NSU. | Text | 6 | Alphanumeric text |
Tid | Transaction Id on the acquirer. | Text | 20 | Alphanumeric text |
AuthorizationCode | Authorization code. | Text | 6 | Alphanumeric text |
SoftDescriptor | Text that will be printed on the carrier’s bank invoice. Does not allow special characters. | Text | 13 | Alphanumeric text |
PaymentId | Payment ID number, needed for future operations like Consulting, Capture and Cancellation. | Guid | 36 | xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx |
ECI | Eletronic Commerce Indicator. Indicates how safe a transaction is. | Text | 2 | Example: 7 |
Status | Transaction status. | Byte | — | 2 |
ReturnCode | Acquiring return code. | Text | 32 | Alphanumeric text |
ReturnMessage | Acquiring return message. | Text | 512 | Alphanumeric text |
Payment.MerchantAdviceCode | Card brand’s return code that defines the period for transaction submission retry. Valid only for Mastercard. | Text | 2 | Numeric |
DebitCard.PaymentAccountReference | PAR (payment account reference) is the number that associates different tokens to the same card. It will be returned by the Master and Visa brands and passed on to Cielo e-commerce customers. If the card brand doesn’t send the information the field will not be returned. If it is a debit transaction, include inside the DebitCard node. | Alphanumeric | 29 | — |