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": "87f3464b-50b7-4651-a473-f885896dac00",
"description": "87f3464b-50b7-4651-a473-f885896dac00",
"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": "3372a6bf-093a-4723-b1d8-9ac8abbea8f1",
"clientId": "<CLIENT_ID>",
"merchantId": "<MERCHANT_ID>",
"orderId": "87f3464b-50b7-4651-a473-f885896dac00",
"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": "ed67074e-6b80-40c7-b2b0-9b1fbec8e0bb",
"createdAt": "2023-07-17T19:46:08.627Z",
"updatedAt": "2023-07-17T19:46:10.861Z",
"idempotencyKey": "7ed5f493-b215-4980-b163-ef675e395f45",
"providerId": "39a44f1c-18b4-43ff-8dff-ea9439a8ad06",
"providerType": "SANDBOX",
"transactionId": "e9244789-8a8c-44c8-a632-f9b66d359299",
"amount": 100,
"authorizationCode": "011056",
"authorizationNsu": null,
"requestStatus": "success",
"requestType": "authorization",
"responseTs": "2212ms"
}
]
}