# Retrieve a payment

Source: https://developers.swell.is/backend-api/payments/retrieve-a-payment

Retrieve an existing payment using the ID that was returned when created.

## Arguments

- `id` (objectId, required): The id of the payment to retrieve.
- `expand` (string): Expanding link fields and child collections is performed using the expand argument.

  - For example, `expand=account` would return a related customer account if one exists.

  When the field represents a collection, you can specify the query limit.

  - For example, `expand=variants:10` would return up to 10 records of the variants collection.

  See [expanding ](https://developers.swell.is/backend-api/querying/expanding)for more details.
- `fields` (string): Return only the specified fields in the result. For example `fields=name,slug` would return only the fields `name` and `slug` in the response. Supports nested object and array fields using dot-notation.

  - For example, `items.product_id`. The category `id` is always returned.
- `include` (string): Include one or more arbitrary queries in the response, possibly related to the main query.

  See [including ](https://developers.swell.is/backend-api/querying/including)for more details.

## Example request

`GET /payments/:id`

**cURL**

```bash
$ curl https://api.swell.store/payments/5cae685b20a54174dd968afa \
  -u store-id:secret-key
```

**Node**

```javascript
const { swell } = require('swell-node');
swell.init('store-id', 'secret-key');

await swell.get('/payments/{id}', {
  id: '5cae685b20a54174dd968afa',
});
```

**PHP**

```php
<?php $swell = new \Swell\Client('store-id', 'secret-key');

$swell->get('/payments/{id}', [
  'id' => '5cae685b20a54174dd968afa',
]);
```

## Example response

```json
{
  "id": "5cae685b20a54174dd968afa",
  "account_id": "5c899d4f7d7920749638dc4e",
  "amount": 50,
  "amount_refundable": 50,
  "authorized": true,
  "captured": true,
  "card": {
    "brand": "Visa",
    "last4": "4242",
    "exp_month": 10,
    "exp_year": 2029,
    "token": "card_XfqLq5nRdOdu7vTvoeKufafN",
    "cvc_check": "pass",
    "zip_check": "pass",
    "address_check": "pass"
  },
  "currency": "USD",
  "date_created": "2019-04-01T00:00:00.000Z",
  "date_updated": "2019-04-01T00:00:00.000Z",
  "gateway": "stripe",
  "method": "card",
  "number": "1947367",
  "order_id": "5cae685b20a54174dd968077",
  "status": "success",
  "success": true,
  "transaction_id": "ch_1XNoXdEAeofUkt5SrbA6Swow"
}
```
