Edit on GitHub

Charge Subscriber

The charge subscriber API call will charge a specified subscriber ID.

Request Headers

The request endpoint is: https://api.scanpay.dk/v1/subscribers/$id/charge, where $id is the subscriber ID that you want to charge. The following HTTP request headers are required:

HTTP/1.1 headers Description
Authorization: Basic MTE1MzpZSFpJVUdRdzZOa0NJWWEzbUc2Q1djZ1NobmwxM3h1STdPREZVWXVNeTBqNzkwUTZUaHdCRWp4ZldGWHdKWjBX
HTTP Basic authentication. Read more.
Idempotency-Key: xM3h1STdPREZVWXVNeTBqNzkwUTZUaHdCRWp4ZldGWHdKWjBX
Sending multiple requests with the same the body and idempotency key will always give the same response and response code. To ensure the validity of the response, however, you must check for the Idempotency-Status header.

Request Fields

All request fields are listed below. Note that if the billing address and/or shipping address is unspecified, they will default to the addresses specified in the subscriber.

JSON fields Description
"orderid": "123" A unique ID that you choose. Never reuse IDs or your synchronization may behave in unexpected ways.
"items": [
    {
        "name": "iPhone 8 64GB Grå",
        "quantity": 2,
        "total": "12998 DKK",
        "sku": "sjk23"
    },
    {
        "name": "Grønt iPhone cover",
        "total": "399.9986 DKK"
    }
]
An array with items.
  • name: The name of the item.
  • quantity: The number of items (integer).
  • total: The line total (i.e. unit-price x quantity) with an ISO 4217 currency code. This is required.
  • sku: A SKU for this particular product.
In this example the grand total is 13397.9986 DKK. Most acquires only support 2 digits after the decimal point. If this is the case we will truncate to 13397.99.
"billing": {
    "name": "Øjvind Jakobsen",
    "company": "Karen Blixen Museet ApS",
    "vatin": "DK14915508",
    "gln": "5790002195341",
    "email": "øjvind@blixen.dk",
    "phone": "+45 45571057",
    "address": ["Rungsted Strandvej 111"],
    "city": "Rungsted Kyst",
    "zip": "2960",
    "state": "Hovedstaden",
    "country": "DK"
},
"shipping": {
    "name": "Thomas Fasti Dinesen",
    "company": "Karen Blixen Museet ApS",
    "email": "thomas@dinesen.dk",
    "phone": "0045 45571057",
    "address": [
        "Att. Thomas Fasti Dinesen",
        "Rungsted Strandvej 111"
    ],
    "city": "Rungsted Kyst",
    "zip": "2960",
    "state": "",
    "country": "DK"
}
Customer billing and shipping address.
  • name: The full name.
  • company: Legal company name.
  • vatin: EU VAT identification number.
  • gln: Global Location Number or European Article Numbering (EAN-number).
  • email: E-mail address.
  • phone: Phone number with country prefix.
  • address: An address array where each element is a new line.
  • zip: Postal code.
  • city: City.
  • state: State or region.
  • country: Two-letter country code (ISO 3166-1).
"autocapture": true Automatically capture the payment. Default is true.

Response Headers

HTTP/1.1 headers Description
Idempotency-Status: OK Response header to ensure that the idempotency key has been considered.

Response

Successful responses have a 200 HTTP status code