Skip to main content

Documentation

Creating a Payment with FX

Create a payment with currency conversion.

You can create a payment where the buyer pays in one currency and the merchant receives a different currency. You decide which currency the price is in.

Reasons to create a payment with currency conversion include:

  • Allow a buyer to pay with their local currency while you receive the funds in your preferred currency.

  • Fund your wallet using a currency that is different than the wallet's currency.

Use the following Create Payment request parameters:

  • fixed_side - Defines whether the payment price is in the merchant's currency or the buyer's currency. One of the following:

    • buy - The price is in the merchant's currency. The buyer uses the buyer's currency to pay the equivalent of the price. The merchant receives the price amount in the merchant's currency.

    • sell - The price is in the buyer's currency. The buyer pays the price amount. The merchant receives in the merchant's currency the equivalent of the price that the buyer paid.

  • amount - The amount of the price, in the currency defined in currency.

  • currency - The currency of the price. One of the following:

    • When fixed_side is buy: The merchant's currency.

    • When fixed_side is sell: The buyer's currency.

  • requested_currency - One of the following:

    • When fixed_side is buy: The buyer's currency.

    • When fixed_side is sell: The merchant's currency.

  • payment_method - The buyer's payment method. The payment method must support the buyer's currency.

Procedure - Price Is in the Merchant's Currency

Use this procedure for a payment where the price is in the merchant's currency.

Create a payment as described in Create Payment, with the following settings:

  • fixed_side - buy. Sets the payment price in the merchant's currency.

  • amount - 321.99. The amount of the price.

  • currency - USD. The merchant's currency.

  • requested_currency - SGD. The buyer's currency.

  • payment_method - The buyer's payment method. An object with sg_paynow_bank as type.

The response shows:

  • The buyer paid SGD 443.83, the equivalent of the price.

  • The buyer's payment was converted to the merchant's currency.

  • The merchant's wallet received the price, USD 321.99.

    • Example request - partial

      • {
            "fixed_side": "buy",
            "amount": 321.99,
            "currency": "USD",
            "requested_currency": "SGD",
            "payment_method": {
                "type": "sg_paynow_bank",
                                        "fields": {          
        //         . . .
                }                 
            }
                
        //         . . .
        
        }
    • Example response - partial

      •    "data": {
        //         . . .
        
                "original_amount": 443.83,
        
        //         . . .
        
                "currency_code": "SGD",
        
        //         . . .
        
                "ewallets": [
                    {
                        "ewallet_id": "ewallet_c67c44ec60d5c2e62480aa7c76b3f8b4",
                        "amount": 321.99,
        //         . . .
                    }
                ],
        //         . . .
                "payment_method_type": "sg_paynow_bank",
        //         . . .
                "fx_rate": 0.72548434,
                "merchant_requested_currency": "USD",
                "merchant_requested_amount": 321.99,
                "fixed_side": "buy",
        
        //         . . .
            }

For a full code example, see Funding Wallet with FX - fixed side buy on Create Payment.

Procedure - Price Is in the Buyer's Currency

Use this procedure for a payment where the price is in the buyer's currency.

Create a payment as described in Create Payment, with the following settings:

  • fixed_side - sell. Sets the payment price in the buyer's currency.

  • amount - 449.99. The amount of the price.

  • currency - SGD. The buyer's currency.

  • requested_currency - USD. The merchant's currency.

  • payment_method - The buyer's payment method. An object with sg_debit_mastercard_card as type.

The response shows:

  • The buyer paid SGD 449.99, the price.

  • The buyer's payment was converted to the merchant's currency.

  • The merchant's wallet received USD 323.72, the equivalent of the price that the buyer paid.

    • Example request - partial

      • {
            "fixed_side": "sell",
            "amount": 449.99,
            "currency": "SGD",
            "requested_currency": "USD",
            "payment_method": {
                "type": "sg_debit_mastercard_card",
                                        "fields": {          
        //         . . .
                }                 
              
            }
                
        //         . . .
        
        }
    • Example response - partial

      •    "data": {
        //         . . .
        
                "original_amount": 449.99,
        
        //         . . .
        
                "currency_code": "SGD",
        
        //         . . .
        
                "ewallets": [
                    {
                        "ewallet_id": "ewallet_c67c44ec60d5c2e62480aa7c76b3f8b4",
                        "amount": 323.72,
        //         . . .
                    }
                ],
        //         . . .
                "payment_method_type": "sg_debit_mastercard_card",
        //         . . .
                "fx_rate": 0.71939468,
                "merchant_requested_currency": "USD",
                "merchant_requested_amount": 323.72,
                "fixed_side": "sell",
        
        //         . . .
            }

For a full code example, see Funding Wallet with FX - fixed side sell on Create Payment.