The Instruct API allows you to submit payment delivery instructions for trades already booked with our system. You will need to include a valid fxId in the request when providing delivery instructions for a trade.

Request

The request body to provide delivery instructions is split into various mandatory and optional objects.

Field NameData TypeRequiredDescription
fxIdStringYesUnique fxId provided by StoneX when booking the trade
clientReferenceStringNoOptional field to provide an external reference for the payment
tradeBookingObjectNoThis object is required only if fxID is not provided. If you have added fxId, leave this blank.
debtorObjectNoInformation about the payer (debtor).
creditorObjectYesInformation about the payee (creditor)
creditorAccountNameStringNoAccount Name of the creditor. Check payment rules to confirm if needed.
creditorAccountNumberStringYesAccount Number of the creditor.
creditorAccountTypeStringNoAccount Type of the creditor. Check payment rules to confirm if needed.
creditorAccountNumberTypeStringNoType of account number
creditorCountryCodeStringNoCountry the creditor account is present in
clientBuyCurrencyStringNoCurrency the debtor has purchased
debtorAccountNumberStringNoAccount number of the debtor
purposeOfPaymentObjectNoPayment purpose code. Check payment rules to confirm if needed
> structuredInfoArray of stringsNoProvide purpose of payment as code here. See payment rules to find out accepted values
> unstructuredInfoStringNoProvide unstructured payment purpose here.
initiatingPartyObjectNoIdentifies the entity initiating the payment.
instructingAgentObjectNoThe financial institution sending the payment instruction.
orderingInstitutionObjectNoThe institution ordering the payment on behalf of the debtor.
ultimateCreditorObjectNoThe final recipient of the payment, distinct from the creditor.
creditorAgentObjectYesFinancial institution responsible for the creditor’s account. Check payment rules to confirm which fields in this object are required.
intermediaryAgentsArray of objectsNoList of intermediary agents involved in the payment transfer. You can provide multiple intermediaries by adding more than one object.
ultimateDebtorObjectNoIdentifies the ultimate debtor for payment

Object Details:

This is a list of fields you can provide when passing any of the above objects in the request parameter:

  1. instructingAgent
  2. orderingInstitution
  3. creditorAgent
  4. intermediaryAgents

BIC or Clearing Code of the institution is mandatory when proving data for any of these objects. You can provide this in the routingCode field. If you do not have BIC or clearing code of the institution, then you must provide Name and Address of the institution. When providing address, the street or postcode is required along with 2-digit ISO country code.


Field NameData TypeDescription
routingCodeStringBank code. Check payment rules to confirm if required.
routingCodeTypeStringRouting code type. Check payment rules to confirm if required.
nameStringName of the Bank/Institution
addressObjectAddress details in structured format
> buildingNoStringBuilding number
> buildingNameStringBuilding name
> floorStringFloor
> streetStringStreet name. Check payment rules to confirm if required.
> cityStringCity name. Check payment rules to confirm if required.
> districtStringDistrict name
> postalcodeStringPost code
> stateStringState name
> countryCodeString2-digit ISO code of the country
> addressLinesArray of stringsUse this to provide unstructured address
accountNameStringName of the account
accountNumberStringBank’s Account Number/IBAN. Check payment rules to confirm if required.
branchCodeStringBank Branch code. Check payment rules to confirm if required.
branchNameStringName of the branch. Check payment rules to confirm if required.
branchNumberStringBranch Number
otherRoutingCodeStringAny other bank code. Check payment rules to confirm if required.
taxIdStringBank’s Tax identifier. Check payment rules to confirm if required.
additionalBankCodeStringAdditional bank code

This is a list of fields you should provide when providing either of the following objects in the request parameter:

  1. ultimateDebtor
  2. ultimateCreditor
  3. creditor
  4. debtor

When providing data for any of the above entities, you must provide Name and Address details. When providing address, the street or postcode is required along with 2-digit ISO country code.


Field NameData TypeDescription
nameStringProvide the name in this field. Check payment rules to confirm if required.
addressObjectProvide structured address in this object.
> buildingNoStringBuilding number
> buildingNameStringBuilding name
> floorStringFloor
> streetStringStreet name. Check payment rules to confirm if required.
> cityStringCity name. Check payment rules to confirm if required.
> districtStringDistrict name. Check payment rules to confirm if required.
> postalcodeStringPost code. Check payment rules to confirm if required.
> stateStringState name. Check payment rules to confirm if required.
> countryCodeStringISO country code. Check payment rules to confirm if required.
> addressLinesArray of stringsProvide unstructured address details here
identificationStringIdentification details
countryOfResidenceStringISO country code (ex - AU, KE). Check payment rules to confirm if required.
partyTypeStringEntity type (ex - personal, business)
taxIdStringTax Identification details. Check payment requirements to confirm if needed.
registrationIdentificationStringRegistration Identification details
taxTypeStringTax Identity type
otherRoutingCodeStringOther routing code
contactDetailsObjectUse this object to provide structured contact details
> firstNameStringFirst Name
> lastNameStringLast Name
> emailAddressStringEmail. Check payment rules to confirm if required.
> telephoneObjectTelephone details
> > countrycodeStringCountry code (ex- +44)
> > phonenumberStringPhone Number. Check payment rules to confirm if required.
> mobilephoneObjectMobile details
> > countrycodeStringCountry code (ex- +49)
> > phonenumberStringMobile number
fullnameStringFull name. Check payment requirements to confirm if needed

initiatingParty Object Details


Name and Address fields are mandatory when providing initiating party information. When providing address, the street or postcode is required along with 2-digit ISO country code.


Field NameData TypeDescription
orgIdStringProvide the client's mnemonic ID generated by StoneX in this field
extOrgIdStringProvide your external reference for the client here
addressStringProvide address in this object
> buildingNoStringBuilding number
> buildingNameStringBuilding name
> floorStringFloor
> streetStringStreet name
> cityStringCity
> districtStringDistrict
> postalcodeStringPost code
> stateStringState
> countryCodeStringCountry Code
> addressLinesArray of stringsUnstructured address can be added here
nameStringName of the initiating party

tradeBooking Object Details:


This object is only required when you are passing trade and payment details together i.e. you do not have a fxId already.

Field NameData TypeDescription
quoteIDStringProvide quoteId if using this endpoint to book trade and provide instructions together.
clientReferenceStringExternal client reference for the payment

Full Request Object

Below is the example of all the parameters you can pass in the request. Before providing instructions, check the payment rules to confirm which fields are required and what value are allowed.

If any mandatory fields for a payment are missing, or any other invalid values are provided in the request, the API will return errors highlighting the same.


{
  "fxId": 0,
  "tradeBooking": {
    "quoteId": "string",
    "clientReference": "string"
  },
  
  "intermediaryAgents": [
    {
      "routingCode": "string",
      "routingCodeType": "string",
      "name": "string",
      "address": {
        "buildingNo": "string",
        "buildingName": "string",
        "floor": "string",
        "street": "string",
        "city": "string",
        "district": "string",
        "postalCode": "string",
        "state": "string",
        "countryCode": "string",
        "addressLines": [
          "string"
        ]
      },
      "accountName": "string",
      "accountNumber": "string",
      "branchCode": "string",
      "branchName": "string",
      "branchNumber": "string",
      "otherRoutingCode": "string",
      "taxId": "string",
      "additionalBankCode": "string",
      "recordKey": "string"
    }
  ],
  
  "clientReference": "string",
  
  "creditor": {
    "name": "string",
    "address": {
      "buildingNo": "string",
      "buildingName": "string",
      "floor": "string",
      "street": "string",
      "city": "string",
      "district": "string",
      "postalCode": "string",
      "state": "string",
      "countryCode": "string",
      "addressLines": [
        "string"
      ]
    },
    "identification": "string",
    "countryOfResidence": "string",
    "partyType": "string",
    "taxId": "string",
    "registrationIdentification": "string",
    "taxType": "string",
    "otherRoutingCode": "string",
    "contactDetails": {
      "firstName": "string",
      "lastName": "string",
      "emailAddress": "string",
      "telephone": {
        "countrycode": "string",
        "phonenumber": "string"
      },
      "mobilephone": {
        "countrycode": "string",
        "phonenumber": "string"
      },
      "fullName": "string"
    }
  },
  
  "ultimateCreditor": {
    "name": "string",
    "address": {
      "buildingNo": "string",
      "buildingName": "string",
      "floor": "string",
      "street": "string",
      "city": "string",
      "district": "string",
      "postalCode": "string",
      "state": "string",
      "countryCode": "string",
      "addressLines": [
        "string"
      ]
    },
    "identification": "string",
    "countryOfResidence": "string",
    "partyType": "string",
    "taxId": "string",
    "registrationIdentification": "string",
    "taxType": "string",
    "otherRoutingCode": "string",
    "contactDetails": {
      "firstName": "string",
      "lastName": "string",
      "emailAddress": "string",
      "telephone": {
        "countrycode": "string",
        "phonenumber": "string"
      },
      "mobilephone": {
        "countrycode": "string",
        "phonenumber": "string"
      },
      "fullName": "string"
    }
  },
  
  "creditorAccountName": "string",
  "creditorAccountNumber": "string",
  "creditorAccountType": "string",
  "creditorAccountNumberType": "string",
  
  "creditorAgent": {
    "routingCode": "string",
    "routingCodeType": "string",
    "name": "string",
    "address": {
      "buildingNo": "string",
      "buildingName": "string",
      "floor": "string",
      "street": "string",
      "city": "string",
      "district": "string",
      "postalCode": "string",
      "state": "string",
      "countryCode": "string",
      "addressLines": [
        "string"
      ]
    },
    "accountName": "string",
    "accountNumber": "string",
    "branchCode": "string",
    "branchName": "string",
    "branchNumber": "string",
    "otherRoutingCode": "string",
    "taxId": "string",
    "additionalBankCode": "string",
    "recordKey": "string"
  },
  
  "debtorAccountNumber": "string",
  
  "debtor": {
    "name": "string",
    "address": {
      "buildingNo": "string",
      "buildingName": "string",
      "floor": "string",
      "street": "string",
      "city": "string",
      "district": "string",
      "postalCode": "string",
      "state": "string",
      "countryCode": "string",
      "addressLines": [
        "string"
      ]
    },
    "identification": "string",
    "countryOfResidence": "string",
    "partyType": "string",
    "taxId": "string",
    "registrationIdentification": "string",
    "taxType": "string",
    "otherRoutingCode": "string",
    "contactDetails": {
      "firstName": "string",
      "lastName": "string",
      "emailAddress": "string",
      "telephone": {
        "countrycode": "string",
        "phonenumber": "string"
      },
      "mobilephone": {
        "countrycode": "string",
        "phonenumber": "string"
      }
    }
  },
  
  "ultimateDebtor": {
    "name": "string",
    "address": {
      "buildingNo": "string",
      "buildingName": "string",
      "floor": "string",
      "street": "string",
      "city": "string",
      "district": "string",
      "postalCode": "string",
      "state": "string",
      "countryCode": "string",
      "addressLines": [
        "string"
      ]
    },
    "identification": "string",
    "countryOfResidence": "string",
    "partyType": "string",
    "taxId": "string",
    "registrationIdentification": "string",
    "taxType": "string",
    "otherRoutingCode": "string",
    "contactDetails": {
      "firstName": "string",
      "lastName": "string",
      "emailAddress": "string",
      "telephone": {
        "countrycode": "string",
        "phonenumber": "string"
      },
      "mobilephone": {
        "countrycode": "string",
        "phonenumber": "string"
      }
    }
  },
  
  "orderingInstitution": {
    "routingCode": "string",
    "routingCodeType": "string",
    "name": "string",
    "address": {
      "buildingNo": "string",
      "buildingName": "string",
      "floor": "string",
      "street": "string",
      "city": "string",
      "district": "string",
      "postalCode": "string",
      "state": "string",
      "countryCode": "string",
      "addressLines": [
        "string"
      ]
    },
    "accountName": "string",
    "accountNumber": "string",
    "branchCode": "string",
    "branchName": "string",
    "branchNumber": "string",
    "otherRoutingCode": "string",
    "taxId": "string",
    "additionalBankCode": "string",
    "recordKey": "string"
  },
  
  "purposeOfPayment": {
    "structuredInfo": [
      "string"
    ],
    "unstructedInfo": "string"
  },
  
  "creditorCountryCode": "string",
  
  "instructingAgent": {
    "routingCode": "string",
    "routingCodeType": "string",
    "name": "string",
    "address": {
      "buildingNo": "string",
      "buildingName": "string",
      "floor": "string",
      "street": "string",
      "city": "string",
      "district": "string",
      "postalCode": "string",
      "state": "string",
      "countryCode": "string",
      "addressLines": [
        "string"
      ]
    },
    "accountName": "string",
    "accountNumber": "string",
    "branchCode": "string",
    "branchName": "string",
    "branchNumber": "string",
    "otherRoutingCode": "string",
    "taxId": "string",
    "additionalBankCode": "string",
    "recordKey": "string"
  },
  
  "initiatingParty": {
    "orgId": "string",
    "extOrgId": "string",
    "address": {
      "buildingNo": "string",
      "buildingName": "string",
      "floor": "string",
      "street": "string",
      "city": "string",
      "district": "string",
      "postalCode": "string",
      "state": "string",
      "countryCode": "string",
      "addressLines": [
        "string"
      ]
    },
    "name": "string"
  },
 
  "clientBuyCurrency": "string",
  "doddFrank": true
}

Response

Once a payment instruction is linked to the trade, the following values will be returned in the API response:

Field NameTypeDescription
createdDateDateTimeDate & time when instruction was created
tradeResponseObjectObject containing the details of the payment
> isSuccessbooleantrue or false (true - instruction was accepted & linked to trade)
> buyAmountnumberAmount you're buying
> sellAmountnumberAmount you're selling
> buyCurrencyStringCurrency you're buying (Ex- INR, KES)
> sellCurrencyStringCurrency you're selling (Ex- USD, GBP)
> tradeStatusStringStatus of the trade
> ratenumberRate for the trade
> tradeDateDate (yyyy-mm-dd)Date trade was executed
> quoteIdStringUnique quote ID used by StoneX to book the trade
> fxIdStringUnique FX ID used by StoneX to book the trade
> feenumberAny fee charge for the payment (always in sell currency)
valueDateDate (yyyy-mm-dd)Value Date of the payment

Success Example

{
    "createdDate": "2024-10-14T00:00:00Z",
    "tradeResponse": {
        "message": null,
        "errorCode": null,
        "isSuccess": true,
        "buyAmount": 8244.07,
        "sellAmount": 100,
        "buyCurrency": "INR",
        "sellCurrency": "USD",
        "tradeStatus": "EXECUTED",
        "rate": 82.4407,
        "tradeDate": "2024-10-14",
        "quoteId": "2538c92a-2d02-43d3-9adc-118312de7a76",
        "fxId": 4763401,
        "fee": 0
    },
    "valueDate": "2024-10-16"
}

Failure Example 1 - Invalid Bank Code and ISO Country Code

{
    "status": "Incomplete",
    "invalidRules": [
        {
            "fieldLabelIdentifier": "IFSCCode",
            "fieldName": "Bank Code",
            "ruleName": "FORMAT BANKCODE",
            "fieldValue": "ABCD0000985",
            "errorMessage": "IFSC Code must have a valid bank code format",
            "validationStatus": "Invalid"
        },
        {
            "fieldLabelIdentifier": "BeneficiaryCountryofResidence",
            "fieldName": "Beneficiary Address Country",
            "ruleName": "ISO COUNTRY CODE",
            "fieldValue": "AB",
            "errorMessage": "Beneficiary Country of Residence must have a valid ISO Country Code (2 letters)",
            "validationStatus": "Invalid"
        }
    ]
}

Failure Example 2 - Mandatory field missing

{
    "status": "Incomplete",
    "invalidRules": [
        {
            "fieldLabelIdentifier": "BeneficiaryAccountName",
            "fieldName": "Account Name",
            "ruleName": "MANDATORY",
            "fieldValue": "",
            "errorMessage": "Beneficiary Account Name is mandatory.",
            "validationStatus": "Invalid"
        }
    ]
}

Failure Example 3 - FxId is already instructed

{
    "title": "Bad Input",
    "status": 400,
    "detail": "FxId is already instructed",
    "traceId": "00-a74be65e2c34f3c41dee4af2f2f00ee3-9f11c7019893e941-00",
    "errorCode": "INS00008"
}
Language
URL
Click Try It! to start a request and see the response here!