# Receiving Payments

{% tabs %}
{% tab title="Create Transaction" %}

### Create Transaction

***

### API POST Fields&#x20;

In addition to the [Main Fields](https://experience.wallex.global/wallex-pay/merchant-tools/api-basics#main-fields-these-fields-will-be-here-for-all-calls) described in the API Basics > [Introduction](https://experience.wallex.global/wallex-pay/merchant-tools/api-basics#introduction)

**Create Fixed-Price Transaction**

<table><thead><tr><th width="195" align="center">Field Name</th><th width="413" align="center">Description</th><th>Required?</th></tr></thead><tbody><tr><td align="center">cmd</td><td align="center">create_transaction</td><td>Yes</td></tr><tr><td align="center">amount</td><td align="center">The amount of the transaction in the original currency (currency1 below).</td><td>Yes</td></tr><tr><td align="center">currency1</td><td align="center">The original currency of the transaction.</td><td>Yes</td></tr><tr><td align="center">currency2</td><td align="center">The currency the buyer will be sending. For example if your products are priced in USD but you are receiving BTC, you would use currency1=USD and currency2=BTC.<br>currency1 and currency2 can be set to the same thing if you don't need currency conversion.</td><td>Yes</td></tr><tr><td align="center">buyer_email</td><td align="center">Set the buyer's email address. This will let us send them a notice if they underpay or need a refund. We will not add them to our mailing list or spam them or anything like that.</td><td>Yes</td></tr><tr><td align="center">address</td><td align="center">Optionally set the address to send the funds to (if not set will use the settings you have set on the 'Coins Acceptance Settings' page).<br>Remember: this must be an address in currency2's network.</td><td>No</td></tr><tr><td align="center">buyer_name</td><td align="center">Optionally set the buyer's name for your reference.</td><td>No</td></tr><tr><td align="center">item_name</td><td align="center">Item name for your reference, will be on the payment information page and in the IPNs for the transaction.</td><td>No</td></tr><tr><td align="center">item_number</td><td align="center">Item number for your reference, will be on the payment information page and in the IPNs for the transaction.</td><td>No</td></tr><tr><td align="center">invoice</td><td align="center">Another field for your use, will be on the payment information page and in the IPNs for the transaction.</td><td>No</td></tr><tr><td align="center">custom</td><td align="center">Another field for your use, will be on the payment information page and in the IPNs for the transaction.</td><td>No</td></tr><tr><td align="center">ipn_url</td><td align="center">URL for your IPN callbacks. If not set it will use the IPN URL in your Edit Settings page if you have one set.</td><td>Yes</td></tr><tr><td align="center">success_url</td><td align="center">Sets a URL to go to if the buyer does complete payment. (Only if you use the returned 'checkout_url', no effect/need if designing your own checkout page.)</td><td>No</td></tr><tr><td align="center">cancel_url</td><td align="center">Sets a URL to go to if the buyer does not complete payment. (Only if you use the returned 'checkout_url', no effect/need if designing your own checkout page.)</td><td>No</td></tr></tbody></table>

`Method:`` `<mark style="color:blue;">`POST`</mark>\
`URL:` [`http://wallexpay.io/api/create_transfer`](http://wallexpay.io/api/create_transfer)

### **API Response**

A successful call to get the 'create\_transaction' command will give you a result similar to this (JSON):

```json
{
   "error":"ok",
   "result":{
      "amount":"1.00000000",
      "address":"ZZZ",
      "dest_tag":"YYY",
      "txn_id":"XXX",
      "confirms_needed":"10",
      "timeout":9000,
      "checkout_url":"https:\/\/www.WallexPay.com\/index.php?cmd=checkout&id=XXX&key=ZZZ""qrcode_url":"https:\/\/www.WallexPay.com\/qrgen.php?id=XXX&key=ZZZ"
   }
}
```

**The result will have the following fields:**

* amount = The amount for the buyer to send in the destination currency (currency2).
* address = The address the buyer needs to send the coins to.
* dest\_tag = The tag buyers need to attach for the payment to complete. (only included for coins that require them such as XRP/XMR/etc.)
* txn\_id = The WallexPay.com transaction ID.
* confirms\_needed = The number of confirms needed for the transaction to be complete.
* timeout = How long the buyer has to send the coins and have them be confirmed in seconds.
* checkout\_url = While normally you would be designing the full checkout experience on your site you can use this URL to provide the final payment page to the buyer.
* status\_url = A longer-term URL where the buyer can view the payment status and leave feedback for you. This would typically be emailed to the buyer.
* qrcode\_url = A URL to a QR code you can display for buyer's paying with a QR supporting wallet.

{% hint style="info" %}
**Note:** This API is for making your own custom checkout page so buyers don't have to leave your website to complete payment. 99% of the time you don't need the extra complexity and would just use a [Simple](https://experience.wallex.global/wallex-pay/payment-buttons#simple-button-maker) or [Advanced](https://experience.wallex.global/wallex-pay/payment-buttons#advance-button-maker) button which you can find in our [Merchant Tools](https://experience.wallex.global/wallex-pay/merchant-tools) section.
{% endhint %}
{% endtab %}

{% tab title="Get TX Info" %}

### Get TX Info

***

### API POST Fields&#x20;

In addition to the [Main Fields](https://experience.wallex.global/wallex-pay/merchant-tools/api-basics#main-fields-these-fields-will-be-here-for-all-calls) described in the API Basics > [Introduction](https://experience.wallex.global/wallex-pay/merchant-tools/api-basics#introduction)

**Get Multiple Transaction Information**

<table><thead><tr><th width="198" align="center">Field Name</th><th width="416" align="center">Description</th><th align="center">Required?</th></tr></thead><tbody><tr><td align="center">cmd</td><td align="center">get_tx_info_multi</td><td align="center">Yes</td></tr><tr><td align="center">txid</td><td align="center">Lets you query up to 25 transaction ID(s) (API key must belong to the seller.) Transaction IDs should be separated with a | (pipe symbol.) Note: It is recommended to handle IPNs instead of using this command when possible, it is more efficient and places less load on our servers.</td><td align="center">Yes</td></tr></tbody></table>

**Get Transaction Information**

<table><thead><tr><th width="195" align="center">Field Name</th><th width="416" align="center">Description</th><th align="center">Required?</th></tr></thead><tbody><tr><td align="center">cmd</td><td align="center">get_tx_info</td><td align="center">Yes</td></tr><tr><td align="center">txid</td><td align="center">The transaction ID to query (API key must belong to the seller.) Note: It is recommended to handle IPNs instead of using this command when possible, it is more efficient and places less load on our servers.</td><td align="center">Yes</td></tr><tr><td align="center">full</td><td align="center">Set to 1 to also include the raw checkout and shipping data for the payment if available. (default: 0)</td><td align="center">No</td></tr></tbody></table>

`Method:`` `<mark style="color:blue;">`POST`</mark>\
`URL:` [`http://wallexpay.io/api/get_tx_info`](http://wallexpay.io/api/get_tx_info)

### **API Response**

A successful call to the 'get\_tx\_info' command will give you a result similar to this (JSON):

```json
- Example Unavailable -
```

{% hint style="info" %}
**Note:** If possible, you should use the [Instant Payment Notification (IPN)](https://experience.wallex.global/wallex-pay/merchant-tools/instant-payment-notification-ipn) system to receive notifications about payments rather than using this polled interface.
{% endhint %}
{% endtab %}

{% tab title="Get TX List" %}

### Get TX List

***

### API POST Fields&#x20;

In addition to the [Main Fields](https://experience.wallex.global/wallex-pay/merchant-tools/api-basics#main-fields-these-fields-will-be-here-for-all-calls) described in the API Basics > [Introduction](https://experience.wallex.global/wallex-pay/merchant-tools/api-basics#introduction)

**Get Transaction IDs**

<table><thead><tr><th width="198" align="center">Field Name</th><th width="416" align="center">Description</th><th align="center">Required?</th></tr></thead><tbody><tr><td align="center">cmd</td><td align="center">get_tx_ids</td><td align="center">Yes</td></tr><tr><td align="center">limit</td><td align="center">The maximum number of transaction IDs to return from 1-100. (default: 25)</td><td align="center">No</td></tr><tr><td align="center">start</td><td align="center">What transaction # to start from (for iteration/pagination.) (default: 0, starts with your newest transactions.)</td><td align="center">No</td></tr><tr><td align="center">all</td><td align="center">By default we return an array of TX IDs where you are the seller for use with get_tx_info_multi or get_tx_info. If all is set to 1 returns an array with TX IDs and whether you are the seller or buyer for the transaction.</td><td align="center">No</td></tr></tbody></table>

`Method:`` `<mark style="color:blue;">`POST`</mark>\
`URL:` [`http://wallexpay.io/api/get_tx_ids`](http://wallexpay.io/api/get_tx_ids)

### **API Response**

A successful call to get the 'get\_tx\_ids' command will give you a result similar to this (JSON):

```json
- Example Unavailable -
```

{% hint style="info" %}
**Note:** If possible, you should use the [Instant Payment Notification (IPN)](https://experience.wallex.global/wallex-pay/merchant-tools/instant-payment-notification-ipn) system to receive notifications about payments rather than using this polled interface.
{% endhint %}
{% endtab %}
{% endtabs %}
