Tinka

Offline Payment Request

URL

POST /merchant-api/v2/offline/payment-requests


HTTP response codes

  • 200 - Successful operation
  • 401 - Unauthorized, maybe the credentials are missing. For more information, see security
  • 403 - Forbidden, the HMAC may be wrong or out of date. For more information, see security

Request

AttributeTypeLengthDescription
transactionId requiredString100A reference provided by the caller. We recommend to use this for linking the payment request and make it unique for every transaction
merchantRequestReference requiredString100A reference provided by the merchant. We recommend to use this for linking the payment request
paymentMethod requiredEnum StringSee Payment methods .
requestedPaymentAmount requiredIntegerThe amount that is needed by the customer to pay the purchase. The requested amount is always in euro cents and should be > 0 and <= the combined orderline values.
invoiceAddressAddress
deliveryDeliveryCharacteristics
routingRouting
paymentsList Of Payment
requestTagslist of RequestTag
merchant requiredMerchant
linesList of Line
applicantApplicant
customerBarcodeToken requiredString128A unique set of characters that identifies the Tinka customer

Response

Response of the offline payment request call

AttributeTypeLengthDescription
paymentRequestId requiredString36A unique number for this payment request transaction. It`s a UUID
paymentMethod requiredString2000The original payment method. Can be used for extra verification on the merchant's side
requestedPaymentAmount requiredIntegerThe original requested amount in euro cents. Can be used for extra verification on the merchant's side
decision requiredEnum StringThe decision of the paymentRequest. Can be Accepted, Rejected. See decision.
decisionDateTime requiredStringDate of the decision. Format yyyy-mm-ddThh:mi:ss.SSSZ In UTC timezone. Example: 2018-11-06T09:41:25.020Z
transactionId requiredString100A reference provided by the caller. Can be used for extra verification on the merchant's side
merchantRequestReference requiredString100A unique reference provided by the merchant. Can be used for extra verification on the merchant's side
errorCodeStringError code (indication of the nature of the error). List of error codes needs to be decided
additionalDataString255Additional info for the payment request. Possibly a reject reason or error message

Type: Address

AttributeTypeLengthDescription
countryCode requiredEnum String10For now this will always be NL
houseNumber requiredString10
houseNumberAdditionString10
postalCode requiredString10The postal code has the format of NNNNAA orNNNN AA for Dutch postal codes(i.e. 8011NW)
street requiredString50
city requiredString50

Type: Applicant

AttributeTypeLengthDescription
dateOfBirthString10The date of birth of the customer. Format: yyyy-mm-dd
emailAddressString320The email address of the customer. We don`t validate if an email address is valid or not.
externalCustomerNumberString100Number provided by the the merchant to identify the customer uniquely. The customer number (or customer reference) of the merchant
gender requiredEnum String10Gender is (in the context of credit payment) important because gender determines how we perform a BKR check. Possible values:Male,Female, Unknown
initialsString20The initials of the customer.
firstNameString100First name of the customer.
prefixLastNameString10The prefix of the last name. Examples : “van” or “van der”
lastName requiredString200The last name of the customer. As for credit we have an obligation to register a new loan on birth name. The general rule at Tinka is to ask for a birth name when gender is Female. For this specific situation Tinka will ask for a birth name during the acceptance process (if needed of course)
telephoneNumberString17The phone number the customer has provided. Phone can either be a landline or a mobile number

Type: Delivery characteristics

AttributeTypeLengthDescription
deliveryDateString10The date the delivery of the goods will take place. Format: yyyy-mm-dd
deliveryMethod requiredEnum StringThe way the goods are delivered. This is important because it will have an effect on fraud detection. I.e. when a customer wants to pick up the goods in a store it will probably be a safer method than delivering the goods to a delivery parcel station Possible values: CompanyDelivery,Locker, ParcelStation, ParcelShop,CompanyStore, ShippingPartner
deliveryAddress requiredAddressThe address where the goods will be delivered.
notificationEmailAddressString320Email address where the customer wants the notification.
notificationTelephoneNumberString18Phone number where the customer wants the notification. Phone can either be a landline or a mobile number
shippingPartnerString100The company who is going to deliver the products. DHL/PostNL/etc…

Type: Line

AttributeTypeLengthDescription
itemPrice requiredIntegerThe price of an individual line item. Amounts are always in euro cents and include VAT.
merchantLineReference requiredString100Unique reference of the merchant of the line item.
productClassificationString100Description of classification of the product.
numberOfItems requiredIntegerThe number of items on the line. should be greater than 0.
description requiredString255The description of a line item.
brandString100The brand of the product.
manufacturerString100The manufacturer of the product.
colorString100Color of the product.
sizeString100Size of the product.

Type: Payment

Is a list of already carried out payments for this request (e.g. via gift card).

AttributeTypeLengthDescription
amount requiredIntegerThe amount of the payment as recorded by the merchant.
Amount is always in euro cents and has to be a positive number (amount > 0)
paymentType requiredString100Free format payment type as reference for the merchant.

Type: Request tag

One or more key value pairs provided by the merchant. For example a key “campaign” and a value “christmas 2018” or key “store” with value “Zwolle”.

AttributeTypeLengthDescription
tagName requiredString50The name of the tag
tagValue requiredString100The value of the tag

Type: Merchant

Unique identification of the merchant provided by Tinka.

AttributeTypeLengthDescription
merchantId requiredString100The unique id of the merchant provided by Tinka.
Should be the same as the merchant id used to sign the request

Type: Routing

URLs for routing the customer back to the merchant's website.

AttributeTypeLengthDescription
callbackUrl requiredString2000URL to send the customer to after the payment flow has been completed. For all outcomes (Accepted, Rejected, Pending) except Cancelled
cancelUrl requiredString2000URL for landing page when customers explicitely cancel the flow

Example

Request

fetch('https://....../merchant-api/v2/offline/payment-requests', {
  method: 'POST',
  headers: {
    Authorization: 'Basic xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
    'X-Authorization': 'hmac example:xxxxxxxxxxxxxxxxxxxxxx/xxxxxxxxxxxxxxxx/xxx=:nonce:xxxxxxxxxx',
    'Content-Type': 'application/json'
  },
  body: {
    transactionId: 'unique-xxxxxxxxxxxxxxxxxxxx',
    merchantRequestReference: 'xxxxxxxxxxxxxxxx',
    paymentMethod: 'Credit', // for credit payment
    requestedPaymentAmount: 90000, // === 900 Euro
    invoiceAddress: {
      countryCode: 'NL',
      houseNumber: '81',
      houseNumberAddition: null,
      postalCode: '4006EA'
      street: 'Dodewaardlaan',
      city: 'Tiel',
    },
    delivery: {
      deliveryDate: '2020-02-02',
      deliveryAddress: {
        countryCode: 'NL',
        houseNumber: '81',
        houseNumberAddition: null,
        postalCode: '4006EA'
        street: 'Dodewaardlaan',
        city: 'Tiel',
      },
      deliveryMethod: 'CompanyDelivery'
    },
    routing: {
      callbackUrl: 'https://www.example.com/callback',
      cancelUrl: 'https://www.example.com/cancel'
    },
    payments: [
      {
        amount: 10000, // === 100 Euro
        paymentType: 'some special gift card'
      }
    ],
    requestTags: [
      {
        tagName: 'campaign',
        tagValue: 'christmas event 2018'
      }
    ],
    merchant: {
      merchantId: 'example'
    },
    lines: [
      {
        itemPrice: 50000,
        merchantLineReference: 'Example_xxxxxxxxx',
        productClassification: '1001',
        numberOfItems: 2,
        description: 'some description xxxxxxxxxx'
      }
    ],
    applicant: {
      dateOfBirth: '1971-01-01',
      emailAddress: '[email protected]',
      externalCustomerNumber: 'xxxxxxxxxxxxxx',
      gender: 'Male',
      initials: 'S.',
      firstName: 'Nosmyut',
      prefixLastName: null,
      lastName: 'Proefpersoonlangnaamdeel'
      telephoneNumber: '0131234567',
    },
    customerBarcodeToken: "xxxxxxxxxx"
  }
})

Response

const example_response = {
  paymentRequestId: '01234567-aaaa-bbbb-cccc-987654321abc',
  paymentMethod: 'Credit',
  requestedPaymentAmount: 90000,
  decision: 'Accepted',
  decisionDateTime: '2020-02-02T09:40:00.020Z',
  transactionId: 'unique-xxxxxxxxxxxxxxxxxxxx',
  merchantRequestReference: 'xxxxxxxxxxxxxxxx'
};

© 2024 Tinka. All Rights Reserved. All trademarks, service marks and trade names used in this material are the property of their respective owners.