---
# System prepended metadata

title: Voucher Redemption

---


# Voucher Redemption
## Flow Chart
### Hold Voucher API Flow
![](https://i.imgur.com/yGfuyWW.jpg)

### Revert Voucher API Flow
![](https://i.imgur.com/vDDMZrL.jpg)

### Transaction Voucher API Flow
![](https://i.imgur.com/6fX85r9.jpg)






<br></br>


## 1. Hold Voucher
API Hold dapat digunakan ketika user input kode voucher ke halaman pembayaran,
Fungsi API ini adalah booking voucher untuk transaksi yang sedang berlangsung sehingga voucher tersebut tidak dapat digunakan di transaksi lain

### 1.1. URL
Dev :
https://devpay.garuda-indonesia.com/payment/general_voucher
prod : 
https://pay.garuda-indonesia.com/payment/general_voucher
Method :
HTTPS POST PROTOCOL

### 1.2. Parameter
![](https://i.imgur.com/M1FqyJf.png)

<br></br>
### 1.3. Example Request (Requester to PLP)
```


{
  "CURRENCY": "IDR", #Mandatory
  "PAYMENTTYPE": "CreditCard",#Mandatory
  "ORIGIN": "LOP",#Mandatory
  "CHECKSUM":  "66a0b06363f68655206155d3ce232bc471b94b21a2e40dae9ff686b6aa6b2836519a2b83532ce83182bc0484d81ed68bbf6a9368695339e3b4d3c318eb5c4cec", #Mandatory
  "ACTION": "HOLD",#Mandatory
  "INVOICENO": "CCEN140008",#Mandatory
  "AMOUNT": "20000",#Mandatory
  "ENDTRAVELDATE": "2021-02-05T03:40:00Z",#Mandatory
  "DESTINATION": "CGK",#Mandatory
  "VOUCHERCODE": "13013383",#Mandatory
  "STARTTRAVELDATE": "2021-02-05T01:40:00Z"#Mandatory
}
```

### 1.4. CHECKSUM FORMAT
`SHA512(action + voucher code + amount + currency + card no + payment type + invoiceno + start travel date + signature key)`

### 1.5. Example Response
```
success hold :
{
  "amount": "10000",
  "expire_until": "Wed Jun 09 03:27:36 UTC 2021",
  "message": "Hold Voucher Successfull",
  "status": "SUCCESS"
}
```
```
failed hold :
{
  "message": "Voucher code is not valid",
  "status": "ERROR"
}
```

<br></br>


## 2. Revert Voucher
API Revert Voucher dapat digunakan ketika user menghapus kode voucher dari halaman pembayar atau ketika transaksi pembayaran gagal, Fungsi dari API ini adalah membatalkan booking voucher untuk transaksi tersebut yang telah dilakukan sebelumnya.
###  2.1. URL
Dev : 
https://devpay.garuda-indonesia.com/payment/general_voucher
Prod : 
https://pay.garuda-indonesia.com/payment/general_voucher
Method :
HTTPS POST PROTOCOL

### 2.2. Parameter
![](https://i.imgur.com/Dxo76MQ.png)


<br></br>
### 2.3. Example Request (Requester to PLP)

```
{
  "CURRENCY": "IDR",#Mandatory
  "PAYMENTTYPE": "",
  "ORIGIN": "LOP",#Mandatory
  "CHECKSUM": "45f99c62ea33c5fc87f6b4ccb478ceeb3f33950ac5a1cd53a5af1076580e8f3648ecba15e119bb009de8c2edd85d91c624fabb2ca05cee1d41192efed904b7bc",#Mandatory
  "ACTION": "REVERT",#Mandatory
  "INVOICENO": "CCEN140007",#Mandatory
  "AMOUNT": "10000",#Mandatory
  "ENDTRAVELDATE": "2021-02-05T03:40:00Z",#Mandatory
  "DESTINATION": "CGK",#Mandatory
  "VOUCHERCODE": "13013383",#Mandatory
  "STARTTRAVELDATE": "2021-02-05T01:40:00Z"#Mandatory
}
```
### 2.4. CHECKSUM FORMAT
```
SHA512(action + voucher code + amount + currency + card no + payment type + invoiceno + start travel date + signature key)
```

### 2.5. Example Response
```
{
  "message": "Revert Voucher Successfull, you can use this voucher again",
  "status": "SUCCESS"
}
```
<br></br>


## 3. Check Voucher
API Check Voucher dapat digunakan ketika user klik trigger "BAYAR/Pay now", Fungsi API ini memastikan kembali bahwa time limit, rules voucher sesuai dan dapat di gunakan.
### 3.1. URL
Dev : 
https://devpay.garuda-indonesia.com/payment/general_voucher
Prod : 
https://pay.garuda-indonesia.com/payment/general_voucher
Method :

### 3.2. Parameter
![](https://i.imgur.com/IaR4KXL.png)


### 3.3. Example Request (Requester to PLP)
```
{
  "CURRENCY": "IDR",
  "PAYMENTTYPE": "CreditCard",
  "ORIGIN": "LOP",
  "CHECKSUM": "52e1ea204f60daa129331546f1ccce398907570f6f540cd4becd5fe2f38b005dd5a0fe0772d29318badd4a584a47ce409845a77e75edc3f9de17276e3e9c98df",
  "ACTION": "CHECK",
  "INVOICENO": "CCEN140016",
  "AMOUNT": "20000",
  "ENDTRAVELDATE": "2021-02-05T03:40:00Z",
  "DESTINATION": "CGK",
  "VOUCHERCODE": "91267384",
  "STARTTRAVELDATE": "2021-02-05T01:40:00Z",
  "CARDNO": "411111"
 }
```

### 3.4. CHECKSUM FORMAT
```
SHA512(action + voucher code + amount + currency + card no + payment type + invoiceno + start travel date + signature key)
```

### 3.5. Example Response
```
{
  "amount": "5000",
  "expire_until": "2021-06-28 03:47:46.0",
  "message": "Check Voucher Successfull, This Voucher can be use",
  "status": "SUCCESS"
}
```

<br></br>

## 4. Use Voucher
API Use Voucher digunakan ketika pembayaran terkonfirmasi sukses, fungsi API ini untuk update informasi voucher yang telah di gunakan.
### 4.1. URL
Dev : 
https://devpay.garuda-indonesia.com/payment/general_voucher
Prod : 
https://pay.garuda-indonesia.com/payment/general_voucher
Method :
HTTPS POST PROTOCOL

### 4.2. Parameter
![](https://i.imgur.com/3MMjTyy.png)

<br></br>

### 4.3. Example Request (Requester to PLP)
```
{
  "CURRENCY": "IDR",#Mandatory
  "PAYMENTTYPE": "CreditCard",#Mandatory
  "ORIGIN": "LOP",#Mandatory
  "CHECKSUM": "32c57ee1d4f6e93739163d8158b5f4996ef907ffd24916b9af6c94d477d7cb97b99b91944e6d964907d4af0f7adf9d8a7fe9b9ba0beaf70a4c2904c536554d5a",#Mandatory
  "ACTION": "USED",#Mandatory
  "INVOICENO": "CCEN140008",#Mandatory
  "AMOUNT": "20000",#Mandatory
  "ENDTRAVELDATE": "2021-02-05T03:40:00Z",#Mandatory
  "DESTINATION": "CGK",#Mandatory
  "VOUCHERCODE": "13013383",#Mandatory
  "STARTTRAVELDATE": "2021-02-05T01:40:00Z",#Mandatory
  "CARDNO": "411111"#Mandatory
}
```

### 4.4. CHECKSUM FORMAT

```
SHA512(action + voucher code + amount + currency + card no + payment type + invoiceno + start travel date + signature key)
```

### 4.5. Example Response
```
{
  "message": "Use Voucher Successfull, Thank You",
  "status": "SUCCESS"
}
```
## 5. Possible Error


| Error Message | Description |
| -------- | -------- |
| Too many failed voucher input attempts. Please try again using a different booking code  | too many hold voucher request, max 4 times per INVOICENUM |
| Voucher code is not valid  | wrong voucher code  |
| Can't Use this voucher code for this payment type  |  voucher code only for certain payment methods  |
| Voucher code is already used  | voucher code already been use  |
| Voucher code is already expired  | voucher code expired  |
| Voucher code is being hold in another transaction  | voucher code already hold  |
| Voucher code can not be used for this currency  | different currency between voucher code rules and transaction  |
| Voucher code can not be used for this card number  | bin rules on  voucher code not match bin used during transaction |
| Start travel date is not in voucher's travel date range  | date of travel rules on voucher code not match with date of travel in this transaction  |




