> For the complete documentation index, see [llms.txt](https://docs.payvalida.com/api-recaudo/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.payvalida.com/api-recaudo/api-recaudo-en/purchase-orders/consult.md).

# Consult

Get the details of a registered order

<figure><img src="https://2646475391-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Ly_b6lZywQ5rYRHAN2H-1525464909%2Fuploads%2FEhSH5bzDL8VOlJRbux65%2Fimage.png?alt=media&amp;token=671f4530-20cb-474b-ab73-53ff53192fea" alt=""><figcaption></figcaption></figure>

{% hint style="success" %}
**Production:** [https://api.payvalida.com/api/v3/porders/{order}](https://api.payvalida.com/api/v3/porders/%7Border%7D)
{% endhint %}

{% hint style="success" %}
**Sandbox:** [https://api-test.payvalida.com/api/v3/porders/{order}](https://api-test.payvalida.com/api/v3/porders/%7Border%7D)
{% endhint %}

{% tabs %}
{% tab title="Request" %}

| Field         | Type                    | Required | Description                                                                                                                                |
| ------------- | ----------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
| order         | string (**pathParam**)  | yes      | Order identifier, unique for the merchant.                                                                                                 |
| merchant      | string (**queryParam**) | yes      | Merchant identifier in Payvalida.                                                                                                          |
| checksum      | string (**queryParam**) | yes      | Verification string using SHA512 (`order + merchant + FIXED_HASH`).                                                                        |
| aditionalinfo | string (**queryParam**) | no       | Value used to get additional information in the `ADITIONAL_INFO` field inside `DATA` in the response. Currently only `cuspse` can be sent. |
| {% endtab %}  |                         |          |                                                                                                                                            |

{% tab title="Request (example)" %}
{% code overflow="wrap" %}

```bash
curl --location --request GET 'https://api-test.payvalida.com/api/v3/porders/9022932?merchant=kuanto&checksum=7CA708050F7F5B3EB5B9FD271D375DCEFCA71BDEFDF91C96A4C38F906EFA133E95675D332279C89F999B1909ECF2EBCA7EC177ACED6EA56D1A72244145E377B7'
```

{% endcode %}
{% endtab %}

{% tab title="Request (example with aditionalinfo)" %}
{% code overflow="wrap" %}

```bash
curl --location --request GET 'https://api-test.payvalida.com/api/v3/porders/prue303459?merchant=kuanto&checksum=YOUR_CHECKSUM&aditionalinfo=cuspse'
```

{% endcode %}
{% endtab %}

{% tab title="Response" %}

| Field                  | Structure            | Type   | Description                                                                                                                                                                                                |
| ---------------------- | -------------------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| CODE                   | -                    | string | Response code. 0000 means OK.                                                                                                                                                                              |
| DESC                   | -                    | string | Response description.                                                                                                                                                                                      |
| DATA                   | -                    | -      | Response data.                                                                                                                                                                                             |
| CURRENCY               | DATA                 | string | Payment currency.                                                                                                                                                                                          |
| NOTIFICATION\_RESPONSE | DATA                 | string | Merchant's response after the payment notification was sent.                                                                                                                                               |
| UDPATE\_DATE           | DATA                 | string | Date of the last update to the order.                                                                                                                                                                      |
| CREATION\_DATE         | DATA                 | string | Order creation date.                                                                                                                                                                                       |
| STATE                  | DATA                 | string | Current order status.                                                                                                                                                                                      |
| PAYMNENT\_METHOD       | DATA                 | string | Payment method chosen for the order.                                                                                                                                                                       |
| EMAIL                  | DATA                 | string | Customer email registered in the order.                                                                                                                                                                    |
| LIFE\_TIME             | DATA                 | string | Remaining time before expiration, in hours.                                                                                                                                                                |
| ORDER                  | DATA                 | string | Order number.                                                                                                                                                                                              |
| CODE                   | DATA                 | int    | Unique order code in Payvalida.                                                                                                                                                                            |
| AMOUNT                 | DATA                 | string | Order amount.                                                                                                                                                                                              |
| DESCRIPTION            | DATA                 | string | Order description.                                                                                                                                                                                         |
| REFERENCE              | DATA                 | string | Order reference number.                                                                                                                                                                                    |
| checkout               | DATA                 | string | Checkout link generated for this order.                                                                                                                                                                    |
| TRANSACTION            | DATA                 | -      | Additional transaction information, if the order was approved and paid by credit card.                                                                                                                     |
| DATE                   | DATA-TRANSACTION     | string | Transaction date.                                                                                                                                                                                          |
| RESPONSE\_CODE         | DATA-TRANSACTION     | string | Transaction processing response.                                                                                                                                                                           |
| QUOTES                 | DATA-TRANSACTION     | string | Number of installments in which the payment was made.                                                                                                                                                      |
| ACCOUNT\_TYPE          | DATA-TRANSACTION     | string | Type of account used for the payment.                                                                                                                                                                      |
| CUS                    | DATA-TRANSACTION     | string | Unique transaction identifier code from the collection network.                                                                                                                                            |
| INVOICE\_NUMBER        | DATA-TRANSACTION     | string | Generated invoice number.                                                                                                                                                                                  |
| FRANCHISE              | DATA-TRANSACTION     | string | Card franchise used for the payment.                                                                                                                                                                       |
| RESPONSE               | DATA-TRANSACTION     | string | Payment processor response.                                                                                                                                                                                |
| CARD\_NUMBER           | DATA-TRANSACTION     | string | CVV1 or last 4 digits of the card if the payment was made by credit card.                                                                                                                                  |
| ERROR                  | DATA-TRANSACTION     | string | Error or approval message from the purchase.                                                                                                                                                               |
| ADITIONAL\_INFO        | DATA                 | object | This object is only sent when the `aditionalinfo` field is present in the request.                                                                                                                         |
| CUS                    | DATA-ADITIONAL\_INFO | string | If the payment method was PSE and the order was approved, this field contains the transaction's CUS code. Otherwise, if `aditionalinfo` is sent but the previous conditions are not met, it arrives empty. |
| {% endtab %}           |                      |        |                                                                                                                                                                                                            |

{% tab title="Response (example)" %}
{% code overflow="wrap" %}

```json
{
    "CODE": "0000",
    "DESC": "OK",
    "DATA": {
        "CURRENCY": "COP",
        "NOTIFICATION_RESPONSE": "{\"CODE\":\"0002\",\"DESC\":\"Checksum diferente\"}",
        "UDPATE_DATE": "2020-11-27 15:29:35",
        "CREATION_DATE": "2020-11-27 15:20:55",
        "STATE": "APROBADA",
        "PAYMNENT_METHOD": "Tarjeta de Credito",
        "EMAIL": "someone@example.com",
        "LIFE_TIME": "75h",
        "ORDER": "9022932",
        "CODE": 1934038,
        "AMOUNT": "200.00",
        "DESCRIPTION": "TEST TRANSACTION AT",
        "REFERENCE": "43568287",
        "checkout": "sandbox-checkout.payvalida.com?token=YOUR_CHECKOUT_TOKEN",
        "TRANSACTION": {
            "DATE": "2020-11-27T20:28:58Z",
            "RESPONSE_CODE": "APROBADA",
            "QUOTES": "2",
            "ACCOUNT_TYPE": "CREDITO",
            "CUS": "_12757866",
            "INVOICE_NUMBER": "12757866",
            "FRANCHISE": "MasterCard",
            "RESPONSE": "Aprobada",
            "CARD_NUMBER": "************8783",
            "ERROR": ""
        }
    }
}
```

{% endcode %}
{% endtab %}

{% tab title="Response (example with aditionalinfo)" %}

```json
{
  "CODE": "0000",
  "DESC": "OK",
  "DATA": {
    "CURRENCY": "COP",
    "NOTIFICATION_RESPONSE": "Error al procesar los datos",
    "UDPATE_DATE": "2022-02-07 10:48:21",
    "CREATION_DATE": "2022-02-07 10:45:57",
    "STATE": "APROBADA",
    "PAYMNENT_METHOD": "PSE",
    "EMAIL": "someone@example.com",
    "LIFE_TIME": "445h",
    "ORDER": "prue303459",
    "CODE": 2202776,
    "AMOUNT": "120.00",
    "DESCRIPTION": "prueb040",
    "REFERENCE": "80011572",
    "checkout": "sandbox-checkout.payvalida.com?token=YOUR_CHECKOUT_TOKEN",
    "TRANSACTION": {},
    "ADITIONAL_INFO": {
      "CUS": "2539443"
    }
  }
}
```

{% endtab %}
{% endtabs %}

#### Path Parameters

{% hint style="warning" %}
If the **aditionalinfo** field is not sent in the request, the `ADITIONAL_INFO` field will not appear in the response. If it is sent, `ADITIONAL_INFO` will arrive with an empty `CUS` field by default, except for a successful PSE payment, in which case the CUS number is returned.
{% endhint %}

{% hint style="info" %}
The merchant identifier (`merchant`) and the `FIXED_HASH` are provided when you create an account on our platform.
{% endhint %}

### Code examples <a href="#user-content-code-examples" id="user-content-code-examples"></a>

#### Go

```go
package main
import (
  "fmt"
  "net/http"
  "io/ioutil"
)
func main() {
  url := "https://api-test.payvalida.com/api/v3/porders/9022932?merchant=kuanto&checksum=7CA708050F7F5B3EB5B9FD271D375DCEFCA71BDEFDF91C96A4C38F906EFA133E95675D332279C89F999B1909ECF2EBCA7EC177ACED6EA56D1A72244145E377B7"
  method := "GET"
  client := &http.Client {
  }
  req, err := http.NewRequest(method, url, nil)
  if err != nil {
    fmt.Println(err)
    return
  }
  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := ioutil.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}
```

#### PHP

```php
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api-test.payvalida.com/api/v3/porders/9022932?merchant=kuanto&checksum=7CA708050F7F5B3EB5B9FD271D375DCEFCA71BDEFDF91C96A4C38F906EFA133E95675D332279C89F999B1909ECF2EBCA7EC177ACED6EA56D1A72244145E377B7",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
```

#### Java

```java
OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
Request request = new Request.Builder()
  .url("https://api-test.payvalida.com/api/v3/porders/9022932?merchant=kuanto&checksum=7CA708050F7F5B3EB5B9FD271D375DCEFCA71BDEFDF91C96A4C38F906EFA133E95675D332279C89F999B1909ECF2EBCA7EC177ACED6EA56D1A72244145E377B7")
  .method("GET", null)
  .build();
Response response = client.newCall(request).execute();
```

#### Python

```python
import http.client
import mimetypes
conn = http.client.HTTPSConnection("api-test.payvalida.com")
payload = ''
headers = {}
conn.request("GET", "/api/v3/porders/9022932?merchant=kuanto&checksum=7CA708050F7F5B3EB5B9FD271D375DCEFCA71BDEFDF91C96A4C38F906EFA133E95675D332279C89F999B1909ECF2EBCA7EC177ACED6EA56D1A72244145E377B7", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
```

#### JavaScript <a href="#user-content-javascript" id="user-content-javascript"></a>

```javascript
var myHeaders = new Headers();
var requestOptions = {
  method: 'GET',
  headers: myHeaders,
  redirect: 'follow'
};
fetch("https://api-test.payvalida.com/api/v3/porders/9022932?merchant=kuanto&checksum=7CA708050F7F5B3EB5B9FD271D375DCEFCA71BDEFDF91C96A4C38F906EFA133E95675D332279C89F999B1909ECF2EBCA7EC177ACED6EA56D1A72244145E377B7", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
```
