curl --location 'https://api.malga.io/v1/charges' \
--header 'X-Client-Id: <YOUR_CLIENT_ID>' \
--header 'X-Api-Key: <YOUR_SECRET_KEY>' \
--header 'Content-Type: application/json' \
--data '{
"merchantId": "<merchantId>",
"amount": 100,
"currency": "BRL",
"statementDescriptor": "Voucher",
"orderId": "15ad136a-520b-40d0-9c0e-05ff008b0fa7",
"description": "15ad136a-520b-40d0-9c0e-05ff008b0fa7",
"paymentMethod": {
"customer": {
"name": "Jose das Flores",
"identity": "11111111111",
"billingAddress": {
"zipCode": "01714140",
"city": "São Paulo",
"state": "SP",
"country": "BR",
"complement": "complement"
}
},
"paymentType": "voucher",
"items": [
{
"id": "123",
"title": "ItemTeste1",
"quantity": 1,
"unitPrice": 100
}
]
},
"paymentSource": {
"sourceType": "card",
"card": {
"cardHolderName": "Jose das Flores",
"cardNumber": "4000000000000010",
"cardCvv": "351",
"cardExpirationDate": "12/2024"
}
}
}'
< HTTP/2 201
< content-type: application/json; charset=utf-8
{
"id": "97443bea-fb76-43c2-afb1-2cb45abbe673",
"clientId": "<CLIENT_ID>",
"merchantId": "<MERCHANT_ID>",
"orderId": "15ad136a-520b-40d0-9c0e-05ff008b0fa7",
"createdAt": "2023-07-17T19:46:08.597Z",
"amount": 100,
"originalAmount": 100,
"currency": "BRL",
"statementDescriptor": "Voucher",
"capture": true,
"isDispute": false,
"status": "authorized",
"paymentMethod": {
"paymentType": "voucher"
},
"paymentSource": {
"sourceType": "card"
},
"transactionRequests": [
{
"id": "e18cf62e-aa43-4db5-abfe-0f63e2749fef",
"createdAt": "2023-07-17T19:46:08.627Z",
"updatedAt": "2023-07-17T19:46:10.861Z",
"idempotencyKey": "5b011a93-2eaf-4b9c-9f22-f3676c7cba74",
"providerId": "56a83eaf-f9b2-4d2e-97f3-53933331b0e5",
"providerType": "SANDBOX",
"transactionId": "f4ae4d32-350d-4135-9b50-b259e937ca03",
"amount": 100,
"authorizationCode": "011056",
"authorizationNsu": null,
"requestStatus": "success",
"requestType": "authorization",
"responseTs": "2212ms"
}
]
}