Payments

Introduction to Payments


Create and authorize payment

  1. Create a new payment
  2. Authorize payment using a link
  3. Check payment status

1. Create a new payment

POST /paymentsCreate payment

First step is to create a payment entity in QuickPay

Selected parameters. See more in the API documentation.

Parameter Description Parameter type Data type Required?
order_id Unique order number form string true
currency Currency form string true

Example request:

1
2
3
4
5
6
curl -u ':APIKEY \
     -H 'content-type:application/json' \
     -H 'Accept-Version:v10' \
     -X POST \
     -d '{"order_id":"pm1001","currency":"dkk"}' \
     https://api.quickpay.net/payments

Example response (snippet):

1
2
3
4
5
6
7
8
9
{
  "id":99685196,
  "merchant_id":1234,
  "order_id":"pm1001",
  "type":"Payment",
  "currency":"DKK",
  "state":"initial"
  ...
}
PUT /payments/{id}/linkCreate or update a card link

Next step is to authorize the payment.

The recommended way is to request the QuickPay API for a payment link, where your customer can fill in their card information.

Selected parameters. See more in the API documentation.

Parameter Description Parameter type Data type Required?
id Transaction id path integer true
amount Amount to authorize form integer true

Example request:

1
2
3
4
5
6
curl -u ':APIKEY' \
     -H 'content-type:application/json' \
     -H 'Accept-Version:v10' \
     -X PUT \
     -d '{"amount":1000}' \
     https://api.quickpay.net/payments/99685196/link

Example response:

1
2
3
{
  "url":"https://payment.quickpay.net/payments/b4674ca58c6c8a2afeea105fb1b5ca22293a1dc17fa852afa0495010999c2d00"
}

When your customer has filled in the card information using the link, the payment is now authorized.

No funds are withdrawn from your customer yet.

If you are selling a digital products, you can include "auto_capture":"true" in the payment link request, to capture the payment automatically after the authorize.

If you are selling a physical product, you can capture the payment using POST /payments/{id}/capture when you are ready to ship the product.

3. Check payment status

GET /payments/{id}Get payment

Last step is to check the status of the payment.

This could be on a continue-url, where you render a “Payment successful”-message when the payment is complete.

Example request:

1
2
3
4
5

curl -u ':APIKEY' \
     -H 'content-type:application/json' \
     -H 'Accept-Version:v10' \
     -X GET \
     https://api.quickpay.net/payments/99685196

Example response (snippet):

1
2
3
4
5
6
7
8
9
{
  "id":99685196,
  "merchant_id":1234,
  "order_id":"pm1001",
  "accepted":true,
  "type":"Payment",
  "state":"new"
  ...
}

Related Articles