Giropay

Giropay is an online payment method used in Germany.

About Giropay

Giropay lets you accept a direct online transfer from the customer’s bank account.

The customer confirms the payment with their PIN (Personal Identification Number) and TAN (Transaction Authentication Number).

After a successful payment, you receive a payment guarantee.

The credit for the payment appears in your account on the next working day.

Accept a Giropay payment

To accept a Giropay payment, follow the steps below.

When testing, do not use real customer data. Use the test data prepared by Unzer.

Step 1: Create a giropay resource

Make an empty-body POST call to types/giropay:

POST https://api.unzer.com/v1/types/giropay/

Body: {}
{
  "id": "s-gro-biqupm9wuk8y",
  "method": "giropay",
  "recurring": false,
  "geoLocation": {
    "clientIp": "115.77.189.143",
    "countryCode": "VN"
  }
}
Property Type Description
id String The ID of the giropay resource that you just created.
method String The payment method.
recurring Boolean Indicates if this is a recurring payment.
clientIp String The IP address of the device used for the payment.
countryCode String The country associated with clientIp, displayed in the ISO 3166-1 alpha-2 format.

Step 2: Make a charges call

Make a POST call to payments/charges with the following parameters in the request body:

Parameter Required Type Description Example
amount Yes Number The charged amount. 12.4500
currency Yes String The transaction currency, in the ISO 4217 alpha-3 format. EUR
returnURL Yes String The URL to redirect the customer to after the payment is completed. https://www.unzer.com
typeId Yes String The ID of the related payment type resource. s-gro-svyymybtwafu
POST https://api.unzer.com/v1/payments/charges

{
  "amount" : "12.4500",
  "currency" : "EUR",
  "returnUrl" : "https://www.unzer.com",
  "resources" : {
    "typeId" : "s-gro-svyymybtwafu"
  }
}
{
    "id": "s-chg-1",
    "isSuccess": false,
    "isPending": true,
    "isError": false,
    "redirectUrl": "https://payment.unzer.com/giropay/3849234023942354935353405234320423",
    ...
}
Property Type Description
id String The transaction’s unique ID.
isSuccess Boolean Set to true if the transaction was successful.
isPending Boolean Set to true if the transaction is pending
(e.g. if a redirect to an external system is required).
isError Boolean Set to true if an error occurs.
redirectUrl String The URL where the customer completes the payment.

Step 3: Forward the customer to the redirect URL

After you charge the giropay resource, implement the following flow:

  1. Redirect the customer to the redirectURL.
  2. The customer is forwarded to the giropay payment page.
  3. After a successful payment, the customer is redirected to the returnURL that you specified in the charges call (Step 2).

Step 4: Check the payment status

After the customer is redirected to the returnUrl, check the status of the payment.

Make a GET call with the following parameters in the request path:

Parameter Required Type Description Example
resource_ID Yes String The returned ID of the giropay resource that you created in Step 1. s-gro-biqupm9wuk8y
transaction_ID Yes String The transaction’s unique ID that you received in Step 2. s-chg-1
GET https://api.unzer.com/v1/payments/{resource_ID}>/charges/{transaction_ID}
{
    "id": "s-chg-1",
    "isSuccess": true,
    "isPending": false,
    "isError": false,
    "redirectUrl": "",
     ...
}