Skip to main content
PUT

File Transfer Token Replacement Guide

Replace tokens with card data in SFTP file transfers
Performs token replacement on a file and uploads the result directly to an SFTP server. Use this when you need to send batch files containing card data to a payment processor or partner that accepts SFTP delivery. PCI Booking replaces all card tokens in the file body with the real card data before uploading.

Error Responses

Error detail

Each condition below gives the exact moreInfo text, why it happens and how to resolve it. The full set is on the Error Handling page.
HTTP status: 400message: Bad input datamoreInfo: the wording depends on which endpoint you called:
The first is returned by token replacement in a request (paycard/relay). The second is returned by tokenization on response (paycard/capture). They mean the same thing.Reason. The profileName you passed could not be resolved for the account making the request. In almost every case the profile does exist, but on a different account than the one your credentials belong to. A misspelled profile name produces the same error.How to resolve.A PCI Shield profile belongs to the account, not to the sub-user that calls the API. When a sub-user makes a request, the profile is looked up against that sub-user’s parent account. A profile configured on one account is never visible to a sub-user of a different account, and sandbox and production accounts are separate.To check which profiles your credential can see:
  1. Identify the parent account of the sub-user whose credentials you are using.
  2. Sign in to the PCI Booking portal as that account and open PCI Shield Settings > PCI Shield Profile Settings.
  3. Confirm the profile name appears there, spelled exactly as you send it. Profile names are matched exactly.
  4. If the profile is listed under a different account, switch your request to a sub-user of that account rather than copying the profile.
There is no API endpoint that lists the profiles on your own account. GET /api/booker returns the platform-wide preset tokenization profiles, which are a different set. Your own profiles are visible in the portal only.
See also: Content Filters, Target Profiles
HTTP status: 400message: Bad input datamoreInfo:
Reason. The body parsed, but the profile’s selectors did not match anything in it, so no card data was substituted. The request was not relayed. This is a mismatch between the profile and the payload, not a problem with the token.How to resolve.
  1. Compare the profile’s selectors against the exact payload you sent. A selector that assumes a different nesting depth or element name matches nothing.
  2. Check the namespaces. For XML and SOAP, a selector written without namespace handling will not match a namespaced document.
  3. Confirm the body is the format the profile was written for. A profile written for XML will not match a JSON body.
  4. Test the profile against a saved copy of a real request before using it in production.
See also: Content Filters
HTTP status: 504message: Request timed outmoreInfo: not populated for this condition. The code and the endpoint are the only signal.Reason. PCI Booking relayed your request but the target server did not answer within the timeout. The failure is on the far side, not in PCI Booking. Card data may already have reached the third party, so the operation cannot be assumed not to have happened.How to resolve.
  1. Raise the timeout parameter if the third party is legitimately slow. Check the maximum the endpoint accepts before relying on a high value.
  2. Confirm the target host is reachable and not rate limiting or blocking the call. PCI Booking calls the third party from its own addresses, which the third party may need to allow.
  3. Do not blind retry a charge. Query the third party for the outcome first. A timeout is an unknown result, not a failure.
See also: Outbound IPs
HTTP status: 404message: Uri not foundmoreInfo:
Reason. The token is well formed but no card is stored against it. Either it never existed, or it was deleted. Deletion is permanent and cannot be undone.How to resolve.
  1. Confirm the tokenization call that should have created it returned success and returned this exact token.
  2. Check whether the token was deleted, either explicitly or by a CVV retention policy configured to delete the card on cleanup.
  3. Check the environment. A token from one environment is not visible in the other.
Some endpoints report a deleted token as -1003 rather than -160. Treat the two as the same investigation and start with whether the token still exists.

Parameter Constraints

  • serverAddress: Format is hostname or hostname:port. Only one colon is allowed. Default port is 22.
  • filter: Must be one of: GBT, SIMPLECSV, SIMPLEJSON, AIR, IUR, TADC, CSV. Case-insensitive.
  • Authorization header: Must contain valid Basic Auth credentials (username:password) for the SFTP server.

Parameters

Authentication

This is a browser-facing endpoint. Use one of the authentication methods below instead of the API key shown above.
string
Recommended. A long-lived token for browser-side calls. How to generate.
string
Alternative. Valid for 5 minutes. How to generate.
If both are provided, the session token takes precedence.

Path Parameters

string
required
The sFTP server address. This can be an IP address or domain name. Add the port number with a colon if required. For example: fsgatewaytest.aexp.com:22 or 10.200.1.10.
string
required
The folder path where the file should be uploaded to. This can be an individual folder or a full path.
string
required
The file name for the content being uploaded, including extension. For example: PCIBTST.xml.

Query String

string
required
Indicates the format of the file being sent. Read more on Supported Formats.
string
The timeout, in seconds, for the sFTP server to respond.

Headers

string
required
Comma-separated token values to insert into the file. Tokens should be listed in the order of their appearance. For tokens appearing multiple times, include the number of occurrences in square brackets. Full token URIs or bare 32-character token IDs are both accepted. If fewer tokens are listed than there are card locations in the file, the last token is repeated for all remaining locations.
string
required
The authorization parameter used to authenticate to the sFTP server.
string
Supported compression formats: gzip and deflate. Omit this header if no compression is needed.

Request Body

The request body contains the raw file content as text, in the format named by the filter parameter. The preset filter determines where card data belongs in that format; PCI Booking inserts the card details of the tokens listed in X-PciBooking-carduri, in order, then uploads the result to the sFTP server.

Response