Credit Card Authorizations Management

Authorizations allow you to allocate a given amount in a credit card to be captured later. You can create authorizations via the checkout API or via the Prows 2 API.

Capture

Request a capture of an authorization, that is a settlement of the payment transaction. The authorization must be accepted first.

You can do a partial capture. Up to 10 capture requests can be made provided they do not exceed the total authorized amount and no release has been called upon the specified authorization. If your use case is to do a partial capture and release the remaining funds make sure you issue the release first.

If the amount parameter is omitted in the CaptureRequest, all the authorized amount is captured.

Request POST /api/v2/authorizations/id/capture
URL params authorization id
Data params CaptureRequest
Returns Operation
Click here for an example
  curl -X POST https://services.wallet.pt/api/v2/authorizations/f7229128-ccca-4950-91fb-82971cb98ebb/capture \
  -H "Content-Type: application/json" \
  -H "Authorization: WalletPT 7a0eb41208209639eda9bf765b6cb04d59fb9e34" \
  -d '{"amount": 1.1}'
Returns
{
    "card": {
        "token": "D31400C2-F323-11EC-AE3A-E5F867E7598C",
        "last4": "0015",
        "type": "mastercard",
        "valdate": "01/2023",
        "expired": false
    },
    "cardsecure_url_confirm": "https://wallet.pt/checkout/48e8e52b-3a71-41cc-802e-d3e3b4ec3c12/end",
    "cardsecure_url_cancel": "https://wallet.pt/checkout/48e8e52b-3a71-41cc-802e-d3e3b4ec3c12/fail",
    "currency": "EUR",
    "id": "4a00fcbc-f324-11ec-aa05-c39c67e7598c",
    "ipaddress": "10.188.160.1",
    "type": "CAPTURE",
    "channel": "WEBSITE",
    "modified_date": "2022-06-23T18:42:57+0000",
    "notes": "",
    "user_notes": "",
    "cardsecure_url_redirect": "https://wallet.pt/3ds/f7229128-ccca-4950-91fb-82971cb98ebb",
    "items": [
        {
            "descr": "Um livro",
            "ref": "123",
            "name": "Livro",
            "qt": 1
        }
    ],
    "refundable": true,
    "fee": -0.02,
    "amount": 1.1,
    "amount_net": 1.08,
    "client": {
        "name": "some name",
        "email": "foo@bar.com",
        "address": {
            "address": "some street",
            "city": "lisboa",
            "postalcode": "1100-000",
            "country": "PT"
        }
    },
    "merchant": {
        "id": "73",
        "name": "Produção de Electrónica e Software",
        "email": ""
    },
    "date": "2022-06-23T18:42:52+0000",
    "parent": "f7229128-ccca-4950-91fb-82971cb98ebb",
    "method": "CC",
    "status": "COMPLETED",
    "expires": "2022-07-23T18:39:48+0000"
}


A callback will be sent in case of failure or success with a reference to the created checkout (checkout_id) if exists and type of operation. In this case is “CAPTURE”.

You can pass a request_id to track this request. Check the Idempotency page.

Release

Request a release of an authorization. The authorization must be accepted first.

You can do partial releases multiple times provided the total released amount does not exceed the authorized amount. You can’t perform a release after a capture has been made.

If the amount parameter is omitted in the ReleaseRequest, all the authorized amount is released.

Request POST /api/v2/authorizations/id/release
URL params authorization id
Data params ReleaseRequest
Returns Operation
Click here for an example
  curl -X POST https://services.wallet.pt/api/v2/authorizations/f7229128-ccca-4950-91fb-82971cb98ebb/release \
  -H "Content-Type: application/json" \
  -H "Authorization: WalletPT 7a0eb41208209639eda9bf765b6cb04d59fb9e34" \
  -d '{"amount": 1.1}'
Returns
{
    "card": {
        "token": "D31400C2-F323-11EC-AE3A-E5F867E7598C",
        "last4": "0015",
        "type": "mastercard",
        "valdate": "01/2023",
        "expired": false
    },
    "cardsecure_url_confirm": "https://wallet.pt/checkout/48e8e52b-3a71-41cc-802e-d3e3b4ec3c12/end",
    "cardsecure_url_cancel": "https://wallet.pt/checkout/48e8e52b-3a71-41cc-802e-d3e3b4ec3c12/fail",
    "currency": "EUR",
    "id": "e6641874-f323-11ec-80a7-be9c67e7598c",
    "ipaddress": "10.188.160.1",
    "type": "RELEASE",
    "channel": "WEBSITE",
    "modified_date": "2022-06-23T18:40:09+0000",
    "notes": "",
    "user_notes": "",
    "cardsecure_url_redirect": "https://wallet.pt/3ds/f7229128-ccca-4950-91fb-82971cb98ebb",
    "items": [],
    "refundable": false,
    "fee": 0,
    "amount": 1.1,
    "amount_net": 1.1,
    "client": {
        "name": "some name",
        "email": "foo@bar.com",
        "address": {
            "address": "some street",
            "city": "lisboa",
            "postalcode": "1100-000",
            "country": "PT"
        }
    },
    "date": "2022-06-23T18:40:05+0000",
    "parent": "f7229128-ccca-4950-91fb-82971cb98ebb",
    "method": "CC",
    "status": "COMPLETED",
    "expires": "2022-07-23T18:39:48+0000"
}


A callback will be sent in case of failure or success with a reference to the created checkout (checkout_id) if exists and type of operation. In this case is “RELEASE”.

You can pass a request_id to track this request. Check the Idempotency page.

Get authorizations

Gets all authorizations with optional date range and pagination.

Parameter When to use
id Authorization id to search
startdate Search operations since date (yyy-mm-dd format)
enddate Search operations until date (yyyy-mm-dd format)
number4 Last 4 digits from credit card
offset Page number
limit How many records per page to return (the maximum accepted value is “30”)
ext_invoiceid merchant reference for this payment
Request GET /api/v2/authorizations
Query params startdate=[string], enddate=[string], limit=[int], offset=[int], ext_invoiceid=[string], number4=[int]
Data params none
Returns Operation Array
Click here for an example
  curl https://services.wallet.pt/api/v2/authorizations/?limit=2 \
  -H "Content-Type: application/json" \
  -H "Authorization: WalletPT 7a0eb41208209639eda9bf765b6cb04d59fb9e34"
Returns
{
    "total": 18,
    "elements": [
        {
            "card": {
                "token": "D31400C2-F323-11EC-AE3A-E5F867E7598C",
                "last4": "0015",
                "type": "mastercard",
                "valdate": "01/2023",
                "expired": false
            },
            "cardsecure_url_confirm": "https://wallet.pt/checkout/48e8e52b-3a71-41cc-802e-d3e3b4ec3c12/end",
            "cardsecure_url_cancel": "https://wallet.pt/checkout/48e8e52b-3a71-41cc-802e-d3e3b4ec3c12/fail",
            "currency": "EUR",
            "id": "f7229128-ccca-4950-91fb-82971cb98ebb",
            "ipaddress": "10.188.160.1",
            "type": "AUTH",
            "channel": "WEBSITE",
            "modified_date": "2022-06-23T18:39:48+0000",
            "notes": "",
            "user_notes": "",
            "cardsecure_url_redirect": "https://wallet.pt/3ds/f7229128-ccca-4950-91fb-82971cb98ebb",
            "items": [
                {
                    "descr": "Um livro",
                    "ref": "123",
                    "name": "Livro",
                    "qt": 1
                }
            ],
            "refundable": false,
            "fee": -0.15,
            "amount": 10,
            "amount_net": 9.85,
            "client": {
                "name": "some name",
                "email": "foo@bar.com",
                "address": {
                    "address": "some street",
                    "city": "lisboa",
                    "postalcode": "1100-000",
                    "country": "PT"
                }
            },
            "captures": [
                {
                    "card": {
                        "token": "D31400C2-F323-11EC-AE3A-E5F867E7598C",
                        "last4": "0015",
                        "type": "mastercard",
                        "valdate": "01/2023",
                        "expired": false
                    },
                    "currency": "EUR",
                    "id": "4a00fcbc-f324-11ec-aa05-c39c67e7598c",
                    "ipaddress": "10.188.160.1",
                    "type": "CAPTURE",
                    "channel": "WEBSITE",
                    "modified_date": "2022-06-23T18:42:57+0000",
                    "notes": "",
                    "user_notes": "",
                    "items": [
                        {
                            "descr": "Um livro",
                            "ref": "123",
                            "name": "Livro",
                            "qt": 1
                        }
                    ],
                    "refundable": true,
                    "fee": -0.02,
                    "amount": 1.1,
                    "amount_net": 1.08,
                    "client": {
                        "name": "some name",
                        "email": "foo@bar.com",
                        "address": {
                            "address": "some street",
                            "city": "lisboa",
                            "postalcode": "1100-000",
                            "country": "PT"
                        }
                    },
                    "merchant": {
                        "id": "73",
                        "name": "Produção de Electrónica e Software",
                        "email": ""
                    },
                    "date": "2022-06-23T18:42:52+0000",
                    "parent": "f7229128-ccca-4950-91fb-82971cb98ebb",
                    "method": "CC",
                    "status": "COMPLETED",
                    "expires": "2022-07-23T18:39:48+0000"
                }
            ],
            "releases": [
                {
                    "card": {
                        "token": "D31400C2-F323-11EC-AE3A-E5F867E7598C",
                        "last4": "0015",
                        "type": "mastercard",
                        "valdate": "01/2023",
                        "expired": false
                    },
                    "currency": "EUR",
                    "id": "e6641874-f323-11ec-80a7-be9c67e7598c",
                    "ipaddress": "10.188.160.1",
                    "type": "RELEASE",
                    "channel": "WEBSITE",
                    "modified_date": "2022-06-23T18:40:09+0000",
                    "notes": "",
                    "user_notes": "",
                    "items": [],
                    "refundable": false,
                    "fee": 0,
                    "amount": 1.1,
                    "amount_net": 1.1,
                    "date": "2022-06-23T18:40:05+0000",
                    "parent": "f7229128-ccca-4950-91fb-82971cb98ebb",
                    "method": "CC",
                    "status": "COMPLETED",
                    "expires": "2022-07-23T18:39:48+0000"
                }
            ],
            "date": "2022-06-23T18:30:15+0000",
            "method": "CC",
            "status": "COMPLETED",
            "expires": "2022-07-23T18:39:48+0000"
        },
        {
            "card": {
                "token": "73B13BE8-F316-11EC-B43F-E5F867E7598C",
                "last4": "0015",
                "type": "mastercard",
                "valdate": "01/2023",
                "expired": false
            },
            "cardsecure_url_confirm": "https://wallet.pt/checkout/03c89dfc-1dd4-4ce8-80ba-ca24bf5148b8/end",
            "cardsecure_url_cancel": "https://wallet.pt/checkout/03c89dfc-1dd4-4ce8-80ba-ca24bf5148b8/fail",
            "currency": "EUR",
            "id": "c180f31c-c30a-419a-8aea-aa1299d9259b",
            "ipaddress": "10.188.160.1",
            "ext_invoiceid": "A1111112aaaaaaaaaa",
            "ext_email": "employeename@email",
            "ext_customerid": "customerrrrrrrrrrrrrrrr",
            "ext_employee": "employeename2",
            "type": "AUTH",
            "channel": "WEBSITE",
            "modified_date": "2022-06-23T17:04:06+0000",
            "notes": "",
            "user_notes": "notes tesfsaf",
            "cardsecure_url_redirect": "https://wallet.pt/3ds/c180f31c-c30a-419a-8aea-aa1299d9259b",
            "items": [
                {
                    "amount": 3.5,
                    "descr": "Checkout Auth",
                    "ref": "515513000",
                    "name": "Checkout Auth",
                    "qt": 1
                },
                {
                    "amount": 0.5,
                    "descr": "Wallet Policia",
                    "ref": "515513002",
                    "name": "Wallet Policia",
                    "qt": 1
                }
            ],
            "refundable": false,
            "fee": -0.07,
            "amount": 4.4,
            "amount_net": 4.33,
            "client": {
                "name": "John Santos",
                "email": "jsantos@email.com",
                "address": {
                    "address": "Av. Fontes Pereira de Melo",
                    "city": "Lisboa",
                    "postalcode": "1100-000",
                    "country": "PT"
                }
            },
            "captures": [
                {
                    "card": {
                        "token": "73B13BE8-F316-11EC-B43F-E5F867E7598C",
                        "last4": "0015",
                        "type": "mastercard",
                        "valdate": "01/2023",
                        "expired": false
                    },
                    "currency": "EUR",
                    "id": "9325299e-f316-11ec-9ccf-798867e7598c",
                    "ipaddress": "10.188.160.1",
                    "ext_invoiceid": "A1111112aaaaaaaaaa",
                    "ext_email": "employeename@email",
                    "ext_customerid": "customerrrrrrrrrrrrrrrr",
                    "ext_employee": "employeename2",
                    "type": "CAPTURE",
                    "channel": "WEBSITE",
                    "modified_date": "2022-06-23T17:04:45+0000",
                    "notes": "",
                    "user_notes": "notes tesfsaf",
                    "items": [
                        {
                            "amount": 3.5,
                            "descr": "Checkout Auth",
                            "ref": "515513000",
                            "name": "Checkout Auth",
                            "qt": 1
                        },
                        {
                            "amount": 0.5,
                            "descr": "Wallet Policia",
                            "ref": "515513002",
                            "name": "Wallet Policia",
                            "qt": 1
                        }
                    ],
                    "refundable": true,
                    "fee": -0.02,
                    "amount": 1.1,
                    "amount_net": 1.08,
                    "client": {
                        "name": "John Santos",
                        "email": "jsantos@email.com",
                        "address": {
                            "address": "Av. Fontes Pereira de Melo",
                            "city": "Lisboa",
                            "postalcode": "1100-000",
                            "country": "PT"
                        }
                    },
                    "merchant": {
                        "id": "73",
                        "name": "Produção de Electrónica e Software",
                        "email": ""
                    },
                    "date": "2022-06-23T17:04:42+0000",
                    "parent": "c180f31c-c30a-419a-8aea-aa1299d9259b",
                    "method": "CC",
                    "status": "COMPLETED",
                    "expires": "2022-07-23T17:04:06+0000"
                }
            ],
            "releases": [],
            "date": "2022-06-23T17:03:18+0000",
            "method": "CC",
            "status": "COMPLETED",
            "expires": "2022-07-23T17:04:06+0000"
        }
    ]
}


Get authorization

Gets the current status of a single authorization with “captures” and “releases” details.

Request GET /api/v2/authorizations/id
URL params authorization id
Data params none
Returns Operation
Click here for an example
  curl https://services.wallet.pt/api/v2/authorizations/f7229128-ccca-4950-91fb-82971cb98ebb \
  -H "Content-Type: application/json" \
  -H "Authorization: WalletPT 7a0eb41208209639eda9bf765b6cb04d59fb9e34"
Returns
{
    "card": {
        "token": "D31400C2-F323-11EC-AE3A-E5F867E7598C",
        "last4": "0015",
        "type": "mastercard",
        "valdate": "01/2023",
        "expired": false
    },
    "cardsecure_url_confirm": "https://wallet.pt/checkout/48e8e52b-3a71-41cc-802e-d3e3b4ec3c12/end",
    "cardsecure_url_cancel": "https://wallet.pt/checkout/48e8e52b-3a71-41cc-802e-d3e3b4ec3c12/fail",
    "currency": "EUR",
    "id": "f7229128-ccca-4950-91fb-82971cb98ebb",
    "ipaddress": "10.188.160.1",
    "type": "AUTH",
    "channel": "WEBSITE",
    "modified_date": "2022-06-23T18:39:48+0000",
    "notes": "",
    "user_notes": "",
    "cardsecure_url_redirect": "https://wallet.pt/3ds/f7229128-ccca-4950-91fb-82971cb98ebb",
    "items": [
        {
            "descr": "Um livro",
            "ref": "123",
            "name": "Livro",
            "qt": 1
        }
    ],
    "refundable": false,
    "fee": -0.15,
    "amount": 10,
    "amount_net": 9.85,
    "client": {
        "name": "some name",
        "email": "foo@bar.com",
        "address": {
            "address": "some street",
            "city": "lisboa",
            "postalcode": "1100-000",
            "country": "PT"
        }
    },
    "captures": [
        {
            "card": {
                "token": "D31400C2-F323-11EC-AE3A-E5F867E7598C",
                "last4": "0015",
                "type": "mastercard",
                "valdate": "01/2023",
                "expired": false
            },
            "currency": "EUR",
            "id": "4a00fcbc-f324-11ec-aa05-c39c67e7598c",
            "ipaddress": "10.188.160.1",
            "type": "CAPTURE",
            "channel": "WEBSITE",
            "modified_date": "2022-06-23T18:42:57+0000",
            "notes": "",
            "user_notes": "",
            "items": [
                {
                    "descr": "Um livro",
                    "ref": "123",
                    "name": "Livro",
                    "qt": 1
                }
            ],
            "refundable": true,
            "fee": -0.02,
            "amount": 1.1,
            "amount_net": 1.08,
            "client": {
                "name": "some name",
                "email": "foo@bar.com",
                "address": {
                    "address": "some street",
                    "city": "lisboa",
                    "postalcode": "1100-000",
                    "country": "PT"
                }
            },
            "merchant": {
                "id": "73",
                "name": "Produção de Electrónica e Software",
                "email": ""
            },
            "date": "2022-06-23T18:42:52+0000",
            "parent": "f7229128-ccca-4950-91fb-82971cb98ebb",
            "method": "CC",
            "status": "COMPLETED",
            "expires": "2022-07-23T18:39:48+0000"
        }
    ],
    "releases": [
        {
            "card": {
                "token": "D31400C2-F323-11EC-AE3A-E5F867E7598C",
                "last4": "0015",
                "type": "mastercard",
                "valdate": "01/2023",
                "expired": false
            },
            "currency": "EUR",
            "id": "e6641874-f323-11ec-80a7-be9c67e7598c",
            "ipaddress": "10.188.160.1",
            "type": "RELEASE",
            "channel": "WEBSITE",
            "modified_date": "2022-06-23T18:40:09+0000",
            "notes": "",
            "user_notes": "",
            "items": [],
            "refundable": false,
            "fee": 0,
            "amount": 1.1,
            "amount_net": 1.1,
            "date": "2022-06-23T18:40:05+0000",
            "parent": "f7229128-ccca-4950-91fb-82971cb98ebb",
            "method": "CC",
            "status": "COMPLETED",
            "expires": "2022-07-23T18:39:48+0000"
        }
    ],
    "date": "2022-06-23T18:30:15+0000",
    "method": "CC",
    "status": "COMPLETED",
    "expires": "2022-07-23T18:39:48+0000"
}
  


CaptureRequest

Field Type In/Out Mandatory Description Validations
amount float I N amount to capture min=0.2
ext_customerid string I N Merchant customer ID (for reference maxlen=45
ext_email string I N Customer email (for reference) maxlen=100
ext_invoiceid string I N Merchant transaction reference maxlen=45
ext_employee string I N employee name (max 45 chars) maxlen=45
notes string I N Merchant notes maxlen=255

ReleaseRequest

Field Type In/Out Mandatory Description  
amount float I N amount to capture min=0.2
ext_customerid string I N Merchant customer ID (for reference) maxlen=45
ext_email string I N Customer email (for reference) maxlen=100
ext_invoiceid string I N Merchant transaction reference maxlen=45
ext_employee string I N employee name (max 45 chars) maxlen=45
notes string I N Merchant notes maxlen=255