# Collecting a Direct Debit Payment

Source: https://docs.gocardless.com/docs/gc-embed/setting-up-mandates-collecting-payments/collecting-dd-payment

# Collecting a Direct Debit payment

After calling the `Billing Request with Actions` we will now use the mandate ID (`MD123`) from the API response in order to create a Direct Debit payment.

For this reason we'll now call the `Payments` API.

```http
POST https://api.gocardless.com/payments HTTP/1.1
Content-Type: application/json
\,
    "metadata": \,
  \}
\}

HTTP/1.1 201 Created
Location: /payments/PM123
Content-Type: application/json
\,
...
\}
\}
```

```php
\$client->payments()->create([
"params" => [
"amount" => 123,
"currency" => "GBP",
"reference" => "Wine Box",
"charge_date" => "2026-12-31",
"metadata" => [
"internal_order_number" => "ID123"
],
"links" => [
"mandate" => "MD123"
]
]
]);
```

```python
client.payments.create(params=\,
"links": \
\})
```

```ruby
@client.payments.create(
params: \,
links: \
\}
)
```

```java
import com.gocardless.services.PaymentService.PaymentCreateRequest.Currency;

Payment payment = client.payments().create()
.withAmount(123)
.withCurrency(Currency.GBP)
.withReference("Wine Box")
.withChargeDate("2026-12-31")
.withMetadata("internal_order_number", "ID123")
.withLinksMandate("MD123")
.execute();
```

```javascript
const payment = await client.payments.create(\,
links: \,
\});
```

```net
var paymentRequest = new GoCardless.Services.PaymentCreateRequest()
\
\},
Links = new GoCardless.Services.PaymentCreateRequest.PaymentLinks()
\
\};

var paymentResponse = await gocardless.Payments.CreateAsync(paymentRequest);
GoCardless.Resources.Payment payment = paymentResponse.Payment;
```

```go
paymentCreateParams := gocardless.PaymentCreateParams\\,
Links: gocardless.PaymentCreateParamsLinks\,
\}

payment, err := client.Payments.Create(context, paymentCreateParams)
```

```bash
curl -X POST "https://api.gocardless.com/payments" \\
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \\
-H "GoCardless-Version: 2015-07-06" \\
-H "Content-Type: application/json" \\
-d '\,
"metadata": \
\}
\}'
```

Note that the amount needs to be provided in the lowest denomination for the currency (e.g. pence in GBP, cents in EUR).

You can decide to either provide a `charge_date` (needs to be later than the `next_possible_charge_date`, as described in the [mandates API reference](/docs/api-reference/mandate#list-mandates)), or let GoCardless create the payment as soon as possible.

You would then be able to see the date that the payment will be taken by looking at the `charge_date` in the response.

## What's next?

  
#### [Pay By Bank](/docs/gc-embed/setting-up-mandates-collecting-payments/actions-instant-payment)

Request a Pay By Bank using a Billing Request with Actions.

  
#### [Dual Flow](/docs/gc-embed/setting-up-mandates-collecting-payments/actions-dual-flow)

Collect a Pay By Bank and set up a DD mandate in a single flow.