Take foreign cash at the till
Set the exchange rates your tills convert foreign cash at, and see exactly which rate a payment would use right now.
Pricing & money · a play in 2 steps.
The steps
- Set the rate for the foreign currency your tills accept. — createFxRate
- Check the rate a foreign-cash payment would use this moment. — resolveFxRate
The calls
Every operation this use case runs, in the order it first appears, with the request and the response its reference page shows.
createFxRate
createFxRate — mutation · Create a new foreign-exchange rate your tills use for foreign cash at your organization.
Example request
mutation ExampleCreateFxRate($input: NewFxRateInput!) {
createFxRate(input: $input) {
id
sysId
type
caption
status
parentId
rootId
createdAt
updatedAt
revisionNum
revision
level
fromCurrency
toCurrency
mode
buyRateMicro
sellRateMicro
adjustPpm
feeMinor
startAt
endAt
}
}
Variables:
{
"input": {
"caption": "Blue jeans",
"fromCurrency": "<from currency>",
"toCurrency": "<to currency>",
"mode": "<mode>",
"endAt": "2027-01-31T00:00:00.000Z"
}
}
Send it with the envelope naming the version: "extensions": {"at": {"version": {"name":"genesis","number":0}}}.
Example response
{
"data": {
"createFxRate": {
"id": "01900000-0000-7000-8000-37386ae00000",
"sysId": "FX-EXMP-0000-000F",
"type": "FxRate",
"caption": "Blue jeans",
"status": "active",
"parentId": "01900000-0000-7000-8000-065235280000",
"rootId": "01900000-0000-7000-8000-a093dd800000",
"createdAt": "2027-01-31T00:00:00.000Z",
"updatedAt": "2027-01-31T00:00:00.000Z",
"revisionNum": 1,
"revision": "01900000-0000-7000-8000-b7960e180000",
"level": "<level>",
"fromCurrency": "<from currency>",
"toCurrency": "<to currency>",
"mode": "<mode>",
"buyRateMicro": 1,
"sellRateMicro": 1,
"adjustPpm": 1,
"feeMinor": 1,
"startAt": "2027-01-31T00:00:00.000Z",
"endAt": "2027-01-31T00:00:00.000Z"
}
},
"extensions": {
"at": {
"callId": "01EXAMPLE-CALL-ID",
"version": {
"requested": {
"name": "genesis",
"number": 0
},
"serviced": {
"name": "genesis",
"number": 0
}
}
}
}
}
resolveFxRate
resolveFxRate — query · What exchange rate applies right now for a foreign currency at your organization.
Example request
query ExampleResolveFxRate($fromCurrency: String!, $organizationId: ID!, $logicalFacilityId: ID) {
resolveFxRate(fromCurrency: $fromCurrency, organizationId: $organizationId, logicalFacilityId: $logicalFacilityId) {
rateId
level
fromCurrency
toCurrency
buyRateMicro
sellRateMicro
feeMinor
startAt
endAt
}
}
Variables:
{
"fromCurrency": "<from currency>",
"organizationId": "01900000-0000-7000-8000-44b781470000",
"logicalFacilityId": "01900000-0000-7000-8000-8026f71c0000"
}
Example response
{
"data": {
"resolveFxRate": {
"rateId": "01900000-0000-7000-8000-fcc46a0a0000",
"level": "<level>",
"fromCurrency": "<from currency>",
"toCurrency": "<to currency>",
"buyRateMicro": 1,
"sellRateMicro": 1,
"feeMinor": 1,
"startAt": "2027-01-31T00:00:00.000Z",
"endAt": "2027-01-31T00:00:00.000Z"
}
},
"extensions": {
"at": {
"callId": "01EXAMPLE-CALL-ID",
"version": {
"requested": null,
"serviced": {
"name": "genesis",
"number": 0
}
}
}
}
}