POST
/
payment-methods
/
{payment_method_id}
/
network-tokens
curl --request POST \
  --url https://api.mattildapayments.com/payment-methods/{payment_method_id}/network-tokens \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "security_code": "123",
  "merchant_initiated": false,
  "is_subsequent_payment": true
}'
{
  "type": "network-token",
  "id": "d6ad71d5-6908-45d6-ab65-39c55475dd08",
  "payment_method_id": "9bdc4bc4-005e-4658-8eee-a309fc43cd4d",
  "status": "active",
  "token": "<string>",
  "expiration_date": "01/30",
  "created_at": "2021-01-01T12:34:00.000+00:00",
  "updated_at": "2021-01-01T12:34:00.000+00:00"
}

This endpoint requires the payment-methods.write scope.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

payment_method_id
string
required

The ID of the payment method.

Example:

"46973e9d-88a7-44a6-abfe-be4ff0134ff4"

Body

application/json

Request body for provision a network token.

merchant_initiated
boolean
required

Defines if the request is merchant initiated or not.

Example:

false

is_subsequent_payment
boolean
required

Defines if the request is a subsequent of another request or not.

Example:

true

security_code
string

The 3 or 4 digit security code often found on the card. This often referred to as the CVV or CVD.

The security code can only be set if the stored payment method represents a card.

Required string length: 3 - 4
Example:

"123"

Response

201
application/json
Returns the created network token.

A network token generated by an open-loop PSP.

type
enum<string>

The type of this resource.

Available options:
network-token
Example:

"network-token"

id
string

The unique ID of the token.

Example:

"d6ad71d5-6908-45d6-ab65-39c55475dd08"

payment_method_id
string

The unique ID of the payment method.

Example:

"9bdc4bc4-005e-4658-8eee-a309fc43cd4d"

status
enum<string>

The state of the network token.

  • active - The network token is active and ready to be used.
  • inactive - The network token is being deactivated.
  • suspended - The network token is suspended.
  • deleted - The network token is deleted.
Available options:
active,
inactive,
suspended,
deleted
Example:

"active"

token
string

The value of the network token.

expiration_date
string | null

The expiration date for the network token.

Required string length: 5
Example:

"01/30"

created_at
string

The date and time when this network token was first created in our system.

Example:

"2021-01-01T12:34:00.000+00:00"

updated_at
string

The date and time when this network token was last updated in our system.

Example:

"2021-01-01T12:34:00.000+00:00"